Relax while watching bouncing particles making connections when they get closer
84 comments
·January 6, 2025chkas
skygazer
Well, that looks suspiciously like caustics in and around a swimming pool on a sunny day.
Root_Denied
How hard would it be to push this into 3 dimensions instead of 2? It made me think of a starting point for a model of the universe and galaxy interactions.
swyx
cant believe nobody has asked... what is the goal of easylang? why did you start working on it? why design choices are you most proud of?
chkas
The aim is to offer beginners a simple and interesting entry into programming. IMO there is an unoccupied niche for this between Scratch and Python. In the days of home computer BASIC, it was easier to learn programming - you switched on the computer and with a few lines of BASIC code you could magically create a nice sine wave on the screen. Nowadays, beginners are often overwhelmed by all the complexity.
Alex-Programs
Are they? I learnt with Scratch from about four then moved to Python when I was about 9 (iirc), and I found the move pretty easy. There isn't much I would change about Python to make it better in that role, and there are plenty of online environments that do a great job of reducing the setup you need. The BASIC experience is now https://projects.raspberrypi.org/en/projects/editor-hello-wo... - are they really so different?
Plus, when you want to move onto slightly more complex projects you can just keep using Python and steadily adding to your knowledge.
E.g. I began with turtle, then something that showed who's in space using requests and an API, then a little chat app with sockets, then a full GUI chat app that pretended to be notepad so I could chat at school. Nowadays, I still sometimes write software in the same language that I first wrote print("Hello, world!") in.
Don't get me wrong, I think it's great that you're making it. I just think that Python is already a great language coming from Scratch.
chkas
@design choices: The graphic primitives built into the language - this is not useful for a general purpose language - but in beginner language this is an important motivating factor.
kaeruct
I'd like to share mine as well. There's a bit of more interaction between particles but I don't remember the exact logic. Code should be easy to read: https://kaeruct.github.io/projects/short-experiments/dots/
rikroots
Nice! On a tangent, I thought this sort of "animated star field" effect had gone out of fashion 5 years ago - I rarely come across a website using it nowadays.
My example is part of the testing suite for my canvas library: https://scrawl-v8.rikweb.org.uk/demo/particles-006.html
ides_dev
I like how some of the particles get thrown out of the cluster on wider elliptical orbits, they look like comets.
biomcgary
Agglomerative clustering
nhecker
I like this.
deskr
[flagged]
IceDane
You alright there, buddy? I think some grass touching might be in order.
deskr
I'm good. I forgot to add there would be a nazi salute too!
taco_emoji
c'mon, man
bijection
I built a similar thing that includes forces between particles meant to simulate a sort of fluid or, as you scroll down, a gelatinous solid. There’s a bit of free energy injected to keep things moving so it’s actually a very bad fluid sim, but I think that makes it a better interactive toy in exchange.
One of the fun parts of naively n^2 particle simulations is trying to find ways to reduce the algorithmic complexity of collision detection. I remember messing with sweep lines and similar, though I don’t remember what optimizations made it into the final code. [0]
bluocms
Looks really good and is also relaxing to watch when it’s compressed. Did you open sourced it?
And your projects are really nice too. Wall smasher is amazing!
Recursing
See https://bleuje.com/animationsite/2024_1/ for a collection of programmatic black and white animations made with https://processing.org/
He publishes the source code on https://github.com/Bleuje/processing-animations-code/tree/ma...
NKosmatos
F**ing hell!!! These are some trippy animations over there. Excellent work and all based on mathematical functions. Thanks for posting this :-)
thih9
Note, you can edit the code.
Here’s my version, with particles affecting each other: https://tiki.li/run/#cod=dVPbToNAEH3fr5jExLQacFH7UNP6Db43jaF...
thih9
Bugfix, because earlier some particles were immune to the forces: https://tiki.li/run/#cod=dVPbboJAEH3fr5ikSaNtoEutDzbab+i7MQ0...
thih9
Another version, this time with varying sizes. I guess I have been nerd sniped
https://tiki.li/run/#cod=dVPBUoNADL3vV2TGGafVYV2qPdSpfoP3Tse...
thih9
More colors (warning, flashing lights):
https://tiki.li/run/#cod=dVTBcqMwDL37KzTTmU7SDq5Jm0N20v2G3ju...
christina97
Having a hero background that was a variation of this was really popular about 10 years ago or so. You’ll still find them on plenty of websites built around that time.
duskwuff
It's still extremely common in web site templates for cryptocurrency and AI companies. Sure, it's cliché as all hell, but that doesn't stop people from using it.
mjstone
Reminds me of the Ex Machina end credits [1] (and the Android live wallpaper I made as a homage to it [2].)
[1] https://www.youtube.com/watch?v=uRJ-fPAO3Go [2] https://play.google.com/store/apps/details?id=com.figmentano...
tempestn
Anyone else's brain find this... I guess stressful, rather than relaxing? Something about them connecting but never hanging on, and the bits never all coming together, I think.
dotancohen
Rather like connections in life maybe.
All I see is blonde, redhead...
bouncybouncycat
It seems to me that it is inevitable: every programmer goes through a phase where they do a bounded billiard ball simulation. It’s like a right of passage.
devin
rite* of passage
jhncls
A "wright of passage", a "craftsperson of passage", someone who facilitates or creates transitions -- like a metaphorical bridge-builder
mystified5016
Rite, as in the ritual one performs to pass to the next stage of their goal.
someoneontenet
Neat, I’ve also made something like this with processing https://robw.fyi/constellation.html
hashishen
this is great nice work
airstrike
Made a version with charged particles. Probably bad physics all around, but here it is: https://shorturl.at/ocvEO
BlueTemplar
It doesn't take much to get decent physics :
https://mattermodeling.stackexchange.com/questions/9541/lenn...
https://en.m.wikipedia.org/wiki/Lennard-Jones_potential
With the right parameters you get to see the solid and fluid phases of matter !
j1elo
Funny how the "shortened" url is actually longer than the real url. Any reason you shared it using the former?
airstrike
You mean shorter than `https://tiki.li/run/`? That one only works after the real URL is loaded at least once. The un-shortened URL was huge as it contains the whole app in base64 encoding or some such
https://tiki.li/run/#cod=pVVLj9s2EL7zVwxgoLCzXa20yTbeIJtD2h4...
j1elo
Oh my! that makes more sense. Yes, I was referring to the shorter url whis is what I saw in the address bar in my browser.
dtgriscom
What? No bonding?
youainti
This made me realize how much I miss screensavers. I used to sit and just stare at them meditatively as a teen.
grues-dinner
I think I learned more about chaos theory by hacking a first person Rössler attractor "rider" into xscreensaver (instead of the usual Lorenz attractor) than by any other thing.
ykonstant
Also the cool effects in music players.
rollcat
Yeah this one definitely has a JWZ vibe. Probably worth porting and contributing to XScreensaver.
Hello author here. I'm a little surprised to see this on the front page of Hacker News. This is just a simple demo for my educational programming language Easylang. You can easily edit the code and increase the particle count for example. In the IDE you can then create a link with the code embedded in the URL.
https://tiki.li/run/#cod=dVLNbsIwDL7nKT5p0gRDdEGMA9PYM+yO0FT...