I really couldn't see this before, but Rust is a replacement for C/C++, a clean replacement.
Here is Redox OS:
Redox is a Unix-like Operating System written in Rust, aiming to bring the innovations of Rust to a modern microkernel and full set of applications.
And Wasmer is pretty promising for the web world:
Wasmer is a fast and secure WebAssembly runtime that enables super lightweight containers to run anywhere: from Desktop to the Cloud, Edge and IoT devices.
This document is also available in
🇨🇳 中 文 -Chinese •🇩🇪 Deutsch-German •🇪🇸 Español-Spanish •🇫🇷 Français-French •🇯🇵 日本 語 -Japanese •🇰🇷 한국어 -Korean.
Features
- Secure by default. No file, network, or environment access, unless explicitly enabled.
- Supports WASI and Emscripten out of the box.
- Fast. Run WebAssembly at near-native speeds.
- Embeddable in multiple programming languages
- Compliant with latest WebAssembly Proposals (SIMD, Reference Types, Threads, ...)
Install
Wasmer CLI ships as a single executable with no dependencies.
curl https://get.wasmer.io -sSfL | sh
Other installation options (Powershell, Brew, Cargo, ...)
Wasmer can be installed from various package managers. Choose the one that fits best for your environment:
-
Powershell (Windows)
iwr https://win.wasmer.io -useb | iex
-
Homebrew (macOS, Linux)
…
Even it might takeover current big C/C++ implementations like this one:
RustPython / RustPython
A Python Interpreter written in Rust
RustPython
A Python-3 (CPython >= 3.10.0) Interpreter written in Rust
Usage
Check out our online demo running on WebAssembly.
RustPython requires Rust latest stable version (e.g 1.43.0 at May 24th 2020)
To check Rust version: rustc --version
If you wish to update
rustup update stable
.
To build RustPython locally, do the following:
$ git clone https://github.com/RustPython/RustPython
$ cd RustPython
# --release is needed (at least on windows) to prevent stack overflow
$ cargo run --release demo.py
Hello, RustPython
Or use the interactive shell:
$ cargo run --release
Welcome to rustpython
>>>>> 2+2
4
NOTE: For windows users, please set RUSTPYTHONPATH
environment variable as Lib
path in project directory.
(e.g. When RustPython directory is C:\RustPython
, set RUSTPYTHONPATH
as C:\RustPython\Lib
)
You can also install and run RustPython with the following:
$ cargo install --git https://github.com/RustPython/RustPython
$ rustpython
Welcome to the magnificent Rust Python interpreter
>>>>>
…
Top comments (8)
I'd like to see a Rust/Gecko/Quantum/SpiderMonkey implementation of Electron (replacing C++/Chromium).
I really hope so 🙏
Checkout servo.org/
I'm preatty new to Rust, so the obvious question (for me) is: "why Rust over Golang in these cases"?
Golang won't work for these cases. A garbage collector is like a layer on which the rest of the program runs. It's very unstable to bootstrap the GC in an OS kernel BEFORE the kernel runs. Aka you need a kernel first to run a GC, and with Golang you will need the GC first to run the kernel. Similar thing applies to many other systems, the extra GC layer is a continual pain point.
Besides what @nielvandw and @buinauskas have already mentioned.
Before writing the post, I've done some research and found that Rust and Go are not competitors.
And I would also wanna add that Go is very very use-case-specific to Google-like products (scalable solutions made by tech gaints like Digital Ocean or Docker).
AFAIK Rust is faster and is designed to be a systems programming language.
Go, on the other hand, is designed for microservices, web based tasks for high concurrency, easy vertical and horizontal scaling.
no way ! C++ was the new C ! :)