TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Why OCaml?

98 pointsby ctrlmetaover 2 years ago

4 comments

xavxavover 2 years ago
OCaml is an impressive language on many fronts: compile time, speed, memory usage, but then is almost crippled beyond usage by a few unfortunate decisions &#x2F; (lack of) features:<p>- Dependency management, despite progress `opam` is hopeless brittle because <i>no one</i> uses lock files, good luck building a project that&#x27;s more than 3 months old. Additionally, by default everything is installed into a global &#x27;switch&#x27; and only one version of each package can exist in it.<p>- Build tooling: things are finally improving with `dune`, but the amount of packages that are running hyper-complex Makefile based build systems is incredibly frustrating. It can be very difficult to add a dependency or change the layout of these projects if you aren&#x27;t an expert in arcane Make sigils.<p>- Error messages: again, finally improving, but the number of times I&#x27;ve gotten errors like &quot;line 78 Syntax Error&quot;... I know that parser generators are appealing academically &#x2F; intellectually but there&#x27;s a reason major industrial compilers use recursive descent.<p>- Documentation: Seemingly non-existent for most packages and the tooling is quite poor compared to peer languages (Haskell, Rust).<p>- More controversially, I think that modules are a worse solution <i>in practice</i> than typeclasses &#x2F; traits. The automatic instance resolution coherence brings is a huge ergonomics win, and it also allows for more ecosystem wide collaboration in practice. I know that modular implicits are supposed to bring the &#x27;best of both&#x27; but that doesn&#x27;t even exist yet.<p>None of the problems above are unfixable but they collaborate to make working in OCaml a very frustrating experience for me, even worse because through them I can see what is actually a quite nice language.
评论 #32993294 未加载
评论 #32993461 未加载
评论 #32994403 未加载
评论 #33009393 未加载
exebookover 2 years ago
OCaml is one of those languages that has it&#x27;s own compiler backend. I might have forgotten but I think it even uses it&#x27;s own linker. It is also backed by organisations, for example people from INRIA university and Jane Street company constantly improve it. I remember it also compiled small programs in a few milliseconds, something LLVM based languages cannot do.
评论 #32993065 未加载
评论 #32992999 未加载
rmanolisover 2 years ago
Does it have concurrency or&#x2F;and asynchronous programming?
评论 #32992997 未加载
JaggerJoover 2 years ago
OCaml is cool, but have you tried F#?
评论 #32992916 未加载
评论 #32993009 未加载
评论 #32992857 未加载
评论 #32992846 未加载
评论 #32992942 未加载