Hacker News new | ask | show | jobs
by generic_user 3367 days ago
Good point. A project with the full financial support of Google with a team including Rob Pike, Ken Thompson, Russ Cox and others, in a language that they designed. And it still took a few years and was a huge and stressful process.
1 comments

When I said "atypical", I was thinking more along the lines of that it is not unusual for compilers to eventually be self-hosting.
Pretty much all of OS development, low level libraries, device drivers etc, are atypical. So are compilers assemblers linkers. Programs that need to allocate and release tens of gigabytes at a time, high performance parallel code etc.

Any language that wants to present themselves as a replacement for C/C++ hast to have at least a reference implementation of all those things so people can start to evaluate (the system).

No one is going to invest the time or the resources into a language to replace what we have if its not an actually up to the task. No one needs another programming language sitting on top of C/C++ that kind of makes things a little better for one class of bugs but will never really replace C/C++ and our our system interfaces.

There is a long list of languages that have made that claim and most of it has turned out to be hot air and marketing.

I am neck deep in C, pretty much all the time, from actual bare metal (i.e. no OS) all the way up to application code, so none of what you mentioned is atypical use of C to me :p

I do not mean to trivialize compilers, linkers and assemblers, but fundamentally they are programs that just read and write files. They don't really have to be in C, IMHO.

I am still waiting for someone to chime in with credible examples of successful C -> non-C transition.

Everyone who has has tried that approach soon after decided to leave the company so they could spend more time with their families...

And your right that compilers etc, do not absolutely need to be written in C/C++. But all of this is taking place in the context of the market. Open source operates in that same market.

If you have two teams working on compilers in different languages and one is using C/C++ its probably going to be much faster with fewer dependencies. 90% of the business is going to go that way and the other team is going under. And so it goes all the way up the stack.

On the other hand what about the kernel and the system libraries? Even if you replaced the whole tool chain with another language but still have a C/C++ kernel and system interface everybody is going to want to use the native interfaces and therefore work in C/C++. So whats the point of adding another layer.

Given what we have now and what peoples expectations are I just don't see 'a replacement for C/C++' ever happening until You can wipe your drive and install a new OS with a kernel and system libraries in a totally different language and never have to touch C/C++ again for the projects developed for that OS.

I do not disagree with you even a little, and not just because C is my bread and butter. At this point, I am merely curious about examples of large projects doing a successful switch from language A to language B.

I just remembered reading about MirageOS recently. Almost everything is done in OCaml. I am sure it contains a bunch of low-level C code. It seemed interesting, but I don't think such projects will ever replace systems written in C.

Sorry, I can't think of any off of the top of my head. The only thing that comes close is once in a while you see a C project switch to C++ but that's not really an example of what your looking for. Like when GCC switched over to C++.
> Even if you replaced the whole tool chain with another language but still have a C/C++ kernel and system interface everybody is going to want to use the native interfaces and therefore work in C/C++. So whats the point of adding another layer.

I guess you don't do much OS X, iOS, Android ,ChromeOS or UWP programming.

I really have no idea what your trying to argue.

OSX is a certified UNIX.A bunch of BSD people ended up over there. Android and ChromeOS use the Linux kernel and Redhats C lib. The one time I checked it looked like most of there compositor and components are also C/C++, skia etc. Windows is written in C++ and you have WinAPI. And of course vanilla Linux is C and all the GNU libs are C.

So its WinAPI and Linux system interface with a preference for POSIX. With lots of other irreplaceable Libraries that are also only written in C/C++. High performance high memory usage that needs to run stable at full load and maximum memory for days at a time.

Keep in mind that there are large industries that have usage and development patters that your oblivious to. And that claims of safety espoused by language developers based on criteria that they themselves have created are so low on the priority stack that there simply non existent in specifications.

What should we do? Should Google and Microsoft and The Linux foundation rewrite there whole stack in XYZ meme language? Or is it just all the other companies that that should switch to a language they don't need or care about just for the hell of it?