Live data from Hacker News

The case against a C alternative

c3.handmade.network

201–210 of 388 posts

Re: The case against a C alternative

#201

I will never use any other language for server apps than C. C is a language for getting things done. It's finished and final. It will not change. There will be no new surprises, no new operators, and no unpublished packages. There are just source files. Write, compile, ship, repeat. You used it in 1990 to ship, you used it in 2000 to ship, you used it in 2010 to ship, you used in 2020 to ship, and you will use it in…

Aways nice to see good reasoning. Though I'd veer away from it if the task is too large and the program needs to be updated frequently by multiple people.

Also, you got any recommendations for a c library for server apps?

Re: The case against a C alternative

#202
post #141

Earlier quoted context omitted.

I agree. I think of address space context switching overhead as the performance price we pay for not being able to run all our programs in a single address space, which we could safely do if we knew all the programs were emitted by a trusted compiler that disallows unsafe memory access. Imagine if system calls were just ordinary functions that can be called with no more than the normal function call overhead? What if…

> I think of address space context switching overhead as the performance price we pay for not being able to run all our programs in a single address space, which we could safely do if we knew all the programs were emitted by a trusted compiler that disallows unsafe memory access. Imagine if system calls were just ordinary functions that can be called with no more than the normal function call overhead? That's pretty…

[deleted]

Re: The case against a C alternative

#203

> Any C alternative will be expected to be on par with C in performance. The problem is that C have practically no checks, so any safety checks put into the competing language will have a runtime cost, which often is unacceptable. This leads to a strategy of only having checks in "safe" mode. Where the "fast" mode is just as "unsafe" as C. I don't think this is true, in the general case: Rust has shown that languages…

But not always. Some algorithms cannot be written in a way that would remove run time bound checking from rust e.g. KMP.

Re: The case against a C alternative

#204
post #45

> C language toolchain I'm sorry, but the C language toolchain is not great. The only part of the C language toolchain that is good is it's platform support. Every platform has a C compiler. However, that's hardly something most devs will care about. At this point, we are pretty much all targeting Arm or x86 (Sorry PIC and MIPS devs). And every new language that's cropped up at a minimum supports both those platforms…

> I'm sorry, but the C language toolchain is not great. The only part of the C language toolchain that is good is it's platform support. Every platform has a C compiler. Please take a few days to review John Regehr’s excellent blog. I’m certain that you’ll find dispelling your ignorance rewarding. > How do you grab dependencies for and build javascript? npm install, npm build. Npm is the poster child for supply chain…

> Please take a few days to review John Regehr’s excellent blog. I’m certain that you’ll find dispelling your ignorance rewarding.

I regularly read his blog and I found nothing to back you up. He mostly work on a generic compiler toolchain (LLVM) other than C-specific tools and his work easily translates to many other languages using LLVM. And even a rare C-specific tool like C-Reduce is not that hard to adapt for other languages; C-Reduce is actually language-agnostic and works well for many other curly-brace languages as well.

Re: The case against a C alternative

#205

Ive been thinking about this topic for years and OP was finally able to put it in writing. I dont think anyone would claim english is the best, but it just so happens that the most powerful empire on earth (until recently?) uses it as its primary language. Its good enough at what it does, and has a lot of history backing it up With this knowledge I choose to align myself with languages and platforms that respect C an…

I concur with you - everything I want to do in Rust or Golang, I can do with C+Lua just as easily and with far less tooling hassle. I'm yet to find a good reason to switch from just using C+Lua for everything - but the Rust guys sure are trying. Maybe Rust+Lua makes the most sense, though ..

Re: The case against a C alternative

#206
post #192

Earlier quoted context omitted.

Precisely. This is perhaps the strangest part of the original post: C++ has the same performance advantages as Rust! It has them not because it's more safe (although it is, in some regards), but because it allows programmers to express behaviors that the compiler can reason about statically.

Interesting. Can you list an example of C++ type system allowing optimization Rust system doesn't?

I don't think they suggested this.

Re: The case against a C alternative

#208
post #195

Earlier quoted context omitted.

Gaming is very much not representative. There's roughly 120M active steam users, vs. ~1.4 billion windows installs. If I look around me, for instance in my whole family we're two with Steam installed but ever household has a desktop or a laptop (and generally a 7-8 years old cheap entry-level 350€ one, you'd be hard-pressed to find even a quad-core in there)

I don’t know dude, if you want to write software for the worst performers instead of commodity hardware that’s up to you Just that single core systems are dying and probably won’t come back. Even Raspberry Pi’s are quad core now.

> I don’t know dude, if you want to write software for the worst performers instead of commodity hardware that’s up to you

I want to write software that people, most people, not only those with SV salaries able to buy a computer every year, can use.

Here's the current best seller laptop in Amazon in my country: https://www.amazon.fr/Dell-Inspiron-i5-1135G7-Ordinateur-por...

It's half past 2022 and the most sold laptop here in France, 7th-ranked in GDP, has 8 gigabytes of RAM and 4 cores. This is what the real world looks like. (and just a year ago it was still 4GB of RAM iirc)

The second best sale is a gamer PC which is a bit better. https://www.amazon.fr/MILUI-Modulaire-Colosseum-Livraison-30...

The third https://www.amazon.fr/Ordinateur-Portable-Celeron-Resolution... comes with a CPU that does not support hyperthreading (so 4C/4T) and does not even support friggin AVX and goes to SSE4.2 at most.

That does not mean not making use of multiple cores of course, but a software should still be able to work on a single-core. Right now we only have certifications such as https://www.blauer-engel.de/en/productworld/resources-and-en... (see https://www.umwelt-campus.de/en/research/projekte/green-soft... for the methodology) but hopefully in a few years we can start making it first heavily discouraged and over time less and less viable to create resource-wasting software - in any case this is a thing I am asking of the people whom I vote for :-)

Re: The case against a C alternative

#209

There is also a more general "case against the self-indulgent narcissism in creating a new language". There are an insane number of languages with the longevity of a mushroom mentioned on HN.

Heh. This article was posted shortly after we instituted a ban [0] on language talks at Handmade Seattle 2022.

There's an oversupply of enthusiastic engineers trying to provide C alternatives and it's creating massive bike-shedding and yak-shaving problems.

Language designers are encouraged to give a presentation if it's about building quality software using a language. Otherwise, no.

[0] https://vimeo.com/handmadeseattle/languages-are-banned

Re: The case against a C alternative

#210

What a defeatist take :/ A "better C" language doesn't have to "win the popularity race" to be useful, it just needs to (a) be easy to learn coming from C, (b) integrate well into the existing C/C++/ObjC ecosystem, and (c) easy to install and across all supported platforms. A "better C" cannot and should not replace C for all use cases, but it should at least augment C by fixing its design wart. The actually depressi…

This person is actively trying to make a "better C" so it's no surprise his arguments against his own project are lukewarm.

"It is difficult to get a man to understand something, when his salary depends on his not understanding it."

Post reply on HN