No description
  • JavaScript 69.3%
  • Lua 18.9%
  • HTML 8.6%
  • CSS 1.2%
  • Vim Script 1.2%
  • Other 0.8%
Find a file
2026-03-15 09:07:03 -06:00
deps Shuffling things around 2025-11-30 13:54:15 -07:00
editors/vim Various cleanups, # is now a comment/drop command like NB & void, tidy playground array output 2026-02-24 01:13:12 -07:00
examples Examples 2026-02-18 23:05:20 -07:00
games/spirograph Various cleanups, # is now a comment/drop command like NB & void, tidy playground array output 2026-02-24 01:13:12 -07:00
lib Various things 2026-03-15 09:07:03 -06:00
original_notes Cleaning up project layout some 2026-01-18 12:50:18 -07:00
scrap Stdlib work 2025-12-05 00:39:58 -07:00
sites/stk.junglecoder.com Various cleanups, # is now a comment/drop command like NB & void, tidy playground array output 2026-02-24 01:13:12 -07:00
.gitignore A -lot- of website work 2026-02-18 00:58:46 -07:00
cli.js Examples 2026-02-18 23:05:20 -07:00
install.stk Work on node-side HTTP client 2026-02-14 01:57:56 -07:00
nstk.sh Added basic stk installer 2026-01-16 10:18:05 -07:00
package.json Add package.json for less error 2025-11-30 15:20:08 -07:00
project.stk Working on web IDE and site 2026-01-26 08:34:31 -07:00
qcli.js Shaking things up a little 2026-01-02 00:18:21 -07:00
qstk.sh Shaking things up a little 2026-01-02 00:18:21 -07:00
README.md Add support for ^ as a prefix to refer to outer variables 2026-02-20 00:35:44 -07:00
stkweb.js Various things 2026-03-15 09:07:03 -06:00
stvm.js Various things 2026-03-15 09:07:03 -06:00
test Made a little spirograph program 2025-12-23 03:53:43 -07:00

StackTalk

This is a prototype for a language I'm calling StackTalk

The core's core ideas are as follows:

  • Quotations, aka code as lists of symbols, that are runtime editable
  • Objects, the main contents of which are multiple named stacks
  • A global* value stack
  • A global* "me" stack, for the current object

The limbs around that core look liek this:

  • A handful of syntax sugars that make it easy to write most common shapes of program, nota
    • word[ code ] becomes [ code ] word, which gives more options w/r/t ordering things
    • word[ some code :or some other code ] produces an object that has some code as quotation in the proc stack and some other code in the or stack. This allows writing programs with named and/or optional parts much more easily than in many quotation-based stack languages.

The end result ends up looking like a cross between Io, Smalltalk and Factor:

Account: is-obj[
    0.0 >balance
    deposit: fn[ balance: += ] 
    show: fn[ "Account balance: $" balance + /nl + Io .write ]
]

"Initial: " Io .write
Account .show

"Depositing $10" Io .println
Account .[ 10.0 deposit ]

"Final: " Io .write
Account .show

* Global being "global to a given interpreter state".

Trying it out

If you just want to try out a little bit of StackTalk, there's a playground at https://stk.junglecoder.com/playground.html.

Getting started locally

To run stacktalk locally, I recommend using node 22 or a compatible JS runtime. Then you should be able to run ./nstk.sh install.stk to install StackTalk to /home/$USER/.stacktalk, which you can then add to your $PATH to get access to stk on posix systems.

REPL

You can run stk -e repl to get a basic stacktalk REPL going.

Projects

If you want to make utility scripts for a given project/folder, you can write a project.stk file. When running stk, any function defined with cmd can be directly invoked by stk like so:

project.stk:

project[
    test: cmd[ "Test" print ]
]

At a command line:

stk test # Prints "Test"

TODOS

  • Add support for ^name as sugar for ^[ name ]
  • Change how modules work so that they can be referenced w/o copying their entire contents
  • Autobox strings, booleans and numbers if they are placed on the me stack
  • Syntax highlighting code editor for playground.