134 points · by mrLSD-dev · 3y ago · 42 comments
Sorry this isn't my wheelhouse but I am curious.
I'm not sure what do you mean "compile programs", because it's not the compiler.
Thanks for explaining.
Such a great language, it never seems to get traction, to hit any critical mass.
I kind of wish we had used a theorem prover language of some sort though since we had the opportunity to do so. I didn't really have the chance to change things there since other people had higher seniority than me.
That must be hypothetical. "Functionalness" of the language/code doesn't make everything that is written automatically subject to formal verification. (mechanized or pen and paper). What kind of correctness properties does it actually allow to formally verify? I understand if it was the F* language, which is a full blown dependently typed proof checker, but with F#, which is defined by the implementation and 300 page English spec, I don't think you can verify anything interesting. As far as I know F# itself doesn't have mechanized formal semantics and its type system could be unsound.
https://github.com/mit-plv/riscv-coq and https://github.com/riscv/sail-riscv (don't know how complete they are) approaches actually allow to formally (mechanically) verify riscv properties.
Your executable specification could probably be called "Formal", in the same sense as a PDF spec being called "Formal", but being subject to verification by the virtue of F# being functional or being written in the functional style might be pushing it too far.
In this case, the term "formal" refers to the formalization of the representation of the specification. And it seems to be already established.
(I'm convinced one of the reasons why Rust is so popular is because it's OCaml with a legible syntax.)
It's not an emulator, it allows you to assemble code in C++ at runtime. It breaks down the architecture (as it looked at the time) quite detailed, if you are interested :-)
EDIT to add: the .cbi file is a text file that contains most of the documentation: [link redacted]
If you've got that encoding <-> code mapping though, you can turn that into an assembler, an emulator and a compiler backend with a sufficiently determined code generator. Probably a profiler and debugger too. That's a whole set of tooling derived from a single source of truth. In the best case, you persuade the people writing the verilog to provide said information as something like xml. More likely it's an error prone transcription from incomplete pdf files.
Seems to be similar to the official Sail model but F# instead of Sail.
Kind of funny since Sail can already compile to OCaml - probably wouldn't be too hard to add a F# backend. Then again, more independent implementations are always nice to have.
Would be interesting to know their motivation for this.
Edit: actually this looks like it has been dead for 3 years so maybe it was just a precursor to the Sail model.
So does this repo define these things as F# function and as a user I can import this repo as library and call those functions and my function call would directly run instructions on RISC-V processors, with no "middlewares" like operating system and such?