Hacker News new | past | comments | ask | show | jobs | submit login

Why does an OS have a “main” language?



There's such a strong connection between the idea of "programming language runtime" and "operating system" (resource management, I/O management, task scheduling, package management, upgrade management, lifecycle management, version control, configuration management, user interface, etc.) that it makes sense both to

- think of a PL as an OS (Smalltalk, Erlang, JVM)

- think of an OS as a PL

The latter leads to the idea that there might be a "main language" for an OS in the same way there's a "main language" for Smalltalk, Erlang, and JVM runtimes (Smalltalk, Erlang, and Java, respectively), and "auxiliary languages" that fit into the same runtimes (Java/Self/etc, Elixir/LFE/etc, and Scala/Clojure/Kotlin/etc, respectively).


If you know this language, you can change any part of OS. I think that's a valuable asset. For example if you're using OpenBSD and know C, you can hack anything from kernel to smtp daemon. If you're OS is written with 10 languages, it's much harder to learn them all.


That's a good argument for keeping the set of languages limited. But it doesn't necessarily have to be just one.


It never is. Even ancient unix had shell and (maybe more to your point) yacc. Yacc still generates C files, but that's more of an implementation detail. The C _interop_ is key.


> The C _interop_ is key.

On UNIX compatible OSes, others not so much.


Well, of course! I was talking about why yacc is a second language for (early and contemporary) unix. Its C interop for (early and contemporary) unix is what I was stressing.


Ah ok, sorry for being pedantic.

You are fully right.




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

Search: