You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
At the moment, there is only a very limited set of \lambda objects is supported. Let's make it possible to have Rust atoms, specified according to the notation of SODG. Each atom will communicate with phie through the SODG graph API. We should implement here a bridge between SODG and our internal representation of objects/baskets.
The source program may look like this:
[] > app
sum > @
4
8
[a b] > sum
rust > @
"""
pub fn f(mut& uni: Universe, v: u32) -> u32 {
let a = uni.dataize("v{v}.𝛼0")?.as_i64()?;
let b = uni.dataize("v{v}.𝛼1")?.as_i64()?;
let v = uni.add(uni.next_id())?;
uni.put(v, a + b)?;
return v;
}
"""
It will be translated to XMIR by eo-parser. Then, it will be passed through a number of optimizers. In the end, we will have something like this:
<program>
<objects>
<oname="app">
<!-- ... -->
</o>
<oname="app$sum">
<oname="@"base="org.eolang.rust">
<obase="org.eolang.string">
let a = uni.dataize("$.𝛼0")?.as_i64()?;
let b = uni.dataize("$.𝛼1")?.as_i64()?;
let v = uni.add(uni.next_id())?;
uni.put(v, a + b)?;
return v;
</o>
</o>
</o>
</objects>
</program>
Then, phie takes a directory with such XMIR files, and starts. First, it converts XMIR to something like this (pay attention to 547483.rs):
At the moment, there is only a very limited set of \lambda objects is supported. Let's make it possible to have Rust atoms, specified according to the notation of SODG. Each atom will communicate with phie through the SODG graph API. We should implement here a bridge between SODG and our internal representation of objects/baskets.
The source program may look like this:
It will be translated to XMIR by eo-parser. Then, it will be passed through a number of optimizers. In the end, we will have something like this:
Then, phie takes a directory with such XMIR files, and starts. First, it converts XMIR to something like this (pay attention to
547483.rs
):Then, it puts Rust code to
547483.rs
file, addscargo.toml
, and compiles all together. It gets547483.so
-- a binary shared Linux library.Then, phie in runtime links the shared library and runs the emulation of the entire program.
In order to make Rust snippets to work, we should implement
Universe
, according to SODG specification.The text was updated successfully, but these errors were encountered: