Hacker News new | ask | show | jobs
by fouric 1721 days ago
> for whatever reason purely functional languages are the only ones that elude me

That's because all of the languages you listed are really similar conceptually. PHP, Ruby, Go, C, and Python (and others you didn't list: Java, C++, C#, Perl, Lua, JavaScript) are far more similar to each other than they are to Haskell - they have different syntax and slightly different semantics, but for the most part they're all in the same language family. It's much easier to pick up Java after learning PHP than it is to learn programming for the first time - or, alternatively, to learn a structured language after having written unstructured BASIC for your whole life.

Lisp users (of which I am one) frequently talk about how all of those languages are "basically the same" - but for all that, Common Lisp is still way more similar to Python than it is to Haskell (which I've also tried and failed to learn).

Also, Haskell isn't just a functional language - it also is a lazy language, which means you have to now learn two new ways of thinking at once.

Erlang is similarly in a different world from the mainstream imperative-OO languages, but I don't think that being functional is the only thing that makes it hard to learn - it also has a fundamentally different model of concurrency (as well as being designed around concurrency) that is difficult to learn if you're just used to pthreads.

Similarly, I think that Prolog (logic programming), Adga (is it a programming language, or a theorem prover?), Rust (maybe; lifetimes), and Forth (stack programming) all present unique challenges to people like us that have only written Python/Ruby/Perl/Go/Lisp...

1 comments

Yeah, I agree with all this. Amusingly, from your extended list I have also written a non-trivial amount of Java, JS, and Perl too which perhaps demonstrates your point further.

I hadn’t before considered the laziness part of Haskell, perhaps I simply hadn’t made it far enough to be aware of it before. Maybe that perspective will help me next time I feel the urge to try out fp again.

fwiw to your point about other languages, Rust has certainly presented a challenge due to new paradigms but it’s never felt insurmountable. The rust book is truly an incredible piece of writing that imo makes the language so much more accessible than it would otherwise be.