A friendly place to discuss OCaml: an industrial-strength programming language supporting functional, imperative and object-oriented styles| OCaml
A friendly place to discuss OCaml: an industrial-strength programming language supporting functional, imperative and object-oriented styles| OCaml
It’s commonly agreed [citation needed] that declarative programming is better than imperative, since it hides irrelevant details from the programmer. This makes the code more compact, focused, and with less noise. Commonly, we care more about the “what” than the “how”. Still, most programming languages out there are not declarative in nature. Why? You can argue that a good code-base would construct an embedded domain-specific language which is mostly declarative. In a sense, each fu...| OCaml - Latest posts
It is my pleasure to announce a new release of Menhir. The main change is improved parser construction time in --table mode. The table back-end uses a new table compression algorithm. This algorithm is significantly faster than the previous algorithm: in our tests, it can be up to 8 times faster. This results in observably faster compilation: for example, the time required to compile the OCaml parser drops from 1.2 seconds to 0.6 seconds. Compared with the previous algorithm, the new algorith...| OCaml - Latest posts
I happy to announce the first release of ppx_format. Its a small ppx rewriter that was first written at the mirage retreat in 24 with @PizieDust , and that allows to put values in the middle of format strings: let s = "World" let x = 123 let () = Format.printf {%i|Hello {%s s} {%a Format.pp_print_char % Char.chr 65} {%d x}%!|} Its compatible with any function that takes format strings. The only constraint is that the format string has to be the last argument. I have used at in some of my proj...| OCaml - Latest posts
The premise of my earlier post was that if ppxlib incentivized clients to always use Ast_pattern instead of depending on Parsetree directly, then breaking changes would have been avoided. Sadly, this is not correct: I missed that ppxlib 0.36 also made breaking changes to Ast_builder: see pexp_functionin v0.35 and in v0.36. From the perspective of a non-maintainer, it seems like this breakage was more of a choice than a necessity - i.e., the function with the new signature could have received ...| OCaml - Latest posts
Hello, I have a library that uses some (include_subdirs qualified) and I would like to write some module documentation for one of the folders, and I’m stuck. The folder looks like soteria/lib/ ├── dune # (include_subdirs qualified) ├── submodule1 │ ├── x.ml │ └── x.mli └── submodule2 ├── dune # (documentation) ├── index.mld # Was hoping to have this... ├── a.ml └── b.ml I was hoping to be able to write some index.mld in submodule2 wi...| OCaml - Latest posts
Welcome to the fifteenth edition of the OCaml Platform newsletter! In this May to August 2025 edition, we are excited to bring you the latest on the OCaml Platform, continuing our tradition of highlighting recent developments as seen in previous editions. To understand the direction we’re headed, especially regarding development workflows and user experience improvements, check out our roadmap. You can subscribe to this newsletter on LinkedIn! Highlights: Enhanced Editor Integration: OCaml-...| OCaml - Latest posts
Can’t seem to get past this, I am new to OCaml, just trying to build a simple web server here: ✗ opam install . --deps-only -y The following actions will be performed: === install 27 packages ∗ caqti 2.2.4 [required by dream] ∗ caqti-lwt 2.2.4 [required by dream] ∗ dream 1.0.0~alpha8 [required by srql-translator] ∗ dream-httpaf 1.0.0~alpha4 [required by dream] ∗ dream-pure 1.0.0~alpha2 [required by dream] ∗ faraday-lwt 0.8.2 [required by faraday-lwt-unix] ∗ faraday-lwt-unix ...| OCaml - Latest posts
What is the standard way to work with CSV Files? I do not want to use any of Jane Street’s packages. Among other reasons, there is no documentation for a couple of csv related packages provided by JS. There is also the very old and unmaintened package csv that I am not sure if I should be using it today.| OCaml - Latest posts
Seeing OCaml have such great editor tooling and there still being more effort spent in making it even better is great!| OCaml - Latest posts
I was thinking mostly of the github issues, pull requests, RFCs, discussions, and this forum, and the ICFP ML and OCaml workshops. The discord channel and libera chat irc is already available for synchronous discussion, and I am available there for discussing compiler internals to anyone interested.| OCaml - Latest posts
Absolutely. I have our CI now producing all our build assets with either 4.14.2 or 5.2.0+ox. My local tests are very promising. I’m gonna ping the community to get more feedback but so far it looks like it’s working great. I see similar CPU usage and a slight increase in memory of less than 10%, which is totally acceptable for us.| OCaml
Hello I am a bit lost. $ opam install lablgl The following actions will be performed: === remove 2 packages ⊘ base-effects base [conflicts with ocaml] ⊘ ocaml-compiler 5.3.0 === downgrade 2 packages ↘ ocaml 5.3.0 to 5.1.1 [required by lablgl] ↘ ocaml-base-compiler 5.3.0 to 5.1.1 [required by ocaml] However opam show lablgl gives me depends "ocaml" {>= "4.14"} "ocamlfind" {>= "1.2.1"} "camlp-streams" {build} "camlp5" "conf-libgl" "conf-libglu" "conf-freeglut" and I am able to install m...| OCaml - Latest posts
We would love to have as much of the dynamism of Smalltalk as possible. Not only coding in the debugger, but also coding together with the AI in the debugger! And at the same time to have more coding assistance from type inference and autocompletion. Could you share your use case with us? We’re collecting evidence that people would be interested in such a product.| OCaml
A friendly place to discuss OCaml: an industrial-strength programming language supporting functional, imperative and object-oriented styles| OCaml
A friendly place to discuss OCaml: an industrial-strength programming language supporting functional, imperative and object-oriented styles| OCaml
A friendly place to discuss OCaml: an industrial-strength programming language supporting functional, imperative and object-oriented styles| OCaml
Hello friends, I’m trying to use Dune with camlpdf and I’m running into trouble getting a project-aware repl. dune build works just fine, but then I get screwy linking error when I try to run dune utop: > opam exec -- dune utop File "_build/default", line 1, characters 0-0: /usr/bin/ld: cannot find -lcamlpdf_stubs: No such file or directory /usr/bin/ld: cannot find -lxdg_stubs: No such file or directory /usr/bin/ld: cannot find -llambda_term_stubs: No such file or directory /usr/bin/ld: c...| OCaml
Why Lean 4 replaced OCaml as my Primary Language| OCaml
I notice several packages are “Compatibility packages” for supporting various versions of ocaml, for instance uchar or seq. If I’m using OCaml 4.10, In principle I need neither of them, but if I ask opam to install uutf it will install uchar, and if I want lwt it will install seq. Isn’t there a way to tell opam “install foo only if ocaml version < xx.xx”?| OCaml
Hello! I have a question: how do you distribute OCaml binaries for MacOS? Until now, I’ve used GitHub Actions to build a binary on a Mac machine, and then just distribute that. (Just like this topic suggests) But apparently, it’s linking against some HOMEBREW libraries. Some user might not have them, some users might have them installed elsewhere… (See for instance this issue). Do you just put the homebrew installation as a prerequesite? Or do you manage to static link in Mac (I haven...| OCaml
A friendly place to discuss OCaml: an industrial-strength programming language supporting functional, imperative and object-oriented styles| OCaml
A friendly place to discuss OCaml: an industrial-strength programming language supporting functional, imperative and object-oriented styles| OCaml
A friendly place to discuss OCaml: an industrial-strength programming language supporting functional, imperative and object-oriented styles| OCaml
Hello, While working on Raven with heterogeneous columns of a dataframe, I encountered let cumsum t name = match get_column t name with | Some (Col.P (dtype, tensor)) -> ( match dtype with | Nx.Float32 -> let arr : float array = Nx.to_array tensor in let result = Array.copy arr in for i = 1 to Array.length result - 1 do result.(i) <- result.(i - 1) +. result.(i) done; Col.P (dtype, Nx.create dty...| OCaml
A friendly place to discuss OCaml: an industrial-strength programming language supporting functional, imperative and object-oriented styles| OCaml
A friendly place to discuss OCaml: an industrial-strength programming language supporting functional, imperative and object-oriented styles| OCaml
A friendly place to discuss OCaml: an industrial-strength programming language supporting functional, imperative and object-oriented styles| OCaml
I’ve been coding in OCaml and using opam for quite a long time now. I’ve still not managed to install a local directory without first creating a git commit. It’s a papercut I’ve worked my way around for a long time now. Specifically, running e.g. opam install . --switch=myswitch will not install the current folder if I have not commited my last changes. Which is annoying, sometimes I just want to install whatever my current work is. I think the most annoying part is the fact that opam...| OCaml
Continuing the discussion from Feedback / Help Wanted: Upcoming OCaml.org Cookbook Feature: OK, let’s talk about an example that I came across recently: minttea/leaves/table.ml at b084ec7401c52167fae5087577133e52e3874899 · leostera/minttea · GitHub Here we want to render a table in the CLI and we want to pad and truncate the table content text to fit inside the column lengths. Eg suppose one of the columns is 30 characters long. So we need to calculate the length of the text that will go ...| OCaml
I’m really happy that the UTF-8/16 decoder is now part of the standard library! However, I kind of miss a way to write down Unicode code points (more precisely, Unicode scalar values) as literals. That is, I want to be able to write 'よ', '酷' and '😎' as literals of type Uchar.t. (The syntax doesn’t have to be exactly like these—especially if we want to make the parser’s job easier.) The GitHub issue tracker suggested that I post here to see how people feel about this. 😀| OCaml
Is Ocaml a good language to create a CLI in? It is usually less about the language and more about the available libraries. As a newcomer to Ocaml and CLI development overall, it is hard for me to judge this. So how do Ocaml CLI libraries fare against those in other programming languages? are they just as easy? are they just as powerful and flexible? are they even better?| OCaml