GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - mcejp/STAK: A game prototyping language with some unusual design choices

BranchesTags
Open more actions menu

Latest commit

 

History

98 Commits
98 Commits

Folders and files

NameName
Last commit message
Last commit date
doc
doc
 
 
example-outputs
example-outputs
 
 
vm
vm
 
 
.gitignore
.gitignore
 
 
01fill.scm
01fill.scm
 
 
02colors.scm
02colors.scm
 
 
03loop.scm
03loop.scm
 
 
04input.scm
04input.scm
 
 
05lines.scm
05lines.scm
 
 
06values.scm
06values.scm
 
 
LICENSE
LICENSE
 
 
Makefile
Makefile
 
 
README.md
README.md
 
 
builtins.json
builtins.json
 
 
compile.hy
compile.hy
 
 
constants.json
constants.json
 
 
flower.scm
flower.scm
 
 
gorillas.scm
gorillas.scm
 
 
link.hy
link.hy
 
 
lisps.txt
lisps.txt
 
 
models.hy
models.hy
 
 
repl.hy
repl.hy
 
 
sin.scm
sin.scm
 
 
transforms.hy
transforms.hy
 
 
wirefram.scm
wirefram.scm
 
 
write.hy
write.hy
 
 

Repository files navigation

This is STAK, a minimalist programming environment based on a programming language with S-expression syntax and a bytecode virtual machine. The intended use is for game prototyping. It was somewhat inspired by the Another World virtual machine, which facilitated the porting of that game to many platforms.

To get started, clone the repository and install the prerequisites.

sudo apt install gcc make libsdl2-dev  # Ubuntu
sudo dnf install gcc make SDL2-devel   # Fedora
pip install hy pyserial tqdm

Build a native version of the VM, then build the examples and run them one by one:

make -C vm
make
./vm/stak 01fill.bc
./vm/stak 02colors.bc
./vm/stak 03loop.bc
./vm/stak 04input.bc
./vm/stak 05lines.bc
./vm/stak 06values.bc
./vm/stak flower.bc
./vm/stak gorillas.bc
./vm/stak sin.bc

Alternatively, having built the VM, launch the REPL, which will also start the VM, and execute some code...

hy repl.hy

(fill-rect COLOR:BLUE 100 50 50 50)

(draw-line COLOR:WHITE 0 0 100 100)

(dotimes (i 15) (draw-line (+ 1 i) (/ (* (- W 1) i) 14) 0 (/ W 2) H))

(dotimes (x 16) (dotimes (y 16) (fill-rect (+ (* 16 y) x) (* 20 x) (/ (* H y) 16) 20 13)))

(define (cls) (fill-rect COLOR:WHITE 0 0 W H))
(cls)

(define (grid rows cols color) (dotimes (y rows) (draw-line color 0 (* 10 y) W (* 10 y))) (dotimes (x cols) (draw-line color (* 10 x) 0 (* 10 x) H)))

(dotimes (i 200) (grid 20 32 i) (pause-frames 1))

...or load one of the example programs in watch mode and make changes to its code.

hy repl.hy
watch flower.scm

Until there is a better tutorial, the examples (*.scm) files are the best way to learn about the language.

Build for DOS

You will first need to download/build the Open Watcom toolchain and set up some environment variables correspondingly.

export WATCOM=/opt/open-watcom-v2/rel
export PATH=$WATCOM/binl64:$WATCOM/binl:$PATH
export INCLUDE=$WATCOM/h
cd vm
make -f Makefile.dos

To connect the REPL to DOSBox, launch the VM in one shell:

make -f Makefile.dos debug

And attach the REPL in another:

hy repl.hy -t tcp:localhost:5000

If your VM is instead listening on a real DOS machine (STAK.EXE -g) you can connect to it over a serial connection:

hy repl.hy -t serial:/dev/ttyUSB0:9600

About

A game prototyping language with some unusual design choices

mcejp.github.io/2025/10/29/stak.html

Topics

game-programming-languagelisps-expressionsstack-machine

Resources

Readme
MIT license
Activity

Stars

1 star

Watchers

2 watching

Forks

0 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.