I was trying OCaml tutorial. It was not building from chapter 4. I ask on discord forum about it. But it seems we (llvm community) don’t have any maintainer for ocaml binding.
Don’t have build system. autoconf removed but cmake was added.
Don’t have any testcase.
If you want to support it, I can revert that patch.
My thinking was having tutorials is good thing but if they are unmaintained they will more frustate newcomers.
Is the OCaml tutorial outdated in the new release?
The errors I found were related to JIT. And I also found the same question on stack overflow(which is still unanswered from 2016-17). So my assumption was Ocaml tutorial is outdated from 2016-17.
I am learning to use the LLVM OCaml binding recently. It’s still working and updating. And I updated it to LLVM 12.0.1 in opam (ocaml package manager).
I understood the problem: the outdated build system etc.
I found one OCaml tutorial implementation for Kaleidoscope on GitHub. The good is it works (with LLVM 12 and the latest OCaml). The bad is it lacks for the chapters 8,9,10 and the code/folder structure is not identical to the C++ one. Another point is in OCaml, using a parser generator (e.g. menhir) is usually much popular than a manual lexer/parser. I guess it’s true even for OCaml LLVM users.
I am working on extending it to cover the material in chapters 8,9,10 on my own. It’s almost done and it works.
I agree with your thinking on unmaintained tutorials. Let me finish my code first and have another post to discuss on the tutorial.
It seems the DIBuilder is not in the LLVM OCaml API so my work is now paused at section 9.4.
(I found it in llvm repo. The doc I used is also outdated)
Let me refactor the code a bit to make it more aligned with the C++ version, for a better comparison. I am thinking maybe I could make a new PR to llvm when it’s done.