DEV Community

Discussion on: What's a useful programming language feature or concept that a lot of languages don't have?

 
kspeakman profile image
Kasey Speakman

It seems more limiting than it is in practice. But I can imagine Ports (the JS interop) being a pain if you need to integrate a lot of existing JS libraries. They closed the more direct escape hatch (aka native, kernel) in 0.19. And yeah, I have the sentiment that things are a bit too rigidly prescriptive in Elm-land. But it taught me a lot -- especially the depth of what you can do with just calculation. It's hard to go back to anything else after that, because pure calculations are so refactorable and testable. We are trialing Fable-Elmish, which is basically Elm with opt-in side effects. It is written in F#, which is syntactically close to Elm. I even have a strategy for isolating side effects to be able to keep the rest of the code pure.

Thread Thread
 
avalander profile image
Avalander • Edited

If that's the case, I would suggest looking into PureScript. I dabbled in Elm a while ago and I really liked it, but I felt that the language had way too many opinions built into it, because it's actually a language and a framework.

PureScript is very similar to Elm, it's also heavily inspired by Haskell, has type inference, and compiles down to Javascript. However, it doesn't have a strict architecture built in and the interoperability with Javascript is a bit more straightforward.

I've been toying with PureScript for a couple of weeks now and, honestly, I'm not sure I'll ever go back to Elm. Plus, you can use PureScript for backend code too.

Thread Thread
 
kspeakman profile image
Kasey Speakman • Edited

Thanks for the suggestion. I’ve been meaning to try it, but it’s philosophical closeness to Haskell gives me pause.

Thread Thread
 
avalander profile image
Avalander

Oh, hey! I meant to reply to Ben, but apparently we wrote at the same time and you won πŸ˜…

Still, if you're familiar with Elm it shouldn't be hard to get the hang of it.