Recent submissions

Comment · 9 months ago
> This is also a big party of why artists don’t earn shit.

The pie that Spotify divides up among the artists is a global one. It's not like you listen to one artist, so they get your 10 bucks every month. You're paying Taylor Swift, even though you never listen to her.

Comment · 9 months ago
The grammar matters also, of course. A pure Python program is going to be much slower than the equivalent Rust program, just because CPython is so slow.

I don't know if this does semantic analysis of the program as well.

Comment · 9 months ago
So it went from parsing at 25MiB/s to 115MiB/s. I feel like 115MiB/s is very slow for a Rust program, I wonder what it's up to that makes it so slow now. No diss to the author, good speedup, and it might be good enough for them.
Comment · 9 months ago
This has to be AI slop text... It doesn't actually say what it does. If you've got a non-compacting GC that's fragmenting memory. If you need to release memory, then you better make sure that the blocks the GC is using are empty, and munmap them.
Comment · 9 months ago
> (not counting emergency and service vehicles)

Just gotta read the last line too :P

Comment · 9 months ago
> The solution to city air pollution is a different vehicle with a different drive train: an EV.

Priority list should basically be:

0. Bicycles 1. Metro 2. Buses 3. EVs

(not counting emergency and service vehicles)

Comment · 9 months ago
> chicken breast is more than twice as "good" ratio wise.

Yes, at more than twice the price for me.

> for the average person's protein intake, yes.

The average person doesn't need that ratio, reaching 60-90g of protein is trivial. That ratio is good for bodybuilding purposes. Now, eating that much tofu, that sucks. Generally, getting 200g of protein sucks, even when you eat protein powder.

Comment · 9 months ago
I'm on a M4 Macbook, and I can see it. I'm inclined to totally accept the blog author's experience as true for them, I'd probably experience the same thing.
Comment · 9 months ago
Tofu's ratio is really good, though? I can get 162kcal/18g of protein tofu here. Anything where P*10 > KCAL is a very good protein source, imo.
Comment · 10 months ago
I am not, how did they solve that?
Comment · 10 months ago
I can't edit my comment any longer, but I really like nullprogram.com
Comment · 10 months ago
void* is basically used for ad-hoc polymorphism in C, and it is a vital part of C programming.

    void new_thread(void (*run)(void*), void* context);
^- This let's us pass arbitrary starting data to a new thread.

I don't know whether this counts as "very few use cases".

The Memory Ownership advice is maybe good, but why are you allocating in the copy routine if the caller is responsible for freeing it, anyway? This dependency on the global allocator creates an unnecessarily inflexible program design. I also don't get how the caller is supposed to know how to free the memory. What if the data structure is more complex, such as a binary tree?

It's preferable to have the caller allocate the memory.

    void insert(BinTree *tree, int key, BinTreeNode *node);
^- this is preferable to the variant where it takes the value as the third parameter. Of course, an intrusive variant is probably the best.

If you need to allocate for your own needs, then allow the user to pass in an allocator pointer (I guessed on function pointer syntax):

    struct allocator { void* (*new)(size_t size, size_t alignment); void (*free)(void* p, size_t size); void* context; }.*
Comment · 10 months ago
No, it's not? Using a VM is one way of preventing buffer overflows, it's not orthogonal.
Comment · 10 months ago
> A stack based machine? Why?

The JVM being a stack-machine is probably the least controversial thing about it. Wasm, CPython and Emacs all also have a stack-based bytecode language. The value, of course, comes from having a generic machine that you can then compile down into whatever machine code you want. Having a register machine doesn't seem very useful, as it's completely unnecessary for the front-end compiler to minimize register usage (the backend compiler will do that for you).

Specifying classpath isn't fun, I agree with that. Launch performance isn't good, and is generally a consequence of its high degree of dynamicism and JIT compiler, though of course there are ways around that (Leyden).

> I've written entire programs in JVM bytecode, without a compiler, and I see very little of value in it

I agree, I also see very little value in manually writing JVM bytecode programs. However, compiling into the JVM classfile format? Pretty darn useful.

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton