Hacker News new | ask | show | jobs
by generic_user 3367 days ago
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.

2 comments

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?

Simple, yes the lower levels of the stack are still C and C++, but that is about it, the very low level layers.

OS X, yes it is a certified UNIX, but the software world is more than command line tools and UNIX daemons.

Any OS X, iOS, tvOS, iOS application that regular users actually want to use, rely in Objective-C APIs making use of classes, categories and protocols, with some of them actually being nowadays implemented in Swift, like the new audio stack.

ChromeOS, yes it is built on the Linux kernel, however the whole stack is built to manage Chrome instances. Only web apps count. Any developer creating applications to ChromeOS only deals with the web stack.

Android, oh sure it is built on top of a forked Linux kernel, stripped out of any signs of UNIX V IPC, but regular application developers only see Java APIs. Surely there is the NDK, which exposes about 5% of Android APIs, has a very limited set of official C and C++, and any attempt to link to on-device libraries not part of the sanctioned list, terminates the application, as of Android 7.

Windows, sure the kernel is built on a mix of C and C++, both Win32 and UWP build on top of that. However .NET Native is also able to produce UWP components, just like C++/CX. Watch any Microsoft conference since the launch of Windows 10, and you will see in which direction the wind is blowing on the whole .NET Native vs C++/CX for UWP applications.

Tizen, yep they built it on top of Linux kernel, offer some native API that has already gone through three reboots, but guess what. The main APIs are their web stack, native is not even allowed on Tizen for TVs and now their are adopting .NET Core as the new API stack.

As for POSIX and mobile OS, maybe you haven't been paying attention to the news.

"POSIX has become outdated" -- http://www.cs.columbia.edu/~vatlidak/resources/POSIXmagazine...

I don't work on phone software as was explained. And POSIX is still very widely used and important in many industries.

People have been attacking POSIX almost as long as C/C++. But unsurprisingly no one has put forward anything that could replace it.

Given the fact that you don't seem to care that the OS or system libraries are written in C/C++. And you don't care that there are industries that produce C/C++ software that have nothing to do with mobile and more closely resembles system programming. Who exactly is the internet safety strike force trying to evangelize? And more importantly why do you feel the need to lecture developers in other industries on what language they should use even tho you have no experience or stake in those industries?

It just annoys people and makes them less likely to try the new meme language. And makes the internet safety strike force look like armatures with to much time on there hands.

You don't see C/C++ programmers running around the internet brigading functional programming languages with nonsense. Even tho most of those languages are total crap. Maybe we are to busy trying to write software. Maybe that's why everything is written in C/C++?

First of all C/C++ doesn't exist, what we have is C and C++.

Second, my issue is with C not C++. C++ is one of my favorite systems programming languages, only spoiled by C copy-paste compatibility, which gets abused by C refugees using a C++ compiler.

I never cared for POSIX, because I always had access to rich C++ libraries, Turbo Vision on MS-DOS, OWL, MFC and ATL on Windows, Motif++ on UNIX and so on.

Windows 3.1 was already doing perfectly fine with C for Win32 SDK, with everything else being done in C++, Turbo Pascal, Delphi and VB.

It was the rise of UNIX, FOSS culture tied to C that changed the wind on C++ sails.

Thankfully Microsoft has decided that C++ is the only system programming language worth keeping and anyone that still wants to use C can keep using gcc and clang instead.

At least there is no place for C in UWP, unless for those that enjoy doing bare COM calls.

As for running around the internet, I guess you are too young, back in the day the C vs C++ flame wars were fought on BBS, USENET or even Teletext messaging boards.

Not everything is (thankfully) written in C, specially in the enterprise world where Java, .NET and C++ rule.

It is also very positive that ANSI C++ working group is turning C++ into a systems programming language with batteries, instead of relying on whatever OS APIs are available.

As for me, I have done my contribution to the world, by not writing a single line of C code since 2002.

The tools of trade are Java, .NET and C++.

One day C++ might get replaced by (Go, Swift, D, Rust, Ada), but currently C++17 as a helper language to Java and .NET, for my line of work, is good enough.

Of course by using RAII, no pre-processor beyond #include, std::string, std::vector, std::array, enum classes, references, templates, std::unique_ptr, , std::shared_ptr, and not a single line of C like coding other than as FFI to third party libraries.