alt.hn

3/6/2026 at 4:15:40 AM

Show HN: Swarm – Program a colony of 200 ants using a custom assembly language

https://dev.moment.com/

by armandhammer10

3/6/2026 at 10:09:58 AM

That's really cute, it reminds me that Will Wright (creator of The Sims) has referenced this book "The Ants", by Bert Holldobler in multiple occasions as a key inspiration for his games (and in particular SimAnt) and systems thinking. Did you come across that during your research phase or had you not heard about it? I haven't read it yet, but maybe someday I'll get around to it.

by TheAceOfHearts

3/6/2026 at 3:58:42 PM

Hey, I'm the one who built this particular challenge!

I had no clue, but thanks for the book lead! It didn't come up directly, but SimCity 2000 and especially SimCity 4 had a huge impact on me growing up / I still spin up SimCity 4 from time to time, so I imagine there's a massive indirect influence haha.

by lightamulet

3/6/2026 at 6:05:14 PM

This is exceptionally beautiful. What did you use to build it? Vanilla JS?

by antfarm

3/6/2026 at 9:09:40 PM

This is actually all built in nextjs/react, though the initial sketches of the sim had no visualization and were just running in my terminal using bunjs

by lightamulet

3/6/2026 at 7:11:08 PM

Will Wright gave at least one great lecture at SIGGRAPH. Wonderful thinker and communicator. #ACM plz unlock this culture.

Ants have fascinated me from a young age, I’d construct a viewing platform so I could watch the hive at work.

My favorite were the carpenter ants, so smart. It feels like they have a theory of mind. I didn’t hurt them, but if you disturbe their nest under a board, the efficiency and expediency they would exhibit while collecting their young was fascinating.

*edit, I meant to ask if you had any other book recommendations?

by sitkack

3/7/2026 at 1:12:08 AM

Well, I'm currently reading through "Designing Virtual Worlds" by Richard Bartle. He's known for being one of the creators of MUD (multi-user dungeon). I'm not far along enough to make a judgement on the quality of the contents, but I keep seeing the book title pop up everywhere so it seems important.

by TheAceOfHearts

3/6/2026 at 8:14:47 PM

Speaking of SimAnt, I soon discovered the bug that by moving into the top corner, the black ants would conquer all squares with no intervention from that one sideways and downwards and too easily win the game.

Still, it was fun just messing around with the ants, watching the trails, and chasing spiders by calling forth all ants.

by JamesTRexx

3/6/2026 at 12:46:12 PM

[dead]

by huflungdung

3/8/2026 at 3:55:12 PM

I think I found a bug:

In the reference material under ARITHMETIC, it shows `AND r1 0xFF` as valid. However, actually using that code always produces zero regardless of what is in r1. My experiment concluded that only decimal inputs are supported, and hexadecimal are not, but the reference doesn't say that, and the editor doesn't flag the hexadecimal inputs as an error. Perhaps the reference material should be updated to simply show "255" instead of "0xFF".

Here is code to reproduce:

  ; ==================================================
  ; Bug Report:
  ;   AND operation returns 0 when give a hex argument
  ;
  ; Expected behavior:
  ;   (1 AND 0xF) should either equal 1 or the
  ;   line should be flagged as an error.
  ;
  ; Actual behavior:
  ;   (1 AND 0xF) equals 0 and does not flag error.
  ; ==================================================

  .alias input r0
  .alias output_using_hex r1
  .alias output_using_dec r2

  main:
      ; Pick any number only using bits 0xF
      SET input 1

      ; Test using hex
      SET output_using_hex input
      AND output_using_hex 0xF  ; no error raised

      ; Test using decimal
      SET output_using_dec input
      AND output_using_dec 15  ; (15 == 0xF)

      PICKUP  ; end the tick, so registers are stable
      ; Registers at this tick boundary:
      ; input:            1
      ; output_using_hex: 0 (incorrect)
      ; output_using_dec: 1 (correct)

      JMP main

by geoffpurvis

3/9/2026 at 2:10:18 AM

thanks for the bug report! oversight on my part, pushing hex support rn :)

by lightamulet

3/6/2026 at 6:39:58 PM

My "hello world" for a new stack is always a version of Worm. Somewhere between Life and your Swarm, Worm wanders around looking for food and water, trying to avoid birds and other issues. Each round the worm survives it grows by a segment. If it doesn't get food or water, it is reduced a segment. And so on. Your Swarm is a few levels up from my iterations, totally inspirational! Thanks!

by ynac

3/6/2026 at 6:42:17 PM

I've been working on a surprisingly similar project for the last week: plants grow cells on a grid by executing a raw chunk of memory according to a simple instruction set. I'm aiming more for an evolution simulator, where each plant gets a 1kb brain that is randomized a little when a new plant is spawned.

Most plants right now settle into a simple goto loop that places the requisite cells to survive and then spam seeds until they die. I have seen some interesting variety in body plans emerge where plants sort into discrete species regionally. I'm hoping to eventually get decision making to emerge organically. If things go well this system is theoretically capable of sexual selection (and maybe fisherian runaway) but that's a pipe dream right now.

https://github.com/Will-Morr/PlantBrainGrid

by WillMorr

3/6/2026 at 5:35:40 AM

what is this? assembly for ants?

by i_am_a_squirrel

3/6/2026 at 11:48:58 AM

It's assembly for people who can code good.. and can do other things good too.

by forkerenok

3/6/2026 at 12:28:35 PM

It needs to be at least three times this size!

by yesthisiswes

3/6/2026 at 4:23:08 PM

just be glad that ants are ambiturners

by RandomTeaParty

3/6/2026 at 5:43:46 AM

ant-ssembly to be precise

by armandhammer10

3/6/2026 at 8:42:17 AM

So hot right now

by testfrequency

3/6/2026 at 12:08:54 PM

Cool. This is how I imagine the ants were programmed by the spiders in Children of Time.

by JetSetIlly

3/6/2026 at 8:08:39 AM

I wish I could read dark-mode but my eyes somehow cannot handle it (not just on that website, in general).

by kleiba

3/6/2026 at 9:01:38 AM

there is a `theme set` command

by purplehat_

3/6/2026 at 10:58:26 AM

Did website break?

I only see "MOMENT" and "All systems nominal"

by RandomTeaParty

3/6/2026 at 1:19:16 PM

Incredible low contrast font color in use there. Looks like about 0x002000 on pure black (per Mk-1 eyeball).

What possesses people to go for these barely perceptible color schemes?

.. a few minutes later ..

Ok, the crazy low contrast was on the initial landing page. Things have somewhat improved after prodding somewhat blindly at it.

I'll let the question stand though, bc why do that for what's going to be people's first impression?

by greenbit

3/6/2026 at 1:06:26 PM

try pressing any key or clicking around :)

by armandhammer10

3/6/2026 at 8:04:41 AM

I think I read a Daniel Suarez book about this once.

by nozzlegear

3/6/2026 at 8:15:10 PM

Make sure you lets those agents relax and recharge at https://vibesprings.net

by Vibeguy900

3/6/2026 at 5:37:06 AM

This is a balancing act between collectors and explorers. There is probably some optimized number. Likely targeted at beginners.

by nurettin

3/6/2026 at 3:19:36 PM

So.... a sort of modern Corewar?

by anta40

3/6/2026 at 7:06:31 PM

Is it possible to reset the source once you've started modifying it?

by ngvrnd

3/6/2026 at 12:08:56 PM

Orwell would suggest you use the word normal.

by general_reveal

3/6/2026 at 3:04:21 PM

The amount of effort put into this tool...just for hiring to your exact shop? I cannot imagine that's a good return on investment?

by orsorna

3/6/2026 at 4:22:09 PM

i think this took me (1 person) like 40 hours max? all built in the last week, though i spent more time than i should have on it haha. quite ai-assisted, that's how most of the layout like the editor, player controls, even eval server got set up.

i spent way too much time on things like the language itself, map generation, and figuring how to only recompute the sim on material code changes vs whitespace and comments (it assembles to "bytecode" with debouncing! and the sim component takes the bytecode as a prop).

we'll see if good ROI, we definitely intend to run more of these types of challenges in the future, so much of this work won't go to waste

by lightamulet

3/6/2026 at 5:42:23 PM

There's also a trip to Hawaii in it for you.

by sixo

3/6/2026 at 4:15:55 PM

People like doing cool stuff

by Kinrany

3/6/2026 at 5:33:25 AM

Wait what this is the best reason to write a bunch of assembly AND learn about ants?

by 4b11b4

3/6/2026 at 5:37:56 AM

And (potentially) go to Hawaii!

But in all seriousness, ants are smarter than they look. They operate as a collective. Just in the same way that assembly needs to operate collectively to get the best output.

They're more closely linked than they appear from the outside ;)

by armandhammer10

3/6/2026 at 11:50:27 AM

> ants are smarter than they look.

Many moons ago I had a big pot of rhubarb in my back yard¹ and was initially irritated by the appearance of ants and aphids, until I took a moment to watch them and realise that the ants were bringing in the aphids and tending to them. The buggers were farming. The ants can't digest the leaves of the rhubarb, but the aphids can and excrete a sugary by-product that the ants “milk” from them. It is a fascinating bit of nature to read into. They even defend the aphids from predators and so forth, so it isn't a bad life for them either.

--------

[1] Not a euphemism for a lovely garden in that case, it was literally about a square yard of concrete behind the mid-terrace I was renting.

by dspillett

3/6/2026 at 10:38:31 AM

> But in all seriousness, ants are smarter than they look.

I'd argue the opposite, ants are dumber than they look. You look at a random ant stack in the forest and it looks like they're smart, but that's only when they're "controlled" by the collective, individual ants themselves are pretty dumb in the end, but it's hard to see as typically we always see them around/in their stacks in nature.

by embedding-shape

3/6/2026 at 9:03:41 AM

As a collective, yes. If you look at individuals, they often go in circles and act really dumb. But for the colony it still works out, bigger brains would cost too much energy I suppose and simple algorithms work. (I often watched real ants while and my head translated their behavior to simple algorithms)

by lukan

3/6/2026 at 9:31:15 AM

Someone else who has read Godel, Escher, Bach by Hofstadter?

by kitd

3/6/2026 at 9:45:52 AM

Excellent book cheers

by oddmade

3/6/2026 at 12:36:58 PM

This is really quite cool.

by Thanakorn_551

3/6/2026 at 3:12:52 PM

What's with "artesenal"? Is this a joke that I don't understand or a surprising way to write "artisanal"?

by macleginn

3/6/2026 at 4:05:35 PM

the answer is my editor doesn't have spellcheck and i apparently don't know english as well as i thought, fixing :')

by lightamulet

3/6/2026 at 2:28:19 PM

All dark themes are too low contrast. Give me pure white (including comments) on pure black please.

by ivanjermakov

3/6/2026 at 4:07:17 PM

on the home page (dev.moment.com) you can type `theme -h` and then `theme set [name]` to change the color scheme, which carries forward to the sim!

by lightamulet

3/6/2026 at 4:40:54 PM

Yes. I checked every theme and all dark themes are too low contrast. Pacman is good but comments are barely readable (gray on dark gray).

by ivanjermakov

3/6/2026 at 10:59:30 AM

Am I being dumb? I was expecting to see ability to look at and run some canned sim

by FpUser

3/6/2026 at 4:47:31 AM

Why? =>

"Moment Engineering by Moment Technology wants to access your {GitHub account name} account Personal user data Email addresses (read-only), profile information (read-only) This application will be able to read your private email addresses and read your private profile information."

by TruffleLabs

3/7/2026 at 6:05:45 PM

[dead]

by riteshyadav02

3/6/2026 at 4:44:02 AM

Nice way of hiring but is it really worth it to give the public a trip to Maui (kinda expensive these days)

Does it really reveal that much talent to make it worth the money?

Just curious

by sudo_cowsay

3/6/2026 at 2:00:31 PM

The prizes (Maui trip, second/third prizes, swag kits, shipping for the swag kits) probably cost around $20k in total.

Assuming an engineer costs $200k/year, 200 effective working days per year, that's 1k/day. Developing the contest (from the idea to building the rules to building the site to playtesting) likely cost more than 20 eng-days, making it the biggest cost.

Hiring is expensive. If it takes 30 minutes to screen one candidate for suitability for the "real" interview and 5h to do a "real" interview (including evaluation etc.), 5 screenings for one interview-worthy candidate and 5 interviews for one hire (I suspect the real factors might be closer to 10), that's 12.5h of screening and 25h of interviewing per hire.

by tgsovlerkhgsel

3/6/2026 at 4:28:07 PM

Sure, hiring is expensive, but firing is really expensive! I salute your efforts to get it right on the first try.

by boutell

3/6/2026 at 4:55:08 AM

It's less about the money. It's about giving people a chance to do something fun / show off their skills and get rewarded for it.

Plus, Hawaii is awesome.

by armandhammer10

3/6/2026 at 5:26:05 AM

I think it is a fun contest! As for recruitment, it suggests to me you are looking for people with no kids, and possibly young people.

by dr_kiszonka

3/6/2026 at 10:19:04 AM

Appreciate this, very cool of you to do that

by nylonstrung

3/6/2026 at 3:14:51 PM

Way less than you would pay for a recruiter

they usually ask for a non trivial percentage of the first year salary

by AndrewKemendo

3/6/2026 at 9:10:40 AM

[dead]

by jackfranklyn

3/6/2026 at 8:30:20 AM

[dead]

by devcraft_ai

3/6/2026 at 4:12:15 PM

[dead]

by lambchop_395

3/6/2026 at 3:10:57 PM

[dead]

by mdk017

3/6/2026 at 8:26:49 AM

[flagged]

by Uptrenda

3/6/2026 at 8:50:37 AM

> my goy master

I’m sorry your what now?

by mock-possum

3/6/2026 at 8:53:36 AM

sorry, im jewish, lets not be racist here

by Uptrenda

3/6/2026 at 12:24:01 PM

Nobody who talks like this has ever been Jewish, in my experience: you'd be the first.

by wizzwizz4