Has anyone had some positive experiences with prototyping / rapid design iteration with Elm and can share some tips / encouragement?
I think two things are require for to solve this:
1. Some way to make it easy to drop in components into an existing view. Global state makes this hard, but it may be possible with some of Haskell's funky features, or even just type classes.
2. With the above we just need people to write some basic controls for Elm and give them more features. We need an ecosystem.
I totally understand that DOM access is a pain point for Elm developers right now. I often run into that issue myself. But declaring a port is a small price to pay for the all that the Elm compiler gives you. When I have to refactor a React/Redux app, I absolutely dread it. With Elm, I love it, even if the project is older or unfamiliar.
If we have to use JS via ports (and it has to be asynchronous! dang) to achieve complex things anyway, why not use typescript, which can do absolutely everything you need without the language context and async switch?
With 0.18, Evan decided that using prime is bad taste, so he decided to break any code that uses it.
Sure, it is not a big change, but it means they are not respecting user's time and it is a sign of things to come.
Sorry for the rant.
Edit: I hope my reply doesn't get misunderstood. I love Elm and use it in all my side projects. I think it made wonders for introducing new people to the ML world.
Edit2: Sorry, didn't meant to make so much fuss about it. It is indeed a small thing.
Which is why for now I'm looking into Purescript and GHCJS which support features such as Rank N types, generics, typeclasses, functional dependencies/type families. Even though I don't use many of those features directly, I do benefit from libraries that depend on them.
https://www.youtube.com/watch?v=XJ9ckqCMiKk
The first half is about Phoenix, the second about Elm. I don't know much about front-end stuff but I did like the Elm bit as an intro, especially the debugging and nice error messages part.
In time your brain realigns, depending on how much you appreciate the functional style or not.
BEGIN
FILE F (KIND=REMOTE);
EBCDIC ARRAY E [0:11];
REPLACE E BY "HELLO WORLD!";
WHILE TRUE DO
BEGIN
WRITE (F, *, E);
END;
END.
I've heard it said that the languages you mentioned are inspired by C's syntax.There is a wide variety of syntax among mainstream languages, but basic function calls are pretty much all the same.
Take a look at Reason [1] for an example of how a functional language (OCaml in this case) can be made more familiar.
Foe example types in Ocaml usually start with lower letter.
Also Elm has "Maybe", just like Haskell, instead of "option" of Ocaml.
Also in Elm, like in Haskell you would write "List Sometype", while in Ocaml it is "sometype list".
https://rawgit.com/krausest/js-framework-benchmark/master/we...
https://github.com/krausest/js-framework-benchmark/blob/mast...
http://package.elm-lang.org/packages/elm-lang/html/2.0.0/Htm...
If I'm not mistaken this wasn't possible in Elm back then, and felt uncomfortable or even hard in ClojureScript. Has that changed?
To be fair if I started a new project like the one I'm working at now I'd much rather use server + template for most pages and add interactivity through JS once it boots up.
currently a pretty nice reactive mobx-state-tree is on the frontpage of hn.
- Flow vs Typescript
- ES5 vs Babel
- React vs Angular vs Vue vs jQuery
- Webpack vs Rollup
- Redux vs Flux vs Mobx vs React states
etc...
Plus, probably lots of dev prefer Elm's syntax and design.
In Elm I can see the same kind of framework simplicity that attracts me to Go.
I can either work on Elm and deal with breaking changes like variable declarations (as noted above), or work on my React/Redux app, where I'm halfway refactoring from ReactRouter v3 -> v4 and Redux Form v4 -> v6, both of which are painful upgrades. Which would you rather deal with?