Hacker News new | ask | show | jobs
by johnisgood 284 days ago
I am curious about people's experiences who are really good and use the following languages regularly: C, OCaml / Haskell (although Haskell feels way different to me), Common Lisp (or any Lisp), Erlang / Elixir, and Forth / Factor. To me, these languages seem to be significantly different.

Edit (before I will not be able to do so): thank you for everyone's replies (in advance, too)!

3 comments

I've been working with functional programming languages for the most part of my career now. Mostly Elixir and Clojure, but some OCaml/Haskell too. I believe after FP "clicks", there is no going back. Everything else feels just so unnecessarily complex.

My favorite is still Clojure by miles ahead, besides it being a functional language, its data-oriented approach to writing programs is completely different from anything else I've ever seen. I currently work with Elixir, and there isn't a day that goes by without me thinking "gosh, this would be so much simpler to solve in Clojure".

> gosh, this would be so much simpler to solve in Clojure

My colleagues are so sick of hearing this.

How come? Genuinely curious.

I feel the same way with Go, OCaml, Factor, Erlang / Elixir, Common Lisp, and even Perl, depending on what I am doing. Heck, I still have new projects written in C due to its simplicity, which is what I want sometimes, and more control.

I end up working with a lot of data transform pipelines, and Clojure's strong support for names (with namespaced keywords) and generic data structure manipulation makes the code you have to write more succinct.

This kind of task is also extremely well suited to a repl. You define a temporary var, and start threading it through a series of super small functions that only slightly change the data until you get what you want.

    (->> my-data 
         parse
         (filter some-pred)
         (map my-mapper)) ;; and so on, if you need more
        
For me, the big thing is REPL driven development, and immutable data structures. Everything can be inspected. It's easy to get insight into basically any small piece of the program as if you were using a debugger (but you don't have to).
I'm not sure if I would consider myself 'really good', but in a previous life I have used Haskell professionally, albeit only for small-scale applications (alongside a Scala codebase).

For what it's worth, I actually really enjoyed using Haskell. It did force me to think differently about problems and I feel that this has carried over to writing cleaner code in non-functional languages like Go/Java. I liked it so much so that I wrote a book about writing functional code in Go along with a supporting OSS library.

Would I recommend it for really large-scale applications? Maybe not, because you'd want a mature ecosystem with a lot of support, and the secondary issue is that you want to have a large candidate pool when hiring people.

Small disclaimer though, the last time I used Haskell professionally was in 2018-2019, so it's not 'recent' experience.

I use Clojure a lot at home and Typescript at work. The experience is dramatically different. Clojure makes me feel free. It feels easy to experiment and the whole world feels open to me.

Typescript on the other hand feels like being confined to a small room. There's not much flexibility. Not much is open to me. It's very regimented and I can sense better solutions, but they're off limits to me either because of the required type gymnastics or the language primitives.