Better HN
topnewbestaskshowjobs
Log inSign up

idoubtit

3,448 karma · joined Jul 6, 2017 (9y ago) · 602 submissions

Submissions

comment 13h ago · link · parent

> I do some crazy WebGL stuff [...] and Ladybird handles it just fine, just with a few rendering issues.

Ladybird uses ANGLE, which is a graphic engine open-sourced by Google that converts from WebGL/OpenGL to a native layer (e.g. Vulkan). So I would expect Labybird to handle WebGL fine, since their engine is the same as Chrome's.

comment 5d ago · link · parent

From your own source, a basic demo with Laravel peaks at 95 requests/s/core. It's worse with Wordpress at less than 20 r/s/core. That's slow.

The last round of TechEmpower web benchmarks computed the framework overhead. Depending on the task, the performance of Laravel was 5% to 20% of the native PHP code, i.e. 5 to 20 times slower. Source : https://www.techempower.com/benchmarks/#section=data-r23&tes...

comment 5d ago · link · parent

My main worry with PHP is that its surface constantly grows. This means the language is

1. more complex to use (it took years for some parsers to implement the PHP 8.4 property hooks, and I suppose few people can explain how they work with inheritance and traits), 2. more costly to maintain (I remember when the developer of PHP's JIT left, the PHP foundation was worried because no one could understand the JIT code), 3. and has more security risks (critical security releases will continue).

I don't disagree with you, but the situation is more nuanced, and PHP's initial promises are now blurred.

> 1. A stateless functional core. It's cheap to run and quick to start.

Most modern codebases use a framework. And once you have to load Wordpress, Drupal, or even worse, Laravel, then it's no longer cheap and quick. So PHP added several layers of complexity to mitigate this: an opcode cache, a code-preload system...

> 2. Every request has an environment created then torn down.

That's no longer always true. When the code preload is enabled, a request can leak into another.

> 3. Every request is single-threaded. [...] Async network/IO requests are handled via extensions.

You mixing up two different things. The default PHP SAPIs have single-threaded request handlers (though IIRC the default deploy stack of Laravel differs). But the language has a native async feature through Fibers, from which coroutines can be implemented (see amphp/amp).

So PHP on the server side is usually like JS on the client side (except for workers): single-threaded with async. Though I haven't seen much use of Fibers in the wild, it's in the language.

comment 1w ago · link · parent

> (No built-in Lua though.)

I thought mod_lua was an official module. I've just checked with Debian stable, and their "apache2-bin" package depends on liblua5.

> Apache has plenty of life left

I would expect a project with "plenty of life left" to support HTTP3. And to use Git (or some modern DVCS) instead of Subversion.

BTW, a co-worker has to maintain an Apache server because its shibboleth mod is mandatory for that project, and he often complains about it, and so do I when they ask for help. Performance is worse than nginx, configuration is awful, documentation is uneven, some features (like .htaccess) are dangerous, etc.

Apache http is the only project that I know that still uses Subversion. They have published a Git clone on Github, but their main source is still svn. It's a bit worrying, because they won't attract new developers with that technical stack. Last I checked, the 2.5 branch looked dead, and the dev-list was barely active.

comment 2w ago · link · parent

Maybe "minimal" was not the right word. I hope the context made clear that I meant the type system was lacking even for basic uses. Here are 3 common cases.

Some PHP functions (e.g. opening a file) return a `resource` type, but PHP has no official way to declare it. So the right way is to declare `mixed` as an official type (which means `any`) and fix that declaration with a phpdoc comment.

Phpdoc provides generics (named "templates", à la C++), e.g. `iterable<Something>` where `iterable` is an official PHP type (which is awfully imprecise without phpdoc).

Phpdoc has tuples and (associative) array shapes, e.g. `@return list{int, \Error}`.

In past PHP versions, the type system was worse because the internal types were ambiguous: types were implicitly nullable, i.e. `string` meant `null|string`. When PHP gradually added sum types, they fixed that ambiguity.

comment 2w ago · link · parent

For anyone not familiar with PHP, static analysis is pretty much required because the official PHP type system is minimal. The detailed types are added through phpdoc comments, and they also help IDEs to provide a sane completion. For instance, the plain "array" should be detailed with phpdoc:

    /**
     * @param array<string, MyRecord> $input
     * @return list<int>
     */
    function foo(array $input): array
    {
        foreach ($input as $string => $record) {
            // IDE knows $record is an instance of MyRecord
The static analysis will use both type systems, and it's the only way to check that phpdoc are consistent. Psalm has various levels of strictness, and even at a very lax level, it can help detect errors or code smells.

There are two major static analysis tools for PHP, Psalm and PHPstan, both written in PHP. The latter used to be much slower, but last time I tried it there was little difference (about 20 s for 100k lines + dependencies).

My guess is that a new contender, Mago, written in Rust, will probably soon replace those other tools. Its commands (analyze, lint) are already almost as complete as psalm/phpstan. Though the migration won't be easy because it does not have a notion of levels.

comment 2w ago · link · parent

My login session starts a background ghostty instance, then each new window is almost instant when I press my i3 shortcut.

This process is documented with systemd, but it's not a requirement, a plain xsessionrc could work similarly: https://ghostty.org/docs/linux/systemd

comment 3w ago · link · parent

I'm not the GP, but I did use Kitty, then switched to Ghostty. There were some great features (e.g. a shorcut to load the current terminal content in a text editor), some arguable points (e.g. Python is Kitty's script language and I had to use it to configure tabs to my taste) and some annoyances (I've had various crashes with Kitty's Debian package, though it did get stable in later years).

For me, the major pain was font rendering. I could not find a portable configuration that would work with any screen. And even worse, for some pixel densities, whatever configuration I tried, the result was awful. In some cases, I vaguely remember there was a legacy mode that made text legible, but it had its own problems.

comment 4w ago · link · parent

As far as I know, there has been no proven vulnerability on a modern PHP (production) stack. The "Steal my Bitcoin" challenge was a toy project. The "lab" target used the embedded PHP server (`php -S`) which is for development only.

> Warning. This web server is designed to aid application development. [...] It should not be used on a public network. https://www.php.net/manual/en/features.commandline.webserver...

There are 3 main PHP interfaces (SAPI):

1. mod_php which is obsolete and requires Apache prefork (which should also be avoided)

2. php-fpm (FastCGI) which has been the default for more than a decade.

3. FrankenPHP is a new official interface much more suitable for containers.

There were 2 vulnerabilities.:

1. "OOM corruption". The advisory says there was a proven exploit with mod_php, but only for that obsolete SAPI. "Source analysis therefore supports FPM as a susceptible, though *no complete FPM exploit* has been demonstrated for this SAPI."

2. "stale global state". The advisory is The last PHP release (8.5) was vulnerable when the debug parameter fatal_error_backtraces was on. There was a suspicion that an exploit could exist in the session code for php-fpm, but it was unproven and probably unrealistic.

The "evidence" given at the end of the article seems old news to me. The honeypot was based on Apache-prefork + mod_php. As stated in the CVE, there is a proven exploit for that (obsolete) stack.

comment 1mo ago · link · parent

This article rephrases and shortens the original article: https://www.dailysabah.com/life/hittite-royal-archive-with-1...

comment 1mo ago · link · parent

> "paramilitaries terrorizing the Ostjuden."

From what I've read, the antisemitism during the Weimar Republic was mostly verbal. The government tried to fight it, but it was still growing. The situation changed very quickly in 32-33 when the NSDAP won the elections, built alliances to claim the power, then ended the Weimar Republic. But its first victims were the Communists, before the Jews.

comment 1mo ago · link · parent

>> They can use passkeys to prevent you from running unapproved software.

The expression was wrong, but the real meaning was described further in the post. The author meant that sites with passkeys can render unapproved software useless, in contrast to TOTP where any client is compatible.

comment 2mo ago · link · parent

> Visa transactions costs are 0,22 € out of a payment of 1 €, Mastercard's is 0,23 €, and the French CB network is 0,17 €.

Are you sure of these values? Because that's different from what I was told, which was that CB was cheaper for transactions of more than 10 €, because their fees were fixed, not rates like Visa and Mastercard.

From what I've just read (not counting the possible extra tax by the bank of the seller):

CB: 0.20% + 0.00117 € ⇒ 0.00317 € for 1 €, 0.20117 for 100 €

Visa: 0.20% + (0.01% to 0.014%) ⇒ up to 0.00214 € for 1 €, 0.214 € for 100 €

Mastercard: 0.20% + (0.15 to 0.17%)

The 0.20% is for the "interchange" described in the article. So it applies only when the seller and the buyer do not have the same bank. The maximal rate is fixed by the UE, and AFAIK everyone use the max value.

comment 2mo ago · link · parent

> The U.S. scores are interesting.

Unfortunately, those scores are not reliable. It is a recurring problem with the USA for the PISA studies.

The preliminary chapter explains why data has lower confidence is some places. For the USA, there were many problems, including political reluctance in some states or schools, that lead to uncontrolled biases. Notably, the ratio of unreachable children is 40 %, twice more than their upper limit for valid results.

comment 2mo ago · link · parent

Yes, bzip3 compresses that 1GB text file into 170 MB while zstd needs 213 MB (SI units, from my own tests with the "enwik9" file of the GP's page, and the latest releases of both programs, same commands). But the decompression (memory and speed) is a different story.

On my desktop, decompressing with zstd requires 128 MB and 1 s, while bzip3 uses 3.2 GB and 90 s.

Without `-b 511`, bzip3's ratio decreases and decompression requires about the same memory as zstd. But the decompression is still two orders of magnitude slower.

comment 2mo ago · link · parent

Maybe in Japan it will be effective. Since their "zone 30" creation was apparently a success, it seems probable that people will generally comply. My experience in France differs.

I live in a French town where the default speed limit is 30 km/h instead of the national 50 km/h. In the street where I live, the drivers that willingly (sometimes they can't overtake bikes and slow cars) observe that limit are a tiny minority. Why would they, since there are no automated controls in the city, and police sets manual controls once in a blue moon.

My street was already at 30 km/h in 2016 when the global speed limit was introduced by the city council. I'm pretty sure the mean speed has increased since then, though I don't have hard facts to prove it[^1]. At first I thought that, since all road signs were removed except on the city borders, the drivers needed a constant reminder of a limit that they'd prefer to ignore. Now I just think that people soon saw that there was almost no risk in breaking the law.

[^1]: There was a study, but the methodology was so poor that it was inconclusive. They monitored the speed in a dozen streets before and after the change, but it was done for different lengths of time (one or two weeks), at different times of the year, and with explicitly no attention payed to potential popular events or roadworks. So the average speed was globally lower after the change, but in most streets it had increased!

comment 2mo ago · link · parent

Do you realise that almost no one can understand what you're alluding to? So the comment looks not only vindicative but also stupid.

Just a reminder that may be relevant to your gripe: allowing free speech is perfectly compatible with forbidding abuse and hate speech.

comment 2mo ago · link · parent

The average American voter does think the USA play a positive role for the world, while the average non-American think otherwise. In details, a 2026 study from the Pew Research Center states that:

- 57% of A. think the USA contribute to peace in the world a great or a fair amount.

- Republicans and supporter think so at 82%.

- Outside of the USA, the median is at 35%.

comment 2mo ago · link · parent

No, that implication is not automatic. The Babylonian numeral system evolved over milenaries, and the simple space noting the absence of a digit between two digits was later noted by a "0" digit. But this symbol was never used by itself, so it did not mean "nothingness". In the same way, a civilization having the concepts of addition and subtraction does not automatically induce the concept of negative numbers.

On the other side, ancient Egyptian numerals did have a zero, but it was only for nothingness. But they did not have a placeholder zero, because their systems was similar to Greek and Roman numerals.

comment 2mo ago · link · parent

The question is the title is left unanswered by this shallow article. At least it's not AI slop since there are spelling mistakes ("You’re best hope").

> Say you’ve found 17 numeric symbols. You might infer that the writing used a base 20 system

Reals numerical systems are much more diverse than that. For instance, Babylon used a base 60 (hence our minutes and hours). But there were much less than 60 numeric symbols, since they had a symbol for 1 and 10. So 2 symbols for a base 60!

> never appears at the beginning of a number, you might infer that is a zero

In the later times Babylonians had a kind of zero, but it was very limited, only used to point the lack of a number between two, i.e. "2∅1" but never "21∅∅" which was written "21" (so numbers were ambiguous if the context didn't give the magnitude).

And Babylonians had floating numbers. So "4" could also mean 4/60.

What I mean is that Babylon had a zero, but it only covered a part of the positional modern zero. They could not write 0 - 3. And if their zero had been fully positional, there would have been numbers beginning with it, i.e. sexagecimals floats.

comment 2mo ago · link · parent

Same here. I immediately visualized one of my juggling balls (the hard kind, pastel blue) on my kitchen table, so the scene was clear. But I was focused on the ball, so I only felt someone approaching and saw their hand pushing the ball, which rolled and fell.

I tried to visualise a scene with more unfamiliar objects (a box in the street then a flood wave arrives) and I also built the scene from my own memories. But I'm obviously biased after the first test.

With objects that I've never seen myself (e.g. a handgun), I have a hard time imagining them and placing them in my imaginary scenes.

comment 3mo ago · link · parent

I'm sorry, but I can't understand how AFL++ could be applied to the Gleam case.

The main presentation of the tool lacks any description of its coverage, but from deep inside the documentation[^1] I gather that AFL++ is only relevant for GCC/LLVM languages. Gleam is not one of those.

[^1]: https://github.com/AFLplusplus/AFLplusplus/blob/stable/docs/...

comment 3mo ago · link · parent

The fact that 62% of Americans have little or no understanding of statistics may be related to those 40% of Americans that believe in Creationism, i.e. human (and fossils) were created by God a few thousands of years ago, and not of randomness and evolution over millions of years. I think no other industrial country has that disbelief in science. https://news.gallup.com/poll/261680/americans-believe-creati...

This problem with science is apparent in another survey: in 2009, a Pew Center publication showed that 33% of scientists in the USA believed in God (and 18% in a transient power), which is much lower than the 80% belief of the general American population at the time. Of course, this is not a proof of causality in either direction, but scientific knowledge is seemingly inversely correlated to religiosity. And the USA are still more religious than any other industrial more-or-less-democratic country.

comment 3mo ago · link · parent

I'm surprised. The stolen data had two parts: some relevant to the income taxes paid, some detailing the real estate (houses and lands) owned by the household. Are both of them public in Norway?

Anyway, the main problem is that the breaches into the many French national data stores seem increasingly frequent.

comment 3mo ago · link · parent

The post is verbose, but lacks substance:

- The last two sections (≈20% of the article, 5.Cloud and 6.IA) are barely relevant.

- Some comparisons are questionable. It claims that, since some taxes data was compromised, the trust in the national Federated Identity is eroded "as if Facebook Connect was hacked". That's strange, I think it should be "as the trust in Facebook Connect would be eroded when Facebook is hacked". Anyway, I think most people won't care.

- Some sentences make no sense: "Le piratage de Ficoba semble en être l'exemple type"... But "Ficoba" is not mentioned anywhere, and, though I know what the word means, I can't guess what the sentence points to.

The OP should have mentioned another important hack of French national structures that happened in december 2025 and which is well documented. IIRC, through phishing, a keylogger was installed on a teacher's computer. Then the hackers got credentials to an internal training platform for teachers. Then they exploited multiple security breaches and connections between Ministries to get access to the national police files.

comment 3mo ago · link · parent

Why write a fanboy text with unfair comparisons that hide the Postgres limitations?

For instance, for many simple needs MySQL is simpler than Postgres, with similar performance and consistency.

* No need for a connection pool, while many use cases with Postgres require PgBouncer and Co.

* Easy sort (and basic search) of multilingual text, because MySQL has case insensitive UTF8 collations.

* No need to VACUUM, which can be a hard problem (it was, the last time I used Postgres).

For full text search, I once worked on a project that considered several alternatives for this, including Postgres. Manticore Search was finally chosen because it was more performant, with better search results.

comment 3mo ago · link · parent

* Dealing with encrypted files is easy, and more versatile than a generic wrapper. E.g. to load a secret environment: `eval $(age -d -i secrets.env.age)`. With the added bonus that it only relies on a trusted tool, age.

comment 3mo ago · link · parent

Decades ago, I was taught to use `!` and Co, by a Linux user who was fond of the `sudo !!` trick. Then I switched from this implicit interpolation to explicit shortcuts, and I'm glad I did.

As suggested in the FAQ at the bottom, instead of !… you can use ctrl-r. Or better, optionally type the first letters then alt-p or "up". It's more powerful and more extensible. Other shortcuts, like alt-., allow navigating into the past parameters.

With up, alt-p, alt-. and such, the command line displays the real command. The !… magic is more error-prone and ambiguous; with zsh, I'd suggest hitting TAB to expand the magic into a static text.

I would add other entries to the FAQ: When I enter `sudo !!` will it be stored unchanged in the shell history, or stored after interpolation of `!!`? When I start a command line with a space, so that zsh does not put it in the shell history, will !… also ignore that line? Is `!$` recursive?

comment 3mo ago · link · parent

> not the best design [...]

So those engineers at Shopify worked hard for months on a more performant system, but they missed the obvious structure? They chose a complex denormalization for no good reason?

It may be true, but I think it's presumptuous to belittle their work when we have only partial information. My guess is that they had good reasons to think that the more obvious ways would not scale.

And from reading your comments in this thread, I believe your structure would fail at their scale. A SQL query that uses 2 sub-queries with "group by" is probably too heavy. From the post, at peaks there would be millions of active shopping carts.

BTW, I suspect most orders are just for 1 or 2 of each item, so the denormalization is not as heavy as it seems.

comment 3mo ago · link · parent

> Almost half of their expenses still go into "keeping Wikipedia up" (+ it's companion projects)

That's a bit of a stretch. I couldn't find any up to date information, but for 2024-2025 WMF wrote: "Across the Product & Tech department, we plan on allocating an estimated 50% of our resources to Wiki Experiences, 30% to Signals and Services, 5% to Future Audiences, and the remaining 15% to Product and Engineering Services."[0]

So "keeping Wikipedia up" is a very minor part (15%) of the "Investments in Technology" budget. It receives around 7% (15% of 48%) of the WMF total budget.

That not to say the rest of those "Investments in Technology" is useless. It's just that it's mostly about developing features, like updating the Wikipedia app, or creating functions and Wikipedia Abstract.

[0]: https://meta.wikimedia.org/wiki/Wikimedia_Foundation_Annual_...

12345
21