Remix.run Logo
IshKebab 4 days ago

I agree. If OCaml had solved some of its bigger paper cuts it could have been a real player. Compilation time is much better than Rust too:

* OPAM is quite buggy and extremely confusing.

* Windows support is very bad. If you ever tried to use Perl on Windows back in the day... it's worse than that.

* Documentation is terse to the point of uselessness.

* The syntax style is quite hard to mentally parse and also not very recoverable. If you miss some word or character the error can be "the second half of the file has a syntax error". Not very fun. Rust's more traditional syntax is much easier to deal with.

Rust basically has none of those issues. Really the only advantage I can see with OCaml today is compile time, which is important, but it's definitely not important enough to make me want to use OCaml.

jll29 4 days ago | parent [-]

I'd say the Modula-2 inspired module system is a very valuable asset compared to today's Rust.

The only contact with OCaml I had was that I wrote a bug report to a university professor because I wanted his tool to process one of my files, but the file was larger than OCaml's int type could handle. That itself wasn't the problem - he wrote it wasn't straight forward to fix it. (This is a bug of the type "couldn't have happened in Common LISP". But I guess even in C one could replace int by FILE_SIYE_TYPE and #define it as unsigned size_t, for instance).

pjmlp 4 days ago | parent [-]

It is more the other way around ML predates Modula-2, and the module system like ideas were already present in Mesa and UCSD Pascal. :)

jll29 4 days ago | parent [-]

It's been a while since I used UCSD Pascal (in high school, on Apple II boxes with an extra hardware card), so I don't recall the details of the module system there but I'm pretty sure it did not back then permit separate compilation of definitions and implementation files as Modula-2 did (.def and .mod in Modula-2, respectively).

I also saw some ML/SML at uni in the early 1990s but no mention of modules then (this is not to say you are wrong, but I question how visible any work in that space was that may have existed). Now Mesa I never got my hands on, nor do I know anyone that did.

Modula-2 was popular e.g. on the Atari ST 520 series, I still have the handbook on my bookshelf next to me (the vendor of the compiler I had was called "Application Systems Heidelberg", founded in Germany in 1985 they now seem to have gone into gaming). This was a decent 32-bit compiler, and with 1 MB RAM you could write great applications when C compilers at the time were still insufficient in their ability to provide proper type checking support (pre-ANSI/ISO standardization).

Reddit has a discussion on Modula-2 and its family tree here: https://www.reddit.com/r/programming/comments/1cuam2p/what_e...