4 ms·
Nope, you're right. But your "any language" almost certainly passes those syscall bindings through C to get there. Some languages are higher fidelity than other
by quesera 14y ago
Nope, you're right. But your "any language" almost certainly passes those syscall bindings through C to get there. Some languages are higher fidelity than others.
However, C requires you to know more about how the compiler is going to turn your character string, say, or your looping construct, into assembly code.
Some languages don't even have structs or pointers, or explicit memory allocation! You're laughing (I hope), but these are real things in memory, with only a thin layer of magic (layout, pointer math) in C...whereas they do exist in other languages, but are hidden -- usually pretty well, but rarely completely to the point where you are better off not knowing about them.
- gaius 14y agoNot really. Using a for loop in C requires no more understanding than using a for loop in Python. As for character strings, what you need to know in C is the "gotchas" related to running off the end, in most cases the machine would be just as happy with a Pascal-style string[1] And for pointers, I'll leave you with http://en.wikipedia.org/wiki/Tony_Hoare#Quotations http://en.wikipedia.org/wiki/Tony_Hoare#Quotations [1] Tho' processors since the Z80 have instructions to help you deal with null-terminated strings...
- frou_dh 14y agoI think Go, for example, performs syscalls directly. > However, C requires you to know more about how the compiler is going to turn your ... into assembly code. But does it really require (with emphasis)? The nature of some debugging and optimisation might push you towards that, but it's still a choice. I feel your point comes down to the use of C as a "vehicle" to learn low-level concepts. Which is fine, but someone can also just learn them directly (upfront or retroactively) and use whatever progression of languages they want.
- pjmlp 14y ago> Nope, you're right. But your "any language" almost certainly passes those syscall bindings through C to get there Only if the OS was written in C...
- batista 14y agoYes, so "only" in 99.9% of the cases, including all that matter most...
- pjmlp 14y agoSo lets see: - all the OS written before C ever existed, some still in use, even if in legacy deployments - Symbian (written in C++) - Mac OS X (is a mix of C++ and C) - Windows is moving to C++ as the default systems language - Native Oberon (Oberon) - Lilitth (Modula-2) - Spin (Modula-3) - BeOS/Haiku (Written in C++) - House (Haskell) - MarteOS (Ada) - IBM's OS/400 system (Written originally in Modula-2 and PL/MI) - Singularity (Written in C# and C++) - Lisp OS (Assembly and Lisp) - Smalltalk Machines (Assembly and Smalltalk) - Forth based OS for embedded systems So one cannot expect that an OS will be always written in C.
- quesera 14y agoC++ is C with libraries to hide some stuff and add others. Removing C++ OSes from your list, I'd say that you're down to a vanishingly small percent of deployed systems. So yes, knowing C is important. And I have never met a single person who knows any of your remaining languages who isn't at last passably familiar with C. I've never asked, but I don't think any of them would call their C knowledge unimportant or not useful.
- batista 14y agoYou're seriously mentioning Lilith, Spin, Singularity, Lisp OS, MarteOS, Smalltalk machines et al to challenge the 99.9% thing? OS X and Windows have some C++ (mostly wrappers) but otherwise are C.
- pjmlp 14y agoYes, because even if they aren't that much used they do exist. OS X drivers are written in C++, they are not wrappers over C. http://developer.apple.com/library/mac/#documentation/devicedrivers/conceptual/IOKitFundamentals/Features/Features.html#//apple_ref/doc/uid/TP0000012-TPXREF101 http://developer.apple.com/library/mac/#documentation/device... In Windows all the new APIs since Windows Vista are mostly COM (C++) based, including the new Userspace Driver Framework. With Windows 8 this will increase, as Microsoft is moving to have C++ as their official systems language, by introducing WinRT as the new subsystem, and dropping support for anything besides C89. Just because C is used a lot, you cannot say that all (even 99,9%) operating systems use it. Actually I failed to mention the amount of operating systems that you may have running on your watch, vcr, radio, microwave, etc, which summed together are much more that the OS X, Windows, Linux base.