13 ms·
A better build system for OCaml
- wiseowise 2y agoDune is the single best name of a build system out there, nothing even comes close to.
- 708733454927516 2y agoIndeed. "He who controls the [build system] controls the universe."
- Kototama 2y agoBecause software is built on shifting sands?
- firesteelrain 2y agoMan I must be under a rock. Never heard of Dune! Cmake mostly
- tombert 2y agoI have to respect Jane Street for proving that HM-typed functional programming can be production-ready and extremely fast when given enough love. I still occasionally hear things about how the more academic-styled functional languages can't work in production, but Ocaml shows that it absolutely can work, even with high performance requirements.
- kyawzazaw 2y ago> HM-typed functional programming Mercury also uses Haskell for their backend https://mercury.com/ https://mercury.com/
- tombert 2y agoAlso very cool! I was fortunate enough to work at Jet.com before Walmart completely destroyed it, which was an F# shop. I really liked it, and I never really felt "limited" by it. The stuff I was working on didn't have nearly the same requirements as high-frequency trading like Jane Street does though. I never did any super low-latency stuff with F#, so it's tough for me to say how well it fair with that kind of environment.
- jlarocco 2y agoToo bad they didn't use their namesake: https://mercurylang.org/ https://mercurylang.org/ Would honestly be a lot more interesting than Haskell.
- brians 2y agoThank you for mentioning this, because—not having followed the link—I thought someone was using Mercury for a backend. And... I wasn't sure I was prepared to follow that link.
- jeofken 2y agoAnyone coding Mercury out there?
- trenchgun 2y agoODASE uses it: https://www.mercurylang.org/documentation/papers/mc_swese_2007.pdf https://www.mercurylang.org/documentation/papers/mc_swese_20... https://www.odase.io/ https://www.odase.io/
- jinwoo68 2y agoStandard Chartered also uses their variation of Haskell.
- zokier 2y agokinda surprising that it still makes sense to develop your own new build system, and then do the migration to it, instead of adopting an off-the-shelf one like buck2 (or bazel/etc...). Not saying that these fancy build tools are easy to adopt, but compared to building your own? is there something remarkable that makes dune much different?
- wk_end 2y agoWithout getting into any specifics of it - I'm sure there's people with much more experience with these tools who can comment - I'll point out that neither buck nor bzl existed when JS decided to start building their own tool in 2012. Bazel's first release was in 2015, Buck's was in 2013. JS does have a bit of a NIH culture, but I'm not sure if that was really at play here. There just...weren't very many good build tools available at the time, particularly for a company using an unorthodox tech stack.
- zokier 2y ago> I'll point out that neither buck nor bzl existed when JS decided to start building their own tool in 2012. Bazel's first release was in 2015, Buck's was in 2013. But Dune started (according to this blog post) in 2016 and JS started seriously improving and adopting it last year. So to me Jenga sounds like a reasonable step in 2012, but pouring significant effort into migrating from Jenga to Dune (and improving Dune) in 2024 sounds more weird
- codr7 2y agoI spent several years in Haskell land a while back, my first functional experience after Lisp. Ocaml never clicked for me, I have a rare form of semicolon allergy and Haskell just looked a lot nicer to me. But then I recently tried Reason and enjoyed it A LOT, so everything Ocaml is suddenly interesting.
- whimsicalism 2y agoi wish the reason syntax was the main one
- cwmoore 2y ago“If your intention is to compile or interpret files as scripts, double semicolons can and should be avoided when writing in OCaml. Leaving them does not raise errors, but they are useless. The compiler tolerates them to allow copy-paste from UTop to a file without having to remove them.“ https://ocaml.org/docs/toplevel-introduction#loading-libraries-in-utop https://ocaml.org/docs/toplevel-introduction#loading-librari... https://reasonml.github.io/ https://reasonml.github.io/ looks cool, OCaml with javascript.
- Taikonerd 2y ago> https://reasonml.github.io/ https://reasonml.github.io/ looks cool, OCaml with javascript. The Javascript-oriented part of ReasonML got forked to be its own language: Rescript. https://rescript-lang.org/ https://rescript-lang.org/
- disconcision 2y agoyou can, for now at least, still use reasonML with js_of_ocaml to compile to javascript if you like reason syntax but don't want to a more complicated relationship with the ocaml ecosystem (we use this for https://hazel.org https://hazel.org)
- cmrdporcupine 2y agoIt's funny because the thing that always turned me off from Haskell was that it feels like a stream of whitespace and identifies without good visual cues as to structure. I'm sure once you get the zen of it, it's fine. Like Lisp, I guess, you learn to think in its structure. But looking at a screenful of Haskell to me is intimidating. Of the bunch I found SML/NJ to be the most readable.
- Lyngbakr 2y agoThey did an episode of Signals and Threads (Jane Street's technical podcast) about their build systems back in 2020¥. Highly recommended, as are the other episodes, especially The Future of Programming with Richard Eisenberg° and What is an Operating System? with Anil Madhavapeddy§. ¥https://signalsandthreads.com/build-systems/ https://signalsandthreads.com/build-systems/ °https://signalsandthreads.com/future-of-programming/ https://signalsandthreads.com/future-of-programming/ §https://signalsandthreads.com/what-is-an-operating-system/ https://signalsandthreads.com/what-is-an-operating-system/
- triyambakam 2y agoVery interesting footnote system. Is it just for fun and aesthetic or have a deeper origin or purpose?
- aaronbrethorst 2y agowhatever it is, it looks like their first time using it. here's the last footnote I see from that account: https://news.ycombinator.com/item?id=39964109 https://news.ycombinator.com/item?id=39964109
- Lyngbakr 2y agoThere's no deeper meaning, just done on a whim.
- postexitus 2y agoFor fun and profit.
- robocat 2y agothe Chicago Manual of Style suggests this order: ⃰ (asterisk) † (dagger) ‡ (double dagger) § (section mark) ‖ (parallels) # (hash) (Hard to present glyphs that would actually be used in print - I've chosen what I think is close - but they are not that close because wrong font)
- Majromax 2y ago
- rwmj 2y agoI respectfully have to disagree. As Fedora packager for OCaml packages, dune's configuration is yet another one-off, with a weird Lisp syntax, hard to understand, difficult to patch. I'd far rather people stuck to using more familiar Linux build systems. As an upstream OCaml developer, the whole thing falls down the minute you need to integrate other programming languages into your build (or OCaml code into a code base written in another language). (This rant more or less equally applies to other language-specific build systems.)
- UncleOxidant 2y agoI haven't been doing much OCaml in recent years, but I do sometimes check in to see what's going on in OCaml-land, and it seems like dune is what everyone is using now - what are the alternatives?
- mhitza 2y agoUsing, probably, to be deprecated ocamlbuild, with _tags file which is another made up syntax. But I'm a new OCaml user, and actively starter using ocamlbuild because dune added layers of indirection really tripped me up at first.
- yawaramin 2y ago> more familiar Linux build systems What's a 'familiar Linux build system'? make?
- n144q 2y agoI wonder if anyone has used Jane Street's open source OCaml libraries and tools for somewhat serious projects. I took a brief look at these things, and my impression is that their stuff isn't "ready" for anyone outside Jane Street, even though they put a lot of effort in building the ecosystem and open source their code.
- Kuinox 2y agoI tried to use their magic-trace tool but I get at least 4 differents crash when using it on trivial dotnet programs.
- giraffe_lady 2y agoI do! Their standard lib replacement was used on the project where I originally learned ocaml, so I have just always used it. You have to be fairly sophisticated at reading fn signatures to find things sometimes but otherwise no complaints with it. It has some very nice features too for example convert functions to/from sexps for all base types can save you a ton of time if you know it's there and plan for it. I've used some of their other libraries too, their logging and unit test ppx are common maybe even de facto standards as much as the ocaml world has such a thing. I've also used, off the top of my head, their code formatter, one of their test frameworks, their implementations of some advanced data structures. Sometimes you do run into one like the other commenter said, where that shit just does not work. It depends on an undocumented something they shipped separately, or needs a secret bit of config or whatever. These aren't malicious, I open a ticket and come back in a year or two often they'll be working. It's not zero frustration but I appreciate their approach of just throwing everything over rather than spending more resources testing and polishing fewer releases. Their code quality is generally very high and even if I can't get something working directly, it provides a rigorous & vetted example implementation.
- n144q 2y agoThanks! The "depends on an undocumented thing" happens quite often for such projects from companies, and is enough to hold people back -- in a company where a third party library requires approval, such issues mean that a fix could take a while before it is available internally, which could delay your own work etc. A lot of this probably comes down to the ecosystem -- not enough people are using these things to discover them early.
- dgfitz 2y agoThe only thing worse than a complex codebase is a complex build system. I think CMake is an abomination. “Hey go learn this new language to compile this other language!”
- gpderetta 2y ago> CMake is an abomination. “Hey go learn this new language to compile this other language!” "go learn this awful new language"
- feznyng 2y agoXmake uses lua if you want to give it a try.
- eadmund 2y agoHe did write ‘awful,’ which is a fair description of the experience of writing Lua. I don’t mean that as an insult to Lua’s creators. They seem like really smart fellows. It’s just that the language is (to my eyes, with my background) viciously ugly. And 1-based arrays, of course, are evil. It has some neat ideas, though, and it is supposed to be very easy to integrate into a project. But man, that syntax …
- yawaramin 2y agoDune's crash message: > I must not segfault. Uncertainty is the mind-killer. Exceptions are the little-death that brings total obliteration. I will fully express my cases. Execution will pass over me and through me. And when it has gone past, I will unwind the stack along its path. Where the cases are handled there will be nothing. Only I will remain.
- snthpy 2y agoLove this! Thanks for posting.
- marviel 2y agoOh wow it's real https://github.com/ocaml/dune/issues/2767 https://github.com/ocaml/dune/issues/2767
- ragnot 2y agoI feel like I just got initiated into something
- sestep 2y agoFor context, this is adapted from the book Dune, after which the OCaml build tool was named. https://www.goodreads.com/quotes/2-i-must-not-fear-fear-is-the-mind-killer-fear-is https://www.goodreads.com/quotes/2-i-must-not-fear-fear-is-t...
- fire_lake 2y agoWhat percentage of JS programmers actually work on this stuff I wonder?
- piuantiderp 2y agoThe article said the team working on it has 5 engineers.
- philipwhiuk 2y agoThe article says 12.
- deleted 2y ago[deleted]
- xiaodai 2y ago[flagged]
- thomastraum 2y agomight get downvoted but all i think of when I see a Jane Street article is how much each programmer earns
- eru 2y agoI hope you are feeling happy for them?
- elzbardico 2y agoWhenever I see posts from Janestreet blog I laugh inside thinking how working on the financial industry at Jane is probably more fun and rewarding than some 90% of the jobs in the so-called tech industry.
- whydid 2y agoGrass is always greener my friend. Many jobs in finance are updating 20 year old Java code, or figuring out new ways to load data in and out of Excel files for custom reporting.
- ericjmorey 2y agoProbably not the case at Jane Street
- udev4096 2y agoOP should've been more specific. HFT firms, not any other finance companies, probably have a lot more exciting work due to the nature of reducing latency using all sorts of novel techniques. I wonder if they disable all the fancy exploit mitigation protection in linux kernel just for a tiny performance hit
- fuzztester 2y agosome use a fork of rust with borrow checking disabled. go fish
- shepherdjerred 2y agoIsn’t borrow checking only compile time?
- SkiFire13 2y agoYes, but sometimes it forces you to write slightly slower code that can be proven safe.
- deleted 2y ago[deleted]
- deleted 2y ago[deleted]
- that_guy_iain 2y ago"accidentally" built a better build system after setting out to build a better build system, it's weird how accidents like that happen.
- edg-l 2y agoi want to like ocaml but the tooling is not there, coming from Rust. The lsp requires you to run "dune build" first, bad already. If you add a new file, the lsp wont pick it up until you dune build it again. The compiler errors arent there too. But i loved writing OCaml, its just thats a bit more painful to learn than due to the tooling, since i didn't use many functional langs before.