I was thinking about a project that I can describe as:
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/