Pebble

Philosophy

BASIC was my first programming language. In the 1980s, I borrowed a book called ‘Start with BASIC’ by Lars-Erik Björk. I was fascinated, but didn’t have a computer at that time. So I started writing small BASIC programs on hand-written notes. My dad brought those to his workplace and ran them, giving me the printouts afterwards.

Seeing my passion, my parents and grandparents came together to buy me my first computer - a TI-99/4A. When I finally got to run my own programs on it, the feeling was pure magic. Writing just a few lines of code and watching a sprite move across the screen - something I had only imagined before - suddenly became real.

Decades later, while working on Strata - the compiler framework for my main programming language, Swamp - I wanted to test whether it could handle a very different style of language. Swamp is expression-based and modern. I needed something small, basic (pun intented), and statement-centric to truly validate Strata’s flexibility. That’s when I remembered those early days with BASIC.

Pebble became both the test and a nostalgic tribute to where it all began.

  • Peter Bjorklund

Install now!

What Pebble Has

  • Simple type system - int, float, byte, bool, string, and fixed-size arrays: type[size]
  • Custom types - Group related data into structures
  • Enumerations - Named constants for states and categories
  • Classic control flow - if/then/else, while, for, select
  • Subroutines - gosub/return for code organization
  • String interpolation - Embed values directly in text

What Pebble Doesn’t Have

  • No functions or procedures (only subroutines with gosub)
  • No classes or inheritance
  • No modules or file imports (everything in one file)
  • No variable scoping (everything is program-wide)
  • No optional types or nullable values
  • No dynamic arrays or complex data structures
  • No collections (Vec, HashMap, pools, circular buffers, etc.)
  • No enums with associated data/payloads

Execution Model

Pebble programs execute from top to bottom. Variables and types are defined as they’re encountered, and your main game logic typically runs in an infinite loop:

' Initialize
score = 0
lives = 3

' Main game loop
while true
    gosub update
    gosub render
    wait_vsync
end

update:
    ' Game logic here
  return

render:
    print "score: {score}"
  return