Re:Writing Python inside Rust
by pansa2 on Saturday April 18, 2020 @02:05AM
(#22905676)
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.
Re:Writing Python inside Rust
by iddan on Saturday April 18, 2020 @03:40AM
(#22906019)
I 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
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.