4 ms·
Ask HN: 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 5y agoIf 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.
- JaggerJo 5y agoWith more recent versions of .NET producing a single binary is also possible. Would try F#
- christophilus 5y agoYeah. F# is possibly my favorite language. The tooling was really rough on Linux last time I looked (admittedly, quite some time ago). Its compiler was also not what I’d call fast (compared to ago or OCaml). But yeah. It may be a good candidate, actually! I’ll try kicking the tires this week.
- xupybd 5y agoLinux tooling is pretty good now. You just get more limited library access. Compilation speed is not great but not the worst I've seen.
- swah 5y agoIf 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 5y agoIs 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.