| ▲ | JavaScript Demos in 140 Characters(beta.dwitter.net) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 253 points by themanmaran 16 hours ago | 52 comments | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ▲ | lionleaf 13 hours ago | parent | next [-] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Fun to see this on HN! :D Apologies for the quick reboot of the servers. I learned from last time this happened and resized the digitalocean droplet. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ▲ | amiga386 15 hours ago | parent | prev | next [-] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
It's very cool, but it's also a shame that measuring in characters leads to the metagame of using 97 multi-byte Unicode characters that decode to 194 ASCII characters when reinterpreted. Almost everything is in the format:
Can't they just have the same agreement that Ford Prefect had with Mr Prosser? "So, assuming I'm going to use this lossless compression technique to fit 194 characters into a 140 character tweet... how about you just show the 194 characters and say that I fitted into 140 characters?"I suppose you could make the same argument about size-based competitions at demo parties; the limit is strictly 4096 bytes but everyone + their dog is using Crinkler to compress a 12-20KB executable down to that size. In fact, part of the effort is in aligning data and tweaking constants with Crinkler's algorithm in mind, to make the raw data more amenable to compression! But at least then, it's not a constant compression (turning any 194 ASCII characters into 97 Unicode characters which with embedded decoder makes exactly 140 characters) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ▲ | MORPHOICES 44 minutes ago | parent | prev | next [-] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Viewing sites like Dwitter always refreshes my confidence in creativity. ~ You would expect severe restrictions to yield sameness. On the contrary, you receive untamed variety. Optical illusions. Modern sayings. People twisting the medium in unplanned directions. The trend I’ve noticed. Limits prevent uninvited focus. Constraints that we all share can become a shared language. A tiny scope reduces experimentation expenditure. When the area of surface is small, people penetrate deep instead of spread wide. They experiment with odd concepts since failing is inexpensive and quick. Unlike most platforms that add features to unlock creative potential, which actually ends up overwhelming it. A rule that I keep coming back to: if something feels playful, constraints are probably doing their job. Inquisitive. In what situations did restrictions lead to better outcomes? When do limitations start to seem fictitious? What contemporary instruments ought to be more limited? | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ▲ | rsiqueira 8 hours ago | parent | prev | next [-] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
A small, curated collection of generative sketches written in 140 characters each, using plain JavaScript on dwitter.net. Fractals: https://www.dwitter.net/h/fractal Dynamical systems / chaos: https://www.dwitter.net/h/chaos Strange attractors: https://www.dwitter.net/h/attractor Spiral-based generative art: https://www.dwitter.net/h/spiral Fireworks simulation: https://www.dwitter.net/h/fireworks Procedural scenes: https://www.dwitter.net/h/scene Wavelets (3D and 2D): https://www.dwitter.net/h/wavelet And the most popular dweets: https://www.dwitter.net/top/all | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ▲ | varenc 14 hours ago | parent | prev | next [-] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
TIL that
is valid JS and calls `js_func` as a tagged template literal, passing it a TemplateStringsArray. Going to use "console.log`weeee`" in my code now. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ▲ | jedschmidt 11 hours ago | parent | prev | next [-] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
i went super deep on 140-byte code golfing[1] back when twitter was taking off, and it changed the way i think about code. for a brief while we had a small community collaborating on byte-squeezing techniques[2], and i was constantly amazed at the creativity that this constraint brought about, from mandelbrot renderings to sudoku solvers. possibly the best part was more than a decade later when i found my golfed UUID implementation[3] deep in my employer's codebase. [1] https://youtu.be/JsAetmgJRss?si=AxIFySX7ktzu5GL5&t=193 [2] https://github.com/jed/140bytes/wiki/Byte-saving-techniques | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ▲ | H3X_K1TT3N 10 hours ago | parent | prev | next [-] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Welp, that took up a chunk of my day. This is as far as I got tricking it into doing webgl (it just renders a triangle): if(!window.g){gc=document.createElement('canvas');g=gc.getContext('webgl');c.parentNode.replaceChild(gc,c);k=Object.keys(g.__proto__);d='void main(){gl_';str = `g395(g41,g318())g310(g41,new Float32Array([0,0.5,0,-0.5,-0.5,0,0.5,-0.5,0]),g46);a=g322(g139)g382(a,'attribute vec3 c;${d}Position=vec4(c,1);}')g313(a);b=g322(g138)g382(b,'${d}FragColor=vec4(1,0,1,0);}')g313(b);d=g320()g302(d,a)g302(d,b)g376(d)g393(d)g435(0,3,g128,0,0,0)g406(0)g404(g12,0,3)`.replace(/g(\d+)/g,"\ng.\${k[$1]}");eval("eval(`"+str+"`)")} I assume there are far more advanced methods than what I managed to do, so it's probably possible to actually get that to 140 characters. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ▲ | socalgal2 15 hours ago | parent | prev | next [-] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
I love these but I wish they'd disallow the eval thing. I also which they'd added more shortcuts. Like IIRC they have `s` for `Math.sign` but so if they're going to shorten things they could have gone much further. `globalCompositeOperation` etc... | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ▲ | dang 15 hours ago | parent | prev | next [-] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Related. Others? Show HN: A Stargate in 140 chars of JavaScript - https://news.ycombinator.com/item?id=25088683 - Nov 2020 (55 comments) Dwitter – A social network for short JavaScript demos - https://news.ycombinator.com/item?id=13700698 - Feb 2017 (71 comments) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ▲ | econ 12 hours ago | parent | prev | next [-] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
OT: we should really extend bbcode with a safe scripting language. The hilarious stuff that could happen in threaded discussions. You could have a sub set of safe instructions that get executed automatically, a larger set of instructions that require pressing a button under the comment. (And a button to view the code) Then a 3rd set that triggers permission dialogs for things like loading (1 or n) external data sets. "Uploading" files, loops that run more than 30,1000 or 10k rounds, access to camera/photos, canvas, LLM etc You start a topic by pasting a dataset or a link to some JSON csv, xml, sql files, etc, then add a description or some other rage bate to start a conversation. Seems much fun and a great way to start getting into coding. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ▲ | tluyben2 6 hours ago | parent | prev | next [-] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Nice work; I remember browsing it during covid. Tried AI for a standalone html page snippet renderer[0]. I tried just feeding it snippets one by one and that worked, but the raymarching ones it could not get going until I gave it the dwitter github repos. Now most, but not all (simple to fix manually though), work. Also interesting to see Claude is terrible at trying to write the art (the demos itself) and seeing what it tries to do; not surprising given the challenge. [0] https://claude.ai/public/artifacts/d8b357df-5982-48c6-be58-7... | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ▲ | falloutx 14 hours ago | parent | prev | next [-] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
It seems like dwitter outlived twitter. Goated site. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ▲ | pverheggen 13 hours ago | parent | prev | next [-] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Cool site! Reminds me of tsubuyaki processing, which is a similar "code golf that fits in a xeet" type of challenge. https://xcancel.com/search?q=%23%E3%81%A4%E3%81%B6%E3%82%84%... | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ▲ | kace91 8 hours ago | parent | prev | next [-] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
I wonder what could be a criteria for demos like this that doesn’t devolve into code golf nor spawns giant files. I’m not saying that to disparage the content mind you; it is amazing. Just wondering which potential rules could make similar results and “normal”/readable code, as that would be awesome to see. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ▲ | RyanOD 6 hours ago | parent | prev | next [-] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Thinking back to days with The Zen of CSS Design, this is just incredible. It's the weekend! Take a journey back in time... | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ▲ | socalgal2 8 hours ago | parent | prev | next [-] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
not quite the same because no site but several devs post pico8 tweets https://x.com/search?q=%23postcart%20%23pico8 maybe #tweetcart is a better hash tag | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ▲ | aziis98 15 hours ago | parent | prev | next [-] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
There are many made with eval-unescape-escape that feel a bit like cheating. Still all very impressive | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ▲ | sshadmand 11 hours ago | parent | prev | next [-] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
What a cool concept to turn the SM 140 chars concept into a programming demo list! Is there a reverse to this that work to compress a JS script into 140 chars to help show some creative ideas without needing to fully understand the code? Also, how good is AI at generating these in your experiences? | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ▲ | alexpadula 13 hours ago | parent | prev [-] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
The website seems to be unresponsive on iPhone safari. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||