frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Open in hackernews

This game is a single 13 KiB file that runs on Windows, Linux and in the Browser

https://iczelia.net/posts/snake-polyglot/
68•snoofydude•2h ago

Comments

zamadatix•2h ago
For me:

- Browser: works after renaming to .html

- Linux: "./snake.com: line 20: lzma: command not found". Installing the xz package makes it work (already had XWayland enabled so X11 worked, but may be needed if you have a strict Wayland session).

- Windows: As either .com or renaming to .exe I get "The application was unable to start correctly (0xc0000005). Click OK to close the application." Not sure how to make this one work, it's definitely not AV related though (I have that stripped in this sandbox VM).

Edit: Got it working in all 3 now. On Windows I still had DEP enabled on all programs to test some apps earlier, turning that back off allowed it to launch.

deklesen•2h ago
its written in the post
zamadatix•2h ago
If you mean lzma it wasn't immediately apparent to me it was a binary requirement, but inspecting the hex dump at the end + the message is how I figured out it was. I wonder how much space you lose dropping lzma and doing some other method as "tail -c+4294 $0|head -c 5061|lzma -dc>/tmp/a;chmod +x /tmp/a;(/tmp/a&rm /tmp/a);exit" would be more universal and the linux portion isn't all that big.

If you mean the .html rename or whatever my Windows problem was, I must be missing it. Edit: Windows was DEP.

GlumWoodpecker•2h ago
If I ran it with just

    $ chmod +x snake.com
    $ ./snake.com
... then it would try to use Mono to launch it:

    Cannot open assembly './snake.com': File does not contain a valid CIL image.
But, running it explicitly with Bash works:

    $ bash snake.com
Pretty nifty but doesn't work out of the box on any Linux, at least :p Running Debian 13.
seba_dos1•2h ago
> ... then it would try to use Mono to launch it:

That's because of the binfmt handler that Mono installs which matches the PE header.

w4yai•2h ago
Works for me on Windows 11
zamadatix•2h ago
Hmm, Windows 11 25H2 here as well. Redbean works so there must be something about this particular approach combined with some unknown setting on my install.

Edit: Got it working, was DEP.

trollbridge•2h ago
One of the interesting things about Polyglot is that nobody did it any sooner. It would have been feasible a decade ago or two ago.
Retr0id•37m ago
Now I wonder when the first polyglot file was published. I kinda just assumed they'd been around forever. EICAR.COM comes to mind as a COM/plaintext polyglot
nvllsvm•2h ago
Not cross-platform, but I'm reminded of the kkrieger game for Windows which was a 96k FPS game that looked visually impressive for the time.

https://web.archive.org/web/20100304155706/http://www.thepro...

the__alchemist•2h ago
From that link: Still works on modern PCs! Was able to DL and launch.
bananaboy•1h ago
Very clever!
indigodaddy•1h ago
Wonder why they don't give a demo/link to the browser version
nxrabl•53m ago
It's the same file, you just rename it to end in '.html'
indigodaddy•27m ago
sure but they have a blog and a webserver that's serving html. just put the file there so i dont have to download anything or mess about too much. just want to click and see it
TuringNYC•1h ago
On a related note -- when I see the minuscule filesize of the original Zelda game on emulators, I marvel at how little text/code/information could produce how much wonder, how far-reaching impact, and how many hours of enchantment for me.

https://en.wikipedia.org/wiki/The_Legend_of_Zelda_(video_gam...

jsheard•29m ago
Zelda 1 was 128 kB, for those wondering.

Double that for the sequel.

gaigalas•1h ago
Quite cool.

You could distribute it as `.html` only, and use JS to offer a local download link to itself in the correct extension. A polyglot installer, of sorts.

For example, this gist is an HTML that, when opened, offers a download zip of its DOM in whatever state it currently is:

https://gist.github.com/alganet/c904acb57282402fc0bd724f1eeb...

I think you can use something similar to get the entire page contents as a blob, but I never tested with binary data in actual browsers. Perhaps even patch it to avoid the initial windows error.

ValdikSS•1h ago
https://js13kgames.com/
socketcluster•51m ago
I love the idea of applications which exist in one file which you can run anywhere. I've been working towards this with my serverless platform; you can build complex data-driven apps with just one .html file and mostly declarative HTML markup (thanks to web-components which are loaded from a remote server). With modern browser features, you don't need a bundling system. Once you do away with it; a whole universe is opened up.

The ability to load .html files over the file:// protocol is a powerful, often neglected feature. In practice, it means you can double-click an HTML file and it runs an app in your browser instantly.

Retr0id•32m ago
Sadly a lot of browser features are inaccessible from non-https contexts.
jsheard•25m ago
Don't most (all?) browsers consider file:// and localhost to be secure for the sake of enabling those features?

https://developer.mozilla.org/en-US/docs/Web/Security/Defens...

journal•47m ago
Can't you do that with a language model in less than one paragraph of instructions? Seems like overkill.

The struggle of resizing windows on macOS Tahoe

https://noheger.at/blog/2026/01/11/the-struggle-of-resizing-windows-on-macos-tahoe/
734•happosai•4h ago•336 comments

CLI agents like Claude Code make self-hosting on a home server easier and fun

https://fulghum.io/self-hosting
232•websku•3h ago•152 comments

This game is a single 13 KiB file that runs on Windows, Linux and in the Browser

https://iczelia.net/posts/snake-polyglot/
69•snoofydude•2h ago•23 comments

iCloud Photos Downloader

https://github.com/icloud-photos-downloader/icloud_photos_downloader
290•reconnecting•5h ago•148 comments

I Cannot SSH into My Server Anymore (and That's Fine)

https://soap.coffee/~lthms/posts/i-cannot-ssh-into-my-server-anymore.html
64•TheWiggles•4d ago•25 comments

FUSE is All You Need – Giving agents access to anything via filesystems

https://jakobemmerling.de/posts/fuse-is-all-you-need/
58•jakobem•3h ago•19 comments

Sampling at negative temperature

https://cavendishlabs.org/blog/negative-temperature/
108•ag8•5h ago•38 comments

I'd tell you a UDP joke…

https://www.codepuns.com/post/805294580859879424/i-would-tell-you-a-udp-joke-but-you-might-not-get
77•redmattred•2h ago•24 comments

I'm making a game engine based on dynamic signed distance fields (SDFs) [video]

https://www.youtube.com/watch?v=il-TXbn5iMA
162•imagiro•3d ago•21 comments

Don't fall into the anti-AI hype

https://antirez.com/news/158
554•todsacerdoti•14h ago•733 comments

Elo – A data expression language which compiles to JavaScript, Ruby, and SQL

https://elo-lang.org/
43•ravenical•4d ago•5 comments

The Next Two Years of Software Engineering

https://addyosmani.com/blog/next-two-years/
46•napolux•3h ago•18 comments

Gentoo Linux 2025 Review

https://www.gentoo.org/news/2026/01/05/new-year.html
291•akhuettel•13h ago•148 comments

Insights into Claude Opus 4.5 from Pokémon

https://www.lesswrong.com/posts/u6Lacc7wx4yYkBQ3r/insights-into-claude-opus-4-5-from-pokemon
24•surprisetalk•5d ago•5 comments

A set of Idiomatic prod-grade katas for experienced devs transitioning to Go

https://github.com/MedUnes/go-kata
101•medunes•4d ago•13 comments

Ask HN: What are you working on? (January 2026)

140•david927•8h ago•464 comments

Perfectly Replicating Coca Cola [video]

https://www.youtube.com/watch?v=TDkH3EbWTYc
128•HansVanEijsden•3d ago•68 comments

Show HN: What if AI agents had Zodiac personalities?

https://github.com/baturyilmaz/what-if-ai-agents-had-zodiac-personalities
9•arbayi•1h ago•1 comments

A 2026 look at three bio-ML opinions I had in 2024

https://www.owlposting.com/p/a-2026-look-at-three-bio-ml-opinions
17•abhishaike•3h ago•1 comments

Rare Iron Age war trumpet and boar standard found

https://www.bbc.com/news/articles/cr7jvj8d39eo
8•breve•4d ago•1 comments

BYD's cheapest electric cars to have Lidar self-driving tech

https://thedriven.io/2026/01/11/byds-cheapest-electric-cars-to-have-lidar-self-driving-tech/
111•senti_sentient•4h ago•123 comments

Poison Fountain

https://rnsaffn.com/poison3/
161•atomic128•8h ago•104 comments

Quake 1 Single-Player Map Design Theories (2001)

https://www.quaddicted.com/webarchive//teamshambler.planetquake.gamespy.com/theories1.html
41•Lammy•19h ago•3 comments

Anthropic: Developing a Claude Code competitor using Claude Code is banned

https://twitter.com/SIGKITTEN/status/2009697031422652461
226•behnamoh•5h ago•137 comments

"Food JPEGs" in Super Smash Bros. & Kirby Air Riders

https://sethmlarson.dev/food-jpegs-in-super-smash-bros-and-kirby-air-riders
255•SethMLarson•5d ago•66 comments

"Scholars Will Call It Nonsense": The Structure of von Däniken's Argument (1987)

https://www.penn.museum/sites/expedition/scholars-will-call-it-nonsense/
50•Kaibeezy•5h ago•6 comments

Meta announces nuclear energy projects

https://about.fb.com/news/2026/01/meta-nuclear-energy-projects-power-american-ai-leadership/
242•ChrisArchitect•6h ago•247 comments

I dumped Windows 11 for Linux, and you should too

https://www.notebookcheck.net/I-dumped-Windows-11-for-Linux-and-you-should-too.1190961.0.html
726•smurda•13h ago•685 comments

C++ std::move doesn't move anything: A deep dive into Value Categories

https://0xghost.dev/blog/std-move-deep-dive/
226•signa11•2d ago•183 comments

iMessage-kit is an iMessage SDK for macOS

https://github.com/photon-hq/imessage-kit
21•rsync•3h ago•5 comments