HNHacker News
TopNewBestAskShowJobs

beeforpork

1,293 karma · joined April 6, 2015

submissionscomments
beeforpork··on The strength of the strong force
I want a Higgs bison steak, please! :-) Medium rare!
beeforpork··on Show HN: 1024, a 2048 Puzzle Game
Nice game! Thanks!

Some proposals to improve usability:

The game should notice a stalemate and tell you that you lost (no matter how you rotate: no more progress is possible).

The game should accept a hit of 'Return' to start the new game (it currently seems to insist of mouse interaction).

The game should have a 'fast' mode with less animation so that I can play faster. A single move takes too long! I am impatient! :-)

beeforpork··on Hacker’s Delight (2012)
This is not only about optimisation, but often it provides you the idiom for coding something.

E.g.: 'is x a power of two'? How to write this in a programming language? However unoptimised: how to actually code this test?

HD tells you the idiom: (x & (x-1)) == 0, for any x != 0.

beeforpork··on C99 doesn't need function bodies, or 'VLAs are Turing complete'
But why? Why is this VLA parameter defined this way? It seems totally bizarre and unnecessary, but I suppose it must have been added to the standard to solve some kind of problem? Is the proposal for this feature available and gives some insight?
beeforpork··on A group of activists got leaf blowers banned in the nation’s capital (2019)
I hate these dog poop distribution cannons. Disgusting and loud. Just use a rake if you want to be tidy.
beeforpork··on Cmacro: Lisp Macros for C
Wow, returning a local function from a ({...}) block is sick. I like that.
beeforpork··on Ask HN: What are some cool but obscure data structures you know about?
Cuckoo hashing is really nice: fast O(1) access, amortized O(1) insert. And really space efficient, and it can be parameterized easily for a space efficiency vs. access time trade-off (it is always O(1), but with larger constants for better space efficiency). It is also very simple: basically just an array (plus an algorithm). Unexpectedly simple in my opinion for its good time and space performance.

https://en.wikipedia.org/wiki/Cuckoo_hashing

beeforpork··on Things I wish everyone knew about Git (Part II)
That!

Also, 'git reset' is only dangerous in some modes, e.g., --hard. It's a user experience nightmare to have the same command be nice in one case and dangerous in another, depending on an option parameter. It is a very useful command, so it's likely that you accidentally lose your local changes the one day when you're a bit tired, maybe.

Also, 'git checkout' is used for many good things like, well, checkout. To abuse it also for reverting local changes is a user experience nightmare, too. It should have a different command for that functionality.

beeforpork··on Fe: A tiny, embeddable language implemented in ANSI C
I like lisp. :-)

But your GC mark (fe_mark) is recursive => it's not embeddable. You need to take care to have O(1) stack for the whole system. All functions: no recursion. The gcstack may grow, obviously, no problem, but the system stack must be O(1), because you cannot dynamically grow it in embedded systems. And this includes GC mark. This is the typical problem, so I looked there first. ulisp (lispbadge) has the same problem...

You can make the mark phase iterative by storing the backtracking stack inside the heap cells you're marking. It's no problem, just a bit annoying to debug, but it needs to be done to claim 'embeddable'. Maybe 20 lines more code.

It can be fixed!

beeforpork··on Carbon Language: An experimental successor to C++
OK, I see. Yes, C and C++ syntax is definitely ambiguous without semantic analysis. Maybe this could also be explained somewhere.
beeforpork··on Brazilian Amazon lost 18 trees per second in 2021
Killing the Amazon is a crime. Nothing done in the US or anywhere else changes that, regardless of whether that was a crime, too.

It is also not hypocritical unless you personally cut down a tree, or unless you believe in the collective responsibility of nations. I don't think 'the Brazialians' are responsible for killing the Amazon -- it's probably a minority of people and we shouldn't care which nation they belong too. This is a serious global problem, and it accidentally happens in some country. Neither collective blame nor collective shame will help. This problem must be criticised.

beeforpork··on Carbon Language: An experimental successor to C++
Why use Rust syntax (fn, x:Type, ...)? Syntax is one thing that is not so well-designed in Rust (in my opinion). Also, with the stated goals, it seems a bit unnecessary to overhaul C++ syntax, but then I found no explanation why syntax was changed. So what's wrong with C++ syntax if your goal is a successor of C++?

This now looks to me like a Rust-- instead of a C++++, which is a picture they might not want to give rise to. Because then I'd rather use Rust instead, which then feels like the real thing(tm).

[EDIT: If you think about downvoting, maybe answer instead as I am genuinely interested in this syntax question. I am not trying to be negative, it was just an observation and a question.]

beeforpork··on A doctor who treated Bach and Handel with disastrous results
There is nothing ambiguous about it, because it's the same pronunciation. It's a convention of how this particular name is spelled.

But does German have ambiguities here? Yes, it does. In the instrument 'Oboe', the 'oe' is pronounced as two syllables: long 'o' plus schwa. It cannot be written with 'ö'. It should better be written 'Obohe' (my controversial proposal). And dialectally/regionally, 'oe' may be long 'o' instead of the 'ö' sound, like in the city of 'Soest', which could be written 'Sohst', but then people from that city would complain (about tradition, maybe).

beeforpork··on Statements vs. Expressions
I am puzzled. 'statement' and 'expression' are items of JavaScript syntax (or C or Java or C++ or Perl or whatever). So to explain it, you point to the syntax definition.

This isn't going to be explained satisfactorily by analogies or intuition, and it won't be logical at all, because it isn't, and you could define the grammar with no such distinction or a different set of distinctions as many posters already showed here.

Besides being arbitrary, I also never found this a useful distinction after having programmed in languages that don't distinguish this. And look at how GCC introduced ({...}) to convert back a statement into an expression.

Anyway, to define this, you have to simply list all the things: statements are 'return', '{...}', 'while() {... }', etc., while expressions are '5', 'f(...)', etc. That's it, that's the explanation. No intuition, just a comprehensive list taken from the grammar.

If course there is some rough idea behind it, which explains why there is a difference, but this is a history class, not an explanation: statements do some action, i.e., this is an imperative concept. Expressions have a value, i.e., this is a functional concept.

beeforpork··on Luxembourgish online dictionary (LOD) now available for Mac
d'Kaweechelche huet de Hammbiere wonnerbar geplékt.

Nice!

beeforpork··on Stars in distant galaxies are typically more massive
Nice try, I'd also like to know. But I am afraid no-one here will be able to answer you. But maybe we're lucky -- I'll monitor this thread.

We can never know the answer, because any possible cause was outside of our observable universe. Inside of our universe, time started at the big bang, so there was no 'before' and thus there was no cause, because the cause needs the time to be before the effect.

beeforpork··on Stars in distant galaxies are typically more massive
Nothing stayed where the big bang was, but everything flew away at the same speed. There is a flaw in your imagination, because as a being in 3D you probably cannot imagine how a 3D thing explodes (I certainly can't). Don't think of the universe as sphere-shaped -- it is not a 3D sphere. Think of it as the 3D surface of a 4D sphere.

Why? Let's reduce by one dimension to be able to imagine this: imagine a small thing (a grain of sand) explodes in our 3D world and all the tiny pieces are flying away at equal speed, then the structure that is created by the explosion is not a 3D sphere, but the surface of a sphere, a 2D structure, because where the explosion started, there is nothing left of the original thing, as every particle of it has moved away from that point, so at any point in time after the start of the explosion, the particles are on the surface of a sphere. That surface is a 2D structure embedded into our 3D world, much like the surface of an expanding balloon. In the same way, our universe is a 3D structure, so looked at from the outside (which we obviously cannot do), it is not a 3D sphere, but probably more like the surface of a 4D sphere.

Now imagine us as a dot on a balloon that is expanding, and other stars are also dots on the surface of the balloon. In whichever direction you look, all the stars are moving away from you (the balloon is expanding). You do not need a center of this structure to observe this moving away -- nothing is in the center -- there is no center.

beeforpork··on C++23: Literal suffix for (signed) size_t
This would be great for C, too.

(And now please do not tell me that I should just go switch to C++... Or Go. Or Rust. I am just saying that I'd like this improvement for C, too.)

beeforpork··on Keep the web free, say no to Web3 (2021)
Storing (whistled?) information (that some people might want to suppress) in a blockchain based 'web' seems like a good idea. It sounds like it wants to make removal of published information next to impossible. Is that a bad idea? Is that a thread? Can it be used for large file sharing? :-P

Or did I completely misunderstand the concept?

beeforpork··on Parmigiano Reggiano makers embedding tiny trackers in rind to fight cheese fraud
The rind is very good for cooking sauces. You pull it out afterwards, but the chip could, of course, fall out into the sauce during cooking.

So if they put electronic sh*t into my food, I do not want to buy that anymore.

Probably it does not need to be declared, so I don't even know I am eating electronics.

beeforpork··on What is our hidden consumption of microplastics doing to our health?
This article conflates particles of any size, and often does not even mention sizes, e.g., '28 particles' in a serving of beer? That is imprecise (doesn't mention size) and wrong: probably way to little, as nano particles are used in filtering (clarifying) beer.

The articles also doesn't really tell me how to avoid all that plastic. If 40 percent of human diet contains plastic, then there's hope, so which 60 percent do not contain plastic? This would be really helpful to check my own diet for surprises. E.g., I drink only craft beer and make my own ketchup, in order to avoid nano plastics -- but what elephant do I miss?

The problem is really serious, so articles about this should take more care to be helpful.

beeforpork··on Please Stop Using Grey Text
Agreed!

But it is funny that the article uses grey text itself for the headline paragraph:

    .fc {
        color: rgba(201, 184, 211, 1);
    }
beeforpork··on Can we make a black hole? And if we could, what could we do with it?
Well, yeah, it is weird at first. But once you think about it, it is not unintuitive: if the light was just gone, that would be wrong, too, right? Also, energy == mass, so of course, it is equivalent to throw mass into a black hole or energy. The longer I think about it, the more it is mass that is the weird thing. What is mass? Something like frozen energy...
beeforpork··on Why does pepperoni curl? (2019)
To maximum your nitrosamine exposure, replace peperoni with ham, then add pineapples.
beeforpork··on Cities with Nice Weather
Cuzco is at a high altitude, which is an important metric, too -- it is relatively cold and has lower levels of oxygen.

Algeciras or Tarifa or anything in the close vicinity to Gibraltar is nice, as there is an unusually cool climate that is much more agreeable than other parts of Southern Spain (usually way too hot, e.g., Seville).

Jamestown, St. Helena is also nice weather in your definition, and they speak English. But the humidity may be a bit too high.

How this can be found automatically would be interesting. I was surprised not to find the above places in the article.

beeforpork··on What Is JSON Patch?
Why are pointers strings? They are really multi-indexes, so why are they not arrays of strings (for hashes/"objects") and numbers (for arrays)? This would have avoided the need for escaping and for string operations in general, which complicate the whole thing.
beeforpork··on Mechanical Watch
Frameworks change and get in the way when a new version is released. It is most annoying. The underlying WebGL changes much more slowly, and in a much more controlled way with a focus on backward compatibility. So I do the same whenever I can and ignore frameworks to get rid of a dependency. The boilerplate overhead can be encapsulated very well into homemade JS functions that only change when I change them. And JS + WebGL is not really low-level.
beeforpork··on I Accidentally Deleted 7TB of Videos Before Going to Production
> I Accidentally Deleted 7TB of Videos ...

Spoiler:

But there was a backup that could be reuploaded in time and everything was fine in the end.

beeforpork··on Mechanical Watch
Amazing! He's done it again, I am blown away! Thanks you very much for this unmatched level of documentation quality!
beeforpork··on Python Shouldn't Be the Top Programming Language
"JavaScript is much better than Python!"

I.e., I cannot read that page without enabling JS in my browser... :-)

← PreviousPage 8 of 15Next →