kuroko-lang / kuroko

Dialect of Python with explicit variable declaration and block scoping, with a lightweight and easy-to-embed bytecode compiler and interpreter.
https://kuroko-lang.github.io/
MIT License
427 stars 25 forks source link

Add meson build system support #38

Open heatd opened 1 year ago

heatd commented 1 year ago

Can be tested by running meson like:

meson setup build/ # for release builds: --buildtype release
ninja -C build/
ninja -C build/ install # If you don't have perms, ninja tries to gain privileges using polkit. Yay technology

This does not entirely replace the Makefile for some usages, so I did not touch it

klange commented 1 year ago

We also need rules to generate the codec libraries: https://github.com/kuroko-lang/kuroko/blob/master/Makefile#L129-L133

klange commented 1 year ago

@heatd If you want this in the final release of 1.4, we need to figure out the codec module stuff.

heatd commented 1 year ago

As noted on IRC, the blocker now is that gen_*.krk scripts do not support input/output arguments, which is obviously a problem given that meson forces you to build out-of-tree

I'm also not compiling every module for the host platform, I'm just compiling libkuroko + kuroko for the native version, since gen_*.krk scripts do not require any "fancy" .so module.

Also! It's worth noting that KUROKOPATH does an oopsie if you give it a non /-terminated path (i.e /usr/lib vs /usr/lib/). As in it tries to do poor path concatenation so you end up with something like "/usr/libjson.krk", which never gets found and the user gets confused