HackerLangs
TopNewTrendsCommentsPastAskShowJobs

pornel

24,111 karmajoined 17 ปีที่แล้ว
https://kornel.ski

@mastodon.social/@kornel

Submissions

Rust9x update: Rust 1.93.0-beta

seri.tools
5 points·by pornel·6 เดือนที่ผ่านมา·0 comments

comments

pornel
·15 ชั่วโมงที่ผ่านมา·discuss
billed for buying unit-hours from an operator... that's very carefully worded to make it sound like a corporation<>customer relationship and not socialism.
pornel
·16 ชั่วโมงที่ผ่านมา·discuss
Use cargo tree to understand Rust/Cargo deps.

The lock format is a multi-line TOML, with a varying number of lines per dep due to redundantly listing deps-of-deps, so a naive line count massively overstates the number.

Cargo.lock contains many unused dependencies, because it's a superset of all combinations of all optional/disabled features of all transitive deps across all possible platforms (so that the deps don't reshuffle even if you enable/disable feature flags or compile on another platform). But that means Cargo.lock is going to have 3 async runtimes even if you use one. It's going to have syscall definitions for RedoxOS and wrappers for WASM, because some dep of dep is compatible with those platforms. But these deps won't even be downloaded if you don't build for these platforms.

The number you got presented is not representing the unit you're insinuating. A crate in Rust is a compilation unit. It's common for projects to ship as a collection of many crates. It's a smaller unit than what C counts as one dependency, and slightly coarser than an .o file. I don't see people freaking out by how many .o files their projects have, including all transitive ones from deps like openssl or curl.
pornel
·เมื่อวาน·discuss
They don't want all Americans to reproduce. Making a law they want still needs a couple of Supreme Court decisions overturned.
pornel
·เมื่อวานซืน·discuss
I suspect we'll move away from pull requests, because in the LLM world they're the worst way of accepting a contribution.

Verbose slop is painful to review, and it's dangerous to accept unreviewed code from a stranger.

For a maintainer it's way easier to tell their own agent to reimplement the same idea. It's still slop, but done their way, under their supervision.

For popular projects agent-made pull requests become a DoS attack. I wouldn't be surprised if projects start refusing to accept unsolicited PRs and switch to "don't call us, we'll call you". You could have an agent scanning forks of your projects to find what bugs users are fixing and what features they're adding, and use it as a roadmap, without the pressure of accepting any particular commit as-is.

I'd also like to move away from a binary merged-not-merged divide. Projects may have a stable manually-reviewed core that should be protected from agents messing it up, while allowing the sloppy parts to churn however LLMs like it.
pornel
·เมื่อวานซืน·discuss
I've watched an interview with Andrew Kelley: https://youtu.be/iqddnwKF8HQ where he seemed much more chill and level-headed.
pornel
·เมื่อวานซืน·discuss
Now you have to take your eyes off the road and look through three screens to find a new icon that showed up somewhere. Then keep not looking at the road and tap though multiple layers of settings screens to dismiss the false positive.

Car makers are chronically awful at making software, and regulations that force them to write more such software are doomed to suck.
pornel
·เมื่อวานซืน·discuss
I'm certainly distracted by all the beeping and bonging the car makes.
pornel
·4 วันที่ผ่านมา·discuss
[flagged]
pornel
·4 วันที่ผ่านมา·discuss
Everything you can capture with Flipper has off-the-shelf cheap simple components you can find in your DIY electronics/maker store: IR leds, 433Mhz antennas. Seeed xiao is also small enough that you can stuff it and a relay into appliances and simulate button presses.
pornel
·5 วันที่ผ่านมา·discuss
I use it to clone remotes of "dumb" devices and emulate them with ESPHome to make them "smart" fully offline under my control.
pornel
·5 วันที่ผ่านมา·discuss
LLM agents have plenty of "bad habits" that are impossible to get rid of. I suspect they're a side effect of reinforcement learning. Training objective rewards fewer tokens, so the results just need to be good enough most of the time while cutting as many corners as possible.

Similarly, I'm trying to stop agents "gracefully" handling errors by stuffing results with empty junk and continuing (get_list_of_problems().unwrap_or_default() -> "no problems found!"). I've filled AGENTS.md with "fail closed", "extremely strict error handling", "no fallbacks", "don't use sentinel values", and hundreds of variations of these, but they work about as well as "do not hallucinate". I get "You're absolutely right, this will cause problems!" and the fix is "changed to Err(_) => String::new()", I suspect it's another case of gaming RL - failing early and loudly increases the chance of failing and being penalized. So fudging data, ignoring errors, and presenting a barely-working result is a better strategy overall. When it fails, it fails anyway, but as long as it stumbles to the finish line it has a non-zero chance of getting accepted by the RL judge.
pornel
·5 วันที่ผ่านมา·discuss
Apple used to know this. They've had animations after items were dismissed, but avoided animations before showing an item.

Old Apple understood design is more than making things pretty. The glassy Apple is all about how it looks in a demo.
pornel
·8 วันที่ผ่านมา·discuss
> But you can just use very similar structures yourself in C programs! You can prevent problems in C as well by construction, even when the compiler does not enforce it.

Enforcement is the point. Otherwise you're just saying people should be writing bug-free programs. "By construction" doesn't mean it's possible to construct a program satisfying a requirement, but that the compiler ensures it's impossible to violate it.

Even for a hypothetical perfectly diligent flawlessly executing programmer it's a time saver. If you want to run a 3rd party function across threads: in Rust, the compiler tells you if it's thread-safe or not, tracing through all dependencies, callbacks, checking data structures, mutexes, ref counts, etc.

And it works the other way, if I change a function that used to be thread-safe to do something unsynchronised, it won't compile any more in users' multi-threaded programs, instead of silently screwing them. Their code may have been perfectly correct before the change, and I couldn't feasibly track down everyone using my function before making a change, but having invariants in the type system automates this checking and communication.

> Just look at some of the bugs found in Rust, it is just the same old nonsense as everywhere

You're comparing your perfect self who writes flawless C on the first try with some random guy's library.

Properly designed Rust written by flawless Rust programmers is also bug-free.

Language safety is a human problem (exists to catch mistakes), and it's hard to sensibly argue whether your imaginary average C programmer is better than mine.

Rust's claims aren't absolute, so aren't disproven by a single counter-example (https://infosec.exchange/@littlealex/116838684458539473)

It's better to look at broader data, e.g. https://github.com/rust-fuzz/trophy-case - look how much lower typical severity is there.

And you can look at data from Google where they track drop in defect density in Android as it gets rewritten in Rust. I know all these top engineering companies just aren't as flawless as you are, and that's okay, Rust is for the rest of us.
pornel
·8 วันที่ผ่านมา·discuss
Thinking that C's lax null handling is fine because it traps misses the entire angle of preventing problems by construction, making invalid states unrepresentable.

Having a program potentially crash is very weak compared to eliminating the crashing code path entirely, guaranteed statically. This matters more and more as the programs grow, because series of 99% correct components will take correctness towards zero (failure probability mulitplies), while 100% correct scales.

Non-nullable types not groundbreaking. I'm just using this example, because it's basic enough that C has a relatable counterpart. Although some values are truly optional and Rust still has to deal with those, having &/&mut references that are never-ever NULL (and never dangling, never uninit, never misaligned, never unexpectedly mutated) makes this problem go away for all the code paths using them (which is the majority in practice).

But C completely lacks the real good stuff in Rust, like Send/Sync. You can shake some bugs with tsan, and have a static analyzer try to figure out effects and propagate them across functions, but like all analysis in C, it's hampered by lack of explicit info in the code (heuristics causing false positives), difficulty of performing true whole-program analysis, and dynamic code being a dead-end (unlike Rust where the traits are part of function types). Until you try it, you won't know how awesome it is to write thousands of lines of pervasively multi-threaded code, and have it work on the first try, without a single UAF or data race (and before you say what about deadlocks and higher-level logical races - there are library building blocks which usually prevent these too).

> people think C is much worse than it is because they do not understand what can be achieved.

I've been writing for ~25 years, from microcontrollers to compilers. Rust for 11. I think I have very good understanding of what is possible. C is stuck in 1970s. Rust at least advanced us to 1990's :)

I think it's much more common for people to not grasp how far Rust is ahead, and think it's merely a slight refinement of "be careful, use tooling" approach in C, rather than a shift towards a level correctness never seen in C.
pornel
·9 วันที่ผ่านมา·discuss
Depends how you define "can", because you can invent your own conventions not checked by the compiler, or even make a compile-to-C language.

But more directly, C barely lets you define non-NULL pointers. It doesn't have pointers that guarantee the data behind them is initialized, it doesn't have never-leaves-this-thread data types. Const merely guarantees that you can't (strongly shouldn't) mutate data, not that it definitely won't be mutated by any thread.
pornel
·10 วันที่ผ่านมา·discuss
It's not switching costs, but trust.

There's no congress. There's no policy (they've been making noises about not allowing AI regulation and now they're not-regulating it like a child paying with an on/off switch). The law is whatever Dear Leader's mood is today. It overrides any contract you sign with private companies, and they roll over and take it, because that's how oligarchies work.
pornel
·10 วันที่ผ่านมา·discuss
Technically, absolutely.

Whether it would suit you, depends if you can learn to like Rust's approach of moving more work to the type system. In Rust you do certain things the Rust's way, period. Programmers used to C being unopinionated about everything find that objectionable.
pornel
·14 วันที่ผ่านมา·discuss
Machine-extruded text is not copyrightable, since there was no human creativity involved in producing it.

(and if you argue the US models do produce copyrighted works, then oooops - whose copyright is it huh?)
pornel
·15 วันที่ผ่านมา·discuss
This still criminalizes sharing "adult" information with people who are not on the government's approved list (the things states do to crush dissent are not safe for children.)
pornel
·16 วันที่ผ่านมา·discuss
So that's how the sci-fi dystopias end up using "credits" for their money.