0

From the QnA for what a runtime is : What is "runtime"?

I understood about runtime a little. To make my understanding more robust, I'd like to ask new question.

Is C runtime an essential for any other programs like lua, haskell, java, etc... ?

I know C library implements not only standard C api but also system call wrappers also.

And I know lua runtime is no different than just a C program. This means lua runtime is based on C runtime.

So I guess any other language would be in the same situation. Because it is only C rumtime which can call system calls.

I considered for linux but I guess Windows and other Unix implementations must be same.

Am I right?

Community
  • 1
  • 1
Jumogehn
  • 1,102
  • 3
  • 11
  • 29

1 Answers1

2

Not necessarily.

All programs written in C make use of the C runtime environment, be it the standard library, the stuff happening before the main function, or else.

If a compiler/interpreter/virtual machine is written in C, yes, it does make use of the C runtime.
OTOH, if it isn't, it does not.

Note that you have to go up the whole "compiler/interpreter/virtual machine chain."
A Python interpreter written in Haskell might still indirectly rely on the C runtime environment if the Haskell interpreter has been written in C.

[...] it is only C rumtime [sic] which can call system calls.

No. The C runtime provides wrappers around some system calls. You can write programs in pure assembly making use of system calls and not rely on the C runtime library at all.

cadaniluk
  • 15,027
  • 2
  • 39
  • 67