3 ms·
I work mostly in Python for data analytics but I like to play with front end from time to time. So I tried elm. I loved learning about the elm architecture and
by kfk 7y ago
I work mostly in Python for data analytics but I like to play with front end from time to time. So I tried elm. I loved learning about the elm architecture and the concepts of a ml type of language. But the community and the principles of it threw me off. I need a simple parser and found this https://package.elm-lang.org/packages/elm-tools/parser/latest/ https://package.elm-lang.org/packages/elm-tools/parser/lates...
I guess if you have a CS degree you can understand how that parser works, I couldn’t. The community tried to help me on the forums but you are supposed to know a lot of key functional concepts to even understand their answers.
Then I learned about how they decided to throw away Javascript interops. I mean I love benevolent dictators but this was too much. Just fyi their benevolent dictator thinks if you need a library you should program it yourself. I can see his point but in Python word there are so many amazing libraries. That principle sounds good in theory but it’s theory, the rest or the world thrives with libraries.
However I became a better programmer thanks to elm. I would love for something like ocaml to pick up more steam in data analytics. I think though python won that battle for good principles (easy to use) and not for being functional, or controlling side effects or having less bugs. If you think about it that’s exactly why Excel is still so popular, it’s a monster but it’s easy to use.
- DavidTNcl 7y agoBecause I do have a CS degree and can program in several functional languages I can glance at your link and see how that parser works. Mind you, you're right re the BDFL stuff. FT.
- kccqzy 7y ago> I need a simple parser and found this https://package.elm-lang.org/packages/elm-tools/parser/latest/ https://package.elm-lang.org/packages/elm-tools/parser/lates... > I guess if you have a CS degree you can understand how that parser works, I couldn’t. The community tried to help me on the forums but you are supposed to know a lot of key functional concepts to even understand their answers. Have you tried writing a simple parser (i.e. just recursive descent) yourself in another language like Python? If so, you'll find the approach of using parser combinators in your Elm example rather superior. If you do not currently understand the foundational concepts of writing a parser, perhaps you should understand them before starting to write a parser. Or perhaps consider this. Can you get by without writing a parser? If the grammar you're trying to parse is well-known you might find an existing parser; if the grammar is extremely simple you might just use a few string manipulation functions to get the job done.
- wwweston 7y ago> Then I learned about how they decided to throw away Javascript interops. Is this true? I'm not an Elm user yet, but I've been eyeing it and my understanding was that there was interop: https://guide.elm-lang.org/interop/ https://guide.elm-lang.org/interop/ It'd be a big deal if that weren't there -- FP stuff I may or may not be used to? Bring it on. Stretch my CS knowledge? Cool. No 3P libraries? That'd make it wrong for a lot of use cases.
- Skinney 7y agoElm has interop, it's called ports. What the poster is referring to is that Elm 0.18 had an unsupported, undocumented way of calling javascript code directly. This was inherently unsafe (Javascript can throw exceptions and Elm doesn't support exceptions, let alone catching them) and people were abusing it, so it was removed from the language in 0.19.