2 ms·
Is it common to embed one language's code directly inside another language like this? Lua is often used tightly-coupled to C, and it doesn't have the significa
by pansa2 7y ago
Is it common to embed one language's code directly inside another language like this?
Lua is often used tightly-coupled to C, and it doesn't have the significant-whitespace issues that Python shows here. Even so, I've only ever seen it used in separate `.lua` files, never embedded directly within `.c` files.
- iddan 7y agoI don’t think it’s common nor it’s a best practice as you can’t apply static analysis on your embedded code. But it’s really cool Rust allows that and it can be a ad-hoc solution when you need to write a piece of code fast inside of rust