skysight-inc/HackerNews huggingface dataset:
> I've also read that await() basically preempts the currently running function. How does this work?

So async/await work by having the compiler do a mechanical transformation of the function. If you have code that looks like this:

async function foo() {
let x = await bar();
await baz(x);
}

The actual code that gets generated is something like this (this is off the top of my head, forgive any transcription errors):

function foo() {
let x = undefined;
return Promise.resolve(null)
.then(() => bar())
.then(function (val) {
x = val;
return baz(x);
});
}

In other words, the async and await keywords work together to tell the compiler how to properly transform the function into the necessary async API: the async keyword says that the function needs this mangling, and the await keyword tells the compiler where the possible re-entry point is.

So, with that in mind, let's answer your main question:

> Why can't non-async functions use await()?

The shortest answer is that the semantics of doing the necessary transformation to support await in a function which doesn't opt into that transformation are hard to design and even harder to use.

Fundamentally, adding async to a function changes the API of the function [1]. In JS, it causes a function to return Promise<T> instead of T, and this API change can be done even without having any await keyword in the body of the function. Similar changes happen for other languages, just substitute Promise for whatever variant of will-resolve-in-future API is in that language.

In principle, it's possible to support such a scenario by making such an await just "run" the promise to completion. But here you run into issues with how the runtime handles asynchronous tasks. Is it possible to spin a nested event loop? Not necessarily, it depends on the runtime. If your synchronous call is already on a task (so there's basically an async function on the callstack), you would really want to basically inline all of the function calls so that the await causes the same transformation were it to be called directly in that async function. But such inlining is impossible (due to dynamic function calls).

To really delve deep into the details here requires a fuller understanding of how asynchronous runtimes work in general, and of the particulars of the various implementations. Async/await is a wonderful innovation in that it allows programmers to write asynchronous code state machines as if they were generally writing synchronous code. But it doesn't do anything to change the deeper issues of how the task runtime system actually works, and in particular, the "correct" way to execute an asynchronous task in a synchronous context, which has multiple answers that are not wrong.

[1] The fact that async functions have a fundamentally different API and ABI makes the "what color is your function" argument somewhat specious: these functions have color because they're different, and you have to be aware of the difference. Only by basically forbidding async (or, in some languages, sync) functions entirely can you make the difference appear to go away, but you'll notice that that doesn't exactly "solve" the issue.
Rumors and hearsay regarding his wealth, he does a good job of concealing it.
Russia 'Likely' to Default on Debts
Slightly off topic, how does Erlang handle this because isn’t it know for having extremely fast & cheap process spawning baked in (with isolation).
Personal anecdote: I've found the tickets can be refunded/transferred. The airline recommended a 45min layover, and the airport's immigration machines broke and we were stuck in line for hours, missing our domestic flight in a separate area of the airport. In this case, I found out that the airline would've worked with me to reschedule another flight, if I could get ahold of them on the phone. Maybe not all airlines are like this, just one case.
Taste-wise, delicious!

It is a bit odd to wear a tux or suit to an In-N-Out at midnight, but after a few times you get used to it.
I’m questioning motivation and priorities not ability.
Great to see this firepower added to Conductor! We started using it a year or so ago and it was taken up by a whole bunch of teams in our company pretty fast. Helped us move fast on building applications and its a very intuitive model.
Show HN: GraphQL-go-tools, open source GraphQL Engine, written in Golang
1. https://code.briarproject.org/briar/briar/tree/master (GPLv3)

2. https://briarproject.org/how-it-works/ any nodes can act as a mule to carry encrypted messages between "bubbles" through either Tor, WiFi or Bluetooth

3. The communications are encrypted all encrypted (at rest and in transit), only those who are added as contacts or part of a forum as a member will have the key(s) to decrypt the communication.
Exactly this. I think that git is only popular currently because everyone else is using it. (That and GitHub).
If you want the child to start executing some other code but you have fork(), it's easy to do it yourself by calling that function.

But on the other hand, if you do want the child to execute code at the same place as the parent, but a hypothetical fork() asks you to provide a function pointer, it would be a bit more complicated.
Practising mental maths at a young age probably also helps in improving working memory. Brains of young people are so malleable, it's very important to do the hard work even if it's drudgery cause it helps improve the thinking capabilities.
Yeah but people complain about all sorts of stuff.
We haven’t gotten rid of the subsidies yet.
Although in this scenario, we could subsidize oil to Hawaii. I don’t know how that could be sold but everyone already benefits from subsidies somewhere and everyone already subsidizes something else.
I don't know of a JavaScript implementation where that approach would work. A synchronous implementation of `sleep` can't yield control back to the main thread to handle the asynchronous stuff. You'd just end up polling indefinitely.
> Putin expected this to be over in 72 hours, he kind of needed it to be over in 72 hours.

This is highly unlikely.

However the coming weeks and months shake out in this war and in the broader political picture, it's important to approach the situation realistically.

This isn't a video game, cartoon or Hollywood movie. The timeline isn't going to be measured in days and the primary agents' motivations and actions aren't as simple as in cartoons.

Pretending otherwise will only confuse you, over and over as events transpire, about why things aren't going like they would in a cartoon.
I don't think that's cynical. It's almost certainly true that a lot of the positive news we're seeing is part of a deliberate propaganda campaign. But it's worth noting that

1. Propaganda is not necessarily untrue.
2. It's working.
Civil wars are different, being the aggressor is very much different from being the defender.
I have missed a few flights and if the ticket agent is feeling nice that day, they will traditionally rebook you on a flight later that day or the next day.
Also what drinking water are they comparing to that gives 99% of the chlorine intake ? In dutch drinking water chlorine is not used at all, neither for primary
disinfection nor to maintain a residual disinfectant in the distribution network.
Still doesn't mean that small chlorine intake is bad for your health. Does seem however they use chlorine rich drinking water to justify the extra intake from chlorinated chickens.
https://dwes.copernicus.org/articles/2/1/2009/dwes-2-1-2009....
Poll: Should Google refuse to block in Russia the war info by Ukraine?
Context ads seems to have become a major (and may be the only) way to reach regular Russians by Ukraine with true information about atrocities of the war. Getting that info to regular Russians is a key in ending that war quickly and in the right way. Russian officials are pressing Google to allow only official Russian information ( https://www.rbc.ru/politics/28/02/2022/621c92589a794755f61c2206 )
which is naturally not even close to the truth.
I applaud the effort! The "Amazon-free" part is attractive, considering that many of us feel that Amazon's business practices are abusive of employees, anti-competitive, and unethical in other ways.

I have stopped using Goodreads already--probably for a couple years now. I found that the only feature I really used was the "To read" bookshelf. And I found that I just replaced it with a specific "To read" list of reminders in my iPhone's Reminders app. For that use case, this seems to work great for me. Can you speak to potentially any features of Booqsi that would be an improvement over my simple / non-book-specific approach?
Makes me sad, because I want to believe in this so much.
"gets you to" has a negative connotation.

I think a better way to say it is that it helps you appreciate the large number of courses without getting stuffed or having your senses exhausted.

Imagine going to a concert where the band says they are going to play their entire catalog front to back. If you're about to listen to 50 songs, you probably don't want them to also play the extended versions of each one at full blast if you have any hopes of making it through the show.
Not entirely on topic here but the first thing I thought of: Years after his music program called Impulse Tracker had had it's heyday, some music magazine did a roundup of various resampling algorithms and Jeffrey Lim's resampling algorithm was included for posterity and to round things out so that it wasn't all only big-money players. Names like Kurzweil, Alesis, Akai, Roland, Yamaha, Sony, Pioneer, Philips, Tascam ... but there on that list at NUMBER ONE was the resampling algorithm from a little shareware program made by a hobbyist for making beep boop techno.

(For those interested in the technical aspects of how to compare resampling algorithms, you take a sound, graph it, speed it up then slow it down, graph it again. Comparison of the two graphs would ideally be identical but in practice that's nearly impossible. Mainly you're looking for where frequencies got created that were not originally there.)
I think it's actually a pretty useful primitive for doing multiprocessing. Unlike threading, you have a completely separate memory space both for avoiding data races and performance (memory allocators still aren't perfect and weird stuff can happen with cache lines). Unlike exec after fork or anything equivalent, you still get to share things like file descriptors and read only memory for convenience.
See also "100,000 lumens to treat seasonal affective disorder: A proof of concept RCT of bright, whole-room, all-day (BROAD) light therapy" on https://www.medrxiv.org/content/10.1101/2021.10.29.21265530v...
Unfortunately data is not in your side. Most countries do not have economic freedom, moreover the less the economic freedom the worse the living conditions [1].

You might think that any country controls their money supply, that’s a fact. But can Biden for example, double the monetary base with his sole signature?

People in those countries could have great aspirations, to have a fair system, a working democracy, a better government and all that… but don’t forget they also need to live in the meanwhile, while fixing all those problems.

I’m not a user of crypto currently, but I see it as a way of shifting power. Similar to what the internet did for information.

[1]: https://www.heritage.org/index/ranking
Google blocks RT, other Russian channels from earning ad dollars
Except people not in the war still need to eat and survive. Maybe it wouldn't matter on a global scale if some small software firm somewhere goes out of business, but it sure as hell matters to the business owner and their family, and the employees and their families.

How do you think western governments can afford to send aid, if not through tax dollars collected via the production of their citizens? If everyone decided to drop what they were doing out of some grossly mislead compassion then the aid currently being sent to the Ukraine in the form of monetary support and supplies would become fiscally impossible due to the lack of national production.

The problem with this kind of anti-industrial sentiment is that on it's surface it may sound morally righteous and perfectly reasonable but as soon as you begin to devote even a moments worth of critical thinking to the ideas you're spouting it's easy to see how totally they break down.

The very people you condemn for selfishness or greed are the same people who keep the world economy functioning in a crisis like this. They're the same people who make it so that there is still some semblance of a normal world for the Ukrainian people to return to once this war has passed.
I find it infuriating when people can’t come up with a ballpark number. You can and should check the numbers later but don’t stop a discussion.
I doubt it's going to actually be the SAT.
Everything, oh my god. (imo, it changes the whole way you think about the world).
I'm assuming the owner of this site has permission to reproduce court documents from each source, generally these types of documents are public record and can be reposted. It sounds like whoever configured this portal where the public can view documents misconfigured it and allowed for private documents to be shown, without any indication that they were supposed to be private.
We've pulled awful lot of natural gas out of the ground, it seems like there ought to be room for more than a months worth down there.
Not at all what I’m saying.

I suggesting that you should try to differentiate between the work of intelligence services and some “decentralized hacker collective”.
The system you are working towards already exists: Courts and precedence.
Meta: We are now prohibiting Russian state media from running ads or monetizing
Had a similar issue. You have to use their browser extension: https://chrome.google.com/webstore/detail/hoppscotch-browser.... Click on this extension and add the domain you want to query. Then on Hoppscotch, go to settings and click "use browser extension to send requests."

I was using Altair's desktop app to handle CORS, but may switch to this set-up.
His Chef's Table episode covers his loss of taste, that is one of my favorite episodes in the series.
The market has spoken, and unfortunately, a lot of people simply won’t buy new computer hardware if it doesn’t have LGBTQ+ lights.
I understood that comment to suggest that China was willing to support Russia regarding Ukraine if the whole operation went smoothly and quickly presented the world with a fait accompli, but that if the whole thing drags on or worse then China might leave Russia flapping in the wind. Is that the case? I've no idea. The comment, however, was interesting.
In Ninja, which needs to spawn a lot of subprocesses but it otherwise not especially large in memory and which doesn't use threads, we moved from fork to posix_spawn (which is the "I want fork+exec immediately, please do the smartest thing you can" wrapper) because it performed better on OS X and Solaris:

https://github.com/ninja-build/ninja/commit/89587196705f54af...
Yeah this one is just great!
We should refer this discussion to committee friend.

In the meantime it's really too bad about the narratives being shared by objective electronic equipment on the ground. Are they narratives? Maybe that's not the right word. They seem to show civilian targeting without need of a storyteller.

https://twitter.com/itvnews/status/1498342001116336138

It is also a dynamic situation with many surprising aspects which were clouded before being made more clear now.

https://twitter.com/KyleJGlen/status/1498363767083651076
At least in python it is needed so that the interpreter can issue very cryptic syntax errors.

No, I'm not bitter.
But this approach would async-pollute all the sync calling functions right? if I had a call tree like

function A(){ B()}

function B(){ C()}

...

function Y(){ await? Z()}

async function Z(){...}

Then A-Y would need to become async. If await Z() was allowed then we could avoid this. So is there a reason why it could not be implemented this way?
I still remember the giddy feeling of paging through coffee table magazines at various places, seeing them mention a $35, credit card sized computer. I also remember trying to explain what it was to my parents, begging them to buy me one even though it had to be shipped from the UK. The biggest memory, though, was opening that box on Christmas day and finding the Raspberry Pi 1 (Revision 2) nestled inside. The rest of my gifts didn't matter: I ripped the mouse and keyboard out of my desktop PC, plugged them into the Pi and co-opted our DirecTV HDMI cable so I could see it in action. Words can't quite describe the magic of booting into Raspbian back them, especially as a budding young computer enthusiast who thought any of this stuff qualified as sorcery.

Nowadays I've moved on to administrating bigger systems, and the Raspberry Pi's value proposition has cooled off somewhat (the Pi Zero is still neat, though). In any case, I can't help but recommend them whenever I hear someone talk about dabbling in Sysops. I get that giddy feeling again, hoping that it might spark someone else's fascination with Linux and wild hardware form factors.

Thank you for all you've done, Raspberry Pi foundation. I'm sure there's more people like me who grew up alongside one of your devices, but I can only hope that the future is even brighter for the next generation of young computer enthusiasts.

(For those of you wondering: yes, my Pi does still work a decade later)
I'm currently typing on a moonlander as well. My one complaint is I have to shift my hand to reach all the buttons on the thumbclusters - particularly the bottom key and the big red one. So I try to map those keys to symbols I seldom need.
This article made my eyes well up a bit. I love food and appreciate cooking and love to see people discover cooking at this level. The author’s reaction to it all, noticing the little details, is just beautiful. I also miss going to these types of restaurants and it makes me a bit sentimental. But soon it will all return, I hope.
Why would this get downvoted? So strange.
It would be great if you could get a correct (or close) answer every time if you made a guess, and where you made an error. I assume you would get better after a while and would be even more fun.
“Almost like the deeper you go, the more likely the thing you're guesstimating will be a fantasy.”

Like with every other method you need to know when to stop.
> Is there a middle ground or best practices where we can be reasonably assured our funds are safe from state influence but easily accessible and secure? Are multi-sig wallets at a state where they can be useful and free from confiscation?

Yes. Take a look at the system used by the Muun wallet[0]. The short version is that it's a 2-of-2 multisig system where you keep one key "online" (on your phone) and they keep the other. Both keys are required to transfer funds—so in the event that either your phone or their systems (but not both) proves compromised or malicious your funds are still safe. That takes care of "easily accessibly and secure". As for "free from confiscation", you additionally keep copies of both keys offline and encrypted in your "emergency kit", which ensures that you retain control even if Muun disappears or stops cooperating. They can't freeze your funds, even if ordered to do so.

The Muun wallet supports both traditional (on-chain) and Lightning transactions for online transfers.

[0] https://blog.muun.com/muuns-multisig-model/
+1 on novelty / variety; fine dining restaurants also change their entire menus a lot and may only keep a few signature dishes between menus. Part of that is due to availability of things and what is in season, part of it is whimsy / novelty / the chef trying out different things.
human psyche rhymes in time
OnlyFans Says It Has Restored Russian Creators’ Accounts
Sure. Like I worked at a company that spent months on design docs and design reviews. Like that? Everything was nicely set up. It was great. Super effective.

Because software is just about following repeatable recipes to produce identical results, day after day after day?

I agree that having one tools organized is a good idea. I disagree with the rest of it. Specifically I don't think cooking is a useful analogy, because it is the antithesis of software development.
This is an allegory for AOT vs JIT compilation. AOT decreases jitter. JIT reduces startup latency (counting AOT compilation time).

In terms of project planning, a single cook using strict mise en place is Waterfall. When I cook, I aim for a more agile approach. Always cut onions into their own bowl first (for pretty much everything I cook). If the prep-time for the next ingredient(s) is long enough that I'd burn the onions, they go into a second bowl. But when I'm part-way through getting that second bowl prepped, I'll get the onions going. If I'm working on a new recipe, I'm more inclined to prepare further ahead, or I'll have a failed dish... but next time I make it, I'll have more confidence to multiplex cooking and prepping.
> why would anyone ever want fork as a primitive

Long ago in the far away land of UNIX, fork was a primitive because the primary use of fork was to do more work on the system. You likely were one of thee or four other people, at any given moment vying for CPU time, and it wasn't uncommon to see loads of 11 on a typical university UNIX system.

> so why is there not a fork-exec combo

you're looking for system(3). Turns out, most people waitpid(fork()). Windows explicitly handles this situation with CreateProcess[0] which does a way better job of it than POSIX does (which, IMO, is the standard for most of the win32 API, but that's a whole can of worms I won't get into).

> why would anyone ever use vfork?

Small shells, tools that need the scheduling weight of "another process" but not for long, etc. See also, waitpid(fork()).

When you have something with MASSIVE page tables, you don't want to spend the time copying the whole thing over. There's a huge overhead to that.

[0] https://docs.microsoft.com/en-us/windows/win32/api/processth...
Note that it's recommend that you avoid using these because they carry a risk of deadlock. Unless something has changed recently .Net doesn't have a 100% safe way to synchronously call an async method from a non-async method.
When I had "press button to switch layer permanently", the LEDs indeed made a huge difference. I didn't need to look at the keyboard directly, my peripheral vision would notice that it stopped being blueish and started being redish, which meant I was on Layer 2.

But then layer I switched to "layer 2 is only active when you're actually holding the layer 2 key" mode and now the leds are not as important anymore. Still, they make my keyboard look cool :)

Also, on my configuration Layer 2 keys each have different colors based on what they do (macros are pink, media buttons are blue, arrows are green, etc.). I have now mostly memorized everything, but in the beginning it was good to have them to help me remember.

Anyway, I like LEDs. But I would happily buy a LED-less keyboard if it meant saving $100.
Humble Bundle: The Joy of Coding by No Starch Press
Percentages were created for clickbait.
Well, you are welcome to believe whatever you want but there is pretty good documentary evidence for the fight the Ukranians are putting up.

Two links for you to review if you can stand them (trigger warning applies, not everything here is going to help your mental state):

https://twitter.com/UAWeapons

https://www.oryxspioenkop.com/2022/02/attack-on-europe-docum...