Open NOP0 opened 4 years ago
I guess that all depends on our software model and how we want compilation to work.
If we were compiling structured text to WASM, the standard library would be implemented by providing various well-known functions and whenever the structured text program references something from the standard library, the compiler translates it to function calls. From there it doesn't really matter whether the functions are implemented in Rust or IEC. We just need to make sure the relevant symbols are available to the WASM virtual machine when we try to run the code (e.g. with ImportObject
in wasmer).
I'd prefer to write as much of the IEC standard library in Rust though. I feel like we'll need better control and more powerful tools than IEC would normally give you (e.g. generics and std
).
This sounds really good. It's ideal if we can write the standard library in Rust.
Related to #13
There's a set of functions and function blocks that are regarded as standard library for IEC.
Examples are for instance; counter blocks, time delay blocks, edge detection blocks, string handling blocks and so on.
Should these be implemented in IEC or Rust, and what should the interface between the languages be, i.e. should we implement it in Rust so it can be callable from Rust, but then how do we call it from IEC? , and so on.