8 ms·
Show HN: Bitwise Liminal – A Short Film in 256 Bytes of Code
A Short Film in 256 Bytes of Code
Programmed by KilledByAPixel
Presented at Lovebyte Party 2024
...
I found an old VHS tape at a yard sale.
It was labeled "Bitwise Liminal" in sharpie.
But when I watched the video it was only static.
Then I started having vivid and... unsettling dreams.
Also I couldn't stop thinking about that weird VHS tape.
After researching I learned it was a digital backup.
Using some special software I recovered the data.
To my shock, it was a 256 byte program...
With trembling hands I opened it in a web browser.
Strange. This reminds me of the dreams I've been having.
Now I don't need to sleep anymore.
I just keep watching.
...
l ɐ u ᴉ ɯ ᴉ ⅂ ǝ s ᴉ ʍ ʇ ᴉ ᗺ
<canvas id=c><svg onload=setInterval("for(t+=.1,R=T=C=Math.cos,c.width=w=128,i=9986,V=t/9&3;Y=i--/w;c.getContext`2d`.fillRect(X,Y,(C(t/6)*T^V*i/1e4*T+t)%20?(R=T++,1):(T=9,19/R),5/Z))for(Z=5,X=i%w+4/R;0<(V*95+C(t/3)+Z*X/64-Z^Z|(60-Y)*Z/58)%13;Z+=.2);",t=9)>
- asadhaider 3y agoThe author has more content at https://killedbyapixel.github.io/TinyCode/ https://killedbyapixel.github.io/TinyCode/
- sebastianconcpt 3y agoCyber-hallucinogenic cryptopoetry.
- deleted 3y ago[deleted]
- cal85 3y agoWhat the fuck. How?
- notso411 3y ago[dead]
- Retr0id 3y agoRay marching, most likely.
- KilledByAPixel 3y agoYes, this raymarching, though the vhs effect was really the trickiest part.
- riidom 3y agoNice visual style!
- bloqs 3y agoNeat
- actionfromafar 3y agoThank you, I lost it in a move ages ago!
- zokier 3y agoReminds me a bit of Megapole (another 256b demo) https://www.youtube.com/watch?v=Z8Av7Sc7yGY https://www.youtube.com/watch?v=Z8Av7Sc7yGY
- zokier 3y agoYou'll want to put the code in code block (prefix line with spaces) so asterisks don't get mangled
- dang 3y agoI've changed the formatting to do that above - I hope it's better now! https://news.ycombinator.com/formatdoc https://news.ycombinator.com/formatdoc
- javajosh 3y agoA minor note: this is the first time I've seen an svg embedded in a canvas purely for it's onload event. Within this context the canvas is referred to by its (bare) id. How strange and wonderful!
- kilroy123 3y agoI noticed and thought the same! Pretty cool.
- cdelsolar 3y agoWhy is that allowed? I didn’t realize one could do that in js.
- cal85 3y agoIf you nest any valid elements inside an unknown element like <asdf>...</asdf>, browsers just ignore the invalid wrapper element but still display the nested children. This fact is exploited by spec authors when introducing new tags to allow backwards compatibility: elements like canvas, video and audio all specifically allow optional children that are automatically hidden - but they won't be hidden in older browsers that don't know about the new elements. This allows you to easily define arbitrary fallback content for older browsers that don't support the new elements, just by nesting children in them.
- KilledByAPixel 3y agoIt turns out that packing it into an svg onload is a tiny bit smaller then using a script tag! It is possible to save a little more space by putting it in the canvas onclick event.
- deleted 3y ago[deleted]
- zeroq 3y agoI can't stress enough how much I admire that it is true 256 bytes, instead of usual 1k game jams, where submissions are presented as zipped, gzipped, and postfixed, and not including assets to fit the criteria. Hats off.
- Hikikomori 3y agoThis one is also cool. https://linusakesson.net/scene/a-mind-is-born/ https://linusakesson.net/scene/a-mind-is-born/
- noman-land 3y agoThis one is incredible.
- rvba 3y agoIs "import gameassets" allowed in those competitions? On a side note "import GOTO" works in python :)
- selcuka 3y ago> On a side note "import GOTO" works in python :) Never heard of this, and it doesn't work on my interpreter (tested with both 2.7 and 3.11). Are you sure it's not a third party package?
- Retr0id 3y agoIt indeed does not work. I was curious, and found this hilarious article "confirming" its existence: https://www.edureka.co/blog/goto-statement-in-python/ https://www.edureka.co/blog/goto-statement-in-python/ - it's complete nonsense and appears to have been written by ChatGPT. The feature has been implemented a few times as a joke (more or less), e.g. https://github.com/snoack/python-goto/ https://github.com/snoack/python-goto/, but that one at least hasn't been updated for 5 years.
- KilledByAPixel 3y ago
- gpderetta 3y agoFantastic. Also this would be perfect as an SCP.
- john-tells-all 3y agoTheir work is always jaw-dropping. Here is some explanation of the tools they use: https://frankforce.com/tools/ https://frankforce.com/tools/ And here's their work on the micro animation blog Dwitter: https://www.dwitter.net/u/KilledByAPixel https://www.dwitter.net/u/KilledByAPixel Youtube explanation: https://www.youtube.com/watch?v=HV7Dmo277Rs https://www.youtube.com/watch?v=HV7Dmo277Rs
- Timwi 3y agoThat “YouTube explanation” doesn't actually explain how any of the Dweets work. Don't get me wrong, his work is amazing, I loved seeing it and I'm excited to listen to him show it off; I'm just saying that anyone looking for a detailed walkthrough of how any of it works, that video will disappoint.
- CmdrKrool 3y agoThis video is a couple of years old but it seems to get more into the steps of how he might go about things (disclaimer - I haven't watched the whole thing yet, just scrubbed through). https://portal.gitnation.org/contents/how-to-make-amazing-generative-art-with-simple-javascript-code https://portal.gitnation.org/contents/how-to-make-amazing-ge...
- naniwaduni 3y agoTIL that elements with ids are exposed as global variables in JS.
- onetom 3y agoI've also noticed this a few years ago, but where is this documented? Was it already the case in IE6 for example? Have you found any definitive source, which states this behaviour?
- serial_dev 3y agoHTML Spec: > 7.2.2.3 Named access on the Window object > window[name] > Returns the indicated element or collection of elements. https://html.spec.whatwg.org/multipage/nav-history-apis.html#named-access-on-the-window-object https://html.spec.whatwg.org/multipage/nav-history-apis.html...
- lifthrasiir 3y agoThe relevant WHATWG specification: https://html.spec.whatwg.org/multipage/nav-history-apis.html#dom-window-nameditem https://html.spec.whatwg.org/multipage/nav-history-apis.html... It was said to be introduced in MSIE 4 or around and then eventually standardized by WHATWG (because `window` was never formally specified before that point, AFAIK): https://stackoverflow.com/questions/9740275/html-element-id-as-javascript-variable https://stackoverflow.com/questions/9740275/html-element-id-...
- sowbug 3y agoStuff like this makes me believe that the entirety of life really could be encoded in DNA. I've read that if you gzipped the human genome, the file would be about 4MB, which intuitively seems too small to represent a human. But if this behavior can emerge from 256 bytes, then clearly my intuition is off.
- ivan_ar 3y agoIs a misconception that DNA is enough by itself to replicate a living being, there are biological bases in the embryon that need to be pass down from the parent as biological infraestructure for the new being to form.
- sowbug 3y agoYou're absolutely correct, just as you'd be correct to observe that these 256 bytes require a fairly complex software platform running on fairly complex hardware. And all these things, including us, operate within the fabric of the universe, whose complexity is only beginning to be understood.
- GuB-42 3y agoBut in theory, would it be possible to genetically engineer a simple life form, like a bacteria, to eventually produce a human, in a process similar to the kind of metamorphosis you see in insects. Of course, this the bootstrapping code would take quite some space, but if we could do that (at least in theory), it essentially means that all you need to make practically any living being is a single generic cell and a few megabytes worth of data encoded as DNA. I mean, when we get infected by a virus, our cells are able to produce a completely different life form (if you consider viruses life forms), so why not going from a bacteria (which can also be infected by viruses) to a mammal. It will obviously take a lot more code, and evolution can't get us there, but the idea is similar.
- Aspos 3y agoIt could be a 4 megabyte-long seed for a random generator.
- 3y ago
- lingeringdoubts 3y agoYou can add image-rendering: pixelated on the canvas element to remove the blurring. Mind you, that may be an intentional effect.
- deleted 3y ago[deleted]
- dang 3y agoRecent and related: Cross My Heart – A Frogger Demake in 256 Bytes of HTML/JS - https://news.ycombinator.com/item?id=39336677 https://news.ycombinator.com/item?id=39336677 - Feb 2024 (44 comments) Normally we downweight follow-up submissions (see https://hn.algolia.com/?dateRange=all&page=0&prefix=true&query=follow-up%20downweight&sort=byDate&type=comment https://hn.algolia.com/?dateRange=all&page=0&prefix=true&que...) but since (a) the submitter is the author in this case, and (b) the work is amazing, I've made it a Show HN instead (per https://news.ycombinator.com/showhn.html https://news.ycombinator.com/showhn.html) and left it up.
- phs318u 3y agoIs there an annotated version breaking down each part of this for us lesser mortals?
- cal85 3y agoI've had a stab at decompressing the code by hand, adding comments and meaningful var names where possible. I still don't understand the maths in it... https://github.com/callumlocke/bitwise-liminal-expanded https://github.com/callumlocke/bitwise-liminal-expanded
- Williams77 3y ago[flagged]
- Linda231 3y ago[dead]
- iszomer 3y agoThis made my 5560U ramp it's sysfan up 100%. :-)
- lxe 3y agoLove seeing demoscene on HN. Excellent work.
- Donaldbendo 3y ago[flagged]
- clemiclemen 3y agoThis is impressive and actually looks like a real movie scene. And to think this only fits in 256 bytes makes you rethink how bloated the things we are using everyday are and also how powerful current browsers are. I am however more impressed by the 8K demos such as "the Sheep and the Flower" [1] which was shared on HN recently or "One of those days" [2] which is a remake of an actual Youtube video [3] (granted not exactly the same video by the second but the style is immediately recognizable). They are way bigger than this 256 bytes movie but convey a lot more graphics and story. [1]: https://news.ycombinator.com/item?id=39121101 https://news.ycombinator.com/item?id=39121101 [2]: https://www.pouet.net/prod.php?which=75790 https://www.pouet.net/prod.php?which=75790 and YouTube video: https://youtu.be/8T_Um-cw0Wc https://youtu.be/8T_Um-cw0Wc [3]: https://www.youtube.com/watch?v=R1NagZN2kjY https://www.youtube.com/watch?v=R1NagZN2kjY
- imaginationra 3y agoIf this is a "short film" then you just read my new novel.
- bsza 3y agoYou could replace "t+=.1" with "t+=.01" and 9986 with 9e3, then you'll have a ~45 second loop still within 256 bytes, though a bit of the bottom part of the screen will be cut off.
- swayvil 3y agoThe first interdimensional probe returned. The universe next door is minecraft.
- layer8 3y agoI wonder how small the SVG spec could be golfed for this program to still work.
- nickdothutton 3y agoVery J G Ballard. Nice work.
- mapreduce 3y agoCan someone explain to me what are we seeing in the short film? I see some black and white animation with boxes moving and some noisy lines on it. But I'm not sure I understand what it means. Anyone can help me understand?
- spartanatreyu 3y agoThat IS the film. What's remarkable about it is how small the file size is. It's 256 bytes! To explain how impressive that is, the entire film itself is about 58 times smaller than a screenshot of the film's first frame. You could fit the entire film on a 1.44mb floppy disk over 5000 times and still have some space left over. How? Normally, videos are made up of a series of images with some information in between that says which part of an image goes where. But this film contains no image data. It only has some math for drawing boxes at different brightnesses at different times.
- adammarples 3y agoAnd if you want boxes of different brightnesses then boy is it a good movie