Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
uecker
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
22 ms
·
511.
▲
by
uecker
9mo ago
I never copied my dependencies into my C project, nor does it usually take more than a couple of seconds to add one.
512.
▲
by
uecker
9mo ago
Na, there are only three classes: stuff where you need simplicity, fast compilation times, portability, interoperability with legacy systems, or high-performance - C. Stuff where you need perfect memory safety: Fil-C. And stuff where you n
513.
▲
by
uecker
9mo ago
With VLAs which are standardized, safer, and scoped.
514.
▲
by
uecker
9mo ago
Why alloca?
515.
▲
by
uecker
9mo ago
Is there any experience on how this works in practice?
516.
▲
by
uecker
9mo ago
I am very happy with my string type in C.
517.
▲
by
uecker
9mo ago
What language features would make C better as a target language for compilers?
518.
▲
by
uecker
9mo ago
But it does not have to be "as easy as int" to be able to be productive in C. Almost as easy is sufficient.
519.
▲
by
uecker
9mo ago
Yes, but I do not think this is a good thing. A programming language has to fulfill many requirements, and convenience for the programmer is not the most important.
520.
▲
by
uecker
9mo ago
Is there still any non-LLVM C++ compiler left besides GCC? LLVM is not exactly known for its speed.
521.
▲
by
uecker
9mo ago
For many string operations such as appending, inserting, overwriting etc. the memory management can be made automatic as well in C, and I think this is the main advantage. Just automatic free at scope end does not work (without extensions)
522.
▲
by
uecker
9mo ago
Of course, but gcc with -O0 is still slower and there is no TCC for C++.
523.
▲
by
uecker
9mo ago
Ah, the C++ guy who think you need all the features of C++ to be efficient... Many people of people are super productive in C. There is a cost, but this is usually just some initial overhead to identify / write some libraries. In a l
524.
▲
by
uecker
9mo ago
This is great! This so rare that people remove the complexity again that has accumulated over the years. Most of the programming world is just accumulating entropy and then people give up and start fresh at some point, which is just sad.
525.
▲
by
uecker
9mo ago
I would argue that is is much harder to find a group of C++ programmers who write a coherent style of C++. In C there is not nearly as much to decide. Note also that I am speaking from experience with both.
526.
▲
by
uecker
9mo ago
We run valgrind and asan as part of the CI, so it is checked before every merge and no developer has to be particularly diligent. But it is also not something that triggers a lot.
527.
▲
by
uecker
9mo ago
This seems orthogonal to std::string. People who pick C do not want automatic memory management, but might want better strings.
528.
▲
by
uecker
9mo ago
TCC - just like many other C compilers - supports many GNU extensions.
529.
▲
by
uecker
9mo ago
Yes, but this is more a theoretical problems while references are common in C++.
530.
▲
by
uecker
9mo ago
Maybe it is similar for the same compiler (but one should check, I suspect C could still be faster), but then there are much more C compilers. For example, TCC is a lot faster than GCC.
531.
▲
by
uecker
9mo ago
Sure, but you can have a similar string abstraction in C. What would you miss? The overloaded operators?
532.
▲
by
uecker
9mo ago
I think it is simpler and "the compiler not helping" == "things are more transparent". int a = 3; foo(a); // What value has a ? There are various things one does not have to worry about when using C
533.
▲
by
uecker
9mo ago
why not std::string?
534.
▲
by
uecker
9mo ago
Some subtle and some not so subtle.
535.
▲
by
uecker
9mo ago
Why do you think working with a group of people on a C codebase introduces pain unlike other languages? Working with a group of people always causes pain, but I found the pain much less severe for C than for C++.
536.
▲
by
uecker
9mo ago
C compilers can emit SIMD instructions just fine and often have extensions to support writing it explicitly. Also few other languages have explicit support for them from the start and most have added them as some kind of extension later. So
537.
▲
by
uecker
9mo ago
I meant there is a lot more new low-level C code being developed than Rust code.
538.
▲
by
uecker
9mo ago
There is also still a lot of low-level proprietary code developed in C. I would guess far more than what is developed in Rust. I fully agree about your last point. The proposed solutions to some of the deficiencies of C are sometimes worse
539.
▲
by
uecker
9mo ago
I am not sure what Filip's view on this is. But like to point out the article from Stephen Kell linked below which explains why C is an incredibly useful tool for systems programming and what distinguishes it from all other languages.
540.
▲
by
uecker
9mo ago
This is a meme which is repeated often, but not really true. If you disagree, please state specifically what property of PDP-11 you think it different from how modern computers work, and where this affects C but not other languages.
More ›