HACKER Q&A
📣 christophilus

Is there a functional programming language with the benefits of Go?


- Fast compilation, producing a single binary

- Fast execution

- Good standard library for things like quickly spinning up a zero-dependency HTTP service

Basically, I have a problem which is well suited to Go, but which would benefit from persistent data structures. Go has some in the form of some libraries, but it really feels like I'd be better off hacking this thing together in OCaml or something. The problem with OCaml, at least, is lack of parallelism and lack of a simple HTTP solution.

Any suggestions?


  👤 xupybd Accepted Answer ✓
If you like OCaml but want speed, parallelism and good library support, then F# is a good option.

There are trade offs. Bit's of C# leak in when using libraries written in C#. It's still a very nice language. With fable you can even complied to JS and use it client side.

Producing a single binary is a super power of Go. I'm not sure there are many other options out there.


👤 swah
If you're not playing with the language itself, but want to finish a project, pick one of the most popular languages and forget about it (so, typescript).

In other words: if Go is good for Google, just go with it...


👤 0x008
Is binary size a concern to you (probably not if you come from go)? If not: don't worry about it. You can compile everything into a binary when you embed the runtime. Ever thought about JVM-languages?

Do you need static typing, multithreading and fast execution? Maybe try Scala or Clojure.

If functional programming is not your main concern, but you want a mature ecosystem with one-liner http server and medium-fast execution? Maybe try python or nodejs.