Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

It has become increasingly clear to me that C's influence on the systems landscape is even stronger than it would initially appear. Our ability to move beyond what we have now is not merely hampered by the fact that we have to create an entire systems infrastructure, it is hampered by the fact that we always get sucked into having to support C shared libraries in addition to that, and in general that requires certain things to be true of your language, which pulls you into the C local optima. And now you've failed to write a systems language that has moved fundamentally beyond C.

In short, to be able to run a C library means that you language must hand over total control to that C library, who may then dance all over memory, if it chooses. You can't build a system that enforces any further constraints. And you don't have to be an "academic weirdo" language anymore to want to be able to enforce constraints; even something like Go has a significant runtime that you need to work with properly to get the benefits of go, and a C library simply expects to own its thread for as long as it wants, do whatever it wants to allocate memory, use whatever resources it wants, not be scheduled in any way by anything other than the OS, and just this immense laundry list of requirements that all looked OK 30 years ago, but it's increasingly clear that to get to the next step of systems design, some of those are going to have to be modified. And C is not the language that will allow this.

The only language I know that manages to have radically different semantics that C at the deepest levels, yet can still talk to C libraries without (much) compromise of those semantics, is Haskell.

Somehow we've got to escape from C-type linking dictating requirements to the deepest levels of the semantics of the new language, or we're not going to escape from the local optima we are in right now.



Why are so many people intent on taking C away from us?

The fact that you can run everything from Erlang to Python to Lisp to a JVM on the same machine and under the same OS is thanks to C, not in spite of it!

C exposes the machine at a low level, which means that you can innovate in the language/VM space without having to beg the runtime gatekeepers to please implement your new experimental semantic. Anyone can generate machine code that will run directly on the hardware -- I recently wrote a JIT that parses Protocol Buffers 2x the speed of any existing parser. Don't take away from the the ability to do this!

Higher level VMs like the JVM can impose further constraints -- this is already possible today. But those VMs can compete for popularity in user-space without imposing limitations on the kinds of VMs you can write directly on the hardware.


"The fact that you can run everything from Erlang to Python to Lisp to a JVM on the same machine and under the same OS is thanks to"

Turing completeless, not C.

"you can innovate..."

We have. We've innovated for 40 years. It turns out we've learned some stuff since then, and it's time to move some of those innovations down to the lower parts of the system. Sorry, that means bumping C. But I assure you, I will celebrate C and put it on a pedestal and remember it fondly, even as I'm shoving it out the door and glad that it is no longer the constraint for all future systems.

It's not that it sucks, it's that it's basically used up. An immense amount of problems with modern computing basically boil down to having C at the lowest level of the system, and we aren't going to fix them until we get something else at the lowest level. The hardware model that it embraces is simply not appropriate for building the networked future on.


> Turing completeless, not C.

Be serious. Brainfuck is Turing-complete: are you suggesting that other programming languages could reasonably be implemented on top of it?

Almost every single VM or programming language implementation is written in C. What are people going to write programming languages in when you take C away from them?

> We have. We've innovated for 40 years. It turns out we've learned some stuff since then, and it's time to move some of those innovations down to the lower parts of the system.

So your opinion is basically that it's time to stop innovating, because now we know the best answer. What do you have to say to the fact that I wrote a JIT two weeks ago that effectively improved the state of the art in network protocol parsing? How is that not part of "the networked future?"

Your arguments that C is holding us back are vague and unconvincing. People write VMs all the time. Code that runs on these VMs can be as insulated as you want from the underlying system. The entire web is built on JavaScript which doesn't know a lick about C -- how would that whole ecosystem be any better if C wasn't underneath it? I argue it would be much worse, because the radical performance improvements of the last 4 years (which came from writing JITs that target the bare metal) would not have been possible.

You can pry address spaces and machine code from my cold, dead hands.


"Be serious. Brainfuck is Turing-complete: are you suggesting that other programming languages could reasonably be implemented on top of it?"

Be serious yourself. With that sort of hostile characterization, I have little interest in following up in a dead conversation. You don't appear to have spent even a second trying to understand what I'm saying before leaping to a nonsensical strawman. (And I am well aware that understand != agree. But you didn't take the time to even know what you disagree with.)

"So your opinion is basically that it's time to stop innovating,"

No, it's time to resume. C is not where the innovation is.


I spent a lot of time trying to understand what you were saying, and because it was unclear to me I asked very specific questions, none of which you answered:

    - what will people write language implementations in, if not C?
    - why don't you consider my JIT an innovation worth supporting?
    - if C is a barrier to innovation, why is the JavaScript landscape so thriving?
My point about Brainfuck (that's a language by the way, not a slur, in case that wasn't clear) is that Turing-completeness says almost nothing about the systems-level capabilities of the language. Turning completeness means that a language can calculate Pi: it doesn't mean that it can open a file or send data over a network, and it says nothing about efficiency. So when you argue that Turing-completeness is what makes it possible to run lots of different kinds of VMs on the same machine, it's hard to take such an argument seriously.


"So when you argue that Turing-completeness is what makes it possible to run lots of different kinds of VMs on the same machine, it's hard to take such an argument seriously."

Turing completeness is why you can run a JVM on top of a C environment. It means that any computation that C could do, the JVM could do. It means that I can run a JVM on top of any Turing Complete environment. The JVM could be ported to a modern day Lisp machine. The JVM could run on a Russian ternary machine. C does not get "credit" for enabling the existence of the JVM, because the JVM could run on any Turing complete substrate. You have the causality backwards.

"- what will people write language implementations in, if not C?"

The new systems languages will be written in themselves! What do you think C is written in? "Bootstrapping."

"- if C is a barrier to innovation, why is the JavaScript landscape so thriving?"

Wrong question for what I'm talking about. Javascript has no innovation of interest to systems level programming, it's just a thin layer over C. I'm talking more like something like Go, which is hampered by the fact that it can't really use C libraries properly because Go can't grab and schedule C routines properly. Or how E [1] is really hampered by the fact that it basically can't work properly in a C environment, its whole schtick really only works if it's down to the OS level. The entire point is that I want to replace the foundation, so it can do things that C basically can't. Like, write a secure operating system, which C is incapable of, despite immense amounts of effort.

Basically, why is UNIX still the preeminent OS? Yes, it was good, I know that, there's a reason why it's the only survivor of its time period, but where's the capabilities-based system? Where's the thing we can't even think of because we're too stuck on C? Why is one of the preeminent kernels of the day, the Linux kernel, still adding an average of two security vulnerabilities a week, the same ones, over and over? Why are buffer overflows still coming out in 2011? Why do I still get segmentation faults in 2011? Why are we building the very foundations of our system on a language that all but mandates such failures, when we know how to not do that?

C.

As for any response you might have as to why C is still worth it, my reply in advance is that every one of those things is room for "innovation", much of which has already been done.

[1]: http://www.erights.org/


> Turing completeness is why you can run a JVM on top of a C environment. It means that any computation that C could do, the JVM could do.

I'm genuinely confused: I thought this was the argument you called a strawman when I argued against it before.

I've already rebutted this argument twice: Brainfuck (http://en.wikipedia.org/wiki/Brainfuck) is a Turing-complete programming language, and yet you categorically could not implement the Java class libraries on top of it. For example, the java.io.FileReader class could not be implemented on top of it, because Brainfuck does not have any API for opening a file.

Even in cases where you can implement one language on top of another, it may not be efficient to do so. For example, Adobe Alchemy runs C/C++ code on top of Flash/ActionScript at a 2-10x slowdown compared with running the C/C++ directly on the hardware. Implementing a JVM on top of Java appears to be 4-9x slower than implementing it in C/C++ [0] (and that's only comparing two interpreters: the difference is far greater when the C/C++ implementation generates machine code directly).

C gets credit for efficiently supporting a whole host of different VMs with divergent GC schemes and synchronization primitives. That is what makes C special, and why it continues to dominate in system space.

[0] http://portal.acm.org/citation.cfm?id=1294345


> Turing completeless, not C.

C's mix of portability, simplicity, flexibility, and expressiveness made it the ideal choice for developing operating systems that had to run on a wide variety of architectures.

Perhaps a simple example of where C gets in the way would help clarify your case.




Consider applying for YC's Fall 2026 batch! Applications are open till July 27.

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

Search: