OPAM Blog
opam.ocaml.org · Company blog · on HN since 2014
The OCaml team behind OPAM, the OCaml package manager, posts release notes, packaging guides and repository security work.
What HN saysHN links it when OCaml package management comes up, including OPAM's lack of Windows support before version 2.2 and comparisons to Cargo.
40HN people shared it
34linked it in comments
7stories submitted
61story points
3 months agolast shared
2014people per year2026
Most-shared posts
- 1Homepage10 people · first shared 2014
- 2OPAM 1.2.0 public beta released3 people · 3 points · first shared 2014 · discussion on HN
- 3Packaging3 people · first shared 2016
- 4Signing the OPAM Repository: TUF Meets Git2 people · 42 points · first shared 2015 · 20 comments on HN
- 5About utop2 people · first shared 2016
- 6Install2 people · first shared 2019
- 7Specifying Solver Preferences2 people · first shared 2014
- 8Packages2 people · first shared 2015
- 9Official native Windows support for OCaml with opam 2.2.01 people · 9 points · first shared 2024 · discussion on HN
- 10Preview of opam 2.0, the OCaml package manager1 people · 3 points · first shared 2016 · discussion on HN
- 11Why we use OPAM in XenServer1 people · 2 points · first shared 2015 · discussion on HN
- 12Draws fractals defined by iterated function systems (IFS) using the chaos game1 people · 1 points · first shared 2026 · discussion on HN
- 13Release of opam 2.0.0, the ocaml package manager1 people · 1 points · first shared 2018 · discussion on HN
- 14Manual1 people · first shared 2020
- 15Opam 2 0 0 repo upgrade roadmap1 people · first shared 2018
What HN people wrote when they linked it
yminsky · 2014-07-08
The biggest change is OPAM, http://opam.ocaml.org/, a top-notch package management system that makes installing OCaml packages much easier.
Shameless plug: there's also a newish O'Reilly book, Real World OCaml http://realworldocaml.org, which I think is a big help in learning the language.
Oh, and there's OCaml Labs, a new lab at Cambridge University that's dedicated to improving the language.
And of course the compiler is constantly making progress. The upcoming 4.02 release is a pretty fun one, which I documented here: https://blogs.janestreet.com/ocaml-4-02-everything-else/ And before that, changes like GADTs and first-class modules landed, which have been quite useful extensions.
Really, it's a very active and fun community these days. The language is getting better quite quickly, but mostly in conservative and tasteful ways. The people in charge of the core language have been doing a great job, and the community infrastructure (things like OPAM) have been making big strides as well.
ReleaseCandidat · 2023-11-12
The biggest problém with Opam and OCaml on Windows is that most of the packages won't work. Officially, Opam does not support Windows at all, that is going to be included with 2.2 (which is still in alpha AFAIK)
https://opam.ocaml.org/blog/opam-2-2-0-alpha/#Windows-Support
I always thought of Opam as the best feature of OCaml (especially compared to Haskell with two no-working package managers - and no, Nix is a problém, not a solution either).
Tommah · 2020-11-03
There is a library called py.ml [0] that lets you call Python code from OCaml. That should let you use Google Cloud's Python SDK from OCaml, although things could get unwieldy if you have to call back and forth constantly. I think it's at least worth a try, especially if the alternative is rewriting your whole codebase in Python.
[0] - https://opam.ocaml.org/packages/pyml/
rwmj · 2020-08-18
On Fedora:
dnf install ocaml ocaml-camomile-devel emacs-tuareg-mode
will get you the compiler, Unicode support and an emacs editing mode. It's similarly easy on Debian. You can also install opam if you want to go that way: https://opam.ocaml.org/
AceJohnny2 · 2018-06-28
OPAM? [1]
(Haven't used cargo, and only briefly touched OPAM. Don't know the feature gap, but am curious to learn more)
[1] https://opam.ocaml.org
agentultra · 2017-02-23
It's going to be hard for any language to compete with the .NET ecosystem due to the hundreds of millions of dollars of funding it gets from industry compared to OCaml.
There's still room for both and they're still both great languages. That F# is quite similar to OCaml is a good thing... it means there must be some good ideas in there. :)
As for a MongoDB driver I found https://opam.ocaml.org/packages/mongo/mongo.0.67.2/ on OPAM in a few seconds. OPAM has been huge.
programLyrique · 2016-06-19
Ocaml has opam, a package manager, with currently 1227 packages in it.
https://opam.ocaml.org/
The standard library of ocaml is quite basic, so usually, you use either Core (https://github.com/janestreet/core) or Batteries Included (https://github.com/ocaml-batteries-team/batteries-included)
I personnally prefer Batteries because it tries to stay compatible with the standard library.
amirmc · 2014-11-15
For Mirage OS, all libs are released as packages in OPAM [0], so it's really straightforward to find out which versions you're using (and manage/update/remove them). In fact, we just did a set of releases recently [1]. I'm not sure how it is for the other systems.
[0] http://opam.ocaml.org
[1] https://github.com/ocaml/opam-repository/pull/3028
avsm · 2014-10-28
The homepage is at https://opam.ocaml.org, and the repository of packages at https://github.com/ocaml/opam-repository. Mailing list is [email protected].
a0 · 2014-08-25
No, it's not common. Most popular projects are normally hosted on GitHub and managed with OPAM[1]. Also you can checkout some interesting projects here: <https://github.com/rizo/awesome-ocaml/>
[1]: http://opam.ocaml.org
p4bl0 · 2014-02-13
If you program in OCaml be sure to checkout Batteries [1], it is an extension (which also replaces some stuff) to the standard library which eliminate most of the criticisms I had against OCaml. Also, don't try to avoid opam [2], I didn't really want to use it at first because I always prefer to use my system's package manager (using Debian), but it makes your life so much easier.
[1] http://batteries.forge.ocamlcore.org/
[2] https://opam.ocaml.org/
ernst_klim · 2018-12-13
>I have not heard positive things about the library eco-system
OCaml has quite a neat ecosystem, though. Especially in terms of quality. There are a few major and a bulk of minor groups that write libraries for different purposes, such as:
* MirageOS -- people behind a bunch of a high quality system libraries, there are tls (in pure ocaml) and various cryptography primitives, filesystem drivers, tar, zlib, full tcpip stack, http server, git (in pure ocaml, not a mere binding), irmin (a git-based key-store database with concurrent access), dns and some other [1].
* Ocsigen -- webdevs, authors of Lwt (monadic concurrency library), js_of_ocaml (ocaml to js compiler) and related stuff [2]
* Jane Street, Facebook, blumberg -- reason syntax, bucklescript (alternative npm-ecosystem-frienly javascript compiler), various libraries for serialization, containers etc.
* Others
Opam [3] has quite a comprehensive set of libraries pretty for every purpose: data serialization, interaction with other langs (python, R, beam Erlang/Elixir), servers, db bindings, stuff for system or web programming. Some stuff is absent, but it's definitely not a scorched field, and most of the time the benefits worth writing an absent binding or two.
[1] https://github.com/mirage
[2] https://github.com/ocsigen
[3] https://opam.ocaml.org/packages/index-popularity.html
nextos · 2025-11-16
It does have a lively ecosystem in some niches. Formal verification is one of them.
For example, https://opam.ocaml.org/packages/why3 is a little marvel of engineering.
johnisgood · 2025-08-13
> difficulty to install
Use opam: https://opam.ocaml.org or https://opam.ocaml.org/doc/Install.html.
Additionally, see: https://ocaml.org/install#linux_mac_bsd and https://ocaml.org/docs/set-up-editor.
It is easy to set up with Emacs, for example. VSCodium has OCaml extension as well.
All you need for the OCaml compiler is opam, it handles all the packages and the compiler.
For your project, use dune: https://dune.readthedocs.io/en/stable/quick-start.html.
emmelaich · 2025-03-07
utop for ocaml is cool, gives type signatures for functions. no explicit help, but does offer completions with tab.
Similarly, rtop for reason.
https://opam.ocaml.org/blog/about-utop/ and https://opam.ocaml.org/packages/rtop/
mro_name · 2024-10-14
how is your tea different from https://opam.ocaml.org/packages/teash/?
maattdd · 2021-10-06
The last published package on opam is 12.0.1 https://opam.ocaml.org/packages/llvm/
bgorman · 2020-10-09
I completed the make a lisp project in Reason (alternative syntax for OCaml) a few months ago.
I used the PCRE library, which has pretty much all the features you expect, and it is actively maintained. Note: the heavy lifting is done by C libraries.
https://opam.ocaml.org/packages/pcre/
If you want to see how I integrated it with the interpreter the code is here:
https://github.com/briangorman/reason-mal/blob/master/reader.re
Erlangen · 2020-06-19
Sorry I miss your reply. I create opam switches to have different versions of compiler, or allow libraries that conflict to live at different branches.
1. Dune is a relative new build system for Ocaml. You just write a configuration file, and dune will handle switches automatically. "It also supports multi-context builds, such as building against several opam roots/switches simultaneously. This helps maintaining packages across several versions of OCaml and gives cross-compilation for free." See https://opam.ocaml.org/packages/dune/
2. Yes. You can can multiple versions library at different switch.
3. I am not sure.
talex5 · 2020-06-08
By default, opam installs everything into the current "switch". Typically you have switch one per compiler, but you can create one per project. You can also create a "local" switch directly inside your project directory: https://opam.ocaml.org/blog/opam-local-switches/
Another option is to use the duniverse tool (https://github.com/ocamllabs/duniverse). That downloads all dependencies to the project directory, and then builds them all together as one giant project. That makes it very easy to make changes across multiple libraries at once, while keeping fast incremental builds.
And a final option is to build projects with Docker, which allows you to have separate versions of non-OCaml packages too.
shakna · 2019-11-09
Not intentionally malware.
But the OPAM install [0] deleted my $PATH, and it took me a while how to fix that one. They've since fixed what allowed the problem to happen [1], well it was a combination of that (normal shell problems) and a power-outage that killed the installer just before completion (in which case the script may just think it's complete).
But I'm sure similar catastrophic side-effects can occur in other install scripts out there.
[0] https://opam.ocaml.org/doc/Install.html
[1] https://github.com/ocaml/opam/issues/2165
jxy · 2019-06-14
In addition to Scheme and CL,
Perl: https://perldoc.perl.org/bignum.html
Perl6: https://docs.perl6.org/language/math#Arithmetic
J: https://code.jsoftware.com/wiki/Vocabulary/xco
ocaml: https://opam.ocaml.org/packages/zarith
anuragsoni · 2019-01-24
Server side reason can already compile to native binaries (thanks to the OCaml compiler). While maybe smaller than the npm ecosystem there are a lot of high quality packages available on the OCaml ecosystem [1] that allow for a very pleasant server side development experience. For example https://github.com/rgrinberg/opium is a really nice high level toolkit. There are database bindings to Postgres, Mysql and the like, and high level interfaces to them like https://github.com/paurkedal/ocaml-caqti
[1] http://opam.ocaml.org/packages/
weberc2 · 2018-11-26
I'm a little hazy on the particulars because I never got terribly deep into OCaml and haven't tried it in a while, but IIRC, OPAM is a package manager (and according to https://opam.ocaml.org/doc/Packaging.html, it requires a configuration file). The most popular build system for OCaml is JBuild (or whatever it got renamed to) which also requires a configuration file (formatted as S-expressions to make things more confusing for newcomers) and I think that usually bottoms out in a Makefile to boot (or maybe it's the other way around, and OPAM packages usually call into Make which calls into JBuild?).
In any case, it's a far cry from `go build`.
yaantc · 2017-08-20
Merlin [1] can provide type information for OCaml and integrates with emacs, vim and sublime (at least). One can easily select any expression and get its type. From experience, it's very convenient to spot mistakes leading to properly typed code, but not with the expected type(s).
[1] https://opam.ocaml.org/blog/merlin-2-0-0-released/
Drup · 2016-07-29
At least for the dependency solving part, a generic exchange format has emerged: CUDF (http://www.mancoosi.org/cudf/).
Several efficient solvers have been implemented that supports this input format. You can read about it more in http://opam.ocaml.org/doc/Specifying_Solver_Preferences.html#Yestherea…
[1]: https://www.youtube.com/watch?v=E-gtFnbHcv0&list=UUP9g4dLR7xt6KzCY…
[2]: http://ocaml.org/meetings/ocaml/2014/ocaml2014_17.pdf
This is at least used in OPAM (the OCaml package manager) and is also available for apt.
If you are implementing a SAT solver for your package manager nowadays, you are doing it wrong. :)
klibertp · 2016-07-16
You mention OCaml, so you probably are aware, but others may not be: there is an `utop` project, which does exactly this for OCaml REPL. It looks like this:
─( 16:36:52 )─< command 0 >───────────────────────{ counter: 0 }─
utop #
┌───┬────────────┬─────┬───────────┬──────────────┬───────┬─────┐
│Arg│Arith_status│Array│ArrayLabels│Assert_failure│Big_int│Bigar│
└───┴────────────┴─────┴───────────┴──────────────┴───────┴─────┘
and supports syntax highlighting and autocompletion, among other features. Similar to bpython in Python-land.
Link: https://opam.ocaml.org/blog/about-utop/
eatonphil · 2015-03-21
OPAM Package:
https://opam.ocaml.org/packages/owebl/owebl.0.1/
Release Candidate:
https://github.com/eatonphil/owebl/archive/v0.1.tar.gz
pjmlp · 2015-02-25
Just to extend your list.
dub for D, http://code.dlang.org/
cargo for Rust, https://crates.io/
biicode for C and C++, https://www.biicode.com/
NuGet for C and C++, http://docs.nuget.org/consume/support-for-native-projects
OPAM for OCaml, https://opam.ocaml.org/
kaeluka · 2014-05-06
fuck, it's in OPAM? The gives me no excuse..
edit: [ERROR] curl: code 404 while downloading https://opam.ocaml.org/archives/mezzo.latest+opam.tar.gz