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/
63•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•1h ago
its written in the post
zamadatix•1h 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•1h 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•1h 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•1h ago
Works for me on Windows 11
zamadatix•1h 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•15m 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•1h 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•31m ago
It's the same file, you just rename it to end in '.html'
indigodaddy•5m 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•7m ago
Zelda 1 was 128 kB, for those wondering.

Double that for the sequel.

gaigalas•39m 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•38m ago
https://js13kgames.com/
socketcluster•29m 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•10m ago
Sadly a lot of browser features are inaccessible from non-https contexts.
jsheard•3m ago
Don't most (all?) browsers consider file:// and localhost to be secure for the sake of enabling those features?
journal•25m ago
Can't you do that with a language model in less than one paragraph of instructions? Seems like overkill.

Show HN: AeroTag – Tag-based workspace management for AeroSpace (macOS)

https://typester.dev/blog/2026/01/11/tag-based-workspace-management-with-aerospace
1•typester•1m ago•1 comments

Hubble Telescope's Final Countdown: Could It Disappear Sooner Than Expected?

https://dailygalaxy.com/2026/01/hubble-countdown-could-it-disappear-sooner/
1•TMWNN•6m ago•0 comments

Token-Count-Based Batching: Faster, Cheaper Embedding Inference for Queries

https://www.mongodb.com/company/blog/engineering/token-count-based-batching-faster-cheaper-embedd...
1•fzliu•8m ago•0 comments

Tuning Random Generators: Property-Based Testing as Probabilistic Programming [pdf]

https://web.cs.ucla.edu/~todd/research/oopsla25a.pdf
2•todsacerdoti•10m ago•0 comments

Show HN: Built a course on buying small businesses – validating demand

https://smalldealschool.com/
1•boring_million•12m ago•1 comments

A $400k payout is putting prediction markets in the spotlight

https://apnews.com/article/prediction-markets-maduro-trades-1f47e737f915fff00c57f03e7390b41f
3•petethomas•16m ago•0 comments

Matchbox Educable Noughts and Crosses Engine

https://en.wikipedia.org/wiki/Matchbox_Educable_Noughts_and_Crosses_Engine
1•icwtyjj•18m ago•0 comments

Big Tech's Ugly Duckling: Can Snap Finally Execute?

https://ossa-ma.github.io/blog/snapchat?
1•ossa-ma•20m ago•0 comments

Live Captions

https://avc.xyz/live-captions
1•wslh•23m ago•0 comments

You don't need a skill registry (for your CLI tools)

https://solmaz.io/skillflag
1•hosolmaz•28m ago•0 comments

The US Empire is going supernova

https://simplicius76.substack.com/p/the-us-empire-is-going-supernova
1•SanjayMehta•30m ago•0 comments

Ogre 14.5 Released

https://www.ogre3d.org/2026/01/10/ogre-14-5-released
1•klaussilveira•32m ago•0 comments

Show HN: Instagram Saved Collection Downloader

https://chromewebstore.google.com/detail/instagram-saved-collectio/dibmfjgbnhbfhlajpahnbiiabpdabajo
1•qwikhost•36m ago•0 comments

Revolutionary eye injection saved my sight, says first ever patient

https://www.bbc.co.uk/news/articles/c89qyv98lzdo
2•1a527dd5•38m ago•0 comments

Show HN: I built an autopilot investor outreach tool – and it became my startup

https://pilt.ai
1•citizenbab•44m ago•0 comments

SwiftScripting (type-safe AppleScript from Swift)

https://github.com/tingraldi/SwiftScripting
1•frizlab•46m ago•0 comments

The Agent Fallacy

https://noemititarenco.com/blog/the-agent-fallacy-prompt-orchestration/
2•dvt•48m ago•0 comments

A ribbon worm's unique attack: R/interestingasfuck

https://old.reddit.com/r/interestingasfuck/comments/1p26zwp/a_ribbon_worms_unique_attack/
2•vinnyglennon•50m ago•0 comments

Show HN: Featureless – a one-page, distraction-free web app for writing

2•emanoj•54m ago•2 comments

Show HN: What if AI agents had Zodiac personalities?

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

iOS as Acceleration

https://arxiv.org/abs/2512.22180
2•PaulHoule•55m ago•0 comments

Trump may be beginning of the end for enshittification – make tech good again

https://www.theguardian.com/commentisfree/2026/jan/10/trump-beginning-of-end-enshittification-mak...
8•pabs3•56m ago•0 comments

How to stalk your ex; made easier than ever [video]

https://www.youtube.com/watch?v=cK6WyS2JipQ
1•vo2maxer•56m ago•0 comments

Discount Gambit

https://longform.asmartbear.com/discount-gambit/
1•mooreds•1h ago•0 comments

Kreuzberg: Extract text and metadata from a wide range of file formats

https://github.com/kreuzberg-dev/kreuzberg
2•thunderbong•1h ago•0 comments

Show HN: UCP Demo – Interactive Demo of the Universal Commerce Protocol

1•init0•1h ago•0 comments

Ethical Principles in the Creation of Artificial Minds

https://nickbostrom.com/ethics/aiethics
1•maxloh•1h ago•0 comments

Human-in-the-loop NLP as a first-class control layer

https://github.com/rado-stack/human-in-the-loop-nlp
1•rado-stack•1h ago•0 comments

Digital Euro 'only defence' against deepening US control of money

https://www.ft.com/content/b0602271-cd43-4a6e-a96d-c8166a05d040
4•rorylawless•1h ago•1 comments

I Made My Own Programming Language

https://github.com/Youg-Otricked/QuantumC
1•YougOtricked•1h ago•0 comments