News for hackers. Stuff that matters.
Re:sudo and su Being Rewritten in Rust for Memory Safety by ittan on Saturday April 29, 2023 @02:03PM (#35755433)
Isn't "C Runtime" inaccurate?

Wouldn't it be the static or dynamic linked libraries for the particular program in question?

Re:sudo and su Being Rewritten in Rust for Memory Safety by pjmlp on Saturday April 29, 2023 @02:08PM (#35755483)
Nope, what do you think calls into main(), does floating point emulation, handles signals on non UNIX platforms, provides threading support?
Re:sudo and su Being Rewritten in Rust for Memory Safety by dahfizz on Saturday April 29, 2023 @03:01PM (#35755973)
The term "runtime" is overloaded here. The C runtime is not what people usually mean when they say a language has a runtime.

There is a crt.0 "C Runtime" object. This is code that is literally run "at runtime". When you execute a binary, the C runtime is the first thing executed to setup the stack and call main().

This is just a bit of assembly that runs before main(). It shares ~nothing in common with "runtime" languages like Python or Java where the runtime is alive during the whole program's execution.

The C run time does not handle floats or threads or anything like that. Software floats are dealt with by the compiler and threading is implemented as its own library (either in userspace or built into the kernel).

Re:sudo and su Being Rewritten in Rust for Memory Safety by pjmlp on Saturday April 29, 2023 @03:41PM (#35756375)
I guess you can educate Microsoft on that then.

https://learn.microsoft.com/en-us/cpp/c-runtime-library/c-ru...

It doesn't matter what people think, rather the CS point of view of a language runtime is.

That library is the runtime.

Re:sudo and su Being Rewritten in Rust for Memory Safety by lanstin on Saturday April 29, 2023 @04:39PM (#35756931)
Libraries and crt0.o and the like. Libgcc_s ; but it isn’t a runtime in the sense that some magic is doing GC or scheduling for routines. ABI that describes what the assembly should be doing, it isn’t a thing doing stuff.
Re:sudo and su Being Rewritten in Rust for Memory Safety by pjmlp on Saturday April 29, 2023 @05:10PM (#35757229)
Runtime is whatever a programming language needs to support its execution, as per CS compiler theory.
Re:sudo and su Being Rewritten in Rust for Memory Safety by dahfizz on Saturday April 29, 2023 @03:07PM (#35756051)
There is a code object called "C Runtime" (crt0.o)[1].

This was a good name at the time. Its a bit of code that gets executed literally "at runtime". When you run a program, this object gets invoked to setup the stack and call main(). Its just a bit of assembly.

Then, decades later, languages like Java overloaded the term "runtime" to refer to their interpreter / vm. This causes confusion to this day, evidently.

[1] https://en.wikipedia.org/wiki/Crt0