dafny VS Rust-for-Linux

Compare dafny vs Rust-for-Linux and see what are their differences.

dafny

Dafny is a verification-aware programming language (by dafny-lang)

Rust-for-Linux

Adding support for the Rust language to the Linux kernel. (by Rust-for-Linux)
Our great sponsors
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • WorkOS - The modern identity platform for B2B SaaS
  • SaaSHub - Software Alternatives and Reviews
dafny Rust-for-Linux
31 79
2,665 3,792
1.5% 1.6%
9.7 0.0
2 days ago 2 days ago
C# C
GNU General Public License v3.0 or later GNU General Public License v3.0 or later
The number of mentions indicates the total number of mentions that we've tracked plus the number of user suggested alternatives.
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.

dafny

Posts with mentions or reviews of dafny. We have used some of these posts to build our list of alternatives and similar projects. The last one was on 2024-04-23.
  • Dafny is a verification-aware programming language
    4 projects | news.ycombinator.com | 23 Apr 2024
  • Candy – a minimalistic functional programming language
    5 projects | news.ycombinator.com | 24 Feb 2024
  • Dafny – a verification-aware programming language
    1 project | news.ycombinator.com | 28 Nov 2023
  • Lean4 helped Terence Tao discover a small bug in his recent paper
    10 projects | news.ycombinator.com | 27 Oct 2023
    Code correctness is a lost art. I requirement to think in abstractions is what scares a lot of devs to avoid it. The higher abstraction language (formal specs) focus on a dedicated language to describe code, whereas lower abstractions (code contracts) basically replace validation logic with a better model.

    C# once had Code Contracts[1]; a simple yet powerful way to make formal specifications. The contracts was checked at compile time using the Z3 SMT solver[2]. It was unfortunately deprecated after a few years[3] and once removed from the .NET Runtime it was declared dead.

    The closest thing C# now have is probably Dafny[4] while the C# dev guys still try to figure out how to implement it directly in the language[5].

    [1] https://www.microsoft.com/en-us/research/project/code-contra...

    [2] https://github.com/Z3Prover/z3

    [3] https://github.com/microsoft/CodeContracts

    [4] https://github.com/dafny-lang/dafny

    [5] https://github.com/dotnet/csharplang/issues/105

  • The Deep Link Equating Math Proofs and Computer Programs
    5 projects | news.ycombinator.com | 11 Oct 2023
    I don't think something that specific exists. There are a very large number of formal methods tools, each with different specialties / domains.

    For verification with proof assistants, [Software Foundations](https://softwarefoundations.cis.upenn.edu/) and [Concrete Semantics](http://concrete-semantics.org/) are both solid.

    For verification via model checking, you can check out [Learn TLA+](https://learntla.com/), and the more theoretical [Specifying Systems](https://lamport.azurewebsites.net/tla/book-02-08-08.pdf).

    For more theory, check out [Formal Reasoning About Programs](http://adam.chlipala.net/frap/).

    And for general projects look at [F*](https://www.fstar-lang.org/) and [Dafny](https://dafny.org/).

  • Dafny
    1 project | news.ycombinator.com | 13 Sep 2023
  • The Dafny Programming and Verification Language
    1 project | news.ycombinator.com | 6 Sep 2023
  • In Which I Claim Rich Hickey Is Wrong
    5 projects | news.ycombinator.com | 24 Jul 2023
    Dafny and Whiley are two examples with explicit verification support. Idris and other dependently typed languages should all be rich enough to express the required predicate but might not necessarily be able to accept a reasonable implementation as proof. Isabelle, Lean, Coq, and other theorem provers definitely can express the capability but aren't going to churn out much in the way of executable programs; they're more useful to guide an implementation in a more practical functional language but then the proof is separated from the implementation, and you could also use tools like TLA+.

    https://dafny.org/

    https://whiley.org/

    https://www.idris-lang.org/

    https://isabelle.in.tum.de/

    https://leanprover.github.io/

    https://coq.inria.fr/

    http://lamport.azurewebsites.net/tla/tla.html

  • Programming Languages Going Above and Beyond
    7 projects | news.ycombinator.com | 29 Jun 2023
    > I think we can assume it won't be as efficient has hand written code

    Actually, surprisingly, not necessarily the case!

    If you'll refer to the discussion in https://github.com/dafny-lang/dafny/issues/601 and in https://github.com/dafny-lang/dafny/issues/547, Dafny can statically prove that certain compiler branches are not possible and will never be taken (such as out-of-bounds on index access, logical assumptions about whether a value is greater than or less than some other value, etc). This lets you code in the assumptions (__assume in C++ or unreachable_unchecked() under rust) that will allow the compiler to optimize the codegen using this information.

  • What are the current hot topics in type theory and static analysis?
    15 projects | /r/ProgrammingLanguages | 8 May 2023
    Most of the proof assistants out there: Lean, Coq, Dafny, Isabelle, F*, Idris 2, and Agda. And the main concepts are dependent types, Homotopy Type Theory AKA HoTT, and Category Theory. Warning: HoTT and Category Theory are really dense, you're going to really need to research them.

Rust-for-Linux

Posts with mentions or reviews of Rust-for-Linux. We have used some of these posts to build our list of alternatives and similar projects. The last one was on 2024-02-18.
  • The Linux Kernel Prepares for Rust 1.77 Upgrade
    9 projects | news.ycombinator.com | 18 Feb 2024
    Rust is backwards compatible when you stick to stable features, but the kernel uses unstable features that can and do incur breaking changes.

    https://github.com/Rust-for-Linux/linux/issues/2

  • Rust in Linux Kernel
    1 project | /r/ThePrimeagenReact | 8 Oct 2023
  • Mark Russinovich: “Working towards enabling Windows driver development in Rust”
    7 projects | news.ycombinator.com | 23 Sep 2023
    > How would this work?

    Don't know exactly what you're asking.

    > And why would it be a better idea?

    Poorly written device drivers are a significant attack vector. It's one of the reasons Linux is now exploring using Rust for its own device drivers.[0] You may be asking -- why Rust and not some other language? Rust has many of the performance and interoperability advantages of C and C++, but as noted, makes certain classes of memory safety issues impossible. Rust also has significant mindshare among systems programming communities.

    [0]: https://rust-for-linux.com

  • The Linux Kernel Module Programming Guide
    2 projects | news.ycombinator.com | 1 May 2023
    Ctrl-F "rust"

    https://rust-for-linux.com/ links to LWN articles at https://lwn.net/Kernel/Index/#Development_tools-Rust that suggest that only basic modules are yet possible with the rust support in Linux kernels 6.2 and 6.3.

    Rust-for-linux links to the Android binder module though:

    > Android Binder Driver: This project is an effort to rewrite Android's Binder kernel driver in Rust.

    > Motivation: Binder is one of the most security and performance critical components of Android. Android isolates apps from each other and the system by assigning each app a unique user ID (UID). This is called "application sandboxing", and is a fundamental tenet of the Android Platform Security Model.

    > The majority of inter-process communication (IPC) on Android goes through Binder. Thus, memory unsafety vulnerabilities are especially critical when they happen in the Binder driver

    ... "Rust in the Linux kernel" (2021) https://security.googleblog.com/2021/04/rust-in-linux-kernel... :

    > [...] We also need designs that allow code in the two languages to interact with each other: we're particularly interested in safe, zero-cost abstractions that allow Rust code to use kernel functionality written in C, and how to implement functionality in idiomatic Rust that can be called seamlessly from the C portions of the kernel.

    > Since Rust is a new language for the kernel, we also have the opportunity to enforce best practices in terms of documentation and uniformity. For example, we have specific machine-checked requirements around the usage of unsafe code: for every unsafe function, the developer must document the requirements that need to be satisfied by callers to ensure that its usage is safe; additionally, for every call to unsafe functions (or usage of unsafe constructs like dereferencing a raw pointer), the developer must document the justification for why it is safe to do so.

    > We'll now show how such a driver would be implemented in Rust, contrasting it with a C implementation. [...]

    This guide with unsafe rust that calls into the C, and then with next gen much safer rust right next to it would be a helpful resource too.

    What of the post-docker container support (with userspaces also written in go) should be cloned to rust first?

  • Teknisk karrierevej i Danmark som softwareudvikler
    1 project | /r/dkfinance | 8 Apr 2023
  • The state of Flatpak security: major Projects are the worst?
    3 projects | /r/flatpak | 20 Feb 2023
    Rust-for-Linux issue tracker
  • rust devs in a nutshell
    2 projects | /r/ProgrammerHumor | 14 Feb 2023
  • Rustproofing Linux (Part 1/4 Leaking Addresses)
    2 projects | /r/rust | 10 Feb 2023
    Yes, I definitely agree that it's a problem that pr_info implicitly wraps its arguments in unsafe {}. I wrote my own Pull Request with a trival fix.
  • how to compile a rust "hello world" with kernel 6.1?
    2 projects | /r/rust | 23 Dec 2022
    Note that this template won't work with Linux 6.1, which has very minimal Rust support. You'll want the RustForLinux tree, or maybe Linux 6.2.
  • If your dream was to be part of a big project like the linux kernel, what would be the first step if you are already an average programmer?
    1 project | /r/rust | 19 Dec 2022
    You can join Rust for Linux zulip chat by requesting invite using the link in https://github.com/Rust-for-Linux/linux 's README.

What are some alternatives?

When comparing dafny and Rust-for-Linux you can also consider the following projects:

tlaplus - TLC is a model checker for specifications written in TLA+. The TLA+Toolbox is an IDE for TLA+.

jakt - The Jakt Programming Language

FStar - A Proof-oriented Programming Language

gccrs - GCC Front-End for Rust

rust - Rust for the xtensa architecture. Built in targets for the ESP32 and ESP8266

rfcs - RFCs for changes to Rust

koka - Koka language compiler and interpreter

rustig - A tool to detect code paths leading to Rust's panic handler

interactive - .NET Interactive combines the power of .NET with many other languages to create notebooks, REPLs, and embedded coding experiences. Share code, explore data, write, and learn across your apps in ways you couldn't before.

rust - Empowering everyone to build reliable and efficient software.

PrawnOS - Libre Mainline Kernel and Debian for arm laptops