minoki / LunarML

The Standard ML compiler that produces Lua/JavaScript
MIT License
356 stars 10 forks source link

What should be the $(SML_LIB) behavior? #8

Closed ratsclub closed 1 year ago

ratsclub commented 1 year ago

I have a small .mlb file containing the following:

$(SML_LIB)/basis/basis.mlb
src/main.sml

Compiling with MLton and MLKit works just fine. However, with LunarML I get this error:

$ lunarml compile sources.mlb 
io error: $PROJECT/../lib/lunarml/ml/basis/basis.mlb, openIn, SysErr

Is there something I need to do?

minoki commented 1 year ago

Did you move lunarml executable from <LunarML repo>/bin? If so, try setting -B option like this:

$ lunarml -B<LunarML repo>/lib/lunarml compile sources.mlb

Creating a proper installer (make install) is on my to-do list.

ratsclub commented 1 year ago

Oh, this did fix the problem. I'm able to compile, right now!

Just for some context, I'm trying to target lunarml on my project's CI. I'm also using the Nix package for lunarml:

"${pkgs.lunarml}/bin/lunarml compile -B ${pkgs.lunarml}/lib/lunarml sources.mlb"

However, running the code now yields another problem, but I guess this should be another issue.

lua: tests.lua:113: unexpected symbol near '/'

Thank you so much!