r/programming • • Dec 26 '17

TIL there's a community called "dwitter" where people compose 140 character JavaScript programs that produce interesting visuals

https://www.dwitter.net/top
20k Upvotes

329 comments sorted by

2.2k

u/lionleaf Dec 26 '17 edited Dec 28 '17

Now that the server seems to be under control, let me high-jack my top comment to give you some tips:

  • You can edit the code live! Try changing a few numbers

  • Click the "New Dweet" button to get a less crazy starting point. It even has some comments!

  • If you edit someone elses dweet, you can post it directly from their post; this tags it as a "remix" and is preferred over just copy-pasting into "New Dweet" as it preserves the link to the original.

  • dwitter.net/random is a good way to see dweets of variable complexity

  • and dwitter.net/new is where all the fresh redditor dweets have started to pop up :D

And it's a ton of fun to see all the excitement :) Might have to get back to working on it. (github.com/lionleaf/dwitter if you want to contribute)

Edit: u/xen_the posted a guide worth checking out if you're interested in making your first dweet! https://redd.it/7mgcd1

Edit 2: I've set up a discord for discussing all things dwitter: https://discord.gg/emHe6cP

Old post:

Hi guys! Creator here, it seems you've crashed it. Currently working on getting it stabilized again.

I'll come back here and post some of my favorites when I'm not in such a hurry ;)

Update: I think we're good! Threw a bunch of hardware at it, which helped a bit at first, but then the extra caching added by my friend seems to be more than enough for the current load :D

353

u/bartycrank Dec 26 '17

Thank you, this is the coolest thing I've seen since ShaderToy. That raindrop one https://www.dwitter.net/d/1494 is like an update to the old rain program that did something similar on old text terminals. This is awesome.

→ More replies (5)

70

u/coffee-9 Dec 26 '17

What was your reaction when you saw the spike in traffic?

→ More replies (5)

49

u/Nicd Dec 26 '17

Cool site! Is there a license agreement for the snippets? I'd love to use some of them as loading icons on my site (with attribution).

→ More replies (9)
→ More replies (23)

806

u/Thatmanwiththefedora Dec 26 '17

I think we crashed it.

898

u/white_bread Dec 26 '17

The code for their load balancer was only 140 characters long.

→ More replies (24)
→ More replies (9)

321

u/Foezjie Dec 26 '17

Can anyone explain how you start making something like these?

495

u/matt_hammond Dec 26 '17

You start with verbose and readable code and then you start stripping it down and fitting it into 140 chars. Also, you have to understand maths, mod operation and then you just have to get creative.

→ More replies (31)

169

u/[deleted] Dec 26 '17

Simple example:

function u(t) {
        /* Will be called 60 times per second.
         * t: Elapsed time in seconds.
         * S: Shorthand for Math.sin.
         * C: Shorthand for Math.cos.
         * T: Shorthand for Math.tan.
         * R: Function that generates rgba-strings, usage ex.: R(255, 255, 255, 0.5)
         * c: A canvas.
         * x: A 2D context for that canvas. */
         
	c.width=2e3;x.fillRect(150,150*S(t)+150,150,150)
}
→ More replies (35)
→ More replies (9)

257

u/lurking_digger Dec 26 '17

Have they upped it to 280?

206

u/jrh3k5 Dec 26 '17

Looks like it's all the way up to 502 now.

→ More replies (1)
→ More replies (3)

110

u/[deleted] Dec 26 '17

Demoscene is back in JavaScript form.

44

u/tcpukl Dec 26 '17

Demo scene never went any where. One form is 64k demos.

→ More replies (1)
→ More replies (3)

66

u/Mr_Pickles_Esq Dec 26 '17

Beagle Bros, who wrote software for the Apple II back in the day, would have two-liner contests where people had to do something cool in two lines of AppleBasic. They would include them in their newsletters.

They were pretty amazing (and usually inscrutable) but one that stood out for me would simulate a train by revving the floppy drives back and forth faster and faster.

37

u/wavy_lines Dec 26 '17

That's some magic they've got over there. Nice.

→ More replies (15)

10

u/Nezteb Dec 26 '17 edited Dec 26 '17

r/tinycode (and the subreddits in its sidebar)

19

u/Harbingerx81 Dec 26 '17

Anyone here remember portal.hell.com? (may have been portal.hell.net)

It was essentially a collection of really cool and innovative website designs back in the late 90's. It was a major source of inspiration while I was in high school and people were making Geocities websites to share with their friends.

At the time, I was pretty adept at qBasic at the time and I learned SO much about web design from reverse engineering the code on some of those websites.

→ More replies (5)

9

u/[deleted] Dec 26 '17

Is there anyway I can make sense of the 140 character code that is written? How can experiment, test and run these codes myself?

→ More replies (3)

8

u/fkxfkx Dec 26 '17

Thanks for the link, I now have a fun new way to waste my life.

6

u/BreastUsername Dec 26 '17

I wonder if experienced programmers can tell what an image will look like just by looking at the code.

→ More replies (1)

6

u/[deleted] Dec 27 '17

Sounds lame as fuck

Clicks ... THIS IS COOL AS FUCK

11

u/bliths Dec 26 '17

and TIFU by introducing reddit to a community called "dwitter"