frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Open in hackernews

Nominal Types in WebAssembly

https://wingolog.org/archives/2026/03/10/nominal-types-in-webassembly
18•ingve•4d ago

Comments

beepbooptheory•1h ago
> field access is a bit odd; unlike structs which have struct.get, nominal types receive all their values via a catch handler.

I know this is meant to be silly, and I am no expert, but I kinda do like this syntax. Its like shaking the struct and seeing what falls out.

tlively•1h ago
Andy jests, but I would actually like to add nominal types to Wasm (along with type imports to make them usable). No proposal yet, but maybe later this year.

This blog post mentions that you can kind of emulate nominal types by putting all your types in one rec group, but then it brushes that off as inferior to using exceptions. (Which is hilarious! Good work, Andy.) What it doesn’t make clear is that people actually use this rec group trick in practice. There are two ways to do it: you can put literally all your types in one rec group, or you can emit minimal rec groups with additional “brand types” that serve no purpose but to ensure the groups have different structures. The former solution is better for code size when the entire application is one module, but the latter solution is better if there are multiple modules involved. You don’t want to repeat every type definition in every module, and using smaller rec groups lets you define only the types that are (transitively) used in each module.

The Binaryen optimizer has to ensure that it does not accidentally give distinct types the same structural identity because that would generally be observable by casts. Most of its type optimizations therefore put all the types in one rec group. However, it does have a type merging optimization that takes the casts into account[0]. That optimization is fun because it reuses the DFA minimization code from the original equirecursive type system we were experimenting with for Wasm GC. We also have a rec group minimization optimization[1] that creates minimal rec groups (by finding strongly connected components of the type definition graph), then ensures the types remain distinct first by using different permutations of the types within a rec group and then only as necessary by adding brand types.

[0]: https://github.com/WebAssembly/binaryen/blob/main/src/passes...

[1]: https://github.com/WebAssembly/binaryen/blob/main/src/passes...

kjksf•37m ago
Good lord. WebAssembly was sold as "portable assembly for the web". It's in the fricking name. Web. Assembly. Assembly for the web.

It was supposed to solve the problem of: some computers run x86, some arm, we need something that is equivalent, but portable across different cpus

What business is it for WebAssembly to know about complex types? What x86 instructions is there for `(type $t (struct i32))` ? Or doing garbage collection.

We would be better off standardizing on a subset of x86 and writing translators to arm etc. Or standardize on arm and translate to x86.

We know it can work. Apple did it with rosetta. Microsoft did it with Prism. I don't think WebAssembly implementation generate faster code than rosetta or prism.

QEMU did it simply (albeit slowly).

WebAssembly is becoming another JVM. It's not simple. It's not fast. It's not easy to use.

But now we're stuck with it and the only path is to add and add and add.

flohofwoe•20m ago
I guess you didn't read to the end?

> Friends, as I am sure is abundantly clear, this is a troll post :)

zffr•10m ago
> It's not fast.

Not disagreeing with you, but here’s an article from Akamai about how using WASM can minimize cold startup time for serverless functions.

https://www.akamai.com/blog/developers/build-serverless-func...

flohofwoe•6m ago
> It's not fast.

My emulators here have roughly the same performance as the same code compiled as native executable (this is mostly integer bit twiddling code).

rusakov-field•25m ago
Not familiar with WebAssembly, but from the namesake was expecting the syntax to kind of resemble assembly.

He is showing S-expressions ? That is its' syntax ? I am intrigued now.

flohofwoe•17m ago
Real-world WAT (WASM text format) looks more like this (e.g. it looks like a 'structured assembly' type of thing):

    i32.const 27512
    i32.load
    local.tee $var1
    if
      i32.const 27404
      i32.load
      local.get $var1
      call_indirect (param i32)
    end
S-expressions are only used outside such instruction blocks for the 'program-structure' (e.g. see: https://developer.mozilla.org/en-US/docs/WebAssembly/Referen...). IIRC early pre-release-versions of WASM were entirely built from S-expressions and as a 'pure stack machine' (I may remember wrong though).

To see what a complete WASM blob looks like in WAT format you can go here: https://floooh.github.io/sokol-html5/clear-sapp.html, open the browser devtools, go to the 'Sources' tab and click the `clear-sapp.wasm` file).

Montana passes Right to Compute act (2025)

https://www.westernmt.news/2025/04/21/montana-leads-the-nation-with-groundbreaking-right-to-compu...
101•bilsbie•2h ago•58 comments

1M context is now generally available for Opus 4.6 and Sonnet 4.6

https://claude.com/blog/1m-context-ga
989•meetpateltech•23h ago•393 comments

Baochip-1x: What it is, why I'm doing it now and how it came about

https://www.crowdsupply.com/baochip/dabao/updates/what-it-is-why-im-doing-it-now-and-how-it-came-...
172•timhh•2d ago•25 comments

Python: The Optimization Ladder

https://cemrehancavdar.com/2026/03/10/optimization-ladder/
116•Twirrim•3d ago•30 comments

Cookie jars capture American kitsch (2023)

https://www.eater.com/23651631/cookie-jar-trend-appreciation-collecting-history
10•NaOH•22h ago•0 comments

XML Is a Cheap DSL

https://unplannedobsolescence.com/blog/xml-cheap-dsl/
171•y1n0•4h ago•144 comments

Megadev: A Development Kit for the Sega Mega Drive and Mega CD Hardware

https://github.com/drojaazu/megadev
78•XzetaU8•7h ago•1 comments

Starlink Militarization and Its Impact on Global Strategic Stability

https://interpret.csis.org/translations/starlink-militarization-and-its-impact-on-global-strategi...
54•msuniverse2026•7h ago•42 comments

Philosoph Jürgen Habermas Gestorben

https://www.spiegel.de/kultur/philosoph-juergen-habermas-mit-96-jahren-gestorben-a-8be73ac7-e722-...
69•sebastian_z•2h ago•24 comments

Wired headphone sales are exploding

https://www.bbc.com/future/article/20260310-wired-headphones-are-better-than-bluetooth
301•billybuckwheat•2d ago•517 comments

9 Mothers Defense (YC P26) Is Hiring in Austin

https://jobs.ashbyhq.com/9-mothers?utm_source=x8pZ4B3P3Q
1•ukd1•2h ago

RAM kits are now sold with one fake RAM stick alongside a real one

https://www.tomshardware.com/pc-components/ram/fake-ram-bundled-with-real-ram-to-create-a-perform...
151•edward•6h ago•103 comments

Nominal Types in WebAssembly

https://wingolog.org/archives/2026/03/10/nominal-types-in-webassembly
18•ingve•4d ago•8 comments

Show HN: Channel Surfer – Watch YouTube like it’s cable TV

https://channelsurfer.tv
564•kilroy123•3d ago•167 comments

NMAP in the Movies

https://nmap.org/movies/
4•homebrewer•10m ago•0 comments

Mouser: An open source alternative to Logi-Plus mouse software

https://github.com/TomBadash/MouseControl
391•avionics-guy•21h ago•122 comments

The Isolation Trap: Erlang

https://causality.blog/essays/the-isolation-trap/
112•enz•2d ago•43 comments

Digg is gone again

https://digg.com/
311•hammerbrostime•21h ago•317 comments

Hammerspoon

https://github.com/Hammerspoon/hammerspoon
322•tosh•22h ago•117 comments

Show HN: Ink – Deploy full-stack apps from AI agents via MCP or Skills

https://ml.ink/
14•august-•3d ago•2 comments

Can I run AI locally?

https://www.canirun.ai/
1329•ricardbejarano•1d ago•323 comments

Secure Secrets Management for Cursor Cloud Agents

https://infisical.com/blog/secure-secrets-management-for-cursor-cloud-agents
31•vmatsiiako•4d ago•4 comments

I found 39 Algolia admin keys exposed across open source documentation sites

https://benzimmermann.dev/blog/algolia-docsearch-admin-keys
145•kernelrocks•17h ago•42 comments

Michael Faraday: Scientist and Nonconformist (1996)

http://silas.psfc.mit.edu/Faraday/
30•o4c•3d ago•3 comments

Recursive Problems Benefit from Recursive Solutions

https://jnkr.tech/blog/recursive-benefits-recursive
39•luispa•3d ago•21 comments

Online astroturfing: A problem beyond disinformation

https://journals.sagepub.com/doi/10.1177/01914537221108467
4•xyzal•42m ago•0 comments

Atari 2600 BASIC Programming (2015)

https://huguesjohnson.com/programming/atari-2600-basic/
46•mondobe•2d ago•12 comments

Show HN: GitAgent – An open standard that turns any Git repo into an AI agent

https://www.gitagent.sh/
5•sivasurend•2h ago•0 comments

Jürgen Habermas, influential German philosopher, dies at 96

https://apnews.com/article/juergen-habermas-dead-germany-2b541721af6cb19abfaa923359d091b5
10•mitchbob•1h ago•4 comments

A Survival Guide to a PhD (2016)

http://karpathy.github.io/2016/09/07/phd/
150•vismit2000•4d ago•92 comments