Current language, runtime, web, JSON, and tooling capabilities
Harding keeps message-passing, lexical blocks, late binding, and non-local returns at the center of the language.
^ non-local returns3 + 4
dict at: key put: value
findPositive := [:arr |
arr do: [:n |
(n > 0) ifTrue: [ ^ n ]
].
^ nil
]
Harding keeps the Smalltalk model but modernizes the surface syntax.
# comments& concatenation# comment
greeting := "Hello, " & name
values := #(1, 2, 3)
payload := json{"ok": true, "count": values size}
Array, Table, and JSON literals fit naturally into normal expression flow.
skills := #(user primarySkill, user secondarySkill, "reserve")
profile := #{"name" -> user name, "active" -> true}
payload := json{"skills": skills, "count": skills size}
Harding now emphasizes canonical derive APIs and direct slot access when you want explicit control.
derive:, derivePublic:, and canonical variants:: direct slot and binding accessPoint := Object derivePublic: #(x, y)
Point>>moveBy: dx and: dy [
x := x + dx.
y := y + dy
]
Harding uses an explicit work queue instead of depending on the native call stack.
Use Process, Processor, Monitor, Semaphore, and SharedQueue for cooperative concurrency.
worker := Processor fork: [
1 to: 10 do: [:i |
i println.
Processor yield
]
]
worker suspend.
worker resume.
monitor := Monitor new.
monitor critical: [ shared := shared + 1 ]
queue := SharedQueue new.
queue nextPut: "item".
item := queue next.
sem := Semaphore forMutualExclusion.
sem wait.
sem signal
Processes remain inspectable at runtime through the scheduler and process APIs.
Harding can build reactive server-rendered web apps using MummyX, a fast scalable native multithreaded HTTP server, the Html DSL, and HTMX-style fragment responses.
Router post: "/todos/@id/toggle" do: [:req |
repository toggle: (req pathParam: "id").
req respondFragment: panel oob: page statsOobHtml
]
The HTML side stays just as small and keeps HTMX concepts visible in the markup.
Html render: [:h |
h section: [:panel |
panel id: "todo-panel".
panel button: [:button |
button class: "btn";
post: "/todos/1/toggle";
target: "#todo-panel";
swap: "outerHTML".
button text: "Mark done"
]
]
]
The active web model uses tracked reads and writes rather than older Html template-hole machinery.
TrackedValueTrackedListRenderCacheRenderEntryComponent render
- reads tracked state
- registers dependencies
- reuses cached HTML if clean
- re-renders when tracked writes mark entries dirty
Harding supports dynamic messaging and runtime inspection when you need it.
obj perform: #description.
obj perform: #at: with: 5.
obj perform: #at:put: with: 5 with: "value".
Point superclassNames.
obj class.
obj slotNames.
obj respondsTo: #do:
Harding supports both class-side methods and qualified or unqualified super sends.
Person class>>newNamed: aName [
| p |
p := self new.
p name: aName.
^ p
]
ColoredRectangle>>area [
^ super area + colorAdjustment
]
The interactive REPL is still a first-class part of the development workflow.
$ harding
harding> 3 + 4
7
harding> numbers := #(1, 2, 3, 4, 5)
#(1, 2, 3, 4, 5)
harding> numbers collect: [:n | n * n]
#(1, 4, 9, 16, 25)
Use json{...} for direct JSON creation and object serialization configuration for API work.
Install packages with harding lib and ship native Nim code together with matching Harding .hrd sources.
Launcher, Workspace, Transcript, Browser/Inspector work, and an Application Builder workflow.
Compile Harding code to native binaries through Nim and C toolchains.
Harding includes arrays, tables, sets, intervals, and the classic collection protocol.
numbers := #(1, 2, 3, 4, 5).
scores := #{"Alice" -> 95, "Bob" -> 87}.
numbers do: [:n | n println].
squares := numbers collect: [:n | n * n].
evens := numbers select: [:n | (n % 2) = 0].
sum := numbers inject: 0 into: [:acc :n | acc + n]
Compile Harding code to native binaries through Granite.
granite compile myprogram.hrd -o myprogram
granite build myprogram.hrd --release
granite run myprogram.hrd
Harding source -> AST -> Granite -> Nim -> C toolchain -> native binary
Use log levels, AST output, and scheduler inspection to understand running programs.
harding --loglevel DEBUG script.hrd
harding --ast script.hrd