specification
rust-playground
specification | rust-playground | |
---|---|---|
18 | 67 | |
386 | 1,168 | |
0.5% | 1.3% | |
8.0 | 9.5 | |
2 days ago | 7 days ago | |
Python | Rust | |
- | 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.
specification
-
Improving Interoperability Between Rust and C++
Many people misunderstand how software is written in regulated industries, and assume that a standard is necessary. In practice, this is not the case. Note that Ferrocene[1] had to produce a specification[2] in order to qualify the compiler. But there isn't a requirement that it must be a standard in any way, only that it describes how the Ferrocene compiler works. Nor that it be accepted by upstream.
1: https://ferrous-systems.com/blog/officially-qualified-ferroc...
2: https://github.com/ferrocene/specification
-
Aerugo – RTOS for aerospace uses written in Rust
If by "no standard" you mean that there is no language specification for rust, then there is no standard. However, a language specification is not sufficient to verify program correctness, nor is it required.
A standard may (and the C standard for example does) leave parts of the behavior as "implementation specific" and there's quite a few edge cases - and that's not even talking about "undefined behavior", of which there is plenty. An even in the behavior that is neither implementation specific nor undefined you'll find enough rope to hang yourself (all the beautiful pointers).
On the other hand, the rust language - while having no formal spec - is fairly well described, in the form of its RFCs and testsuite. We (the ferrocene team) were able to derive a descriptive specification from the existing description fairly easily. So while there is no ISO standard, and no spec that would be sufficient to write a competing implementation, there is a description of what the language behaves like. You can read up on it at https://spec.ferrocene.dev/
As for verification of correct behavior of such a program, you can employ a host of different techniques depending on what your requirements are - down to verification of the produced bytecode by means of blackbox testing or other.
-
Progress toward a GCC-based Rust compiler
They created a specification for Ferrocene because Rust does not yet have a language standard:
https://spec.ferrocene.dev/
>> But does the language need a standard?
Yes, Rust needs a standard.
>> And if so, then for what purpose?
For the same purpose that all standards have--to formally define it in writing.
Ferrocene's web site (https://ferrous-systems.com/ferrocene/) shows that it meets the ISO 26262 standard (https://en.wikipedia.org/wiki/ISO_26262).
Why does ISO 26262 matter? What purpose does it serve? Couldn't a vehicle manufacturer just say "our vehicles are safe"? Which would you trust more: a vehicle that is verified to meet ISO 26262 standards, or a vehicle whose manufacturer tells you "it's safe"?
-
Officially Qualified – Ferrocene
https://github.com/ferrocene/specification
They do say any differences between it and upstream behavior or documentation is a defect in the spec, not upstream. So it isn't authoritative. Unless we all decide it is.
-
A Guide to Undefined Behavior in C and C++
>> The spec does not define the software. The software is as the software does. Having or not having a spec doesn't protect from bugs - people do.
>> What you're taking about is covering one's ass, not specification.
They are related.
In safety-critical software, bugs can cause people to die. Without a spec, no one will use Rust for safety critical software. It would be too risky and no company would accept that level of risk.
For example if software that controls an airplane is written in Rust and an error occurs during flight, what happens? The software can't just panic and crash or the airplane might crash.
The Ferrocene project (https://ferrous-systems.com/ferrocene/) is working on producing a safety-critical Rust specification (https://github.com/ferrocene/specification) because having a language specification matters for safety-critical work.
-
A Decade of Rust, and Announcing Ferrocene
I'd like to clarify a little here: There's an ISO certifiation in here - but it's not an ISO standard for the language.
Essentially, the ISO 26262 certification verifies that the compiler release process conforms to a certain standard. It does not create an ISO standard for rust, not does it aim to. At part of the certification process we had to write a spec for the rust language, but it is a descriptive spec of how certain aspects of the rust language behave for one specific release of the compiler.
The certification builds on this to ensure that tests catch deviations from the spec, known problems are documented etc. So rust as a language is unaffected, as is the rust project. The spec is open source and might be useful to others, you can find it at https://spec.ferrocene.dev/
The target sectors for ISO 26262 and related industrial certification are clearly sectors that require such certification: automotive, medical, etc.
Ferrocene itself however, is not only the ISO certified downstream of the rust compiler, it also offers for example long term support and tracking of known issues which the rust project does not provide. This is also important for certain applications that do not strictly require certifications.
- Ferrocene Language Specification
-
Rust has been forked to the Crab Language
>> Rust is defined by the implementation.
Hopefully not for long:
https://github.com/ferrocene/specification
https://ferrous-systems.com/blog/the-ferrocene-language-spec...
Hopefully Ferrocene can lead to Rust itself being standardized.
To me, it seems inevitable that there will be multiple implementations of Rust, especially if Rust continues to be more widely adopted and used in new domains.
I would also not be surprised if Rust were to adopt optional language extensions for specialized use cases, similar to Ada's language annexes:
http://www.ada-auth.org/standards/22rm/html/RM-1-1-2.html
Why? Because the Rust implementation you use for video game programming does not need all of the same features as the Rust implementation that you use for safety-critical embedded systems (for example: railroad control software).
-
GCC 13 and the state of gccrs
That’s an easy enough problem to solve (though time consuming), and Ferrocene is working on it. Having >1 compiler implement the spec is just a human fuzz test that finds edge cases, and that’s a good thing.
-
Rust in Automotive
I don't know what ISO-26262 requires, but for IEC-61508 only requires "The language should be fully and unambiguously defined." - which I think Ferrocene has taken a decent stab at with https://spec.ferrocene.dev , and an accompanying ISO standard is not a hard requirement.
rust-playground
-
Fivefold Slower Compared to Go? Optimizing Rust's Protobuf Decoding Performance
That would be true if you used `Vec::clear` too, it doesn't allocate a new vector. My point was that you still end up running Drop implementations with RepeatedField, just not all at once. See https://play.rust-lang.org/?version=stable&mode=debug&editio...
- Xz: Can you spot the single character that disabled Linux landlock?
-
How to Lose Control of Your Shell
That's a valid Unix path, but rust's quoting does nothing to stop it: https://play.rust-lang.org/?version=stable&mode=debug&editio...
-
Borrow Checking Without Lifetimes
Self-referential structs work fine in Rust and always have.
https://play.rust-lang.org/?version=stable&mode=debug&editio...
The compiler will correctly prevent you from moving the value.
The other way to have a struct that starts out as non-self-referential and then becomes self-referential can be achieved with `unsafe` and `Pin::new_unchecked`, which is how `async {}` is handled.
-
Improving Interoperability Between Rust and C++
In rust as currently stands: https://play.rust-lang.org/?version=stable&mode=debug&editio...
On the other hand, both this wrapper and yours are counterproductive if the element size is dynamic (e.g. perhaps you're dealing with some nonsense like:)
struct ITableColumn {
-
New Linux glibc flaw lets attackers get root on major distros
Overflow checks turn into two's compliments' wrapping, but that's only considered acceptable because bounds checks are not turned off.
https://play.rust-lang.org/?version=stable&mode=release&edit...
-
Atomics and Concurrency
I have no idea what you're talking about, but it sounds unnecessarily complicated and why I don't use Rust for any serious work.
This demonstrates the ABA problem in safe Rust: https://play.rust-lang.org/?version=stable&mode=debug&editio...
Substitute the sleep with a combination of doing computation/work and the OS thread scheduler, and you can see how the bug surfaces.
-
Rust 🦀 Installation + Hello World
You can also try Rust online using the Rust playground: https://play.rust-lang.org/
-
4B If Statements
(Click ... beside build to get assembly) https://play.rust-lang.org/?version=stable&mode=release&edit...
Unfortunately the go playground doesn't seem to support emitting assembly?
-
My reference was dropped, why is the compiler complaining about multiple borrow
Rust isn't a fully functional language, but the functional features play well with the lifetime system and are optimized well.
(Rust playground example: https://play.rust-lang.org/?version=stable&mode=debug&editio...)
What are some alternatives?
bc - An implementation of the POSIX bc calculator with GNU extensions and dc, moved away from GitHub. Finished, but well-maintained.
tokio - A runtime for writing reliable asynchronous applications with Rust. Provides I/O, networking, scheduling, timers, ...
stc - Speedy TypeScript type checker
trunk - Build, bundle & ship your Rust WASM application to the web.
crab - A community fork of a language named after a plant fungus. All of the memory-safe features you love, now with 100% less bureaucracy!
mdBook - Create book from markdown files. Like Gitbook but implemented in Rust
polonius - Defines the Rust borrow checker.
Rocket - A web framework for Rust.
windows-rs - Rust for Windows
egui - egui: an easy-to-use immediate mode GUI in Rust that runs on both web and native
compiler-team - A home for compiler team planning documents, meeting minutes, and other such things.
sqlx - 🧰 The Rust SQL Toolkit. An async, pure Rust SQL crate featuring compile-time checked queries without a DSL. Supports PostgreSQL, MySQL, and SQLite.