nilput | 5 years ago | on: Knit – A Scripting Language
nilput's comments
nilput | 5 years ago | on: Knit – A Scripting Language
i added a tool that does that: https://github.com/nilput/knit/blob/master/scripts/knc
a slightly better way of doing this would be implementing a way of exporting the scripts' bytecode and executing it as that is currently being done only in memory, this would avoid the need to reparse it and hides the script's source code.
nilput | 5 years ago | on: Knit – A Scripting Language
It has a surprisingly decent performance compared to other interpreted languages.
This could be partly attributable to the fact that the whole language is written in headers, so everything is available to the compiler where it can inline and do all kinds of optimizations, additionally the language is small and doesn't require much during initialization (the benchmark is ran 100 times with perf).
There's a benchmark in examples/bench/ where it beats PHP7, Python, Perl, and PUC Lua
in terms of benchmarks alone languages with JIT compilers will definitely beat this, that's one possible direction to go with (there are great projects out there that make adding this capability potentially easier, MIR for example), another feature would be a C FFI rather than just a C API.