
OCaml 4.10 - pjmlp
https://discuss.ocaml.org/t/ocaml-4-10-released/5194
======
dragonsh
Congratulations to the team and hope ML family languages become popular and
mainstream.

Rust compiler front-end was initially written in OCaml and later moved to rust
and dependent on LLVM written in C++. Still Rust became more popular by
following a simple imperative style of programming with some incremental
improvements over C/C++.

OCaml is confined mostly within Facebook with some use by Bloomberg and in Xen
development. I hope functional programming languages become popular and also
used for systems programming. OCaml indeed is used for system programming,
like Mirage unikernel OS is written in it.

Although OCaml can offer whatever is offered by Rust I believe Rust being
imperative language along the lines of C++ will be more popular.

~~~
smabie
OCaml is also used by Jane Street and they are probably the biggest corporate
users of it.

~~~
Kalooo2020
Same name every OCAML or F# post.

~~~
exdsq
They are very involved with the ecosystem. They sponser a lot of the events,
conferences, etc. In fact I'm attending OPLSS this year and even _that_ is
sponsered by them.

I even saw someone compare OCaml build methods as 'Jane Street Way' vs 'Other
Ways'. It's hard to ignore such an influential company like that when the
question about who uses them comes up!

------
e12e
> Some preliminary runtime work for OCaml multicore

Anyone have more information on a likely time-line for multicore? It feels
like it's been comming for a _long_ time. I suppose it's encouraging that some
work is released in the mainline compiler though.

~~~
sadiq
There's an update to for January: [http://discuss.ocaml.org/t/multicore-ocaml-
january-2020-upda...](http://discuss.ocaml.org/t/multicore-ocaml-
january-2020-update/5090)

Behind the scenes there's a lot of work happening. Retrofitting parallelism to
an existing runtime while maintaining compatibility with existing code and
keeping the kind of performance users are used to is difficult.

There will be a lot more information out in the next month or two about how it
all works, which should coincide with getting more of it upstream.

I don't speak for OCaml or OCaml Labs but am a contributor to multicore if
people have specific questions, I can try to answer them.

~~~
pdimitar
What are the top challenges? Why is it taking so long? What exactly will
multicore OCaml cover? Native OS threads? Green threads? Actors like in
Erlang/Elixir?

I'm learning Rust and I'm doing so a bit begrudgingly at times. I like OCaml
better but the lack of frictionless parallelism is a huge letdown. (And I
don't think spawning several processes is an actual alternative, no.)

Trust me, there is some amount of programmers out there who will very quickly
adopt OCaml after it gains multicore abilities. They are eagerly awaiting and
watching. And I'm one of them.

------
a7b3fa
I'm reasonably competent in Haskell and am interested in checking out OCaml.
Can anyone recommend any good resources (books, tutorials, etc.) for someone
like me to get started?

~~~
x0re4x
See
[https://www.cs.cornell.edu/courses/cs3110/2020sp/textbook/](https://www.cs.cornell.edu/courses/cs3110/2020sp/textbook/)

~~~
a7b3fa
Based on the introduction, that looks like a great book which I definitely
wouldn't have found on my own, so thanks for the suggestion! I'll have to give
it a try when I have some time.

~~~
x0re4x
I have some more older links, ocaml changed a bit over time, but I think they
are still relevant:

[https://caml.inria.fr/pub/docs/oreilly-
book/html/index.html](https://caml.inria.fr/pub/docs/oreilly-
book/html/index.html)

[https://caml.inria.fr/pub/docs/u3-ocaml/](https://caml.inria.fr/pub/docs/u3-ocaml/)

[https://ocaml.github.io/ocamlunix/](https://ocaml.github.io/ocamlunix/)

------
fishmaster
Sometime in the future I would like to use ocaml, but I found the user
experience from 0 so difficult that I just didn't bother at all. Haskell was
much friendlier.

~~~
yawaramin
Can you give any specifics?

~~~
pdimitar
Tooling mostly. It was needlessly difficult to make a small project and use
dune to build and run it.

Contrast this with Elixir and Rust where the beginner howtos are front and
center. Both mix and cargo are amazing tools that are also very easy to use.
Dune is rather cryptic and non-obvious.

I'd definitely be much more excited about OCaml if dune and opam had good
cheatsheets and proper brief manuals that don't assume anything about the
proficiency of the reader.

A lot of educational OCaml material is either old or imprecise.

Again, start with dune. I want a brain-dead intro to it but still it should
cover everything it can do, and how.

~~~
johnisgood
You may want to read part III ("The OCaml tools") here:
[https://caml.inria.fr/distrib/ocaml-4.10/ocaml-4.10-refman.p...](https://caml.inria.fr/distrib/ocaml-4.10/ocaml-4.10-refman.pdf)

You could give
[https://ocaml.org/learn/tutorials/](https://ocaml.org/learn/tutorials/) a try
as well, specifically this:
[https://ocaml.org/learn/tutorials/setting_up_with_oasis.html](https://ocaml.org/learn/tutorials/setting_up_with_oasis.html)

For profiling:
[https://ocaml.org/learn/tutorials/performance_and_profiling....](https://ocaml.org/learn/tutorials/performance_and_profiling.html)

For debugging:
[https://ocaml.org/learn/tutorials/debug.html](https://ocaml.org/learn/tutorials/debug.html)
and [https://caml.inria.fr/pub/docs/manual-
ocaml/debugger.html](https://caml.inria.fr/pub/docs/manual-
ocaml/debugger.html)

For unit testing:
[https://www.cs.cornell.edu/courses/cs3110/2019fa/textbook/da...](https://www.cs.cornell.edu/courses/cs3110/2019fa/textbook/data/ounit.html)
and
[https://www.cs.cornell.edu/courses/cs3110/2019fa/textbook/te...](https://www.cs.cornell.edu/courses/cs3110/2019fa/textbook/testing/intro.html)

You may find
[https://github.com/gildor478/ounit#examples](https://github.com/gildor478/ounit#examples)
useful for both OUnit (unit testing) and OASIS (build system).

~~~
pdimitar
Thank you for posting these. I've lost some of the links and I am now
bookmarking them so I don't lose them again.

I got through some of them and I felt the quality of the OCaml teaching
material itself is very high. No remarks there. Any syntax cognitive shock is
eventually overcome and things flow pretty well.

Wasn't `oasis` the legacy way of building projects? Thought everyone used
`dune` now?

In short, I am looking for the way that most OCaml programmers manage their
project nowadays. I know this is happening through `dune` but the tool's
documentation and educational material is very lacking. I don't object against
the build file being LISP; when I thought about it for a minute it actually
makes a lot of sense.

But I need a quality material on everything you can do with `dune`. Can you
recommend such?

~~~
yawaramin
Can you give some specifics about what's lacking in the dune docs?

~~~
pdimitar
It has been a while. I admit I haven't read the entire tutorial and I checked
the website just now -- seems like stuff has been added (and maybe modified).
Looks a bit more understandable and beginner-friendly now! I'll have to give
my two hobby projects another go from scratch. :)

Is it OK for me to hit you up on OCaml's Discourse forum if I need help or
want to give extra feedback when I am able to, in the future?

~~~
yawaramin
Sure, happy to help.

------
walterbell
Does Ocaml support cross-compilation, e.g. x86->arm?

~~~
eru
Some Googling leads to eg [https://discuss.ocaml.org/t/ocaml-cross-
compiler/1494/5](https://discuss.ocaml.org/t/ocaml-cross-compiler/1494/5)

------
idbehold
Still no regular expression negative look-aheads?

~~~
alharith
If you need a regex that complicated it’s probably better to be written as a
parser. Not only will it be way more performant, it will be much more
maintainable.

~~~
leoh
I agree that if you're designing a system from scratch this makes sense.
Ocassionally you need to extend the syntax of an existing system that is
written with regular expressions and would require a negative lookahead. Some
sub-parser with negative lookahead functionality would be possible, but a
regex would be more convenient in a pinch.

