Live data from Hacker News

I stopped everything and started writing C again

kmx.io

471–475 of 475 posts

Re: I stopped everything and started writing C again

#471
post #466

Earlier quoted context omitted.

Cargo's threat model here is identical to that of rust analyser. If you trust your dependency tree sufficiently to run `cargo build`, then you trust it sufficiently to run rust analyser.

Considering Cargo has build scripts, which are designed to run arbitrary code, that doesn't appear to be correct. https://doc.rust-lang.org/cargo/reference/build-scripts.html

Rust analyser executes those exact same build scripts. This is the primary avenue for exploits in both pieces of software, and is called out explicitly in the page you originally linked.

Re: I stopped everything and started writing C again

#472
post #176

Earlier quoted context omitted.

The biggest problem with C is that doesn't even have enough features to help you build the features and abstractions you need and want. For example with C++ the language offers enough functionality that you can create abstractions at any level, from low level bit manipulation to high level features such as automatic memory management, high level data objects etc. With C you can never escape the low level details. Cur…

so confused by this one. C is the most free to build systems and abstractions. it doesnt lock you down into any paradigm so you can build your own.... you can abstract away perfectly fine low level details and use your own high level constructs to build what you want in a memory safe way... high level daya objects? sure it doesnt have garbage collection, so it motivates you not to leave garbage laying around for some…

Sure you can do this, but the point is that it's all manual and always will be because you get no help from the compiler.

Compare in C++ where you can have higher level types and compiler helpfully provides features that let the programmer do stuff such as RAII or unique_ptr.

Huge difference.

Re: I stopped everything and started writing C again

#473

Earlier quoted context omitted.

> after sufficient practice, I became good enough to start avoiding those pitfalls. You can only do that in code you control. You can not control the entire call stack of your functions in cooperative environments.

> You can not control the entire call stack of your functions in cooperative environments. That's true. But I try by doing code reviews, and I try to lead the team by example and suggestion.

Examples and suggestions don't transmit your years of experience of pitfall-avoidance. You say you "try" to do code reviews, which is honorable, but also proves that there is code in your codebase that you can not and do not control, and which likely features unsafeness. This is fair enough, we can't do all the work as maintainers after all.

When I `git blame` segfaults in the D compiler repository, the aforementioned assumption -- that you can't control faults introduced by someone else -- seems to be largely true. We do use Go/Rust at work (albeit an easier flavor of it), because I don't trust my juniors.

Re: I stopped everything and started writing C again

#474
post #448

Earlier quoted context omitted.

Yes, very similar. We had pthreaded mutexed queues too, and measured timings with clock_gettime() with CLOCK_MONOTONIC. Our facial template match runs at 25M compares per second per core, and simply keeping that pipeline fed required all kinds of timing synchronizations. The only community I know that produces developers that know this kind of stuff intimately are console game programmers, and then only the people re…

Also the old school HFT community (which I'm from).

An even smaller community too. I spent time in that community, very briefly around '89. I was not of the mindset to be interested in the stock market at that time, and left for the animation industry.

Re: I stopped everything and started writing C again

#475
post #466

Earlier quoted context omitted.

Considering Cargo has build scripts, which are designed to run arbitrary code, that doesn't appear to be correct. https://doc.rust-lang.org/cargo/reference/build-scripts.html

Rust analyser executes those exact same build scripts. This is the primary avenue for exploits in both pieces of software, and is called out explicitly in the page you originally linked.

Yes, and that is my complaint.
Post reply on HN