Hacker News new | ask | show | jobs
by yjftsjthsd-h 3367 days ago
If you believe that you can rewrite any of those libraries or tools in a nice modern language with no security issues and all the portability that they had (including operating systems and embedded systems), please do grace us with your work.

In the meantime, it appears rather difficult to replace the last 40 years of work overnight in a novel, untested language, with support for a tiny fraction of the targets that C has been supporting all that time, while maintaining reasonable performance.

Or in short: It's easy to work smart when you're not working hard in your arm chair.

1 comments

> If you believe that you can rewrite any of those libraries or tools in a nice modern language with no security issues and all the portability that they had (including operating systems and embedded systems), please do grace us with your work.

I can point you to numerous examples of people writing and rewriting software, there is no reason for it to be my work to prove its doable and often worth the effort. And all languages that generate C code are as portable as C is. I can also point you to countless examples where people replaced their dependencies with something written in another language. Also please go back to first line of my comment and read it again.

> In the meantime, it appears rather difficult to replace the last 40 years of work overnight in a novel, untested language, with support for a tiny fraction of the targets that C has been supporting all that time, while maintaining reasonable performance.

Who suggest it can be done overnight? Why not use something that compiles to C if you need this compatibility? There is no need to replace all of it at once - you can pick particularly sensitive parts first, one file or one library at a time. There are many ways to introduce safer languages if you want to do it. Also difficult or not, all code will be replaced eventually.

As for performance - its irrelevant in large amount of networking code. I'd have no issue whatsoever with adding few cpu instructions for bounds checking, when you wait several milliseconds for IO operation, which is the case with curl.

> there is no reason for it to be my work to prove its doable and often worth the effort.

Why? You don't have expertise needed to do that yourself? It seems you think you have enough to lecture others and write how easy it is (just generate some C code).

> I can point you to numerous examples of people writing and rewriting software

Ok, point me to this software that was rewritten from unsafe C code and was replaced with memory safe language. I don't want any hobby projects, real software used by millions. Give me 10 examples.

I too am curious to know of large and prominent C projects rewritten in another language successfully. One recent atypical example that I can think of is the Go compiler.
And unfortunately it become twice as slow because of that[1].

[1] https://cdn.infoq.com/statics_s1_20170328-0458_1/resource/ne...

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.
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.

> Why? You don't have expertise needed to do that yourself?

You are taking code criticism to personally. Keep it professional.

> point me to this software that was rewritten from unsafe C code and was replaced with memory safe language.

From my own field - bunch of libraries for python. Mysql driver for example - used by large amount of people.

Numerous compilers and related tools: Golang runtime for example. Objective-C to Swift migration. Various parts of Firefox. Coreutils (https://github.com/uutils/coreutils). Ruby extensions: https://codeandtalk.com/v/fullstackfest-2015/full-stack-fest... remacs: https://github.com/Wilfred/remacs Whole industries run from C/C++ to Java/Python/.Net. Millions of projects there.

> You are taking code criticism to personally. Keep it professional.

What? I am asking if what you are writing is based on your experience or it's just theory that you've read somewhere. How is this personal?

I am not asking for myself. I already know the answer for that question after reading your comments (the last one only confirmed that), but people that are reading your comment may not, so why don't you just answer the question ?

> Numerous compilers and related tools: Golang runtime for example. Objective-C to Swift migration. Various parts of Firefox. Coreutils (https://github.com/uutils/coreutils). Ruby extensions: https://codeandtalk.com/v/fullstackfest-2015/full-stack-fest.... remacs: https://github.com/Wilfred/remacs Whole industries run from C/C++ to Java/Python/.Net. Millions of projects there.

I am talking about projects that NEEDED C for it's time/space efficiency and cross platform support. Not any C project. Do you see OS kernels in production written in python used by millions ? Do you see video/audio codecs written in Java/python/.net used in production by millions? No. This is where C is used because it's needed.

Coreutils in rust, remacs, ruby extensions - this is not used by millions.

> Objective-C to Swift migration

What? This are different languages. It's not SAME software rewritten from C.

> Various parts of firefox

Whole software, not parts.

So the only valid example you gave is Go (Go compiler is not used by millions by the way). So you gave 1 example instead of 10 and Go compiler is now twice as slow after rewrite.