Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
uecker
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
8 ms
·
211.
▲
by
uecker
4mo ago
Most of this can be done just fine in practice. NULL safety is not so much an issue as people claim as trapping is safe on most implementations and then similar to a panic in other languages. If you create data types via constructors you c
212.
▲
by
uecker
4mo ago
C is a tool which requires expertise but then goes out of your way and let's you do things, and do things rather efficiently, with no overhead, and exactly how you want. If you want it to cut off your arm it will do this too. But if y
213.
▲
by
uecker
4mo ago
This is about as correct as saying http is bloated because there are printer protocols using REST.
214.
▲
by
uecker
4mo ago
It is amazing. It is the result of two decades of research in image reconstruction algorithms. The machine learning is part of it, but that it is sold as "AI" has probably more to do with marketing.
215.
▲
by
uecker
4mo ago
Reimplementing everything is not an option in C. But one should be able to pass string views directly to printf. The allocating version is what string_dup does. strv2cstr is certainly more dangerous. But as since the size is encoded in the
216.
▲
by
uecker
4mo ago
Without this flag it can also attach to existing processes and on my Debian this is set to zero.
217.
▲
by
uecker
4mo ago
It will not add one if there isn't one already. (I should probably rename this function, work in progress..). But the type is an array of the correct length. Edit: renamed to strv2array
218.
▲
by
uecker
4mo ago
BTW: I was experimenting a bit more with string and string view (strv) types in my e toy library: https://codeberg.org/uecker/noplate/ The tests are maybe better examples than those on godbolt. https://
219.
▲
by
uecker
4mo ago
It is not really the same as LLMs. I wouldn't call it AI. And I wouldn't say "makes up". I work in this field and this is certainly based also in part on my research.
220.
▲
by
uecker
4mo ago
Of course they can! How do you think a debugger works?
221.
▲
by
uecker
4mo ago
No, there is already a secure mode which in the past worked fine but was bit too restrictive for modern clients, and there already exist hooks for fine grained access control.
222.
▲
by
uecker
4mo ago
It is the same issue with all sandboxing solutions. If your program does not work without giving it excessive permissions, it does not work. If we want to move to a version with minimal privileges, X would still seem like a good platform t
223.
▲
by
uecker
4mo ago
Most of the time applications can read each other's memory, so protecting the display does not make much sense. Basic X client isolation (not using XACE just Xsecurity) would have worked for sandboxed applications with some minor chang
224.
▲
by
uecker
4mo ago
In my experience is it also possible to avoid most holes in the trousers easily with C as well and not just by testing. For example, it is also often possible to build safe abstractions by designing an API around an incomplete type etc.
225.
▲
by
uecker
4mo ago
So it seems exactly the same to me?
226.
▲
by
uecker
4mo ago
Oh, you can get the information at compile time as well. https://godbolt.org/z/hTYbTE8j8 (or https://godbolt.org/z/K1M68sY3Y but this will be tricky in a larger code base)
227.
▲
by
uecker
4mo ago
Interestingly, I would see it just the other way round. It is easier for me to reason about the code if it not cluttered with null checks and a null sanitizer is I would see as a very light-weight tool. I may put an assert some once in whil
228.
▲
by
uecker
4mo ago
My worries about coding all these things into type systems is that this freezes the semantics at a time during development where one is still figuring out the ideal semantics. In any case, I wonder what you think about my experimental maybe
229.
▲
by
uecker
4mo ago
Is it? I program in C a lot, and null pointer dereferences are not really an issue in my experience. And any option type (which you could also have in C) does not really change the fundamental problem that you have some exceptional state yo
230.
▲
by
uecker
4mo ago
Reserved identifiers in general are not only for future use of the standard, but also for internal use of implementations and for extensions. The single-under bar rule is to give the programmer some part of the _... namespace which is othe
231.
▲
by
uecker
4mo ago
In C, you would typically rely much more on tooling to find bugs (but there are different styles and opinions). Checking for null is not bad, but does not usually add anything. If you de-reference a null pointer, you get a segmentation faul
232.
▲
by
uecker
4mo ago
Also reserved as identifier with file scope, just not for "any use". In any case, the program used underbar + capital letter.
233.
▲
by
uecker
4mo ago
Two things stick out as un-idiomatic for C. First, the casts before malloc are unnecessary. This you do in C++ but not in C. Second, names with beginning underscore are reserved, and the underscore + capital letter is specifically problemat
234.
▲
by
uecker
4mo ago
By complexity I mean roughly the number of language rules / techniques / idioms a programmer has to understand and keep in their head to be able to program effectively. I would say this is far lower in C than in Rust. I do not see
235.
▲
by
uecker
4mo ago
The check can not be removed if it becomes before the access because in this case the program has no UB . If there were UB, a compiler in C is not allowed to move (time-travel) UB before any observable behavior. This was never allowed by i
236.
▲
by
uecker
4mo ago
I did not know this was disputed, as even developer surveys in the Rust community highlighted complexity as a concern. But seems it is the overall summary of features that make it complex: lifetime, borrowing, a polymorphic type system, tra
237.
▲
by
uecker
4mo ago
I guess this depends on what you might corrupt (if it is not valuable but irrelevant intermediate state it might be ok) and what the consequences of an outage are. In any case, I largely tend to agree with you that this is better in most sc
238.
▲
by
uecker
4mo ago
Considering the amount of C programs that exist, the "we see severe bugs in C code seemingly every week" is on the same level of propaganda as we see "crime in the news every week" when the real societal problems are ent
239.
▲
by
uecker
4mo ago
There are certainly good parts in Rust that force you deal with inherent issues explicitly. I do not think this justifies a language with the complexity of Rust, but I would agree it is preferable to C++ in this regard.
240.
▲
by
uecker
4mo ago
A major global internet outage can certainly considered a "clear signal". Still not sure this was a good thing though.
More ›