Getting Started

Installation

git clone https://github.com/gokr/harding.git
cd harding
nimble harding

# Optional install
nimble install_harding

Requires Nim 2.2.6 or later.

Quick Start

harding
harding script.hrd
harding -e "3 + 4"
harding --ast script.hrd
harding --loglevel DEBUG script.hrd

Use the interpreter for interactive work and Granite for native builds.

Granite Compiler

granite compile myprogram.hrd -o myprogram
granite build myprogram.hrd --release
granite run myprogram.hrd

Compile Harding code to standalone native binaries.

Where To Start

Web And APIs

MummyX is Harding's current web server path: a fast scalable native multithreaded HTTP server, with Harding handlers executed through the interpreter's green-process model.

Packages And Tooling

Example Code

Hello World

"Hello, World!" println

Simple Class

| c |
Counter := Object derive: #(count)
Counter>>initialize [ count := 0 ]
Counter>>value [ ^ count ]
Counter>>increment [ ^ count := count + 1 ]

c := Counter new.
c initialize.
c increment.
c value println

Resumable Exception

result := [
    10 // 0
] on: DivisionByZero do: [:ex |
    ex resume: 0
].

result println

Web Route

Harding load: "lib/mummyx/Bootstrap.hrd".
Server := HttpServer new.
Router := Router new.
Router get: "/" do: [:req |
    req respondHtml: "<h1>Hello</h1>"
].
Server router: Router.
Server serveForever: 8080.

IDE Support

VSCode

Syntax highlighting, language-server features, and debugger integration.

Bona

nimble bona
./bona

Launcher, Workspace, Transcript, Browser/Inspector work, and the Application Builder workflow.

Getting Help

GitHub Issues

Bug reports and feature requests.

Open Issues

Discussions

Questions and design discussion.

Join Discussion

Contributing

Development guidelines and setup.

Read Guide

GitHub

Browse the source, examples, and current docs.

View Repository