Live data from Hacker News

The road to OCaml 5.0

discuss.ocaml.org

111–118 of 118 posts

Re: The road to OCaml 5.0

#111
post #84

Earlier quoted context omitted.

Can you post a simple code example? It is hard to imagine what the difficulty is.

You can read through this SO question and the top response does a good job explaining the possible solutions: https://stackoverflow.com/questions/32300132/why-cant-i-stor...

Seems like using Box solves this issue fairly simply.

Re: The road to OCaml 5.0

#112
post #95

Earlier quoted context omitted.

Yes, thank you, I don't see any OCalm depart there, just depart from ReasonML is mentioned.

I think the "depart" is not supporting newer OCaml feature. While Rescript/ReasonML at first was just an alternative syntax, it has now become a standalone programming language.

I'm sure they'll support new features that apply to rescript runtime context.

Things that don't make sense in javascript runtime context should not be supported.

Backward compatiblity on OCaml side is also something they don't need to care about as its ephemeral - it must typecheck and spit out valid javascript code, that's all.

Re: The road to OCaml 5.0

#113
post #110
post #106

Earlier quoted context omitted.

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.

Labels and labeled optional arguments, they were pretty straightforward to me when I was a newbie. I came from C. OCaml was the type of language in which I just wrote something and it worked on the first, or at worst on the second try without even having to look up the syntax. I would never be able to read Haskell, for what it is worth, even though in OCaml I mix imperative, functional, and OO; I use whichever makes the most sense. In a project I typically use all three.

Re: The road to OCaml 5.0

#114
post #103

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…

> - 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.

Yes, part of the reason why I am generally excited about Scala 3 is because of the work on the theoretical underpinnings of the language on the DOT calculus.

Unfortunately I don't know much more about this other than "this is a Good Thing" and has helped/will help with dealing with edge cases in the language and the compiler, better type inference etc.

But Scala 3 still is overwhelmingly compatible with Scala 2.x (which is a required because of the tons of legacy code out there). Given that Scala 3 continues to be essentially the same language as Scala 2, the overall complexity of the language has not gone down very much even though the core of the language is now more consistent.

Put another way, the emergent complexity of the (tad more uniform) building blocks of Scala 3 still needs to be tackled by programmers.

I also want to point out that Scala 3 compilation speed is supposed to be faster but generally speaking the compiler is still slow-ish.

All in all, Scala 3 is more compelling than before. I may still adopt it in the future for a project. But I'm not as starry eyed about it than some others may be...

Re: The road to OCaml 5.0

#115

Earlier quoted context omitted.

What I meant is that Rescript is not really tied to OCaml as strongly as it was before. The connection before was: ReasonML frontend + Bucklescript compiler backend. Now you just have Rescript which is a rebranding of Bucklescript with a more focussed front-end language (which is a subset of ReasonML). ReasonML aims to supports all of the OCaml syntax while Rescript's aim is to preserve only that syntax that is benef…

I don't think ReScript is a subset of ReasonML. It's forked language that already has some substantial differences and will keep diverging. ReScript is very active. ReasonML is dead for quite a while now. I'm pretty sure ReScript will drop ReasonML syntax soon?

> It's forked language that already has some substantial differences and will keep diverging.

This is really about opinion and individual assessment. It depends on how much emphasis one assigns to surface syntax vs deep language features.

Yes, the surface syntax of Rescript has been cleaned up a bit. There are some new language features but the language is still "close" to OCaml/ReasonML as of end 2021 according to me. If you're able to understand OCaml/ReasonML today you won't have much problem reading Rescript.

But, yes, it is diverging and it could look very different in the coming years.

Re: The road to OCaml 5.0

#116

Earlier quoted context omitted.

Some of the Python FFI tools are listed here: https://ocamlverse.github.io/content/ffi.html . But clicking through to GitHub, the repos haven't been updated in a while.

https://github.com/thierry-martinez/pyml -- 2 days ago

I wasn't counting changes to project metadata like gitignore

Re: The road to OCaml 5.0

#117
post #99

Earlier quoted context omitted.

All good improvements, but Java is missing some really key pieces: - pipe operator (or custom operators in general) - do-notation - tail call optimisation - currying / partial application - (better) type inference - expression orientated - less syntactic noise around function calls (fewer commas and parenthesis) - type-classes or even runtime generic information to work around that Some of the thing I’ve listed can n…

I think you're moving the goalposts from "good to great FP support" to "is Haskell". I think that's the only one that fullfills both do-notation and tail call optimisation at the same time. Well, there's also Purescript and Scala.js running on JavaScriptCore since it has tail call optimisation, but that's a bit of a stretch. I see a lot of people like you that seem to have a very precise idea of what FP is supposed t…

I would add F#, which can do Object Programming like C# but has most of the features I listed above.

Re: The road to OCaml 5.0

#118

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 ?

https://github.com/ocaml-community/awesome-ocaml
Post reply on HN