As in the whole project was rewritten in Django or some kind of transpiration going on there?
I haven't gotten to the point where I'm adding a lot of libs yet and certainly can't speak to using it in a big team.
In terms of syntax flexibility, Ruby has a similar issue where a lot of popular libs implement their own DSLs. I've never fully bought that that is a problem—a library is going to have an API that will require reading documentation. Maybe the one example that goes off the wire is RSpec (I'm really used to it now but I'm really enjoying going back to good ol' `assert` in `ExUnit`). In terms of keeping it idiomatic with the business logic, library can (and in my opinion always should) be wrapped. I may be missing the point or being reductive here, though, and I would be interested to hear more about your particular pain if you're willing to share!
...and of course if you are talking about using meta-programming to write business logic, that's not a thing anyone should ever do for any reason ever, period (IMO).
For me the raw speed of writing a highly interactive app in LiveView is unlike anything I've ever experienced. My primary experience is with Rails and React.
> In terms of syntax flexibility, Ruby has a similar issue where a lot of popular libs implement their own DSLs.
Of course in ruby, nobody is actually adding new syntax, although that's a common misconception. Ruby DSL's are still just ordinary syntax for method calls and block parameters, there's no new syntax at all. Sometimes it can look like it, maybe because ruby method calls don't require parentheses? But no library truly adds syntax to ruby, they just define methods that can be called.
I am not familiar with elixir, I am curious if what we're talking about is an ability in elixir to truly add new syntax, or something more like Ruby so-called "DSLs".
Correct. You can't add new syntax to Elixir either.
FWIW, the meta-programming models are very distinct. Elixir's is based on AST and it works at compile-time (like Lisp but without reader macros). For example, imagine you want to do your html markup in Elixir, you could do this (but don't!):
html do
title "hello world"
body do
...
end
end
In the above, `html` would be a macro that looks at the structure of the code and transforms it into something at compilation time. The macro must exist before being invoked and it has to literally surround the code it changes. Once the code compiles, you can't change it.
Ruby's meta-programming is runtime-based. So the same example above would likely be implemented by calling methods on an object, either pre-defined ones or using method_missing, as you execute the code. In Ruby you can also define (or redefine) methods at any time and it affects the whole runtime.
Both languages also have a similar ability to meta-program a class (in Ruby) or a module (in Elixir). Think Rails' resource macro in a router. But Elixir modules are closed, in contrast to Ruby classes. Many times this is what people refer to as DSLs, even though the term DSL in itself is more general. Python has similar abilities too.
PS: you are certainly aware of the Ruby bits but I went for completeness to be a reference for others. :)
> Of course in ruby, nobody is actually adding new syntax, although that's a common misconception.
This is the argument I usually use for anyone who has a problem with it yet if they've already decided they don't like it, it doesn't do much to pursued them. On the other hand, being able to rewrite operators in Ruby does take it a bit in that direction—While not strictly new syntax, changing the meaning of an operator can really throw people off. As an example in the standard library, there is `Dir[]`. `Dir[]` is a shortcut to `Dir.glob`. Sure, it's technically doing some kind of access, but everyone knows it as hash access and certainly aren't accustom to passing a pattern to it. Elixir libs do stuff like this.
And I'm sorry, I don't know if can actually add new syntax in Elixir, but you can certainly change the meaning of existing syntax (as in Ruby).
I haven't gotten to the point where I'm adding a lot of libs yet and certainly can't speak to using it in a big team.
In terms of syntax flexibility, Ruby has a similar issue where a lot of popular libs implement their own DSLs. I've never fully bought that that is a problem—a library is going to have an API that will require reading documentation. Maybe the one example that goes off the wire is RSpec (I'm really used to it now but I'm really enjoying going back to good ol' `assert` in `ExUnit`). In terms of keeping it idiomatic with the business logic, library can (and in my opinion always should) be wrapped. I may be missing the point or being reductive here, though, and I would be interested to hear more about your particular pain if you're willing to share!
...and of course if you are talking about using meta-programming to write business logic, that's not a thing anyone should ever do for any reason ever, period (IMO).
For me the raw speed of writing a highly interactive app in LiveView is unlike anything I've ever experienced. My primary experience is with Rails and React.