Copilot: Realtime programming language and runtime verification framework
copilot-language.github.io
copilot-language.github.io
Like if we should increase the temp, we can tolerate a couple of heaton fails before it reaches to some min limit.
[1]: https://copilot-language.github.io/downloads/copilot_tutoria...
the trigger functions typically would just raise dio lines high which is not something that really fails unless you're completely crashed.
In any case let's not judge the writers too harshly for omitting some error checking in the very first complete example they provide in the manual. The typical introductory "hello world" program also doesn't contain error handling to check if writing to stdout succeeded or not. A real CoPilot program could (and should!) have a separate stream for checking `heaterStatus` and raise a separate alarm if the status of the heater does not update when it should.
Yes but the heater is a mechanical device that behaves unexpectedly. I mean, should the "fault-tolerance" logic be handled in the copilot DSL itself?
https://github.com/Copilot-Language/copilot/tree/master/copi...
And she's buying a stairway to heaven There's a sign on the wall But she wants to be sure 'Cause you know, sometimes words have two meanings
[1] https://www.joelonsoftware.com/2007/01/26/copilot-20-ships/
To bring it back to CoPilot, it is a heavily restricted DSL where all variables are streams of values, each of which gets updated in every iteration of the main loop. The types of the functions and datatypes that you can manipulate these streams with don't contain any "interesting" monadic contexts, so you definitely can't access the outside world other than through the provided interfaces. You are also mostly restricted to mathematical operations on these streams, like summing or multiplying two other streams to produce a third stream. This already restricts a lot of the variability you could introduce in a "normal" program. The CoPilot project then contains a dedicated Haskell-to-C compiler that will try its best to generate constant-time and constant-memory code. If that is not possible, it will generate a compiler error indicating which part was not possible to compile in such a way. For example, for most recursive functions it would not be possible to prove it terminates in a predictable amount of time so that would be right out.
Of course, even if it does compile then there are no guarantees that the code will fit inside your time or memory budget. It is still possible to write code that is inefficient or contains bugs. It will just always take the same amount of memory and same amount of cycles per iteration.
> Copilot is implemented as a Embedded Domain Specific Language in Haskell. Currently Copilot 3.1 requires a version of the Glasgow Haskell Compiler (GHC) of at least 8.0 to be installed.
So yeah, looks like Haskell because it is Haskell! :)
Good names like Linux, Google, Kodak, Adidas, etc are instantly recognizable and cannot be mistaken for anything else.
Lots of things predate Meta (Facebook) and Copilot (Microsoft), but the new thing muscled its way in and now anything that already had those names will struggle.
I hate to say it.
This is something that actually, genuinely should, be re-written in Rust.
It uses C as a back end, which is a sensible thing to do since it is the default in embedded software development, few embedded toolchains support Rust. And it is just a backend, they could have output machine code directly, but C is more universal and you can take advantage of all the C compiler optimizations. Using Rust for this would get you all of the disadvantages and none of the advantages that Rust has over C.
Now, maybe you mean writing embedded code in Rust instead of C, at least, now you have a point, Rust has features that I think would be well suited for critical embedded software. But that's also what Copilot tries to do, if anything, Copilot competes against Rust (and ADA). I say that in the sense that they all address the same problem (safety) and you have to choose one solution, not that they are enemies.
Should its author generate Rust from Rust? Would it be better if Copilot produced object files or executables directly, or used eg. LLVM IR?