skysight-inc/HackerNews huggingface dataset:
I’m also not much of a Go programmer, but looking at the benchmark code[1] it doesn’t actually use the values after they are retrieved, so if the compiler is smart it may never have to check the type at runtime. It does, however, have to wrap the primitive in the `any` type, which seems to be what’s making it slow.

Question for Go programmers: does using the `any` type result in an additional memory lookup if the wrapped type is a sized primitive like an int, or is the value stored directly alongside the type information?

[1] https://github.com/sekoyo/deque/blob/86df0003850acaf3039c2d6...

Edit: I wrote that before you added the second paragraph, which sounds right to me.
The article doesn't live up to the title. I'm still not sure why I should care.
Isn't the main problem with the utilitarian views presented here that they are deeply hedonistic?

Yes, if you only care about pleasure, you will make horrible moral choices.

Now if we include in our definition of goodness things are are actually important like survival, stability of order, justice and fairness, scientific and personal progress and so on, we might get more practical. Of course then these decision become multi-dimensional and and highly dependent on your personal priorities but that is the real world for you.
I think it's important to understand that "being free" and "endorsed by FSF" are two completely distinct states. It's not enough to be fully free to get endorsed - FSF has their right to decide fully arbitrarily what's acceptable enough to endorse it and what isn't, and being technically free is just one of the aspects they are considering. Endorsement isn't technical, it's political.

> the FSF considers the whole OS nonfree

As an example, the FSF does not consider Debian nonfree - they even acknowledge that "Debian is the only common non-endorsed distribution to keep nonfree blobs out of its main distribution"; they just don't want to endorse it because it points people to nonfree software. As a user, I don't mind that it does so I use Debian, but FSF is free to not want to endorse it because of that.
It was a nice read. Having gone through the experience first hand(engineer from India), the situation is true and in dire need of change. Growing up, I always hated the idea of incentivising the ability to memorise something versus actually understanding how something works or why. And as the article says I was on the minority and left out of the race.

To my great surprise, when I landed in the US to do my masters degree, there was no need to memorise most stuff. Heck you can even bring your book to the exams. The exams tested one’s ability to _apply_ what they should’ve learnt in the course. It felt so great.

Then came the experience of watching schools in Denmark. The kids are taught to be independent right from kindergarten and never suppressed by saying “you should not do this because I say so”, instead being told - if you do this, this will happen and it will hurt/cause pain/make _ sad etc. Kids are treated as mini adults whose thoughts and opinions are counted. This never occurred in my childhood. Their school is more fun than the toil that I experienced going to school in India(sitting in a bench being pushed to take notes of all the facts thrown at me with the fear of being able to cough it up during a test). Kids in Danish school system probably does not hear about all the things possible in a field, but learn the basic principles practically which is great. The exams seemed to be more a combination of a written test and an “oral test” that is more qualitative than quantitative approach to evaluating someone.

I wish the Indian education system learns from other approaches and move away from creating rat races.
No, but the people in this case are not random, their death somehow saves billions, which means it very different from killing random people on the street.

In fact, we make far worse moral calculations than that frequently. Eg, if you've ever supported a war, you've agreed with killing completely innocent children, often in horrible ways, for the sake of whatever benefit the war might have had for the side you support. And there have been plenty wars fought for reasons other than self-defense. Take Iraq and Afghanistan for instance.
Would you ride a €1000 motorbike and trust it? Also, how good are you at maintaining them to pass the yearly inspections?
I appreciate you say this with humour. But if you voluntary or due to circumstances out of your control cannot distract you brain... At least nine starts thinking. The energy cost is high, but I always end up with a very profound experience and some great outcomes.

So I wouldn't cross out "staring at a wall" as inarguably invaluable. It's what's going on in your head when you do it. Same as when reading that book.
French here. Thank you.
Exactly. Go was (still is tbh) slow. that is why these improvements are possible. Fast is relative ofc but if you are going to introduce the words "low level" in your description then don't be surprised when C/C++/Rust rear their ugly (but very fast) heads.
Issues with MMAP
We should really start teaching basic epistemology in elememtary school and then expanding upon that in secondary schoool.
Yep. The creators of the standard spoke to this:

"The three-fold definition of compliance is used to broaden the population of conforming programs and distinguish between conforming programs using a single implementation and portable conforming programs.

A strictly conforming program is another term for a maximally portable program. The goal is to give the programmer a fighting chance to make powerful C programs that are also highly portable, without demeaning perfectly useful C programs that happen not to be portable. Thus the adverb strictly.

By defining conforming implementations in terms of the programs they accept, the Standard leaves open the door for a broad class of extensions as part of a conforming implementation. By defining both conforming hosted and conforming freestanding implementations, the Standard recognizes the use of C to write such programs as operating systems and ROM-based applications, as well as more conventional hosted applications. Beyond this two-level scheme, no additional subsetting is defined for C, since the Committee felt strongly that too many levels dilutes the effectiveness of a standard.

Conforming program is thus the most tolerant of all categories, since only one conforming implementation need accept a program to rule it conforming. The primary limitation on this license is §2.1.1.3. "

It turns out it's not an all-or-nothing thing. Not being "strictly conforming" is not a "breach of the contract" by the developer, and thus license for the compiler to do anything they want.

See also:

"Existing code is important, existing implementations are not. A large body of C code exists of considerable commercial value. Every attempt has been made to ensure that the bulk of this code will be acceptable to any implementation conforming to the Standard. The Committee did not want to force most programmers to modify their C programs just to have them accepted by a conforming translator. "

http://port70.net/~nsz/c/c89/rationale/a.html
Even in these microbenchmarks it’s not 10x.

Boxing can be faster or slower depending on the context. For example, if the objects you are storing are large, unboxing them (rather than storing pointers to them) could well make the queue perform worse, as extending the arrays will require more memory to be copied.

There’s no doubt that the unboxing permitted by (Go’s) generics will sometimes lead to better performance. But I think that the article is exaggerating.

> TBH it's 2022 and it seems that "Go" devs are just seeing fire for the first time in their lives.

Come on, let’s keep this patronizing and flamey kind of commentary off HN. I for one am a language nerd who’s tried plenty of languages with various forms of generics. I’ve even been paid to write Haskell code! That said, I was pretty happy with Go without generics.
Not giving the programmer a choice and forcing them to be pragmatic was one of the main selling points of Go. Allowing generics at all will likely make them seep into he ecosystem over time and destroy part of that value proposition.
Brave essentially plays the advertisement business well.
They advertised with speed and privacy for the majority time while not providing anything more than a adblock build into the browser.

The browser is still very crypto based and comes with their own build in add service and crypto currency.

Only very recent they started to add some fingerprint protection, its still only a very small subset of fingerprinting but it potentially blocks some approaches of it.

There is still a big question mark about the browser, because the base building block of privacy is trust and Brave has many times showen that it might not a trustworthy company with issues that only got addressed after public outrages.
> My dream ebike does 35mph

A human body travelling at 35mph is likely to suffer serious damage if it collides with the road surface. I hit the road going at about 15mph, and suffered concussion, a fractured jaw and the loss of two teeth. I needed 15 stitches in my lip. At twice the speed, it would have been much worse.

Motorcycles go much faster; but everyone knows motorcycles are dangerous, so motorcyclists wear leathers, gauntlets and a helmet. And they still get injured a lot.
As a tl;dr for people not familiar with web3. Doing things in the web3 that change the Blockchain (like buying nfts for example) has a large cost on "gas" (ie fees you pay for your transaction to be included in the Blockchain). These are more that $30 euros and may go up to $80 euros (depending on what you want to do). So if you want to buy an nft for like $30 you will pay $30 more for the ethereum fees. This makes web3 viable only for very expensive stuff, making it more or less non usable and defeating its whole purpose.

The solution to that is stuff like polygon which is an ethereum compatible network ( meaning that smart contracts that run on ethereum can be also deployed to polygon without changes) and has minimum fees. The same thing that has $30 fees on ethereum will have line $0.01 in polygon. So polygon can be easily used for all kind of stuff without the need to pay the heavy gas premium.

This is possible because polygon uses a different concencus model (proof of stake) than ethereum (proof of work).
But they really meant it.

See also the different conformance levels and the rationale given for them.

http://port70.net/~nsz/c/c89/rationale/a.html
It's not about replacing cars, it's about replacing all those short car journeys. I understand that people are just lazy and take the car for a 1km trip, but with a bicycle you can do the same trip, usually faster. If you don't need to commute to work more than say 5km, then the car isn't your best option, the bike is.
Once you got rid of your car, for those few cases where you need to haul big loads or multiple people just rent a car.
Throwing out utilitarianism in ethics because you can't exactly calculate which actions precisely correspond to the brightest futures is a lot like throwing out mathematical modelling in engineering because you can't exactly calculate which arrangements of atoms precisely correspond to the most optimal bridges.

I'd be more open to questions about how a rational person might figure out what the best things to do are in the face of uncertainty, if the article's examples didn't include things like should we torture Jewish people for the enjoyment of Nazis? The right intervention to that is much more baseline, of actually stopping to think about what one is saying.
Alas, I can no longer find it. :-(

However, the rationale is quite clear on most of this.

http://port70.net/~nsz/c/c89/rationale/a.html
You can just verify using any language with powerful optimizations and whose generic system supports both boxed and unboxed generics, e.g., Rust.

The difference between passing an unboxed generic and triggering monomorphization vs passing a boxed type-erased generic is night and day in terms of performance.\

Boxed generics generate one version of the code that need to work for all types, independently of layout, and dispatch via the generic ABI (aka `interface {}` in Go).

Unboxed generics generate one version of the code per type, removing memory allocations, and allowing the compiler to optimize the function for each type and each layout independently.

This increases code size and compilation times, but in many cases allows dozens of compiler optimizations that aren't possible for the boxed generic case. The code produced by these optimizations allow others to run, etc. And a 100x improvement in perf isn't uncommon (i've seen order of magnitude larger improvements and regressions in perf than that from switching back and forth between boxed and unboxed generics in Rust).
Having the knowledge of 2022 this can be said about any web application or anything one exposes to the internet to be accessed by randoms.
PHP has a pretty good deployment story in FPM since 10+ years. Every worker can run in a read-only chroot, or with separate uids.

Wordpress has only one entrypoint and only needs to write to its data directory, so it's quite decent.

The big issue with wordpress is with the vast plugin system, where all bets may be off depending on what you run.
Most if not all these supposed dilemmas are the author missing to account for the aftereffects.

Organ harvesting:
How bad is the fear in every healthy person for risking to be harvested? Healthy people are much more that people in need organ transplants.
How that fear condition their life. Is range generated? With what effects on in need organ transplants?

Framing the innocent:
If the action from sheriff comes out and don't get punished what's the effect in people that that fear to be framed for no reason? What's the effect for people losing trust in justice?
If you need just a temporary guilty just fake it as long as you find the real criminal or you improve the situation with other means. Obviously situations abstracted from the context and for others lines of actions lead to absurd solutions.

Deathbed promise:
Considering the aftereffects of this case are so complex that giving a clear response is quite complex at best.

Sports match:
Just save the person and let the other people know that they helped to save a person in need.
Gratification will be much more that annoyance for short interruption and memories for that extraordinary events will be good too.
If the person was just experiencing a little distress for the latest minutes of mood landing just let him experience it. Utilitarianism let you balance different situations.

Cookie:
If we are talking about cookies who care. If we are talking about reward we can balance two things:
- a gentle act toward a mad person can have much bigger effects
- letting people know that good people get rewarded can generate more good people and more good with time

The Professor and the Serial Killer:
Professor do good mainly with his work and with his personal life. Charity is only a small part.
How being a lawyer would affect this total outcome? These more money he earn come from somewhere. What's the total effect?

Excess altruism:
An altruist get joy from helping others so giving the cookie to Sue the total pleasure is maximized.
Does anyone have an idea whether there is a potential hobbyist market for home-grown chips of this size? I know that I would definitely be willing to spend around $100 for a much smaller chip, like quad-gates or slightly above (1200 transistors is way beyond what I thought is possible in a garage), more the larger the chip gets, and ultimately including getting involved in the design of the chip -- but then of course paying for all failures resulting from that.

The upside, compared to things like Europractice or MOSIS being lower one-time costs and lower turnaround time, but higher per-chip costs, which matches very well with the "hobbyist" target.

I long thought that this would be a nice niche market, but I never found any clue about whether these are realistic numbers or if anyone else would be interested in that.
> TL;DR The Go standard runtime allows for asynchronous coding while allowing the developer a simply synchronous interface.

I didn't read the article but this TL;DR captures the essence of simplicity of programming in Go when writing IO apps. Go essentially optimizes for the majority case: run these things one after another. All the await/async fluff in other languages is evidence of poor/old language design. Every non-trivial production code you see these days in Javascript is littered with await/async as is the case in Python, etc. Why the heck do I have to repeat a keyword 1000s of times when that's expected in majority of languages.

Yes, Go may not cover every case perfectly (e.g. mentioned by sibling re CGO blocking OS thread), but when you look at real world stats of how often this is an actual issue, you find that it's almost noise (i.e. do a code search across Github for instance for such workarounds).
Brake cables need periodical exchanging. Many people don't do this for some reason. A well maintained brake cable will support your whole weight, one that is ignored for a decade or so will snap when you need it most.

There is no periodical roadworthyness review for bicylces, if I look at the things people sometimes cycle on I shudder. Broken / not properly tensioned spokes, cracked rims, missing brake pads, brakes not working at all, fixies, broken ball bearings, skipping chains etc. Bikes need maintenance, like every other vehicle.
Let me wade in: I think what you're saying is plausible, because the CPU cache should be an important variable here. Boxing should cause cache misses.
It means ignoring the situation and emitting the code that the programmer wrote. The programmer did not write "put this array in registers". The programmer did write "access element 6 of this array".

This isn't hard.

"Keep the spirit of C. The Committee kept as a major goal to preserve the traditional spirit of C. There are many facets of the spirit of C, but the essence is a community sentiment of the underlying principles upon which the C language is based. Some of the facets of the spirit of C can be summarized in phrases like

- Trust the programmer.

- Don't prevent the programmer from doing what needs to be done.

- Keep the language small and simple.

- Provide only one way to do an operation.

- Make it fast, even if it is not guaranteed to be portable.

The last proverb needs a little explanation. The potential for efficient code generation is one of the most important strengths of C. To help ensure that no code explosion occurs for what appears to be a very simple operation, many operations are defined to be how the target machine's hardware does it rather than by a general abstract rule."

http://port70.net/~nsz/c/c89/rationale/a.html

> calling scalar replacement of aggregates a weird optimization is very strange.

No it's not, certainly for arrays. It's a little less weird for structs than it is for arrays. But the fact that you consider calling it weird "very strange" is telling, and to me the heart of this disconnect.

The Optimiser-über-alles community feels that the needs of the optimiser far outweigh the explicit instructions of the programmer. Many programmers beg to differ.
I agree with most of this (apart from the weirdly American bit about not wanting to design cities well because that would not be "freedom").

I got hooked on cycle commuting years ago, and although they were basically impractical at that point I vowed that if a job was out of range of my own power I would definitely get an e-bike rather than use a car. I never needed to, but that decision has only become easier as evokes have improved.

I looked at buying an e-bike recently, and for me and my needs, they still don't make sense. The extra cost, weight and complexity don't offer sufficient benefits over a cheap light, reliable non e-bike over the (short) distances I cycle.

But I've been following the same developments as the author and think they're definitely going to change the world, and for the better. America will lag, but I'd look to places where 2 stroke engines are currently popular to see the future. E-mopeds and e-tuktuks are going to be built for non cyclists, and that's where the new transport ideas will arrive in mass manufactured form.
If only they'd had them from the beginning and not bolted them on
Thanks, i'm in Bay Area :) Australia is great, and it has been popular with Russian/Ukranian/etc immigrants too. I read some are trying to start a space port there.
That's not all that relevant. Bikes need maintenance too. And indeed, e-bikes are often vastly overpriced.
Is There Any Problem with Test-Driven Development and Unit Testing?
“Don’t make sophisticated arguments in public because they might confuse stupid people” is reasonable, but you need to work out the implications.

Do non-stupid people have some alternative forum to have sophisticated discussions with each other? If so, you’ve replaced an open society of free expression with a society with a gatekeeping intellectual elite that does everything behind closed doors. And if not, you’ve literally imposed an artificial cognitive handicap on your whole society.
You are right a lot of jobs out there are meaningless crap that build some pathetic e-commerce just for profit and people working there, are in for it just to pay bills. On the other hand you can be a poor scientist and do meaningful work which contributes to science, society and people's life.

In both cases you won't be very happy. The trick is finding a balance between sort of meaningful and interesting work that also pays well enough. If you are lucky you can get that in something like a FAANG.

Also happiness is relative to the person you need to find what it means to you.
Skimming the code it looks like one operation is 10 push front, not just 1.
Great article, but as a dev working in the crypto sector, I can guarantee you that many people in the sector are strongly opposed to proof of work.

All these points are things I regularly bring up to bitcoin maxis. Usually they fall on deaf ears, but occasionally it does get through to people.

I think it's disingenuous to lump in all crypto with bitcoin however.
We can already see the comparison in the benchmark in the original blog post.

I edited my previous post to point out that I’m familiar with Rust and other trendy languages. Please don’t assume that I’m not just because I don’t also hate Go.

The speed up (or even slow down!) from boxing is highly dependent on the nature of the code, the size of the relevant type, and the usage patterns for the data structure.

In the context of a generic data stucture, unboxing is not likely to unlock a huge number of optimizations. This is in contrast to e.g. generic code for performing matrix operations, where unboxing could make a huge performance difference.

My original post said “A generic data structure is exactly the kind of code that you wouldn’t expect to perform better with generics.” You then responded by taking about performance improvements deriving from autovectorization, which are relevant to generics in general but not to generic data strucures like a deque.
Why not simply take the dice result not literally, but as index to a mapping table there 2 or 12 is swapped with 7?
> If the global bitcoin network is not designed to cope with a miniscule fraction of the global payment volumes and doing so at massively higher energy costs, how could it ever scale to take over from centralised currencies? And if it cannot do that, then it’s only purpose is speculation and - based on its volatility - gambling.

yes it's a massive pyramid scheme waiting to collapse. all the working class folks who are miseducated and not able to see it for what it is in time will pay a very heavy cost when it does collapse.
You can run that many Erlang processes or more.

Millions is typical of green thread implementations.