an `inline` language (
rust! {
// Rust Code
}
c! {
// C code
}
)But what is the overall point of just doing some "inlining" for all languages (I feel this is kind of a bad version of org-mode babel [0])
Just inlining code doesn't do that much but managing the code smartly by a compiler would be nice. What do I mean?
let rust_result = rust! {
return "[RUST]";
}
// below means send the variable `rust_result` to C
// and scoop up the c call result into `c_result`
[rust_result] -> [c_result]
c! {
printf("rust_result: %s\n", rust_result); // prints "[RUST]"
return "[C]";
}
I am seeking for you guys feedback on the project in general (also possible hard cases that can occur)I think I may try to build an IPC - Shared memory stuff based on the target language.
But there are some philosophical differences between programming languages (e.g types!) which would make it insanely difficult to bridge between them (let me know do you have a solution) but some are similar which makes transpilation-like operations a lot easier.
Overall:
Do you thing this is doable?
Do you have some pathway to suggest?
Do you like it?
-----------------------------------------[0]: https://orgmode.org/worg/org-contrib/babel/
It would be a lot of work, but I think it's possible. (Please do trash my theories if you think I'm wrong though =p)
> Do you have some pathway to suggest?
LLVM generates a bytecode called "IR" for many different languages (Rust and C included). Try and experiment with that, see if you can get bytecode from two languages to run in one binary. From there, the rest should be logistics!
> Do you like it?
Yes! But as a primarily Rust-based dev, I'm not entirely sure what I'd use other languages for. LLVM generates IR for a lot of languages though, so if you can get them working the value prop would increase exponentially.