Better HN
topnewbestaskshowjobs
Log inSign up

sapiogram

922 karma · joined Aug 18, 2014 (12y ago) · 345 submissions

Submissions

comment 2y ago · link · parent

Both statements don't need to be true. The compiler just has to prove that at least one of the statements will always be true.

comment 2y ago · link · parent

As long as overall power consumption keeps decreasing, yes.

comment 2y ago · link · parent

Does anyone know what they mean by "set-theoretic types"? I'm a PL nerd, but I've never heard this term before.

comment 2y ago · link · parent

Given how long arm64 took them, my guess is "3 years after major cloud vendors start offering risc-v VMs".

comment 2y ago · link · parent

4c/8t gives more throughput than 4c/4t.

comment 2y ago · link · parent

> there is hardly a reason to keep hyperthreading around.

Performance is still a reason. Anecdote: I have a pet project that involves searching for chess puzzles, and hyperthreading improves throughput 22%. Not massive, but definitely not nothing.

comment 2y ago · link · parent

Wouldn't it be even more frustrating if your opponent was constantly picking up pieces when thinking?

comment 2y ago · link · parent

Earlier this years, Github would routinely say "2 years ago" for comments made 11 months ago.

comment 2y ago · link · parent

What's RISC about adding more registers?

comment 2y ago · link · parent

For large (>10m) telescopes, it doesn't matter much, because no one is building rockets with big enough fairings. Even if the cost of launching to LEO was $0, in-orbit unfolding/assembly is a bottomless hole of engineering complexity that you cannot avoid. Again, see JWST/ISS.

comment 2y ago · link · parent

The largest filled-aperture radio telescope in the world has a 500-meter diameter, and reportedly only cost $180 million. For comparison, the International Space Station costs $3 billion per year just to operate. Doing stuff in space is expensive.

comment 2y ago · link · parent

They will survey the entire sky every week or so. At the end, you can create a nice 60 fps timelapse of many objects in the southern sky.

comment 2y ago · link · parent

Note that rustc will not emit this instruction by default, to support older CPUs. Without `target-cpu=haswell` or similar, the operation will be quite slow, but still O(1) of course.

comment 2y ago · link · parent

Thank you for your response. I think your final remark was unnecessary though, I think less people asking stupid questions just leads to more confidently incorrect non-questions, which is not an improvement.

comment 2y ago · link · parent

> You are still dependent on foreign inputs that are dependent on the Dollar or Yuan payments

For Russia in particular, do we have some idea of how true this actually is? Russia lacks a lot of things, but natural resources is generally not one of them.

comment 2y ago · link · parent

> 1) the memory speeds are increasing and approach those of the CPU ― that's definitely not true today;

What does "speed" mean here? Latency? Bandwidth?

comment 2y ago · link · parent

I'm not familiar with ocaml, but the LEA thing can reasonably be fixed by a better compiler, no? Is there no LLVM backend for ocaml?

comment 2y ago · link · parent

That's an entirely different concept imo. Overloading in Rust would be to have separate `Vec::new()` and `Vec::new(capacity: usize)` functions, which is not allowed.

Case in point: Java does allow exactly this, while also allowing classes to implement interfaces very similarly to how Rust structs can implement traits. Rust code sometimes uses traits to achieve similar results, like the `slice::get(index: SliceIndex<[T]>)` function, but the example above can't be done.

comment 2y ago · link · parent

That can't really be the main reason, Rust is doing just fine without it.

comment 2y ago · link · parent

> I don't see why did you label Aliaksandr Valialkin, the author, an "expert". I mean, he's no dummy but what exactly makes him an expert on optimizing Go code?

I was trying to convey the meaning of "far more experienced than the blog post authors", but without having to insult the authors. It's a good writeup after all, and I'm glad they took the time.

We must have some different interpretations of what "optimized" means. This is the very first piece of code in the file you linked:

  func (fc *FieldContext) NextField(src []byte) ([]byte, error) {
      if len(src) >= 2 {
        n := uint16(src[0])<<8 | uint16(src[1])
        if (n&0x8080 == 0) && (n&0x0700 == (uint16(wireTypeLen) << 8)) {
            // Fast path - read message with the length smaller than 0x80 bytes.
            msgLen := int(n & 0xff)
            src = src[2:]
            if len(src) < msgLen {
                return src, fmt.Errorf("cannot read field for from %d bytes; need at least %d bytes", len(src), msgLen)
            }
            fc.FieldNum = uint32(n >> (8 + 3))
            fc.wireType = wireTypeLen
            fc.data = src[:msgLen]
            src = src[msgLen:]
            return src, nil
        }
    }
    // ... function continues beyond this point

As far as I can tell, this entire codepath exists solely as an optimization. I spent many years working on a chess engine for fun, so I'm pretty well versed in bit twiddling, but I'm seriously struggling with this. Like, is it doing `(n&0x8080 == 0)` to check to whether length is less than 0x80? Is that even correct?

I think "hyper optimized" is a completely fair characterization. But we clearly work in different industries.

comment 2y ago · link · parent

The Go code is already hyper-optimized by experts, just not by the blog authors, so you don't read about it here. As someone who has tried to write high-performance Go code on occasion, I can assure you that a ton of digging would have been required on that side as well.

comment 2y ago · link · parent

I haven't dug into the code, but it's clear that the Golang library has had a ton of optimization work put into it by very knowledgeable people. Techniques like object pooling are highly error prone, and certainly not "out of the box" Golang.

The Rust code and the blog post, on the other hand, seem to be written by someone less familiar with Rust and high-performance parsing. I think they would have avoided all their problems if they just used lifetimes to safely avoid copying from the start, instead of relying on increasingly elaborate workarounds like the `Bytes` crate. Apart from one "forces one to deal with the contagion of lifetimes" comment in the conclusion, they never mention why they didn't do this, even though it's clearly the idiomatic Rust solution. Maybe they had technical reasons for not doing lifetimes, but to me it just seems like unfamiliarity with Rust.

comment 2y ago · link · parent

> I am guessing it’s the Rust stuff that caused the performance hit

From Github's code stats, Zed is 97.3% Rust, so Rust is almost certainly both the problem and the solution here.

comment 2y ago · link · parent

Nope, and I don't think Google will publish concrete numbers anytime soon, if ever.

comment 2y ago · link · parent

> lower emissions

Do you know of any cloud providers that publish actual data for this? Preferably verifiable, but I'll take anything at this point.

comment 2y ago · link · parent

Why?

comment 2y ago · link · parent

Javascript is even better, by not having multithreading at all. I am not joking, Go is much worse than Java and C#, but Javascript and Rust are the only mainstream languages where I've seen non-experts reliably write correct concurrent code. Maybe it's true for langauges like Elixir as well, but I haven't tried.

comment 2y ago · link · parent

> Please. Stop posting about async/await here.

I agree with everything else you said, but that's all the more reason to post it imo. The misconceptions aren't going away just because you don't hear about them, and every time I hear the different arguments, my own understanding grows a little bit. It's annoying, but quite healthy.

comment 2y ago · link · parent

I think your theory makes a lot of sense if you reverse the causality: Mammals have evolved to not engage in cannibalism to avoid prions. Other diseases as well, of course.

comment 2y ago · link · parent

Well, names are useful for the same reason people's names are useful. The rest just kinda happens naturally, I think.
1
678
12