Tick feels like a natural conversation between objects. It combines the pure message passing of Smalltalk-80 with the command-token clarity of Tcl.
Every statement is a receiver, a keyword, or an argument—with zero decorative prepositions and zero punctuation noise. Featuring Ruby-style fluent pipelines (|), comma cascades (,), stackless Protothreads coroutines, and native FFI (@).
Compile and run Tick code directly in your browser with zero installation.
Designed as an embeddable, featherweight scripting language for rapid prototyping.
Everything is an object, from integers and booleans to block closures. Objects communicate strictly via unary, binary, or keyword messages without primitive exceptions.
No semicolons, no trailing periods, no parenthesis soup. Newlines terminate statements, and inline expressions nest naturally using Tcl-style brackets [...].
Chain outputs seamlessly with the pipe (|) like modern Ruby or Elixir, and send sequential messages to the same receiver with comma cascades (,).
First-class cooperative coroutines with two-way value exchange. Implemented via Adam Dunkels' stackless protothreads in C and Goroutine channels in Go.
Variables and functions with the @ sigil directly invoke host C functions, system calls, and dynamic DLLs without writing glue code.
Complete, independent reference implementations in C99 and Golang with identical semantics, plus a WebAssembly build for in-browser execution.
Rooted in the timeless object messaging philosophy of Alan Kay and Smalltalk-80.
There are zero unboxed primitive types. Numbers, strings, booleans, code blocks ({ ... }), and classes themselves are first-class objects inheriting from Object. Arithmetic and conditionals are message sends!
Classes are first-class runtime objects (instances of Metaclass). Create classes and subclasses dynamically using Superclass subclass Name vars { ivar1 ivar2 }.
Instance variables are private to each instance and protected from external access. All state mutation uses the clean keyword set (e.g. set balance [balance + amount]). All external interactions are mediated through messages.
Method resolution is late-bound at runtime. Diverse classes can implement common selectors (e.g. speak, area), and the runtime dispatches to the correct receiver implementation.
Every method implicitly returns self if not terminated by return, enabling natural Smalltalk cascading where multiple messages are chained on one receiver with commas (,).
Any class—including core built-ins like integer, string, or Array—can be reopened and extended with custom methods at runtime.
# 1. Base Class with Instance Variables
Object subclass Animal vars { name sound }
Animal method init nameVal sound soundVal {
set name nameVal
set sound soundVal
}
Animal method getName { return name }
Animal method speak {
"$name says: $sound" println
}
# 2. Subclassing & Method Overriding (Inheritance)
Animal subclass Dog vars { breed }
Dog method initDog nameVal breed breedVal {
set name nameVal
set sound "Woof!"
set breed breedVal
}
Dog method speak {
"$name the $breed barks: $sound" println
}
# 3. Cascading Instantiation & Polymorphism
set dog [Dog new , initDog "Rover" breed "Collie"]
dog speak # => Rover the Collie barks: Woof!
# 4. Open Classes (Extend built-ins)
integer method square {
return [self * self]
}
"5 squared = [5 square]" println # => 25
Familiar Smalltalk semantics with a streamlined, modern command-token grammar.
| Feature | Standard Smalltalk | Tick |
|---|---|---|
| Assignment | total := 0. |
set total 0 |
| Unary Message | server start. |
server start |
| Keyword Message | canvas draw: shape at: origin. |
canvas draw shape at origin |
| Sub-expression | x := a + (b factorial). |
set x [a + [b factorial]] |
| Zero-Arg Block | [ self alert ] |
{ self alert } |
| Parameterized Block | [ :x :y | x + y ] |
{ x y | x + y } |
| Fluent Pipeline | ((items select: [:x | x valid]) collect: [:x | x name]) sorted. |
items select { x | x valid } | collect { x | x name } | sorted |
| Message Cascade | pen up; color: "blue"; down. |
pen up, color "blue", down |
| Class Definition | Object subclass: #Dog instanceVariableNames: 'breed' |
Object subclass Dog vars { breed } |
| Method Definition | Dog >> speak [ ^ 'Woof!' ] |
Dog method speak { return "Woof!" } |
| Implicit Self Return | deposit: amt [ balance := balance + amt. ^self ] |
Account method deposit amt { set balance [balance + amt] } |
First-class lists and dictionaries with pure Smalltalk message passing, fluent pipelines, and native JSON.
Array / List)| Operation | Standard Smalltalk (Smalltalk-80 / Pharo) | Tick |
|---|---|---|
| Instantiation | list := OrderedCollection new. |
set list [List new] (or Array new) |
| Append Item | list add: 42. |
list add 42 |
| Cascade Appends | list add: 1; add: 2; add: 3; yourself. |
list add 1, add 2, add 3 |
| Access by Index | elem := list at: 1. (1-based) |
set elem [list at 1] (Strictly 1-based; index 1 is 1st element) |
| Mutate by Index | list at: 1 put: 99. |
list at 1 put 99 |
| First / Last | list first. list last. |
list first / list last |
| Size / Length | list size. |
list size (or count, length) |
| Check Empty | list isEmpty. |
list isEmpty |
| Contains Item | list includes: 42. |
list contains 42 |
| Index of Item | list indexOf: 42. |
list indexOf 42 |
Iteration (do:) |
list do: [:x | Transcript show: x printString]. |
list do { x | x println } |
| Map / Transform | doubles := list collect: [:x | x * 2]. |
set doubles [list collect { x | x * 2 }] |
| Filter (Select) | evens := list select: [:x | x even]. |
set evens [list select { x | [x % 2] == 0 }] |
| Filter (Reject) | odds := list reject: [:x | x even]. |
set odds [list reject { x | [x % 2] == 0 }] |
| Fold / Reduce | sum := list inject: 0 into: [:acc :x | acc + x]. |
set sum [list inject 0 into { acc x | acc + x }] |
| Custom Sort | sorted := list asSortedCollection: [:a :b | a < b]. |
set sorted [list sortBy { a b | [a < b] }] |
| Natural Sort | sorted := list asSortedCollection. |
set sorted [list sorted] |
| Reverse | list reversed. |
list reversed (or reverse) |
| Slice / Sub-list | list copyFrom: 1 to: 3. |
list slice 0 to 3 |
| Join Strings | (list collect: #asString) joinSeparatedBy: ', '. |
list join ", " |
| Fluent Pipeline | ((list select: [:x | x > 10]) collect: [:x | x * 2]) sorted. |
list select { x | [x > 10] } | collect { x | x * 2 } | sorted |
Dictionary / dict)| Operation | Standard Smalltalk (Smalltalk-80 / Pharo) | Tick |
|---|---|---|
| Instantiation | dict := Dictionary new. |
set dict [Dictionary new] (or dict new) |
| Store Key-Value | dict at: 'name' put: 'Alice'. |
dict at "name" put "Alice" |
| Lookup Key | val := dict at: 'name'. |
set val [dict at "name"] |
| Cascade Inserts | dict at: 'a' put: 1; at: 'b' put: 2; yourself. |
dict at "a" put 1, at "b" put 2 |
| Check Key Exists | dict includesKey: 'name'. |
dict hasKey "name" |
| All Keys | dict keys. |
dict keys (returns Array) |
| All Values | dict values. |
dict values (returns Array) |
| Size / Count | dict size. |
dict size (or count) |
| Check Empty | dict isEmpty. |
dict isEmpty |
| JSON Export | (Requires external NeoJSON library) | dict asJson (or JSON stringify dict) |
| JSON Import | (Requires external NeoJSON library) | set dict [JSON parse '{"name": "Alice"}'] |
Composing lists, cascading dictionaries, and fluent pipelines with zero ceremony.
# 1. Populate records with cascading dictionaries
set students [
List new
, add [Dictionary new , at "name" put "Alice" , at "score" put 92 , at "active" put true]
, add [Dictionary new , at "name" put "Bob" , at "score" put 65 , at "active" put true]
, add [Dictionary new , at "name" put "Carol" , at "score" put 88 , at "active" put false]
, add [Dictionary new , at "name" put "Dave" , at "score" put 95 , at "active" put true]
]
# 2. Pipeline: filter active students scoring >= 80, map to names, and sort
set honorRoll [
students select { s | [s at "active"] & [[s at "score"] >= 80] }
| collect { s | s at "name" }
| sorted
]
set names [honorRoll join ", "]
"Honor Roll: $names" println
# => Honor Roll: Alice, Dave
# 3. Native JSON serialization
set jsonOutput [students asJson]
"Exported JSON: $jsonOutput" println
No hidden exceptions, stack unwinding, or invisible control jumps. Predictable and fast.
# 1. Go-style [value, err] tuples
File method read path {
[path == "missing.txt"] ifTrue {
return [List new , add nil , add "file not found"]
}
return [List new , add "file data" , add nil]
}
set outcome [File read "missing.txt"]
set err [outcome at 2]
[err notNil] ifTrue { "Error: $err" println }
# 2. Smalltalk-style fallback blocks
Service method query id onError errBlock {
[id <= 0] ifTrue { return [errBlock value "invalid ID"] }
return "Record-$id"
}
set record [Service query -1 onError { e | return "default-user" }]
# 3. Userland Result class (isOk, unwrap, error)
set result [Math safeDivide 10 by 0]
[result isOk] ifFalse { "Failed: [result error]" println }