Skip to content

Instantly share code, notes, and snippets.

@SimonMeskens
Last active March 6, 2025 22:21
Show Gist options
  • Save SimonMeskens/38e872e968ba2000f5c2b141b795243e to your computer and use it in GitHub Desktop.
Save SimonMeskens/38e872e968ba2000f5c2b141b795243e to your computer and use it in GitHub Desktop.
Programming language that resembles redstone

Scarlet - A mini-language vaguely based on redstone

MIT license

Overview

Scarlet is a 2D programming language where the output of the program looks like the source code, but colored based on the signals propagating.

Semantics

  • [a-Z]: Solid block, turns white if receiving a signal
  • [0-9]: Like a solid block, but only pass their signal to nearby blocks after X ticks, where X is their number
  • +: Dust, 16 states, 0 being off, can receive signal from a solid block
  • !: Torch, emits signal unless there is an adjacent solid block being powered, doesn't itself power adjacent blocks
  • ?: Button, sends out a pulse if clicked with the mouse
  • \: Lever, toggles between either no signal or signal like a powered torch when clicked
  • @: Observer, sends out a pulse if any adjacent block changes state
  • #: Signal crossing
  • &: Repeater, when it has a powered dust on one side, powers a solid on the other side. When powered by another repeater, stays locked in its current state

Future ideas

  • (old idea) - and |: Repeaters, pass signals along their visual direction with a 1-tick delay. Can pass signal to solid, but not receive. Can receive from dust, but not send. Can be locked by powering the sides.
  • Compare, one half of the Comparator
  • Subtract, other half of the Comparator
  • Sculk sensors?
  • Someone mentioned an interaction between sculk and trap door?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment