Live data from Hacker News

Draft of OCaml Scientific Computing book

discuss.ocaml.org

31–40 of 132 posts

Re: Draft of OCaml Scientific Computing book

#31
post #12

Earlier quoted context omitted.

I've talked to at least one persons who works on production Haskell applications, and Jane Street, a company that was discussed on HN just yesterday makes heavy use of OCaml, but yeah they're pretty rare and I suppose the people working with them are just lucky. I've heard particularly about the Haskell market that if you want a chance of competing for the few jobs available you have to be among the top-haskellers, b…

Jane Street being the only company that anyone ever mentions when discussing OCaml is even worse in my opinion. It means the ecosystem is going to be heavily driven by their needs, not to mention that banks tend to have idiosyncratic development cultures.

Facebook also uses it and will probably have more of an emphasis on it now with their ReasonML project

Re: Draft of OCaml Scientific Computing book

#32

I've never encountered a real OCaml project or anyone who uses it in my career (same is true for Haskell). I have assumed these languages are a hobby for CS academics and get used for pet projects by their devotees. Not that that's bad - they're interesting and the ideas are cool. I would just be afraid of locking myself into an isolated ecosystem that it's hard to hire experienced people for. Is anyone on HN actuall…

I've talked to at least one persons who works on production Haskell applications, and Jane Street, a company that was discussed on HN just yesterday makes heavy use of OCaml, but yeah they're pretty rare and I suppose the people working with them are just lucky. I've heard particularly about the Haskell market that if you want a chance of competing for the few jobs available you have to be among the top-haskellers, b…

Jane Street has 900 employees, I'm guessing 600 in US and maybe 200 devs at most.

Re: Draft of OCaml Scientific Computing book

#33
post #20
post #7

Each year I think wether should I learn OCaml or not. What is the current state of multi-thread OCaml? Is that a game changer or just a cool feature? I can't understand why OCaml doesn't have mass adoption.

Multicore development has sped up pace, there are many changes in the latest two compiler internals that were made in order to accommodate the new GC, and you can read updates on those works in this year's' POPL and ICFP talks. Multicore benchmarks are on github and are used to drive the changes. When used properly you can see large speedups without affecting much the speed of single core OCaml (which is quite fast).…

Just to add to this good summary, OCaml already has some support for parallelism that would be useful for scientific computation.

Essentially you can already have multi-threaded OCaml programs as long as only one thread is using the OCaml runtime at any point in time. For numerical code where you might be spending the vast majority of your time in external libraries this ends up not being a major problem. It's not a dissimilar story for where Python is.

What Multicore OCaml adds is the ability to run multiple threads of OCaml code at the same time (we call them Domains, to avoid confusing them with existing Threads - which can coexist).

There's an entry on the Multicore wiki that gives some more depth: https://github.com/ocaml-multicore/ocaml-multicore/wiki/Conc...

In terms of the project you can also follow progress in the Multicore Monthlies: https://discuss.ocaml.org/tag/multicore-monthly as well as see the in-progress and merged multicore PRs that are hitting upstream ocaml: https://github.com/ocaml/ocaml/pulls?q=is%3Apr+label%3Amulti...

If you want to know more about how the multicore runtime works the recent ICFP2020 paper has a lot of detail: https://arxiv.org/abs/2004.11663 and KC's presentation is worth a watch: https://www.youtube.com/watch?v=ASX79I0jm6M&feature=youtu.be...

Re: Draft of OCaml Scientific Computing book

#34
post #28

Earlier quoted context omitted.

Thanks for the hard work! I always appreciate any contributors even if I have only used OCaml a few times. I think y'all are definitely raising some awareness and I agree the lack of a plotting library is a major hurdle. You can always call out to GNUPlot from the terminal, but most folks probably don't want to do that.

Thanks for the kindness! There is actually a GNUPlot backend for Owl. Works very well, but is a bit lowlevel: https://github.com/hennequin-lab/gp Similarly, I use https://github.com/mseri/ocaml-gr but it is a safe lowlevel binding. I hope one day to have the time to wrap it into an interface similar to Julia's one.

Not a problem at all. Thanks for chatting and sending the links. I wish you the best on this project. Maybe it will help get OCaml some additional/well-deserved attention and love. I'll keep my eye on the project too. Is anyone working on data frames?

Re: Draft of OCaml Scientific Computing book

#35
I'm beginning to think of learning either OCaml or F# for data sciency-kind of things. Any points of comparison between those?

Library ecosystem seems better on F#, but I must admit I'm somewhat wary of the behemoth that is .NET .

What else should I consider?

Re: Draft of OCaml Scientific Computing book

#36
In my opinion, static languages don't bring a whole lot to the table with numerical math. There's not many types for one. You basically just use matrices and vectors of floats most of the time.

What would really be a bigger deal is some limited dependent typing to avoid errors from mismatched array sizes. Until then though, Julia is a bit more practical choice for me.

Re: Draft of OCaml Scientific Computing book

#37

I'm beginning to think of learning either OCaml or F# for data sciency-kind of things. Any points of comparison between those? Library ecosystem seems better on F#, but I must admit I'm somewhat wary of the behemoth that is .NET . What else should I consider?

Scala might be something worth looking at. There's a lot of libraries on the JVM, but sparse linear algebra is still kind of a wasteland compared to Python or Numpy. I wish someone would just make some good bindings to Eigen or something for the JVM.

Re: Draft of OCaml Scientific Computing book

#38
post #23

Earlier quoted context omitted.

I'm not very familiar with the scientific landscape of Haskell or OCaml, but if you would allow an educated guess... Languages like R, Python, Matlab, and Mathematica have a LOT of built-in capability in this area to do symbolic and numerical methods and data analysis kind of stuff (large sparse matrices... etc). You can do a ton in the high level language without ever dropping down to C or Fortran. So a scientist ca…

I am part of Owl contributors/maintainers. You are right that the ecosystem is small, and will likely be always behind Python, R and Julia. But considering how small the community around numerical methods in OCaml is, I think the work that went into owl and this book is incredible and may help raising awareness and growing the userbase. I think one of our current limitations is the lack of a high quality, full-featur…

> You are right that the ecosystem is small, and will likely be always behind Python, R and Julia.

But you should be able to call those languages from OCaml. For instance, RInside

https://cran.r-project.org/web/packages/RInside/index.html

lets you call R from any language with a C FFI. A very simple solution (even if not quite as convenient as a full OCaml solution) that lets someone write OCaml if that's their preferred language. I helped add that functionality to RInside and I've been doing that for years so I can use D for my research.

Re: Draft of OCaml Scientific Computing book

#39

Skimming through this book, one thing i was constantly wondering, is how well does this ocaml framework use the hardware. Leaving ocaml aside, the connection between scientific computing and hardware is the one thing I miss the most in "scientific computing" books and courses, because it sooner or later limits the science that any researcher doing scientific computing can do. To give an example, earlier this week, on…

Let’s face it, is this researcher ever going to read a book on scientific computing in OCaml? Most researchers won’t even read a book on scientific computing.

Re: Draft of OCaml Scientific Computing book

#40

I've never encountered a real OCaml project or anyone who uses it in my career (same is true for Haskell). I have assumed these languages are a hobby for CS academics and get used for pet projects by their devotees. Not that that's bad - they're interesting and the ideas are cool. I would just be afraid of locking myself into an isolated ecosystem that it's hard to hire experienced people for. Is anyone on HN actuall…

I use OCaml at work. We work with the Binary Analysis Platform https://github.com/BinaryAnalysisPlatform/bap which is a pretty essential part of what we do. In general, OCaml seems somewhat popular in the area of compilers and program analysis. Facebook Infer is written in OCaml for example https://fbinfer.com/. This may be as you said because of these areas sometimes more academic flavor. There are companies out there using OCaml for all sorts of things, although of course it is a small fraction of those using python or C++.
Post reply on HN