> Refactoring your views with the same ease that you do with your normal code and with a compiler to watch your back is liberating
I have this experience with JSX (which I didn't have with string template libs), and I also don't see that an Elm equivalent like elmx would take anything away from that experience in Elm.
The result won't be understood by elm-format. Compiler errors will exist at the level of Elm, not elmx. It's something extra that has to be learned by any other developer trying to work on the code -- and they'll still have to understand the pure Elm code that the elmx compiles to as well. Plus it has limitations like not being able to nest code interpolations.
No I'm not, and I'm tired of 'the familiarity argument'.
> elmx feels like it just complicates the view code with virtually no benefit.
See my other comments in this thread - I don't agree - JSX being more closely related to the DOM you're building is a significant benefit.
Also empirically in React land, JSX is vastly more popular than not using it.
> The result won't be understood by elm-format.
If ESLint can understand JSX, then elm-format can understand elmx.
> It's something extra that has to be learned by any other developer trying to work on the code
That dev already knows DOM (or will have to do so via their devtools) if they're a front-end dev.
(And React seems to have proven that's not an issue).
> they'll still have to understand the pure Elm code that the elmx compiles to as well
I don't experience this in React. I never think about the 'create dom'-ish JS calls it's translating to.
> Plus it has limitations like not being able to nest code interpolations.
Unless I misunderstand you, JSX can absolutely do this.
> Non-recursive interpolation: currently Elm code interpolated between { and } is not recursive (i.e. is a regular grammar not a CFG). This means that you cannot include curly brackets inside curly brackets.
This is of course just a limitation of the implementation, not the idea.
Also there are some things about Elm's DOM style in particular that are especially awkward, compared to other function-style dom creation syntax [0], like the [ ] everywhere.
> The main difference is that the Elm "bracket soup" is just a composition of functions
So is the JSX counterexample I gave, (it de-sugars to function calls), which is why elmx [1] can exist, and seems like an improvement to me.
[0] https://github.com/hyperhype/hyperscript [1] https://github.com/pzavolinsky/elmx