HN2new | past | comments | ask | show | jobs | submitlogin

Um, rust does have a runtime, that's why you don't need to include packages for strings, refcounting, allocation, etc.

Anything that has a language keyword should have a default implementation in that runtime, and much like box, ?, !, etc async and await are both language features that I shouldn't need to include from outside of the runtime.



> you don't need to include packages for strings, refcounting, allocation, etc.

Oh, but you do!

These are in std::str, std::rc, and std::alloc, respectively. You're absolutely able to choose not to include these packages, with #![no_std]. That's how rust is able to target platforms like 8-bit microcontrollers with 16kbytes of RAM.

https://rust-embedded.github.io/book/intro/no-std.html


What the OP is probably referring to is that Rust does not have a runtime in the typical sense used by languages such as Java. Rust does have a runtime, as all non-assembly languages do, but it is very very small. Languages with minimal runtimes like C or Rust are commonly referred to as having "no runtime".


Those are all pay-as-you go features; in my mind I associate runtime with a single, constant-ish initialization cost, plus possibly some background processing or inserted hooks that do janitor work for you. Rust doesn't have a runtime in that sense.


I think you are confusing a standard library with a runtime.

A runtime is something you need to start before being able to use a language (typically a garbage collector, an event loop, a threadpool or a VM)




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: