NOP0 / rustmatic

PLC programming in Rust!
Apache License 2.0
35 stars 2 forks source link

Assumptions about the environment #3

Open Michael-F-Bryan opened 4 years ago

Michael-F-Bryan commented 4 years ago

What assumptions are we making about the environment?

Michael-F-Bryan commented 4 years ago

Some of my thoughts:

Will we have access to an allocator?

I'm guessing so, seeing as we'll want some level of type erasure (e.g. Box<dyn Process>) to handle different types of process, possibly not known at compile time (e.g. ladder logic uploaded at runtime).

If so, how much memory would you expect to be working with (50KB, 2MB, 16MB, 2GB, etc.)?

For some reason, I had something like a Raspberry Pi in mind. So a decent amount of memory.

Will we be running on top of an operating system (e.g. realtime Linux), or are we the operating system?

Operating systems give us nice things like TCP, clocks, and threads.

NOP0 commented 4 years ago

I'm guessing so, seeing as we'll want some level of type erasure (e.g. Box) to handle different types of process, possibly not known at compile time (e.g. ladder logic uploaded at runtime).

Seems reasonable, there's also some no_std allocators out there, if the need arises.

For some reason, I had something like a Raspberry Pi in mind. So a decent amount of memory. Operating systems give us nice things like TCP, clocks, and threads.

Yeah, down the road, it would be cool to say "you can run this on a micro:bit!" But in short-term I guess we should aim for something running some kind of OS (realtime Linux 👍 ). With that foundation we're free to focus on the PLC problems without getting bogged down in the details.

Who knows, maybe in the meantime wasm/wasi will solve the embedded story for us. Just my 2¢.