Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Looks like 2021 is shaping up to be a fantastic year of Ocaml. I know I've been digging into it, trying to sharpen my skills in FP.

I think Ocaml's learnability is a huge asset. I'm surely biased, my main skillset is in Python so of course the low friction to a new language is more important to me rather than say, a Haskell user, or a Scala user. The 2nd edition of Real World Ocaml on Yaron Minsky's site is a great resource for me, though once multicore is actually stable and fully activated there will be still more learning to do.

It's a really nice change to embrace types so close to the top of the software process. Things like Mypy have been a godsend, and I've said in the past that Mypyc represents the biggest quantum leap that Python will ever make, but having such a mature and FAST compiler, with a syntax that's clean and consistent on top of a huge, mature ecosystem (not as huge as pypi, ofc) is just such a powerful value proposition.

Aside from Multicore, I think OWL (ocaml.xyz) is a big leap forward for the ecosystem too. I can see some finance shops putting together Ocaml-Jupyter notebooks and that sort of thing. Maybe bio-tech researchers with FP backgrounds could get more into it.

This is all just my opinion, but having leaned pretty heavy on Python's ecosystem for a pretty long period of time, I am VERY optimistic about finding ways to replace things with Ocaml for speed and correctness. I do enjoy Python, but I think the typed-Python renaissance is about 3 years too late now. It'll win more battles in the years to come, but I see war on the horizon, and not just with Ocaml either.



We've been converting our code from Typescript to Ocaml/ReasonML. The genType project from the Reason team makes it possible to gradually integrate the ReasonML codebase into our existing Typescript project because it generates fully typed Typescript code and not just plain JS. And best of all, if something is hard to do in Ocaml/ReasonML we can actually just use a nodejs package.


You might be interested in F# https://fsharp.org/


The NET ecosystem is too heavily built for C#. The documentation is hard to use, and nearly non existent for F#. I looked at it before I started digging into Ocaml. I interact with Linux far more than anything else, I think Ocaml is just going to be more useful to me, more often.

I really admire Don Syme though. He's one of the most intelligent people in software, by my reckoning. Literally a brilliant genius in a field littered with mediocre hacks that work real hard to ship things. He's a real legend.

Thanks for the suggestion though. Maybe some folks will come across it for the first time now. It's a well designed syntax, and has some really interesting features. Units of Measure in particular is a really cool thing I've needed before, I usually just use data classes and decorators in python to do a lookup, and just pay the performance penalty. It's neat to have that info at compile time for free.


dotnet core runs on linux, mac and windows - just mentioning.


I was to introduced to F# through the excellent fsharpforfunandprofit blog[1]. I wonder if there is a similar thing for other ML-like languages

[1] https://fsharpforfunandprofit.com


https://blog.janestreet.com/ is fantastic.

Jane St are a hedge fund doing some seriously heavy lifting in OCaml land, and they sometimes write up really interesting stuff they've done. It's less tutorial-like than fsharp for fun and profit, though.


If you're willing to be judicious about which libraries you use then you can absolutely pick up Scala directly from Python - a lot of things you'd write in Python translate directly into Scala, particularly if you were already writing map/filter style code.

(I like OCaml too, don't get me wrong)


Oh yeah, for sure. I've seen some scala code that appeared quite palatable. I just meant that I don't know very much about writing it.

There's been some times where I needed python for systems that weren't so lax about what I was able to install, and python was already there. Other than that, I've never really come across a reason disqualifying scala, barring know-how and time to learn it.


> There's been some times where I needed python for systems that weren't so lax about what I was able to install, and python was already there.

FWIW if a system has Java and Maven installed (i.e. any machine set up for Java) then you can use Scala there (indeed I'd say that's a much nicer way to use it than installing it at the system level). Unfortunately Scala tooling isn't really set up for starting quickly if you're not familiar with it, even though it's actually a pretty decent language for one-off scripts.


You might find this interesting

> A conversation with Laurent Mazare about how your choice of programming language interacts with the kind of work you do, and in particular about the tradeoffs between Python and OCaml when doing machine learning and data analysis. Ron and Laurent discuss the tradeoffs between working in a text editor and a Jupyter Notebook, the importance of visualization and interactivity, how tools and practices vary between language ecosystems, and how language features like borrow-checking in Rust and ref-counting in Swift and Python can make machine learning easier.

https://signalsandthreads.com/python-ocaml-and-machine-learn...


I actually read a good chunk of this today!

My experience in software is pretty different than his, though I find his insights very welcome and quite valuable. I don't really have to build large systems, I work mainly with programs I'd describe as duct tape and wrenches. They're small and one-off, and the main goals are to compose them quickly and arrive at a stable behavior that I can write solid tests for. With ocaml, I think the way I'd write a lot of programs I use python for is roughly the same way, just piping a bunch of crap together and then cramming it into a test harness, but with ocaml I can have type safety and speed and a higher level of footgun to do work with. For me. I do weird work.

If I was a more typical software guy, I'd be able to relate a lot more.


Signals and Threads has been a fantastic podcast thus far, I've really enjoyed all the episodes.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: