skysight-inc/HackerNews huggingface dataset:
Am I the only one struggling with async/await in _any_ language?

I did my fair share of tornado/twisted/zeromq ioloop programming, and even though I completely agree that it gets messy real quick, I always "got it".

With async/await though, I always struggle and need a really long time to get a clear picture of what is happening.

Maybe my mental model of how it works is not optimal so I would love for people to describe how they "read" async/await code.

I typically see await very much like I would read a "yield", except that instead of yielding a value, it just yields a promise to the ioloop that will "next()" once it resolves.

Still, it seems every language is adopting it, so I guess à majority of people find it simpler to reason with, I just don't :(

Note: the same applies for async/await in JS. I can easily get my head around the "then" style, but struggle with async/await. A bit less than in python though.
The big parallel with Nazi Germany could I suppose be the coziness between the elites; all the way from little details like the Germans copying British foxhunting to King Edward VIII having a fascist spy as a girlfriend.

However, Germany was explicitly trying to be a colonial expansionist. Having run out of unconquered countries in Africa, all that was left to enslave was Eastern Europe. Chinese expansionism seems much more limited.
Hello, I am the author of this article

Netflix and Amazon had to reduce their quality from HD to SD amid pandemic

Covid19 has accelerated the consumption of online video

Video streaming platforms are facing pressure due to the enormous demand

There is a need for the streaming platforms to use the latest technologies to catch up with the continuous growth

In this article I discuss various techniques which can help in scaling the video streaming platforms, improving user experience and reducing latency with the help of AI, P2P, Multi-CDN, CMAF and Per-title encoding and the background of how these technologies work

Did I miss out any recent other technologies in video streaming. Let me know in comments
I suppose it's less useful as a standalone technique - I've used it before but not that heavily (e.g. in a library built around sequencing effects in a certain way, where I've wanted to guarantee that one effect can't be called before another). Really we'd want a considerably more powerful type system - Idris 2's quantitative types and/or Rust's ownership, for example - before that particular technique really starts to shine.

However, the general mindset is one I use all the time. For example, if I've written a state machine that is represented explicitly in the types, I might be able to encode some of the state transitions in the type system directly, so the compiler prevents me writing certain invalid transitions. For example, if state B can only be reached after state A, I might write the in-memory representation of B to contain an in-memory representation of A; this guarantees I must have passed something through state A to get anything in state B. Doesn't save you from everything - in particular it doesn't solve your "passing the token to the wrong instance of the object" problem - but any constraint on the state space is useful in my book. When the state machine gets sufficiently large, in my experience, the benefits of the restricted state space start outweighing the negatives of manual token shuffling.

(I have a blog post brewing about this general class of techniques, but I don't know when it'll be ready.)
"Do the needful at the earliest" is the poster-child, but I'm struggling to find a great list to link.

The effective divergence time is much longer than since 1947 -- I believe that around 1900 people in England thought their cousins in India a generation behind in dress & everyday speech. And formal bureaucratic terms were already ossified, another classic is "out of station" (as in, out of town, away from the office) which IIRC is from east-india company days.
Questions to consider when choosing a low-code / no-code app dev platform
> apart from the border
In germany it's a mandatory corona-test and quarantine until the results come back if you entered the country from a high-risk region (to avoid the spread through travelling). No restrictions as far as I know if the region is not considered a high-risk one.

I guess it's similar in Finland.
We've been busy developing a low-code web app platform for the past year, which of course also means being in touch with what other companies like JourneyApps, PowerApps, AWS Honeycode, Retool, Internal.io are doing and saying. This detailed post by JourneyApps highlighted a few key principles which I think are often overlooked.

Here is my TDLR;

1. Is code a first-class citizen or an afterthought behind visual tooling?

- Platforms usually prioritize one above the other.

- When code is an afterthought on top of a primary visual drag-and-drop tool, it generally tends to perform poorly and raises complexity, slowing down development velocity.

2. What is the skill level required to build apps on the platform using code?

- Complexity of code required by a platform directly correlates to the level of skill developers need to build apps.

3. What is the learning curve for the platform?

- Platforms focusing on visual development tools tend to be highly proprietary.

- Complex proprietary environments translates into long learning curves, with tons of ins and outs to "discover" before becoming truly productive.

4. Is coding on the platform based on a popular, open language?

- The use of a popular open language translates to more available talent.

- The most prevalent developers are JavaScript developers, be cautious for proprietary languages.

5. Can you make use of open source libraries, or are you stuck in a walled garden?

- Can you use npm or similar packages to build extensions.

- Is the platform open to using these external packages or is it a closed off ecosystem.

6. Developer productivity: What kind of headcount do you need?

- If developer productivity and output is lower, you will need a larger team to develop the same number of apps, more time, more risk.

- Many low-code platforms that are extensible with code leave a massive amount of heavy lifting to the developer.

7. Is the platform a true full stack, or do you need to build your own full stack?

- Higher total cost of ownership if external parts needs to be wired together.

8. How badly are you locked in to the vendor?

- Vendor lock-in is a major drawback of many low-code platforms.

- Can you export your code, and is that export usable and human-readable.

9. Are developers excited about using the platform?

- Many low-code platforms tend to force developers to work within a constrained proprietary framework.

- Many low-code platforms do not allow developers to leverage the major innovations in software tooling.

- Does the platform help software engineers improve their marketable skills to advance their careers.

- High-productivity app platforms that are based on popular open languages and allow developers to use open source packages, are much more attractive to developers.

10. How much does the platform reduce your risk?

- Cost to introduce.

- Hire scarce developer talent.

- Reliance on proprietary closed-system technologies.

- Requiring development of unsupported functionality.
One thing about a democracy, if poor choices are made and poor leaders are selected, it’s only temporary until the next wave of elections. But in a dictatorship, or even something that masquerades as a democracy but is not, those choices may go unchecked for decades.
Concepts are a huge improvement to help new users learn the language. Large, unclear errors are a big put-off.
Any native speaker of an Arabic dialect (except for perhaps some really peripheral countries like Mauritania or Chad) brought up on television is going to know some Modern Standard Arabic, because it is used in newsreading and other posh broadcasting. MSA is not identical with Quranic Arabic, but it is conservative and close enough that Arabic speakers will understand the older Quranic language based on their understanding of MSA. Of course, Arabic speakers will still misunderstand things here and there from the Quran (just like native English speakers sometimes misunderstand a word or expression used in the King James Bible), but they will understand most of it.
The problem is not just complexity, but complexity with tons of pitfalls.
I'm very uncomfortable with the assertive tone of this post. It's probably the right move to push for vitamin supplements, but we really should be careful with asserting the benefits with basically 100% confidence like he does, to the point of guaranteeing causal connection and claiming that further studies will only illuminate few more details in the picture. It's almost irresponsible, specially in the context of an ongoing pandemic.

And I've read that vitamin D has been touted and later dismissed as the solution so many times...
Terrific piece. Thanks for reposting.
>Nowadays I am using C++ mainly for the high-performance libraries, and only if I can't archive the same in jit-ed python, cython or rust.

Is anyone aware of a library for another language that's as fast as Eigen?
Open source is not enough, since you have to trust the compiler and hardware the system is running on as well [1,2]. But from the page you linked, the key benefit of that system isn't that it's open source, but that the results are verifiable. I.e. you can check that the results are trustworthy, even if you don't trust the code or machines it's running on?

[1] https://www.win.tue.nl/~aeb/linux/hh/thompson/trust.html

[2] https://en.wikipedia.org/wiki/Intel_Management_Engine
I'm not saying Java should have introduced ground breaking features - I'm saying they made design mistakes that they should have corrected far sooner (var/type inference) and refused to add some basic features (lambdas) that would have made the code a lot better for it.

They did add those features eventually (Java 8) - about 8 years behind C# (since C# 3.0)
If power bars and all other manner of plug splitters didn’t exist

If we didn’t already put up to 12 (!!) outlets on a 15A breaker (where I live, anyway — trying to find some US numbers online it sounds like there is no limit there?!)

If you couldn’t trivially create a 24A load on a kitchen plug by plugging two small appliances in on your counter

Then I would agree. As it stands, this is no more dangerous than the things that literally hundreds of millions of monkeys in as many homes and offices are doing every day by accident.
I think something like this should be in the standard library.
Parents Got More Time Off. Then the Backlash Started
In an anarchic society with no government to protect people, the people would pay whoever likes this line of work to protect them.
A system of private law enforcememt could emerge out of anarchy.
The interactions between different law enforcement agencies (whether with simple agreements or third party private arbitration courts) and the different internal rules would create a market in which consumers are free to choose what laws make sense for them, or at least where laws converge towards what all people want.
"The Machinery of Freedom" contains a more in depth description.

As an addendum, in an anarchic society victimless crimes wouldn't be crimes so there would be significantly less people to imprison / execute / send to force labour camps.
>If we look at programming languages as tools, it makes sense for them to get out of date and new ones taking their place, with all the lessons learned.

Part of me thinks that this is how it should be. Extending a language constantly while providing backwards compatibility can lead to some awkward syntax too.
Concepts are great because we can get rid of all tag dispatching/partial ordering/SFINAE hacks with a more principled (and understandable) approach.
> They "fixed" the issue, but did not bother re-running the PoC. It still worked. I pointed out the fix was incomplete, and was told "that issue was already fixed".

That reminds me of when cisco "fixed" a bug by blocking the curl user agent:

https://www.bleepingcomputer.com/news/security/cisco-botches...
FWIW, Córdoba is very sunny, and the hottest place in Spain.
Here's the area in Google Maps: https://www.google.co.uk/maps/place/Wakering+Stairs/@51.5485...
No, the poster already said the above should be enough for anyone. /s
Has anyone anything positive to say about C++, and more specifically C++20?

We all know the negative parts, any C++ related thread is always full of people repeating them over and over. What about some celebration time for now? A huge milestone for the language has been reached with C++20, can we share something positive about it for once?
Of course you could also just write assembly if you wanted the exact most optimized machine code.

It’s also hard to generalize these things in the form of those kinds of macros. Whereas with something like Eigen, just write your code like normal, you don’t have to worry about the special cases, and the compiler rewrites it for you. That’s one of the nice benefits, one of many, of metaprogramming.
That is exactly what proof of work was invented to do. It’s the claim to fame of Adam Back, the current CEO of Blockstream.

https://en.wikipedia.org/wiki/Hashcash
I also want a solution, but I think the measurement is far from straightforward. So far what I've found are (Disclaimer: I'm a sysadmin, not a qualified hardware engineer, it's just for fun):

* Using a Vector Network Analyzer and do a S22 (S11 on a two-port VNA) measurement directly at the output driver - it's exactly what we want by definition. But the measurement is not passive and you are connecting the output of the VNA to a "hot" output driver, guess what could possibly go wrong? Both the chip and the VNA can be damaged if it's not done properly. It's quite a headache for testing RF amplifiers.

Even if the setup is a success, everything else connected to the output driver can distort the measurement. But I believe it's easier on low power logic circuits. You add a DC-block to the VNA, get a test fixture and do Open/Short/Load calibration, then solder the output driver on the fixture and turn it on, drive the output high, measure it, drive the output low, measure it again. But it certainly needs to be done on a test fixture in a controlled setting, not an actual live board. I'm not sure if the approach I just described can work yet, I'll do some experiments in the future.

* Weng-Yew Chang, et al. proposed output impedance measurement by current injection using two reproposed wideband oscilloscope current probe (Tektronix CT-6, $1000) and a standard VNA. You hook both probes at the output side of the driver, connect them to the VNA, and do your measurements as usual [0]. Apparently it's already the standard practice for measuring DC power supplies (e.g. see PicoTest Signal Injector manual [1]), and they simply applied the same trick on output driver.

* Richard Allred proposed a method at DesignCon 2014 [2]: First, get a multi-GHz oscilloscope, get a Time Domain Reflectrometer, do a lot of TDR measurements while the board is unpowered. Then, power on the board, measure the real output signal on your oscilloscope. Next, solder a shunt resistor at the output, repeat the measurement. Finally, do a lot of linear algebra on the measured waveform using previous TDR data to remove the influence ("de-embedded") of the interconnection (cable, board) from the signal, and do more algebra to get the complex impedance of the output driver on the Smith Chart.

Expensive equipment and a considerable amount of work. But Allred's work is used on 10 GHz+ systems, and it's designed to be applied directly on the board, without the use of a test fixture, and avoiding a that can potentially upset the output.

[0] https://sci-hub.tw/10.1109/APMC.2009.5384220

[1] https://www.picotest.com/images/download/injector-manual-1.1...

[2] https://www.sisoft.com/elearning/secure/files/2-WE4_Practica...
Try curio or trio in python :)

Trio especially with its requirement of an owner for each task makes the thinking of it all entirely sequential and clear. In curio it's optional.

See the rationale here:
https://vorpus.org/blog/notes-on-structured-concurrency-or-g...

On top of that, I must recommend dabeaz's concurrency from the ground up talk, where he explains it all in primitive terms and lives codes a wee co-operative yielding thing on the fly:

https://youtu.be/MCs5OvhV9S4
> Meanwhile, Icelandic people can readily understand the historic and archaic Old Norse texts without much translation—or certainly far more easily than a Norwegian would—where a Norwegian would struggle to understand most of it today.

This is not actually due to Icelandic being as conservative as you think. It is due to Icelandic intellectuals in the 19th century successfully pushing for the restoration of many old words that had gone out of use in the intervening centuries. Before the 19th-century language movement, Icelandic had lost a lot of that old vocabulary and had replaced them with borrowings from Danish.
This looks like Magnet but in open source. Nice!
> you generally don’t see language lawyering for Python or Java

But my experience for instance when having to do stuff in C#, Java or Python is that when I'm looking for advice on the internet, stackoverflow, etc etc... 80% is reaaalllly bad, in the sense that if it were C++ everybody would be screaming "wtf don't do that this is insane" and write 12 blog posts and 40 twitter flamewars about why this is a bad idea and you should never ever do this... but apparently the "tolerance to bad code" is much higher in other communities.
You can organise without a government, using the free market.
Having competing law enforcement firms would bring competition to a state monopoly that does little to nothing to prevent actual crime and persecute tons of innocent people.
This work (based on a parallel pilot randomized open label, double-masked clinical trial) fits to the new Bradykinin Hypothesis [1][2]

[1] Michael R Garvin et.al. https://elifesciences.org/articles/59177

[2] euronews.com: A supercomputer analysed data on COVID-19 and helped come up with this new hypothesis https://www.euronews.com/2020/09/05/a-supercomputer-analysed...
And it would tell us heaps about how serious vitamin D deficiency (and likely other deficiencies) can really be. If, for example, reports of large amounts of African Americans being vitamin D deficient are true and vitamin D plays a significant role in many pathologies, safely getting those people to the right level without inducing vitaminosis could possibly lead to improvements in health issues that occur with higher incidence in African Americans (asthma comes to mind). It would have huge benefits to individuals and by extension healthcare systems.

For everyone reading this, please make sure to get blood work done before supplementing more than 1000 or 2000 IU per day.

Taking vitamin D in its complete and ready form sidesteps the bodies regulation mechanism because that happens before the body produces vitamin D from components after sun exposure. Taking it orally basically skips that regulation and therefore you CAN overdose with potentially severe health consequences.
> the fundamental problem of email [is] random strangers on the Internet are still allowed to push to you

I think that’s the fundamental strength of email, and what has given it staying power. I can email a person in government or an old friend or a scientist and be reasonably certain they will read it without knowing who I am.

Email is the only tool where I still regularly have meaningful conversations with strangers. Several times a week I get emails from strangers asking for help with something they’re working on and I am almost always happy to oblige them. I have built a number of meaningful relationships through these chance encounters with random strangers.

It would be all to easy on other services just to say “I don’t know this person” and ignore them, as I regularly do on Facebook. With email on the other hand I always read a message before deleting it.
The effect size is enormous. When things are that stark there isn't really much need to worry about sample sizes or statistical tests. Statistical analysis is basically useless when comparing 13/26 to 1/50. They are different, we don't need maths to verify that.

There might be problems in the experimental design, but the sample size isn't an issue in this case.
Yeah. Nowadays it feels like macOS is designed mostly for touchpads.
with concepts you also get

void f(auto x) { }

or

void f(Sortable auto x) { }

as a bonus, which is super neat imho and will reduce the amount of template<> syntax verbosity by a good margin
You wouldn't have a compiler without someone having developed formal language theory. Or, at least, probably not one built on a solid theoretical foundation that actually happens to be helpful.

You wouldn't have complexity analysis of algorithms, with which most of us don't need to directly involve ourselves, but you do apply its results when choosing an algorithm based on the knowledge that was originally obtained through that analysis. Or if you're not choosing your algorithms, at the very least someone who chose them for your platform did.

You probably wouldn't have lossless data compression (and an understanding of it) at its present level without someone having done mathematically-based work on things like arithmetic coding [1] and range encoding [2]. Again, you probably don't write that code yourself (I haven't), but it's there.

The list goes on.

A PhD degree isn't really a good investment in terms of just salary in almost any field that I can think of. That just means work that's closer to (and directly applicable for) direct revenue streams tends to pay better than work that's further away from them. That doesn't directly mean work that's further away from revenue streams is less valuable down the road; it just means there's less certainty about its ability to help generate revenue, and that there are more steps, more interim work and a greater financial risk involved. While most businesses don't, and shouldn't, bother, that doesn't mean they might not benefit at some point if someone else does it. "The market has spoken" is a shortsighted way of looking at these kinds of things.

Sure, there are areas of theoretical computer science that are more similar to pure maths in terms of abstraction and applicability, and which are pretty much a pure intellectual pursuit. They are very far from engineering or applications. But theoretical work in CS is broader than that, and some of it underlies much of what we have in the practical world.

It's also true that most of software development and engineering work don't really require involvement with much of the theory, partially because someone else is already doing that work within the platform, and partially because most business software is actually theoretically more or less trivial.

Still doesn't mean the theoretical side is useless, because not all software is trivial.

[1] https://en.wikipedia.org/wiki/Arithmetic_coding

[2] https://en.wikipedia.org/wiki/Range_encoding
> Can we please change this to the actual study

It was discussed a few days ago here on HN:

https://news.ycombinator.com/item?id=24366006

In any case, I think it is still nice to have a good article written in layman's terms that we can share with friends and family.
"And you're right: we were not out to win over the Lisp programmers;
we were after the C++ programmers. We managed to drag a lot of them
about halfway to Lisp. Aren't you happy?"

– Guy Steele responding CL programmer criticism of Java
Funny Meme Pictures 2020 to Make You Laugh Out Loud
It might not matter to your average programmer, but the author, ralfj, is writing from the point of view of RustBelt, a project to establish a formal foundation and soundness proofs for Rust's type system and memory model. He recently defended his PhD thesis on the topic [1].

[1] https://people.mpi-sws.org/~jung/thesis.html