Quantcast
Channel: OCaml - Topics tagged dune
Browsing all 517 articles
Browse latest View live

Linker errors when using the `threads` library and building an object file (.o)

What is a the right way to configure Dune to build an object file that includes the Batteries library? I have tried the following: let test () = () let _ = Callback.register "test" test with the...

View Article


How should `dune` be used in the newcomer tutorials?

Just one problem: dune. It’s one thing to recommend dune as a build system. No prob. It’s another thing entirely to teach newcomers that dune is OCaml. It is not. Emphatically not. It is in fact...

View Article


PPX name conflict, what to do with dependencies

I’m trying to port my work project to the OCaml 5. I found that Core library now depends from ppx_log (through ppx_jane), and in ppx_log are defined logging macros just like we already use in our own...

View Article

Not able to use %{d}_to_yojson in different path

Hey Team, I am trying using to_yojson function on the type and structure = structure_item list [@@deriving to_yojson] the file path is : cst_viewer/bin/ml/parsetree.ml I am using structure_to_yojson...

View Article

Adding both action and PPS in preprocess - Dune file

Hey everyone, I am new to OCaml and wanted to know how can i add two preprocess in my dune file. Here’s the dune file and my use case is to add (pps ppx_deriving_yojson) in preprocess - (library (name...

View Article


[ANN] dune 3.14

We’re happy to announce that Dune 3.14.0 is now available. This feature has many fixes and new features that you can find in the changelog. There are a few new features that we would like to specially...

View Article

How to define “sub-aliases” of runtest

I am trying to define tests specific to Wasm and others specific to Javascript. I have tried the following: (rule (alias runtest-js) (action (run node %{dep:./link.bc.js}))) (rule (alias runtest-wasm)...

View Article

Question on native executable dependencies

Hello everyone, I am new to OCaml and I am currently testing some small programs just to see how I could use it. In that process, I have written a basic program that fetches a web page from a given...

View Article


In flambda, no inlining-report is generated

So this is probably a dummy question, but I’m currently trying to investigate a bizarre performance issue while using the flambda compiler, and I have added -inlining-report to ocamlopt_flags in my...

View Article


Image may be NSFW.
Clik here to view.

20+ ways to build an executable with foreign libs

Foreign libs can be linked into OCaml executables in a variety of ways. The pertinent info is distributed across several topics in the manual. So I put together a suite of 20-some MWEs demonstrating...

View Article

How to quote included content in dune file?

I have the following line inside a dune library stanza: (flags :standard -ccopt (:include flags.txt)) flags.txt is generated by running a shell command, but it’s not in a sexp format. I would like the...

View Article

Relocatable compiler with binary patching?

Following up on my earlier question Relocatable compiler work Could opam or dune make the compiler relocatable by downloading pre-built binaries and doing a search-and-replace of the hard-coded paths...

View Article

Dune compilation with -output-obj

Here is my dune file: (executable (name binding) (modules binding) (libraries xxx) (modes (native object)) ;(ocamlopt_flags (-output-obj)) (promote (until-clean) (into .))) This compiles, but doesn’t...

View Article


How to use a costum generator for odoc in dune?

I am trying to write my own odoc generator, in a project that is using packages from opam, and dune. I’m kinda new to dune, so I’m not sure how to set it up. Here is an explaination how to include a...

View Article

Stuck installing dune on Windows

Currently attempting to get ocaml up and running in VSCode on windows 11 (win64). Have attempted getting the dkml distribution running, which has given me utop, ocaml, ocaml, opam. But for some reason...

View Article


Image may be NSFW.
Clik here to view.

How to properly define a library with C bindings?

I’m using ctypes and writing custom very small bindings to libsecp256k1, and I can get it to work, but only if I add (flags :standard -cclib -lsecp256k1) on my executable. But that feels wrong, I...

View Article

[ANN] dune 3.15

We’re happy to announce that Dune 3.15.0 is now available. This feature has many fixes and new features that you can find in the changelog. There are a few new features that we would like to specially...

View Article


[blog] Melange 2024 Progress Update

Hi all, we recently shared what we’ve been up to around Melange & ecosystem in a blog post which you can find here: melange.re What's 2024 brought to Melange so far? | Sandtracks The official blog...

View Article

TicTacToe Game GUI with Bogue

can someone help me to create Tictatoe game using graphical interface ?! i already have the code for the game but not gui just in the terminal . type piece = Cross | Circle let piece_opposite =...

View Article

Make `dune runtest` explicitly show passing tests

I have a dune project, in which I added cram-style tests in .t files. When I run dune runtest, the tests are being run, and any failures are promptly identified. However, when all tests pass, the...

View Article
Browsing all 517 articles
Browse latest View live