Ask HN: Which functional language for full stack web development?

2 points by akkad33 ↗ HN
I am thinking between F# and elixir. I like F# but don't like .net ecosystem. Should I pick up Elixir?

8 comments

[ 1.8 ms ] story [ 45.5 ms ] thread
I'd pick both ;)

I actually don't know much about F#, but Elixir is great. The main problem with Elixir is that batteries aren't included for a lot of things and some libraries are hard to work with because they don't expose the right interfaces. It's not too bad - you just fork your own version and make the necessary changes, but it can be a little annoying. Also, don't fall into the trap of "do everything in Elixir", if there's a library you really need that exists in another language, it's ok to wrap it in a "micro service". Being overly purist about everything needing to be in Elixir set me back a little bit. You have a lot of ways to call out to other services/languages from a simple HTTP API, to a NIF (natively implemented function; currently C, Rust, and Zig have good support), to something like GRPC.

If you do want to learn Elixir, I would recommend learning Erlang first or in parallel to Elixir. Learning Erlang will make all the syntactic sugar very obvious and give you an appreciation for what both languages provide.

Oh one more cool part - Elixir is great as glue with other parts of the BEAM ecosystem. You can easily call out to Erlang modules and Gleam modules. I haven't tried with LFE though.

JavaScript/TS is a functional language, too[0]. Like Lisp, it supports all programming styles. With JS you have the advantage of being built into the browser with rich debugging tools.

[0] https://medium.com/gitconnected/functional-programming-in-ty...

Does it have default immutability, currying etc?
It doesn't have any default anything. You can mark constants as immutable in TS and yes you can write currying style functions if you want that. JS supports all programming styles.
Pattern matching multi functions too? Thats one of the favorite parts for me in elixir.
No java script does not have currying that exists in languages like fsharp, ocaml etc