HNHacker News
TopNewBestAskShowJobs

pygy_

6,423 karma · joined February 23, 2010

hn.py@py.gy

https://bsky.app/profile/py.gy

submissionscomments
pygy_··on Having trouble understanding your regexes? Try parser combinators
With https://github.com/compose-regexp/compose-regexp.js you can have your cake and eat it too.

It's a JS RegExp builder with a parser combinator API.

pygy_··on C was not created as an abstract machine
Would you write it?

You can use the same compiler with a language whose design committee isn't deliberately user hostile, like Rust (where UB-like behaviors in safe code are considered soundness bugs).

https://runrust.miraheze.org/wiki/Undefined_Behavior

pygy_··on C was not created as an abstract machine
> [whatever] is undefined behaviour, which means the compiler is allowed to assume it never happens;

That interpretation is the root of the problem. Compilers authors use it to implement outright user hostile behavior in the name of elusive performance.

Why would you spend resources looking for zero days when you can have a few LLVM contributors plant them in every program "as an optimization"?

pygy_··on The x86's Decimal Adjust after Addition (DAA) instruction
I wonder when Google is going to pull the plug on Blogger/Blogspot.

I wouldn't feel safe about my posts having them hosted there...

pygy_··on Marko: An HTML-Based Language
The view DSL is declarative (as most are).

By definition, controllers must be imperative.

pygy_··on Pwned or Bot
It is going to happen, and some people will make money off it by farming such addresses, but it raises the time and the cost to obtain a plausible email address for fraud.
pygy_··on Use.GPU Goes Trad
By default, identity is the place in the vDOM tree (taking `null` nodes into account so that you can have conditional nodes in fragments/children lists).

In lists, identity can instead be tracked by a user-provided key: https://reactjs.org/docs/lists-and-keys.html

pygy_··on Use.GPU Goes Trad
This is not unlike integrated automatically GC'd and non-GC'd code.

The gap can be bridged for granular reactive systems as it can be for React, provided the reactive system is well designed.

pygy_··on Use.GPU Goes Trad
> What reactivity really does is take cache invalidation, said to be the hardest problem, and turn the problem itself into the solution. You never invalidate a cache without immediately refreshing it, and you make that the sole way to cause anything to happen at all. Crazy, and yet it works.

> When I tell people this, they often say "well, it might work well for your domain, but it couldn't possibly work for mine." And then I show them how to do it.

Signals-based reactivity is garbage collection on steroids. It does solve cache invalidation, and extends it to effects as well. It really should be a language feature at this point.

I wish the model could be extended to distributed systems, but adding network unreliability to the mix is non-trivial.

pygy_··on Pomsky – A portable, modern regular expression language
RegExp is optimized for typing, not for reading.

Trouble comes when one need to update or debug a complex RegExp. The one you posted is not that complex.

pygy_··on Pomsky – A portable, modern regular expression language
The regular formalism is, fundamentally, about composition, and the current syntax doesn't do it justice.

That syntax was devised as a math notation, where sub-patterns were abstracted as one letter variables. You didn't have to deal with complex patterns at all, and it was very readable for that use case.

It was then re-purposed as a write-only language for searching at the CLI (in `ed` and its descendants, then grep).

They gradually graduated into what they are today in general programming languages because they were familiar and worse is better... However, composition got lost in the process.

Swift takes a radically different approach, and gives RegExps a parser combinator syntax. So every sub-expression can be assigned to a variable and reused/tested independently.

Here's an example (sorry I don't have it at hand in text form): https://pbs.twimg.com/media/FipgjUdUcAAl1xS?format=jpg&name=...

I wrote a lib that does the same in JS (the lib predates the Swift syntax by years). Here's the same example ported to JS: https://flems.io/#0=N4IgtglgJlA2CmIBcBWAzAOgAwCYA0IAzgMYBOA9...

Here's the lib: https://github.com/compose-regexp/compose-regexp.js

pygy_··on 86Box – Low level x86 emulator that runs older operating systems and software
Indeed, DOSBox has been written for DOS games (and it's great at this), compatibility with other software has never been a concern. BIOS and DOS calls are HLEd which is why neither are necessary to get it running.
pygy_··on Apple GPU drivers now in Asahi Linux
Provided Linus Torvalds has been test driving it, I'd expect Asahi to be merged in sooner than later...
pygy_··on maps.google.com now redirects to google.com/maps
I’m pretty sure you can still identify specific services from trafic patterns. It is more expensive, but within reach for well funded actors.
pygy_··on Stable Diffusion 2.0
> Can’t you just engineer the prompting better so that it generates “by Greg Rutkowski“ images without being trained on actual images by Greg?

You couldn't teach a human to do that without them having seen Greg's art. There are elements of stroke, palette, lightning and composition that can't be fully captured by natural language (short of encoding a ML model, which defeats the point).

pygy_··on Elon Musk publicly feuding with and firing his developers on Twitter
Dan Luu (former Twitter employee) begs to differ:

https://twitter.com/danluu/status/1591963269077819392

> An interesting thing about this claim is that not only is the implication wrong, Twitter probably has better evidence of its wrongness than any other company in its size class could have.

> There are very few companies that have a better distributed tracing setup w.r.t. getting actionable insights on the backend and the ones that have a better setup are much larger (Google, FB, etc.)

> Twitter client tracing also punches above its weight.

> https://twitter.com/danluu/status/1267069847428411392

> Of course, the key people who did that work left or got laid off, but it's clear from the data that, if you're looking at why Twitter is so slow in, e.g., India, Uganda, etc., esp. on slow devices, tail latency comes from the network due to unreasonably large payloads + client.

> When leadership wanted to drive growth in India, they were into "visionary" stuff, e.g., "add features cricket watchers would like" when the app was unusably slow [on] a low-end device and the client performance team had been disbanded.

> https://twitter.com/danluu/status/1591507609651408896

pygy_··on Shanghai Disney shuts: Visitors unable to leave without negative Covid test
I'll add that, since posting this, I've discovered this video (https://twitter.com/YanzhongHuang/status/1586537964267798530) that predates my post, where a Chinese businessman makes the same argument.

I had no idea this was openly discussed over there (though I suppose I should have guessed it was).

pygy_··on Mastodon Explained
As can Twitter and Facebook employees
pygy_··on Twitter’s mass layoffs have begun
News site could fetch the tweet markup using the API at publication time, save it locally, and publish a static version along with the article.
pygy_··on Shanghai Disney shuts: Visitors unable to leave without negative Covid test
It's not year-to-year noise, it's quarter-to-quarter, and there's a seasonal pattern that vanishes if you do year-on-year quarter comparison (see the solid blue line in the bls.gov chart).

The WaPo article only shows the dotted line data from the BLS graph, which is far noisier, but shows two consecutive quarters of decline, which is unusual too.

pygy_··on Shanghai Disney shuts: Visitors unable to leave without negative Covid test
Point 1 is reasonable, point 3 arguable, but point 2 is way off..

> The drop in productivity is a fake as it is still higher than in 2010 before Covid.

Could it be that we made technological progress in the mean time?

The drop definitely isn't fake (https://www.bls.gov/charts/productivity-and-costs/nonfarm-bu..., look at the blue line), and a stark break from a consistent increase in productivity that's been ongoing for decades with few exceptions (https://ourworldindata.org/grapher/labor-productivity-per-ho...).

pygy_··on Shanghai Disney shuts: Visitors unable to leave without negative Covid test
> I wonder what China is trying to achieve here.

From reading scientific papers about the occurrence of complications in people who've had Covid twice, it looks like the virus inflicts long-lasting damage to the body, even if it isn't readily apparent.

People how have Covid twice have a higher rate of complication the second time around (including post-Covid syndrome a.k.a. long covid). There are no reasons to think that people in places where "living with Covid" is a thing really are rotting with it. Vaccines do little to protect against this.

In Europe, the cumulative incidence of confirmed infections is nearing 50% of the population (and ~30% in the US). In China, that number is less than 1%.

Major caveat regarding the reasoning above, the studies were carried before omicron emerged. These variants have fewer complications, not sure how this will compound.

It is possible that the drop in productivity in the US that's been reported this week (https://news.ycombinator.com/item?id=33405389) is in part driven by lower mental acuity or immune system performance. The decline may not be large enough to be noticeable on a day to day basis, yet show up in aggregate measurements.

Xi may be playing the long game here. If the above holds, even if Covid ends up endemic in China after a while, its workers would have an edge on the rest of the world.

————

https://www.researchsquare.com/article/rs-1749502/v1 (it's only a preprint, but third party experts vouch for it: https://edition.cnn.com/2022/07/05/health/covid-reinfection-...)

I've read an earlier paper on the topic, but I can't find it right now.

pygy_··on 62 People own the same as half the world, reveals Oxfam Davos report (2016)
The economic power imbalance is still problematic.

Free trade and supply/demand were supposed to be a way to decentralize economic decisions, but they lead in practice to inequality and a situation where we have an economy that's planned by the wealthy for their own benefit (see planned obsolescence, predatory marketing practices, dark UI patterns, the privatization of justice through arbitration, lobbying, ...).

pygy_··on Manifest V3, webRequest, and ad blockers
That is also true of Mozilla and Facebook, and probably others...
pygy_··on Manifest V3, webRequest, and ad blockers
And, surprisingly, Google has more employees on WICG (the W3C standards incubator) than all other relevant parties added together.
pygy_··on The Lost Art of Conversation (1899)
Complimentary sound track by The Divine Comedy

https://www.youtube.com/watch?v=0MVESWB1CBg

pygy_··on Speculoos-2c: A new potentially habitable earth
Mirroring the fact that the cephalopod eye doesn’t have a blind spot unlike the vertebrate one.
pygy_··on Paris’s missing palace and the making of the Louvre
Richelieu had unused forts filled with gunpowder and blown up. I suppose it was the most efficient way to get the stones back to build other stuff.

The Regneville castle partially survived the ordeal...

https://www.google.com/maps/place/Ch%C3%A2teau+De+Regn%C3%A9...

https://www.google.com/maps/place/Ch%C3%A2teau+De+Regn%C3%A9...

pygy_··on They're trying to get me kidnapped and tortured, but Twitter doesn't care
> this is what you get as a society when you let arbitrary entities arbitrate speech: ambiguity and unclear expectations.

The platform allows speech amplification. It used to be that lies could run around the world before the truth could get its boots on. Social apps now make this orders of magniture worse...

Rather than moderating content, Twitter could add systems that automatically tame virality (hide a post for n minutes after x retweets/impressions), with bias against new accounts.

pygy_··on We don't know how the universe began, and we will never know
Yea, the intractable mystery is the existence of spacetime.

Whether time has an origin, and whether we can measure how distant it is from us are questions that could be answered.

← PreviousPage 4 of 34Next →