Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I like Ocaml for these reasons. It's actually a very simple language and has the C-like elegance. If you already know a few programming languages and can "think functionally", you can pick it up in about a week.

C's major win, in its time, was context-independence: people could drop into a 200,000-line C project and have a good idea of what the code they're looking at is doing. And if C code has been written well, it's not hard to look further if needed. This is not really possible when metaprogramming features like self-modifying code and insane macros are pulled out. Lisp is great in the right hands, but I've seen undisciplined "rock star" programmers produce write-only code in it and that's ugly.

Ocaml also has this context-independence, but it has most of the power of a language like Lisp, it's statically typed and functional, but it's pretty much the minimally complex language that has that power. It loses on libraries, but as far as the language itself goes, it's one of the best languages out there.



I'm an OCaml fan as well and having written in a number of languages I can say that complexity in and of itself is probably not the enemy. I think the problem is more related to modularity. For instance I don't think it is the best policy to make a skip list implementation as simple as possible because it is self contained and will likely be used by many of my programs in the future. Complexity only becomes a problem when it is no longer possible for a developer to fit all the pieces of the program in her mind at once. Abstraction and modularity can generally help with this.


Just because you personally cannot handle macros does not make the code "read only". As I remember, your CL skill is minimal, and your macro skill even smaller.

I am the "rock star" programmer, here referred, and all my code has been easily worked on by three other people, well versed in CL, with only compliments for readability.




Consider applying for YC's Summer 2026 batch! Applications are open till May 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: