MurphyA/hacker-news huggingface dataset:
Show HN: Minfern – Type inference for JavaScript without transpilation
by _sinelaw_ | 2025-12-28 12:50:42+00:00
I wrote a type checker (minfern - https://github.com/sinelaw/minfern) for a subset of javascript with no transpilation. It accepts valid JS as input and allows a subset of JS code to pass the checking. There’s no transpilation or compilation needed. The input code can be run directly.

Try it online at: https://sinelaw.github.io/minfern/

It could be used for checking code targeting normal JS runtimes, or runtimes like mquickjs (though infern is more strict but also allows things like ‘const’ which mquickjs doesn’t). minfern is based on the type system for Infernu, which I wrote back in 2015, but is less hacky and has a cleaner implementation.

Very simple example:

function calculateTotal(product, quantity) {
return product.price * quantity;
}
var item = {
name: "Wireless Mouse",
cost: 25 // Note the property name is 'cost', not 'price'
};
console.log(calculateTotal(item, 2));

Output:

Error: Property 'price' not found in type {cost: Number, name: String}
╭─[ tests/example_error.js:11:13 ]
│
11 │ console.log(calculateTotal(item, 2));
│ ───────────┬───────────
│ ╰───────────── Property 'price' not found in type {cost: Number, name: String}
────╯

Type system features:

- Full type inference with principle typing, support for type annotations

- Parameteric polymorphism (aka “generic functions”)

- Structural typing with row-type polymorphism

- Object method typing with equi-recursive types (for self/“this”)

- Polymorphic object methods (still considered rank-1)

- Basic constraints “Plus a” and “Indexable a” to allow + and [] to apply to different types like numbers, strings, arrays.

This allows a subset of JS expressions to be checked.

Some JS idioms are not allowed by this system:

- No union types (design choice) - return values, variables, arrays, etc must have a single type. Currently it doesn’t support returning null/undefined either, this can be fixed in the future by adding Optional as a type, but makes principle typing harder.

- No sum types (yet) - this explains why I haven’t added Optional<T>, I think sum types will fit in the type system and are doable. Once added also enums could be expressed.

- Value restriction forbids reassigning to polymorphic variables after declaration (ML-style).

- As a result of the above - can’t use && / || operators like some people do in JS. The operators are required to have the same type on both sides (no allowing “undefined” on one side)

- No type coercion, converting a number to a string (for example) requires using String() constructor.

- And probably other limitations that people might see as a limitation rather than a feature of the type system.

Disclaimer: this type checker comes with NO WARRANTY. I am not a language expert. I didn’t prove soundness, and would love someone who’s an expert to look at it. That being said - it looks correct on all the tests I’ve tried. It’s based on HMF and other published type systems but combines things in a different way.

GitHub: https://github.com/sinelaw/minfern
by mkesper | 2025-12-28 12:52:08+00:00
Some years ago I wrote "just a little script" to handle encrypting password-store secrets for multiple recipients. It got quite ugly and much more verbose than planned, switching gpg output parsing to Python for sanity.
I think I used a combination of --keyring <mykeyring> --no-default-keyring.
Never would encourage anyone to do this again.
by aljgz | 2025-12-28 12:52:33+00:00
No criticism of SSL-Certs in particular.

Essentially the flip side of any critical but low maintenance part of your system: it's so reliable that you can forget to have external monitors, it's reliable enough that it can work for years without any manual labor, it's so critical that can break everything.

Competent infra teams are really good at going over these. But once in a while one of them slips through. It's not a failure of the reliable but critical subsystem, it's a failure mode of humans.

One of the main ways "How Complex Systems Fail"
by mort96 | 2025-12-28 12:53:37+00:00
There's a huge difference in programming model. You can rely on C++ or Rust destructors to free GPU memory, close sockets, free memory owned through an opaque pointer obtained through FFI, implement reference counting, etc.

I've had the displeasure of fixing a Go code base where finalizers were actively used to free opaque C memory and GPU memory. The Go garbage collector obviously didn't consider it high priority to free these 8-byte objects which just wrap a pointer, because it didn't know that the objects were keeping tens of megabytes of C or GPU memory alive. I had to touch so much code to explicitly call Destroy methods in defer blocks to avoid running out of memory.
by MrJohz | 2025-12-28 12:53:44+00:00
You don't need the hidden="until-found" for details/summary, because that has those semantics automatically, but you can use that for other elements that behave similarly (for example tabs, which can't quite correctly be implemented with details/summary, and so needs to be done by hand).

Also I think the event isn't currently emitted consistently on all browsers (and maybe not at all for hidden="until-found"?) so unfortunately you can't quite rely on that yet if you need to sink some JavaScript state to your html. But in general, yeah, this is a really cool feature.
by somenameforme | 2025-12-28 12:53:54+00:00
The amount of currency does not have to correlate with the size of an economy. When the economy grows while the amount of currency stays the same then your money simply becomes worth more. For the overwhelming majority of history this was taken to be a good thing. The argument for inflation is that if money become worth more over time then it would discourage investment and encourage money hoarding.

That's probably not untrue, but that critique doesn't simply make the alternative better. Money becoming worth less, inflation, creates an arguably worse scenario where now wealthy individuals are motivated to hoard things instead of currency. For instance Bill Gates is currently the largest private landowner of farmland in the US. This issue is where you get the WEF also publishing their 'You will own nothing, and be happy.' goal. I find this more unpleasant, and even dystopic, than Scrooge nosediving into his stash of ever more valuable dollars.

Another major issue here is that lower classes are the most unable to deal with inflation. They can squirrel away some money, but in an inflationary system that's the last thing you want to do. For instance stuff like bank CDs are basically just exploiting economically illiterate individuals. Nobody wants money in an inflationary system, but lower classes need immediate access to their money for the next time e.g. their car breaks down, and they are extremely risk averse. The net result of this is a system that not only perpetuates but directly drives ever greater extremes of wealth inequality.
by mightybyte | 2025-12-28 12:54:28+00:00
Was just talking with someone the other day who used to write Haskell professionally but is now using Python. He said that in his experience when there are bugs the "blast radius" is much larger in a dynamic language like Python than in a static language like Haskell. That has been my experience as well.

Something I haven't seen talked about, though, is how powerful the type system is for constraining LLMs when using them to generate code. I was recently trying to get LLMs to generate code for a pretty vague and complex task in Haskell. I wasn't having much luck until I defined a very clear set of types and organized them into a very clear and constrained interface that I asked the LLM to code to. The results were much better!

Sure, you can use these same techniques in less strongly typed languages like Rust, and you can probably also use a similar approach in dynamically typed languages, but Haskell's pure functions allow you to create much stronger guard rails constraining what kinds of code the LLM can write.
by ljf | 2025-12-28 12:54:48+00:00
When I was commuting back to London for work I tried a hostel in Central London, I think it was about £25 a night 9 years ago. The room itself was clean and 'only' 6 people in it.

The main lobby was nice and a pint was a reasonable price - I sat there after having dinner at work, and read a book, which felt pretty nice to be honest.

The bed was comfy, with clean good smelling sheets.

But there were three issues that meant I went back to relying on friends and family until I got a local job.

1. Someone's feet smelt terrible - so bad it was hard to sleep

2. Someone snored loadly - it was even harder to sleep

3. The shower was grimy. I was lucky to have a ThirdSpace membership so showered there instead

It was a bargain and saved me traveling after a long day of work and having to be social after a very early start to get to London on the Monday. But the better option for me was to find a suitable local job and not do the extra long week commute. (I was also missing my family loads too, so it was never a longer term option for me).
by mmasu | 2025-12-28 12:55:04+00:00
I use the house analogy a lot these days. A colleague vibe-coded an app and it does what it is supposed to, but the code really is an unmaintainable hodgepodge of files. I compare this to a house that looks functional on the surface, but has the toilet in the middle of the living room, an unsafe electrical system, water leaks, etc. I am afraid only the facade of the house will need to be beautiful, only to realize that they traded off glittery paint for shaky foundations.
by Vincent_Yan404 | 2025-12-28 12:55:19+00:00
That’s a great question. In the early days, physical travel permits were indeed the norm. But the most effective 'security precaution' was psychological.

We had secrecy education (保密教育) starting as early as primary school. We were taught from a very young age that our city didn't exist to the outside world, and we simply didn't talk about it. But when I was a kid ,I didn't know anything about 404.
by nirui | 2025-12-28 12:56:47+00:00
It is more useful to know what exactly you're writing beyond the description of "business logic and real world problem".

For example, writing UI components maybe easier on some language than writing abstract algorithms, writing standardized solutions (i.e. text-book algorithms, features, etc) is easier than writing customized algorithms, etc.

Also, writing code can be very fast if you don't unit test it, especially for CURD apps. In fact most of my coding time was spent on writing unit tests.

I really hoped AI could write those tests for me to lock the specs of the design completely down. But currently it's the opposite, I have to write test for AI generated code. So, my over all experience can be described as the tyranny of reading other people's code times 10.
by sfn42 | 2025-12-28 12:57:06+00:00
I've never met a designer who wasn't completely fine with my suggestions for more pragmatic solutions. Like just styling a default scrollbar instead of implementing my own scrollbar to make it exactly like the design. Using a default drop-down menu instead of rolling my own just so I can round the corners of the selects.

The designers I've worked with are fine with these things. We have more important things to work on than small style details. We can go back and change these things later if anyone actually cares, but generally nobody ever does.
by cons0le | 2025-12-28 12:57:41+00:00
Hear hear. Ban all advertising. We could do it slow.

Start by banning all gambling and drug commercials. That's like 20% of all commercials right there. This is already normal in other countries.

Then ban all billboards. People hate them already.

Then the big one, ban targeted advertising. With personalized ads gone, all of the incentives that make data collection profitable are gone.

Of course there will still be bad actors that want data mining to continue. But right now you can't even read 95% of websites because they have popups that make you agree to data mining just to get in. I'll be searching for like, a recipe and they want my name, device IP, browser fingerprint, and anything else they can pinch.

I'm searching for a nice spinach salad recipe. I go to google

First it fires up an LLM, which will run a GPU in an AI data center that they probably cleared a forest to build.

I just made nvdia stronger. I just helped pump their AI "adoption" numbers. And I helped train an AI that will help layoff me and my friends.

As always I run the search again with "-noai" at the end. Now I'm searching twice for no reason. The results were better, and faster 10 years ago.

It gives me results and I click the first link. A video that I can't pause starts auto playing. This recipe isn't that good so I go back and find another. I need to click the back button 4 times.

I try another link. And get another pop up. I opt into data mining this time because uBo is having trouble with the full page transparent overlays. Now they have my data to sell to 3rd party intermediaries that will sell them to companies like palantir and cambridge analytica. Every search builds a little more of my "shadow profile".

Maybe I should have just gone to the library and taken a picture. All I wanted was a salad recipe and I've now helped train the system that made brexit possible. I've helped nvdia. I've helped the very AI datacenters that I hate. I've helped the data miners.

The experience of using a computer in 2025 is exhausting. Particularly search engines. They used to work so good. They used to be so fast.
by fuzzfactor | 2025-12-28 12:57:50+00:00
Good observation.

In Houston the rail does not actually extend to any suburbs, if they have that in Chicago it would probably make a big difference.

I got the idea when they were building it in Houston that a large bit of the Metro system is geared toward transporting people in lower-income areas who can't afford cars, so they can gain employment downtown and in the med center.

When it comes to toll roads most suburbs have a long-established freeway commute, but directly west from downtown a major suburb is known as the International District containing a large concentration of immigrants. The only traffic solution leading in that direction was built as a tollway instead.

It all started with the Beltway 8 toll bridge with toll that was cheaper than the gas saved by taking alternate routes.

By now the toll road authority has expanded and embraced a growth mindset for so long, and in recent years gotten so expensive, that any upcoming candidate for County Judge may be able to prevail on a single-issue of lowering the tolls alone.
by jibal | 2025-12-28 12:58:07+00:00
> You took a left-turn

I certainly didn't; I simply quoted a sentence from the article. (I've noticed that some people have difficulty distinguishing between the person who quotes something and the person being quoted ... it might be a Sally-Anne effect.)

> It’s the rest of the crap in smokes and vapes to be concerned with.

Yes, which makes this article even less reliable.
by saghm | 2025-12-28 12:59:05+00:00
Not related to the topic, but seeing this tidbit in the article took me by surprise;

> PSA: if you don’t see syntax highlighting, disable the 1Password extension.

This linked to the following discussion that's been ongoing for over a week (with acknowledgement from 1password that they're looking into it but as far as can tell no ETA on the fix or explanation for why it's happening in the first place):

https://www.1password.community/discussions/developers/1pass...

I know that browser extensions are in general a pretty terrible ecosystem in terms of security, but am I off-base for thinking this is not a great look for 1password? Maybe I'm just underestimating how hard this is to solve generally, but my expectation would be that it shouldn't be that hard to keep track of which circumstances you're loading entire external scripts to manipulate the DOM and not do it accidentally in places you have no need for it.
by tourmalinetaco | 2025-12-28 12:59:17+00:00
M1 macbooks are known to have fragile screens, there are multiple class action lawsuits over it. Just because you, anecdotally, have not had issues does not mean they don’t exist.

And the average Joe is far better off with a newer laptop with the same performance for 1/3rd the price. The M1 Air will be out of updates in 2 years, requiring whoever’s listening to your advice to either suffer with an insecure laptop or to spend another grand or more on a new laptop.

Apple has no unique benefits for the average person, and in fact a Chromebook fulfills the average user’s needs perfectly fine.
by troad | 2025-12-28 13:00:02+00:00
A good faith interpretation of the comment you're responding to is that they're saying a standardised marquee tag should have been introduced, with extra functionality akin to horizontally scrollable carousels.

Considering that such a tag would naturally have had considerations for accessibility options, like all standard HTML tags, it would be an accessibility win over the current CSS/JS mess.

As for the historical note - yes, we know. We were there.
by taylodl | 2025-12-28 13:00:17+00:00
This feels like it's rearranging the deck chairs on the Titanic. We know GR is incorrect - after all it predicts singularities. GR is also silent on how stress/energy/momentum causes curvature in space time. In that vein, GR seems more like a law of gravity rather than a theory of gravity.

I would suggest we work on an actual theory of gravity before we tackle black hole event horizons and their formation. Such a theory should provide a lot of insight into the formation (or not) of black holes.
by PopAlongKid | 2025-12-28 13:00:42+00:00
I stayed in this location as a solo tourist for four nights last year. I was in a "cocoon" not a capsule. My room looked a little different from the photo at the website for 1 person, in that there were no hooks on the wall for hanging clothes, but there was a low, small table that could be used to set a laptop computer on top. No chairs, no TV, no windows, but with a sink/toilet/shower. It was OK, although I probably wouldn't do it again, since I can afford something more traditional if I choose (like the Tower Hotel, which I moved to for another four nights).

The facility was nice, clean and modern (it is in the Trocadero building, I think they have over 700 rooms when I asked), but the cafe didn't open until something like 9 AM so I had to go out several times in the morning for my coffee. I ended up using the bathroom mirror backlight as a night light, otherwise it is pitch black.

One way to describe it is as a very pleasant jail cell, which (of course) you can leave at will.
by hopelite | 2025-12-28 13:01:06+00:00
Excuse my delivery of bad news, but the time to say no would have been when the dystopian British government installed CCTV cameras everywhere. The Fox has been in the henhouse for several decades now, asking politely or just mumbling "no" under your breath is not going to do anything at all. You may as well just save yourself the further humiliation of inevitable defeat with that mentality. People are going to say no to the implementation of a system with direct, root ties to the "intelligence" (we really need a better term for that) triad, when the peasants are totally dependent on the centralized, ruling class controlled health services of the NHS???

Hello? Does no one else notice that the peasants are in a a dungeon, in a cage in that dungeon and shackled to the wall in that cage in the dungeon? And they're going to say "no"???? People clearly have either gone insane and are lying to themselves, or they have absolutely no idea what the reality is that they are experiencing all around them out of delusions or stupidity, or both.
Show HN: Word-GPT-Plus – Integrate AI and Agent Directly into Word
by kuingsmile | 2025-12-28 13:01:14+00:00
I'm sharing a project I've maintained for two years: a powerful Word plugin called Word-GPT-Plus. It integrates modern AI and agent capabilities directly into your document workflow.
I recently completely rewrote the project with a modern UI and added an "Agent Mode" for handling complex, multi-step tasks within Word and multiple tools like web fetch/search, document manipulate can be used by LLM.
Feedback and criticism are very welcome!

Repo: https://github.com/Kuingsmile/word-GPT-Plus
by donatj | 2025-12-28 13:01:17+00:00
Once a year for a number of years we would have a small total outage as our Ops team forgot to renew our wildcard certificate. Like clockwork.

It's been a couple of years now so they must have set better reminders for themselves.

I have tried several times to convince them of the joys of ACME, but they're insistent that a Let's Encrypt certificate "looks unprofessional". More professional than a down application in my opinion at least.
by mexicocitinluez | 2025-12-28 13:02:03+00:00
> > Palantir do not control that part of decision making (you as a voter do! You did vote right?)

You're not actually suggesting that the company providing the data isn't at all part of that process, are you?

Can you, for a second, imagine a company collecting/forwarding only data that's beneficial to it's core objective? Especially one whose led by a guy who has quite literally benefits off of a war????
by tialaramex | 2025-12-28 13:02:22+00:00
In this context the specific thing they are is certificates from the Web PKI. A PKI (Public Key Infrastructure) is an arrangement with Relying Parties (in this case, basically everybody), CAs (Certificate Authorities - in this case a mix of companies, not-for-profits, government and so on entities around the world) and Subscribers. The Subscriber says to a CA "I want you to certify that I'm some.website.example" and the CA issues them an X.509 certificate, which the Relying Parties trust to prove that this really is some.website.example. The Relying Parties (indirectly as we'll see shortly) ensure they trust only CAs who will do this name certifying job well. This uses Public Key encryption, which is a mathematical technology where you pick two related huge numbers, one public key (revealed to anyone who wants it) and one private (known only to you) and then you can prove you know the private key by performing arithmetic that anyone with the public key can verify is correct, and yet they could not perform that arithmetic without your private key.

It is called the Web PKI because although this secures most of the Internet, the billions of Relying Parties are represented in practice almost solely by a handful of Trust Stores who mostly make Web Browsers. Specifically, Mozilla, Google, Microsoft and Apple.

The Web PKI requires that the certificates are not only X.509 but specifically they obey PKIX, RFC 5280 which explains how X.509 (a standard from the X.500 directory system, a directory which in reality never ended up existing) can be used for the Internet (which very much did end up existing) via "Alternative Names". When your modern certificates have a "Subject Alternative Name" the word Alternative there means alternative to the X.500 naming scheme, which is irrelevant to us, specifically the Internet's two alternatives, an ipAddress (4 bytes or 16 bytes forming either an IPv4 or IPv6 address) or a dnsName (a subset of ASCII characters, punctuated with but never ending in a dot)

Edited: Correct s/Server/Subject/ in expansion of SAN acronym
by mexicocitinluez | 2025-12-28 13:03:45+00:00
Absolutely.

And that the people who stand to benefit the most from another war might want to filter/target that data in a way to make that more probable?

I mean, I know it's a stretch. Especially with how benevolent our current class of billionaires are. But just imagine a guy who thinks money is more important than anything else. I know... another stretch. lol.