Live data from Hacker News

Draft of OCaml Scientific Computing book

discuss.ocaml.org

71–80 of 132 posts

Re: Draft of OCaml Scientific Computing book

#72
post #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.

OCaml can provide that: https://github.com/Octachron/tensority

Re: Draft of OCaml Scientific Computing book

#73
post #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.

These old papers might pique your interest

Shape in Computing [https://dl.acm.org/doi/10.1145/234528.234749 ]

A Semantics for Shape [https://www.sciencedirect.com/science/article/pii/0167642395... ]

https://www.semanticscholar.org/paper/The-FISh-language-defi...

https://link.springer.com/article/10.1007/s100090050037

The page for FiSH used to be online. I cant find it now.

Re: Draft of OCaml Scientific Computing book

#74
post #9

Earlier quoted context omitted.

I think Rust kind of stole OCaml’s thunder. It has most of the same benefits, with a mostly familiar syntax and a lot of industry buy-in. And with recent versions, I never find myself fighting the borrow checker like I used to.

I don't know. I think Scala and F# have stolen OCaml's thunder more than Rust. While Rust has been inspired by ML, OCaml and Rust have much different usecases.

Other than interop with .NET does F# bring anything more ? Perhaps a little cleaner syntax. One thing F# does not bring is Ocaml's powerful module system

Re: Draft of OCaml Scientific Computing book

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

As others said, I think the language is great. Things get uglier when you want to go from OCaml to real world OCaml. The standard library is lacking, which means you have to use Jane Street libraries or other third-party library which may not be very robust, stable, documented. Jane Street libraries are fine but they significantly increase the complexity of the langage. They also encourage you into doing things a certain way (using sexp, ppx). Also, I find monad-based asynchronous programming to be quite tedious. I feel like a lot of the simplicity and elegance of OCaml is being lost. In terms of fun, I'd rather write a server in Go than in OCaml.

Re: Draft of OCaml Scientific Computing book

#76

Love OCaml. One of my favorite languages. But I'm using Julia for this kind of thing, it just seems much better suited. Likewise, I wouldn't use Julia to write a programming language implementation, OCaml is much better suited for that.

It's the same for me, Julia is perfect for scientific programming - it has basically replaced Python, it's even starting to be used at my work. I don't think Ocaml has its place in this domain.

Re: Draft of OCaml Scientific Computing book

#77
post #42
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.

> I can't understand why OCaml doesn't have mass adoption. Probably for the exact same reason each year you think about learning OCaml you decide not to (I mean this sincerely, not trying to be snide). I think the main reasons it doesn't see mass adoption in industry: * There are only two major companies that do a substantial amount of OCaml that I can think of off the top of my head, Jane Street and Ahrefs. Facebook…

I agree with most of your points. Though for the Python and Java thing, I think it's less that they're easier to learn and more that they are taught in school and/or already have a lot of popularity/momentum.

Re: Draft of OCaml Scientific Computing book

#78
post #60

Earlier quoted context omitted.

Depends on the science domain. I have spent a couple of years doing .NET for life sciences, as many labs are mostly focused on Windows due to their laboratory robots and data readers. So many researchers end up using a mix of Excel, VBA and MFC (old tech) and Forms/WPF (new tech) based tooling. If that is your data science domain, I would definitely advise F#.

That's pretty far from my domain, TBH. Definitely not Windows if I can avoid it, Linux or Mac, cmdline applications, maybe simple web apps. Would you then dis-recommend F#, or merely not recommend it for Windows compatibility?

The experience with VSCode, VS for Mac and Rider are also quite good, as far as I can tell.

Also you can use .NET Core.

Note that VS for Mac is no longer Xamarin Studio rebranded, nowadays it shares several common code with VS, which is one of the reasons why the plugins have moved away from COM to being .NET based.

Re: Draft of OCaml Scientific Computing book

#79

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?

I would recommend F#.

I went from Ocaml to F# because I wanted better tooling and a much larger pool of available library (any .net library can be used from F#), I did not look back.

Both languages are close cousin but F#'s syntax feels a bit more streamlined at the cost of less powerful type inference (the type inference in Ocaml is a thing of beauty that I have not found elsewhere).

Re: Draft of OCaml Scientific Computing book

#80

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…

We've written a bunch of virt tools in OCaml, used by hundreds of customers. eg: https://github.com/libguestfs/virt-v2v
Post reply on HN