Live data from Hacker News

The road to OCaml 5.0

discuss.ocaml.org

101–110 of 118 posts

Re: The road to OCaml 5.0

#101
post #81

Earlier quoted context omitted.

I don't think that's totally fair. The Up and Running page of the OCaml website ( https://ocaml.org/learn/tutorials/up_and_running.html ) was added during 2020. Before that it lacked a straighforward introduction on what you need and how to install it. Node, Go and Rust all come with the package manager, and Rust even comes with a way of managing the different Rust versions. The essential part are here, and everythin…

Let's take a look at the page around this time two years ago. Landing page: https://web.archive.org/web/20191002202720/https://ocaml.org... From which you can click through to the Install page: https://web.archive.org/web/20190819032815/https://ocaml.org... Over there the second and third lines are: > The OCaml compiler and libraries can be installed in several ways: > - With OPAM, the OCaml package manager (recommen…

There's no mention of dune on the old page, which sounds like what they were looking for.

> Look, I agree with you that OCaml installation and tooling are not the easiest to get into. But it wasn't like what the GP was making it out to be.

I disagree with your interpretation of the initial post. Notice the "But it to me seemed" and "My experience with OCaml", and also "The way of the world today to me seems to be". These things are important. They inform us that that person is not exposing a truth, but sharing an experience, and personal preferences. They are also, I think, a way of saying "I don't know if the installation process was too hard, or if it was me that didn't understood something, but what I know is that in the end it didn't work out.".

So at this point, you have multiple options. You can empathize, you can work hard on trying to solve the issues on your end, assuming they are on your end, which might not be the case, you can ignore the post. What, I think, you shouldn't do is to deny this experience and imply that that person is "unreasonable".

Re: The road to OCaml 5.0

#102
post #60

My favourite quote about OCaml: "Never have I took so long, to write so little code, that does so much" OCaml can be a big learning curve, but I urge you to push through. The syntax might not be everyone's cup of team, but you get used to it quickly.

I really wanted to settle on OCaml as the "real programming language" that I would learn for any "serious programming" I had to do. I couldn't make it stick (in part because I don't actually do any "serious programming") precisely because of the syntax. There's too little of it! OCaml seems to take a "you don't need syntax except when you need syntax" approach, which I found very destabilizing. One of the major onlin…

> One of the major online OCaml tutorials said something like "If it doesn't work the way you expect, try adding parentheses"

That sounds like what I did with C++ with * and & when I didn't understood them. Do you think it's a lack of exprience/comprehension on your part, or that some parts of the syntax are fundamentally flawed?

Re: The road to OCaml 5.0

#103

I write a lot of Scala for living, Ocaml looks a bit outdated to me. Having said that, Ocaml compiler is one of the greatest miracles in PL when it comes to speed vs complexity of the language. Scala/Haskell/TS are not even close. I hear Ocaml's runtime performance is not too shabby either

Agree - there are some aspects to OCaml that feel a bit outdated but the language has been trying to refresh itself over the last few years. With multicore (and a minimal version of effects) in OCaml 5.0, certain aspects of the OCaml will become state of the art again. This is just the start though -- lots of interesting features (around effects especially) should land in the future. You mention that you write a lot…

> - The language veers towards a C++ style "I will have every PL feature." Sometimes less is more

Do you still feel that way with Scala 3? From what I understood, the work on the DOT calculus helped reduce and simplify the core of the language.

Re: The road to OCaml 5.0

#104
post #33

Earlier quoted context omitted.

I think Elixir would be interesting for your usecase. It's a dynamic, garbage collected language. It's easy to pick up and get going with. As a functional programming language there isn't a lot to learn in the way of language constructs, and you don't even have to do the 'wrestling with the type system' thing that you have to do in compiled functional languages like OCaml or Haskell (like you do in Rust). Its process…

Thank you! So this looks interesting but it seems like there's no easy way to share numpy arrays? The main use case for a language other than python is a more robust codebase but also performance. We need to be able to efficiently ship lots of large arrays between the languages and the Rust-Python interop supports zero copy arrays for example.

Elixir and Rust are very good friends, so to speak. Writing a library in Rust that you can use from Elixir is only slightly worse than trivially easy.

But I agree somebody has to put the work.

I've made a good career with Elixir but I still don't think it's a good fit for a hedge fund. IMO invest in Rust.

Re: The road to OCaml 5.0

#105
post #33

Earlier quoted context omitted.

I think Elixir would be interesting for your usecase. It's a dynamic, garbage collected language. It's easy to pick up and get going with. As a functional programming language there isn't a lot to learn in the way of language constructs, and you don't even have to do the 'wrestling with the type system' thing that you have to do in compiled functional languages like OCaml or Haskell (like you do in Rust). Its process…

Thank you! So this looks interesting but it seems like there's no easy way to share numpy arrays? The main use case for a language other than python is a more robust codebase but also performance. We need to be able to efficiently ship lots of large arrays between the languages and the Rust-Python interop supports zero copy arrays for example.

Ah, no. I'm sure that's build able in Elixir using a NIF (function built into the VM, in a similar manner to Python modules written in C) but you'd have implement it, I'm not aware of anything out of the ox.

Re: The road to OCaml 5.0

#106
post #102
post #60

Earlier quoted context omitted.

I really wanted to settle on OCaml as the "real programming language" that I would learn for any "serious programming" I had to do. I couldn't make it stick (in part because I don't actually do any "serious programming") precisely because of the syntax. There's too little of it! OCaml seems to take a "you don't need syntax except when you need syntax" approach, which I found very destabilizing. One of the major onlin…

> One of the major online OCaml tutorials said something like "If it doesn't work the way you expect, try adding parentheses" That sounds like what I did with C++ with * and & when I didn't understood them. Do you think it's a lack of exprience/comprehension on your part, or that some parts of the syntax are fundamentally flawed?

Well anything can be chalked up to lack of experience -- I'm sure if I was programming OCaml every day it wouldn't be an issue. Nor would I try to categorically claim the syntax is flawed!

But so much of the syntax, particularly around function calls, is simply a long row of whitespace-separated tokens, and I feel like my brain has to do extra work to parse what's what, and figure out associativity, and constantly remember what the ~ and the ? are doing. This[1] section of the tutorial makes perfect sense when you read it, but that doesn't mean you can easily scan a long function call with a lot of arguments, and instantly see what's happening.

The block-level syntax is great. But it got to the point where if I didn't write/read OCaml for a few days in a row, I forgot how it worked. And that's simply calling a function, nothing esoteric.

[1]: https://ocaml.org/learn/tutorials/labels.html#When-and-when-...

Re: The road to OCaml 5.0

#107

Earlier quoted context omitted.

Agree - there are some aspects to OCaml that feel a bit outdated but the language has been trying to refresh itself over the last few years. With multicore (and a minimal version of effects) in OCaml 5.0, certain aspects of the OCaml will become state of the art again. This is just the start though -- lots of interesting features (around effects especially) should land in the future. You mention that you write a lot…

I disagree on everything you said about scala, except your point about JVM :) but obviously I am biased. WRT to JVM, pure FP recursion (beyond simple tail call elimination) relies on trampolining which is a whole other can of worms. Stacksafe but with heavy performance penalties.

Even Odersky regrets the abundance of curly braces, now that Python is eating the world.

Re: The road to OCaml 5.0

#108

I really hope to see more interest in OCaml in the future. It is probably one of the most underrated programming languages. The perfect marriage between state of the art functional programming and pragmatism. A great static and strong type system. Solid performance and an insanely fast compiler. Also compiles to JS if you need that. Multicore support will make it quite perfect. Only thing that is holding it back more…

Is there a curated list of libs to review ?

Re: The road to OCaml 5.0

#109
post #60

My favourite quote about OCaml: "Never have I took so long, to write so little code, that does so much" OCaml can be a big learning curve, but I urge you to push through. The syntax might not be everyone's cup of team, but you get used to it quickly.

I really wanted to settle on OCaml as the "real programming language" that I would learn for any "serious programming" I had to do. I couldn't make it stick (in part because I don't actually do any "serious programming") precisely because of the syntax. There's too little of it! OCaml seems to take a "you don't need syntax except when you need syntax" approach, which I found very destabilizing. One of the major onlin…

On parentheses, this is one of the main reasons why I integrated ocamlformat with my editor: I write explicit parentheses around everything and I let the formatter remove the superfluous ones. No surprises or guesswork that way.

Re: The road to OCaml 5.0

#110
post #106
post #102

Earlier quoted context omitted.

> One of the major online OCaml tutorials said something like "If it doesn't work the way you expect, try adding parentheses" That sounds like what I did with C++ with * and & when I didn't understood them. Do you think it's a lack of exprience/comprehension on your part, or that some parts of the syntax are fundamentally flawed?

Well anything can be chalked up to lack of experience -- I'm sure if I was programming OCaml every day it wouldn't be an issue. Nor would I try to categorically claim the syntax is flawed! But so much of the syntax, particularly around function calls, is simply a long row of whitespace-separated tokens, and I feel like my brain has to do extra work to parse what's what, and figure out associativity, and constantly re…

To quote the tutorial you linked:

> The syntax for labels and optional arguments is confusing, and you may often wonder when to use ~foo, when to use ?foo and when to use plain foo. It's something of a black art which takes practice to get right.

So I don't think it's just you.

Post reply on HN