4 ms·
I think you are confusing the language runtime with the Go "runtime" package that provides an API to the Go runtime. Golang runtime is basically a program, that
by cft 9y ago
I think you are confusing the language runtime with the Go "runtime" package that provides an API to the Go runtime. Golang runtime is basically a program, that is running whenever your Go application is running. As a programmer, you do not have full control over the language runtime. It runs things like garbage collection, and serializes/deserializes data in the channels. True system languages like C do not have a runtime. Rust has a primitive automatic memory allocator/deallocator (not a garbage collector!), but I would not call it a full fledged runtime.
- paxys 9y agoBy that definition every language has a runtime (yes, including C with crt0.o). Something has to set up the stack, enter the main() function etc. So how do you differentiate a systems language runtime? One that is bundled with the OS? Or is thin enough by some arbitrary measure?
- cft 9y agoIn Go you cannot fully control the runtime as a programmer- Go's GC is a complicated periodically run program with sometimes surprising behavior. crt0.o is a very simple set of startup routines with a fixed and predictable behavior. It is typically run only once ("0" in the name is for startup), and has only a couple of assembly instructions.
- pjmlp 9y agoC runtime does much more than that, depending how floating point is supported, language extensions for constructors on execution start, threading runtime introduced in C11.
- steveklabnik 9y ago> is thin enough by some arbitrary measure? Colloquially, this. There's historically been a fairly big gap between "very little runtime" and "more runtime", so "no runtime" and "runtime" are what people say. That said, the word is generally ill-defined; some people use it to mean "interpreter" or "vm" rather than the classic definition, which is (as you say) that every non-assembly language has a runtime.
- pjmlp 9y agoActually in the world of micro-code and uOPs even Assembly can be said to use a "runtime", for specific CPUs. :)
- AnimalMuppet 9y agoOK, if you really want to go as far low-level as possible: My mother, back in the 1950s, worked on at least one CPU where the instruction set could be changed with patch cords. So is the configuration of patch cords a "runtime"? ;-)
- pjmlp 9y agoI guess not, but uploading a micro-coded bytecode interpreter into an Alto CPU in 1973, to switch between Smalltalk, Interlisp-D and Mesa/Cedar support certainly feels like a runtime.
- steveklabnik 9y agoThat memory stuff isn't even part of Rust's runtime; it's compile time stuff. Here's Rust's runtime: https://github.com/rust-lang/rust/blob/master/src/libstd/rt.rs https://github.com/rust-lang/rust/blob/master/src/libstd/rt....