prusti-dev
miri
Our great sponsors
prusti-dev | miri | |
---|---|---|
23 | 120 | |
1,446 | 3,849 | |
2.5% | 3.2% | |
8.8 | 10.0 | |
22 days ago | 7 days ago | |
Rust | Rust | |
GNU General Public License v3.0 or later | Apache License 2.0 |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
prusti-dev
-
Using_Prolog_as_the_AST
> The overall goal would be to figure out classical error conditions like nill pointers deference.
> If I can figure out if a pointer will be nil in some execution branch, there is no reason why a computer cannot do the same.
Note, this is called flow-sensitive typing (also called type narrowing) and I think that typescript does it.
https://en.wikipedia.org/wiki/Flow-sensitive_typing
> I personally would see this as an human race level upgrades. Imagine feeding your code to a CI that spit back something like: "you will have a panic at line 156 when your input is > 4"
A model checker can do that!
See this
https://model-checking.github.io/kani/tutorial-kinds-of-fail...
Other techniques are also possible
https://github.com/viperproject/prusti-dev#quick-example
(Here I could link a lot of things, I just selected two Rust projects to illustrate)
This works better if you are able to provide contracts in your API that says which guarantees you provide. Alternatively, asserts are useful too.
-
Programming Languages Going Above and Beyond
You might be interested in the Prusti project, which statically checks for absence of reachable panics, overflows etc. It also allows user-defined specifications such as pre and post-conditions, loop body invariants, termination checking and so on.
-
Trying to find a crate that allows you to constrain the value of arguments in various ways via a proc macro
This is called refinement types and prusti might be the project you saw.
-
rustc-plugin: A framework for writing plugins that integrate with the Rust compiler
But there's also a lot of exciting work around formal verification like Prusti.
-
Is there something like "super-safe" rust?
prusti
-
A plan for cybersecurity and grid safety
Efforts: seL4, Project Everest, the Prossimo project of the ISRG, Let's Encrypt, and Prusti for the Rust language
-
Prop v0.42 released! Don't panic! The answer is... support for dependent types :)
Wow that sounds really cool! I'm not an expert but does that mean that one day you could implement dependend types or refinement types in Rust as a crate ? I currently only know of tools like: Flux Creusot Kani Prusti
-
Prusti: Static Analyzer for Rust
And have it checked at compile time that the assertion holds! Which is a bit like Liquid Haskell in capability: https://ucsd-progsys.github.io/liquidhaskell/
... and now I just noticed that prusti has a crate prusti_contracts that can do the same thing!! https://github.com/viperproject/prusti-dev/blob/master/prust...
Now I'm wondering which tool is more capable (as I understand, they leverage a SMT solver like Z3 to discharge the proof obligations, right?)
-
Six programming languages I’d like to see
For contract-based programming, I'm personally planning on experimenting with https://github.com/viperproject/prusti-dev
The withdraw example would look something like
impl Account {
miri
-
RFC: Rust Has Provenance
Provenance is a dynamic property of pointer values. The actual underlying rules that a program must follow, even when using raw pointers and `unsafe`, are written in terms of provenance. Miri (https://github.com/rust-lang/miri) represents provenance as an actual value stored alongside each pointer's address, so it can check for violations of these rules.
Lifetimes are a static approximation of provenance. They are erased after being validated by the borrow checker, and do not exist in Miri or have any impact on what transformations the optimizer may perform. In other words, the provenance rules allow a superset of what the borrow checker allows.
- Mir: Strongly typed IR to implement fast and lightweight interpreters and JITs
- Erroneous UB Error with Miri?
-
I've incidentally created one of the fastest bounded MPSC queue
Actually, I've done more advanced tests with MIRI (see https://github.com/rust-lang/miri/issues/2920 for example) which allowed me to fix some issues. I've also made the code compatible with loom, but I didn't found the time yet to write and execute loom tests. That's on the TODO-list, and I need to track it with an issue too.
-
Interested in "secure programming languages", both theory and practice but mostly practice, where do I start?
He is one of the big brains behind Miri, which is a interpreter that runs on the MIR (compiler representation between human code and asm/machine code) and detects undefined behavior. Super useful tool for language safety, pretty interesting on its own.
-
Formal verification for unsafe code?
I would also run your tests in Miri (https://github.com/rust-lang/miri) to try to cover more bases.
-
Ouroboros is also unsound
You can run miri and it will tell you if the given run triggered any undefined behavior. It will not analyze it for every possible use of the code, but checking for the presence of this specific issue using it should be fairly simple.
-
From Stacks to Trees: A new aliasing model for Rust
If you do encounter a piece of code on which TB performs much worse than SB, do submit it as an issue! There was one recently and we massively improved TB performance on this case by improving garbage collection.
-
My Rust program (Well, game) is leaking memory, 4MB/s.
Have you tried adding miri checks to see specific warnings it suggests? It should have some memory leak checks aswell. https://github.com/rust-lang/miri
-
What would be your programming language of choice to implement a JIT compiler ?
Depends on what you mean by "better experience". What the article doesn't mention is the fact that you can still run into undefined behavior (including pointer aliasing) in C/C++/Zig and have your programs exhibit unexplainable weirdness, but you won't get any help from the language/compiler to figure out where it's coming from. In Rust you just run MIRI which tells you exactly where you have undefined behavior as long as you have at least one test which exercises the affected code path.
What are some alternatives?
sanitizers - AddressSanitizer, ThreadSanitizer, MemorySanitizer
rust - Empowering everyone to build reliable and efficient software.
cons-list - Singly-linked list implementation in Rust
Rust-Full-Stack - Rust projects here are easy to use. There are blog posts for them also.
nomicon - The Dark Arts of Advanced and Unsafe Rust Programming
rfcs - RFCs for changes to Rust
MIRAI - Rust mid-level IR Abstract Interpreter
Clippy - A bunch of lints to catch common mistakes and improve your Rust code. Book: https://doc.rust-lang.org/clippy/
unsafe-code-guidelines - Forum for discussion about what unsafe code can and can't do
kani - Kani Rust Verifier
bacon - background rust code check
tokio - A runtime for writing reliable asynchronous applications with Rust. Provides I/O, networking, scheduling, timers, ...