Better HN
topnewbestaskshowjobs
Log inSign up

staticassertion

13,486 karma · joined Jun 1, 2016 (10y ago) · 4,896 submissions

@insanitybit
Submissions

comment 4y ago · link · parent

> make these wildfires a non-issue for breathing.

Unless you're one of those weirdos who... goes outside.

comment 4y ago · link · parent

That sort of "flow typing" is extremely cool and I'd love to see it added to Rust. Perhaps something like mypy's proposed TypeGuard.

comment 4y ago · link · parent

I think that's obviously a matter of opinion. I don't think Rust is hard to read at all, nor do I think of it as being particularly sigil heavy, but that's me. I think the syntax is probably unfamiliar for some, and familiarity is almost always what people mean when they say "readability".

Coming from c++, Rust was pretty familiar. PHP isn't that hard to read either.

comment 4y ago · link · parent

I guess, but if you're just building some basic CRUD app that's never going to change, why would iteration speed matter anyway?

comment 4y ago · link · parent

The time it takes to run `cargo check` is nothing compared to dealing with bugs, terrible tooling, weak errors, etc. All of those areas have been radically better with Rust.

As an example, type errors in Rust are radically better than mypy, it's no competition. In general rust's type system is just way better, we have to use Any all over the place because mypy can't even handle a Json type (no recursive types at all).

There's nothing that Python really does better in terms of iteration that I can think of. Obviously you don't have to compile code, but `cargo check` is seconds, that is not the bottleneck. We use hypothesis in Python and quickcheck in Rust, cargo is way better than pip, working with loosely typed data is about the same in Rust, maybe a bit better, and working with strictly typed data is wayyyy better.

The tooling for working with crates, having an actual lockfile, higher quality libraries, etc. It just all makes Rust more productive.

We've run into maybe one rust footgun, which is that binding to _ drops the value immediately. We've run into so many Python footguns, like, did you know that in Python if you want to do circular imports you need to put your imports at the bottom of the file? Or use absolute imports everywhere? Neither of which seem to work 100% of the time by the way, something that makes writing graph data structures quite cumbersome. The other day we ran into a stray comma turning a value into a tuple. The papercuts and footguns across the tooling and language just add up really fast and basically don't exist in Rust.

I don't know how people get stuck on the borrow checker, frankly. It's one thing if you're very new to the language, but within weeks it should be very simple to avoid those errors. I maybe hit a "fuck, what" borrow checker issue once a year, in which case I hit up the Discord, they fix it, and I file an issue with rustc so that the error message will get improved.

This is based on about 7 years of Rust and Python experience, with 6 years of professional experience in Python and 3 in Rust.

comment 4y ago · link · parent

Nope, it's written correctly as-is. Probably the "time to tests pass" is about equal, but the iteration and maintenance is far better in Rust.

comment 4y ago · link · parent

How so? We use many of the crates listed on the linked page - sqlx, rusoto, actix-web, tower/tonic, etc.

comment 4y ago · link · parent

The code used for it looks like someone ran a compiler over it and then dumped the output lol it's... extremely hard to read.

comment 4y ago · link · parent

> They're surely not talking about compilation times.

Correct.

comment 4y ago · link · parent

Go is closer to old versions of Java than C.

comment 4y ago · link · parent

I think it's more of a Rice's theorem/ halting problem issue than an incompleteness theorem issue.

comment 4y ago · link · parent

My company has its code basically split in half between Python and Rust. Our Python code uses mypy pretty aggressively. The iteration speed difference is... drastic. Rust far outshines Python in terms of our ability to get something done, maintain it, and iterate on it over time.

comment 4y ago · link · parent

It just seems like an extremely niche, difficult problem, whereas CRDTs are a very general tool.

edit: Oh you edited your post there's way more now, but I can't read it all now x_x but fwiw when I said "anyone else" I meant that I use crdts.

comment 4y ago · link · parent

I don't really understand why every single article on CRDTs is about collaborative text editing. Is no one else bothering to build systems with CRDTs outside of this space?

Not to detract from the article, which I found interesting for a number of reasons - both in terms of the technology and future of that technology as well as the personal realization of "the thing I'm building won't be necessary one day".

comment 4y ago · link · parent

IO is necessary because of purity, but it's in no way enabled by it. You don't need purity to have the IO monad, and you don't need purity to enforce that IO is defined in a type signature.

comment 4y ago · link · parent

That seems easy to optimize out, especially given rust's mutability guarantees. If I have a u8 and I index into an array in a loop the compiler should be free to cast it to a usize above that loop, right?

The benefit being you can store much smaller structures, plus in the case of memory unsafety you reduce attacker control.

The vast majority of strings I personally use are certainly well under 2^32 bytes, and most are probably under 2^8.

comment 4y ago · link · parent

I'm not advocating for Uber and Lyft or a free market or whatever, but isn't the "free market accounting for it already in the ride price" exactly because they adjusted their prices?

comment 4y ago · link · parent

All of that gets removed though

comment 4y ago · link · parent

> This means that a time.Time pointer has the same GCShape as an uint64, a bytes.Buffer and a strings.Builder.

> In the current implementation of Generics in 1.18, every runtime invocation of a generic function will transparently receive as its first argument a static dictionary with metadata about the arguments being passed to the function.

> That’s right, after the monomorphization step, the generated function shape needs to take as a runtime input the virtual method tables for all its generic arguments.

What an odd design. I'm curious to read the justification for this. I assume it's faster compile times.

comment 4y ago · link · parent

> currently do not believe we can achieve AGI (ever).

Do you mean with embeddings as the approach, or in general?

comment 4y ago · link · parent

We have a log processing system that performs entity resolution and merging of data. It does this without synchronization, out of order, in parallel.

What that means is we may get N records referring to the same 1 entity. We incrementally build that entity as records come in. Regardless of the ordering of the updates, we always end up with the same information in that entity.

In our case this is for security analytics. This lets us process data from arbitrary sources, with arbitrary ingest cadences, and build a single graph of entities and relationships. Every property has a merge strategy.

The exception to this is that we also have immutable properties. These are contract based - we store the first write and assume that the value will never change, and it's up to the client to only mark immutable data as immutable when that is correct.

comment 4y ago · link · parent

> In a certain sense, this means that everything written in Python is memory unsafe.

CPython is also less aggressive about adopting mitigation strategies compared to Rust, although it has improved a lot in the last few years.

comment 4y ago · link · parent

I forgot to link it... https://eprint.iacr.org/2019/1492.pdf

comment 4y ago · link · parent

Keep in mind that openbsd has a tiny base install, so it's not exactly surprising that there aren't a lot of remote exploits. Nothing's listening by default, so why would there be?

By the time you set up OpenBSD to do anything, that's gonna change.

comment 4y ago · link · parent

That does not sound right. Are you talking about RSA?

comment 4y ago · link · parent

The "Too Much Crypto" paper is pretty reasoned.

See section 5.2, and 5.2.3 - "Should we care?"

comment 4y ago · link · parent

Yeah, I should have elaborated. Like, fundamentally you want to express "caller has capability x", and coloring does that. But coloring isn't ergonomic, so some languages try to infer their way out of it or hide it. But I'd rather they instead just make these things more explicit and lean into it a bit more, like in a capabilities system.
1
495051
164