Go to file
Corey Johnson 82722ec9e4 Update exports and editor script in package.json
Refactored the exports field to provide explicit entry points for the main module, editor, and editor CSS. Updated the editor script to point to the example server file.
2026-01-05 11:30:23 -08:00
assets wip 2025-10-22 11:23:11 -07:00
bin Formatted EVERYTHING with prettier 2025-12-17 09:58:02 -08:00
examples [example] update scripts script 2025-12-10 13:41:13 -08:00
src Use isDebug 2026-01-05 11:30:02 -08:00
vscode-extension Formatted EVERYTHING with prettier 2025-12-17 09:58:02 -08:00
.gitignore ignore vscode extension tmp/ 2025-12-09 08:13:11 -08:00
bun.lock sorry lezer... 2025-12-02 17:11:39 -08:00
bunfig.toml emoji 2025-09-29 11:40:32 -07:00
CLAUDE.md Better names 2025-11-06 10:22:37 -08:00
example.shrimp add barus minimus docs 2025-10-28 21:36:02 -07:00
package.json Update exports and editor script in package.json 2026-01-05 11:30:23 -08:00
README.md old syntax 2025-11-03 20:25:44 -08:00
tsconfig.json works better 2025-10-08 17:30:30 -07:00

Shrimp Language

Overview

Shrimp is a shell-like scripting language that combines the simplicity of command-line interfaces with functional programming concepts. Built using Lezer (CodeMirror's parser system) with TypeScript.

Use it

Go to http://localhost:3000 to try out the playground.

echo "Hello, world!"
tail log.txt lines=50

name = "Shrimp"
greet = do person: echo "Hello" person

result = tail log.txt lines=10

Language Design Philosophy

  • Shell-like command syntax - echo hello world works naturally
  • Everything is an expression - Commands, assignments, and functions all return values
  • Whitespace matters in binary operations - Spaces distinguish operators from identifiers (e.g., x-1 is an identifier, x - 1 is subtraction)
  • Unbound symbols become strings - echo hello treats hello as a string if not defined
  • Simplicity over cleverness - Each feature should work one way, consistently. Two simple features that are easy to explain beat one complex feature that requires lots of explanation

Parser Features

  • Distinguishes identifiers from words to enable shell-like syntax - paths like ./file.txt work without quotes
  • Smart tokenization for named args (lines=30 splits, but ./path=value stays together)
  • Handles ambiguous cases (bare identifier could be function call or variable reference)

Architecture

parser/ - Lezer grammar and tokenizers that parse Shrimp code into syntax trees editor/ - CodeMirror integration with syntax highlighting and language support compiler/ - Transforms syntax trees into ReefVM bytecode for execution

The flow: Shrimp source → parser (CST) → compiler (bytecode) → ReefVM (execution)

See example.shrimp for language examples and src/parser/shrimp.grammar for the full grammar.