Dune makes it very easy to build shared objects (*.so) so that OCaml libraries can be used from C. You can see a minimal example here. To give you an overview of this example, here is the dune file for the shared library: (library (name lib) (public_name binding-example) (modules lib)) (executable (name CAPI) (libraries binding-example) (foreign_stubs (language c) (names cstub)) (flags :standard -linkall) (modes (native shared_object)) (modules CAPI)) (install (section lib) (files ...| 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} ...| OCaml
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
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
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, 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