Hacker Newsnew | past | comments | ask | show | jobs | submit | chkas's commentslogin

This is mine in my programming language: https://easylang.online/apps/mandelbrot.html?v=hn1


It shouldn't be that complicated. I tried it once with gravity and without limits on the edges. The cluster of stars moved around in 2d space and stars were repeatedly catapulted out, which then disappeared. Maybe you need a super gravity (black hole) in the center to keep it stable.


From my experiments, you need to flip the velocity if it goes out of bounds, and have a little bit of drag, multiply each vel by 0.9999 each frame.

Otherwise, a few particles being ejected at very high speeds IS realistic... they carry away surplus kinetic energy, which allows the remaining cluster to contract.

And once too much matter has lost too much kinetic energy, it does converge and become a black hole.

The weird thing is that their radius scales proportional with their mass, not volume... so they grow in this weird way where adding a 3 solar mass black to a 3e6 solar mass SMBH causes the SMBH's volume to grow by several, several times the volume taken by the 3e0 BH. It's like black holes force themselves to grow in a straight line internally, but then the entire sphere encompassing that line becomes event horizon, which is probably why there only seems to end up being 1 SMBH per galaxy, they get so big so quickly at the 1e6+ range, that any other BHs drifting around the vicinity get absorbed by the growing EH, which causes the EH to grow more, causing it to absorb more BH... so there's this period where a bunch of relatively tiny, sparse black holes suddenly hit the critical density where the entire region they were all sharing suddenly pops into one huge event horizon that encompasses all the empty space they were sharing previously.


Did some experimenting with gravity, not sure how far the physics is correct, but looks okay

https://tiki.li/run/#cod=dVLbbuIwEH33Vxyp0gqKGhIktKVqeO1HIB5...


The physics in the simulation was faulty, that should be better now. Of course there are less collisions in 3D than in 2D. And this catapulting of stars is also an artifact in the discrete computer simulation

https://tiki.li/run/#cod=fVPRbuMgEHznK0aqdGodxSW5S0+uSl/zEVF...




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...


Well, that looks suspiciously like caustics in and around a swimming pool on a sunny day.



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.


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?


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.


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.


@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.


Another programming environment for kids with its own simple programming language: https://easylang.online/ide/


I have programmed a small simulation of colliding balls in 2D.

https://easylang.online/show/#cod=jVPbbptAEH3frzhSpMqJFYppI0...


Not Logo - but BASIC.


Maybe a help window where you can select commands like "background" would be helpful.


Thanks for the suggestion - my native language is not English.


First JavaScript, now WebAssembly - the world keeps on moving.


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: