logoalt Hacker News

keithnztoday at 1:41 AM1 replyview on HN

Vibe-coded a YouTrack CLI tool in < 1 hour:

https://github.com/keithn/yt

Also working on a language for embedded bare-metal devices with built-in cooperative multitasking.

A lot of embedded projects introduce an RTOS and then end up inheriting the complexity that comes with it. The idea here is to keep the mental model simple: every `[]` block runs independently and automatically yields after each logical line of code.

There is also an event/messaging system:

- Blocks can be triggered by events: `[>event params ...]`

- Blocks can wait for events internally

- Events can also be injected from interrupts

This makes it easy to model embedded systems as independent state machines while still monitoring device state.

Right now it’s mostly an interpreter written in Rust, but it can also emit C code. I’m still experimenting with syntax.

Example:

    module WaterTank {
      type Direction = UP|DOWN
      let direction = UP
      let current = 0

      [>open_valve direction |> direction]
      [>update level |> current]

      [
        for 0..30 |> iteration {
          when direction {
            UP   -> !update level=current + 1 |> min(100)
            DOWN -> !update level=current - 1 |> max(0)
          } ~
          %'{iteration} {current}'
        }
      ]

      [>update level |> when {
          0..10  -> %'shallow'
          11..15 -> %'good'
          16..   -> %'too much!' then !open_valve direction=DOWN
        }
      ]
    }

Replies

keithnztoday at 1:45 AM

holy, downvotes on what I'm working on?

show 4 replies