Hi
Like mentioned in the title this compiles Ocaml (Bytecode) into Lua (lua5.1). This project is ai generated, I tried to fully disclose that with the methods described in the project ocaml-ai-dislosure:
Is the comical value of the name intentional or accidental? Especially when this has been developed with AI.
The name was my contribution. I wanted to make sure I still had the last word somewhere in the repo.
This reminded me of Parsing Lua in Lua with OCaml | SquidDev, which takes a more āmanualā approach (basically hand-translating the tables that Menhir produces into lua tables)
This doesnāt work for me with a plain Lua 5.1 interpreter:
# In PowerShell but hopefully should work in a Unix shell
$ git -C build clone https://github.com/maltasea/lua_of_ocaml.git
$ docker run -v $PWD/build/lua_of_ocaml:/work --workdir /work -it nickblah/lua:5.1-luarocks bash
/work# lua -v
Lua 5.1.5 Copyright (C) 1994-2012 Lua.org, PUC-Rio
/work# lua test/hello.lua
lua: test/hello.lua:2873: 'end' expected (to close 'if' at line 2871) near '_v473'
What interpreter are you using?
thanks for trying it out. Claude and I solved a lot of errors and write new and better tests. It should now run with lua5.1.5 and luajit. If you want, please give it another shot by run make hello after cloning
[I] ~ % cd ~/temp
% git clone https://github.com/maltasea/lua_of_ocaml
Cloning into ālua_of_ocamlāā¦% cd lua_of_ocaml
[I] ~/temp/lua_of_ocaml % make hello
dune buildocamlc -g -o hello.byte hello.mldune exec ā compiler/bin lua_of_ocaml/main.exe ā hello.byte -o hello.lua
lua hello.lua
hello from lua
I was not expecting the code to be rewritten to get the hello world example to work. Sorry, but it sounds like you didnāt/canāt detect when LLMs hallucinate. Thanks; I wonāt look at this further.
hmm, not sure what you mean, or why do make the halluzination not detected claim. there is quite some time between the first announcement and your report. At the beginning there where some problems with the generated lua. But this and numerous issues where detected by me and solved, among other the initial problem with some faulty lua, you where refering to. So up to this time iāve manually done around 40 commits, and as far as i can tell all quite intentional
ā¦
But admittedly, the whole experience is a bit strange and the ego is a little bruised, for sure. However after having poured something around 13 hours in it, Iām ok with the end result. While it cannot not match the quality of a skilled Ocaml developer, and while there are things there are bothering me more on a conceptual/structural level (ffi). Itās something I can use now.
And honestly when I think about it, the strange and ego-bruising experience is also due to the tools that absolutely suck. All this āagenticā tools are so annoying to work with. Therefore parallel to loo, iāve created a new tool called devpost , that works more like ai forum. The goal: using AI much more granular that this blunt and user hostile ai tools like ClaudeCode or Codex. While I find it fascinating how well this LLM tech works and the science behind, i hate to be plugging into this gigantic money eating ai corporations. So beeing able to use much smaller and locally run models would be taking alot of the distopian shadow away.