Getting Started

Installation

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

Requires Nim 2.2.6+

Quick Start

harding              # Start REPL
harding script.hrd   # Run a script
harding -e "3 + 4"   # Evaluate

Use --loglevel DEBUG for verbose output

VSCode Extension

code --install-extension \
  harding-lang-0.1.0.vsix

Syntax highlighting for .hrd files

Examples

Hello World

"Hello, World!" println

Factorial

factorial := [:n |
    (n <= 1) ifTrue: [^ 1].
    ^ n * (factorial value: (n - 1))
]
(factorial value: 5) println

Counter Class

Counter := Object derive: #(count)

Counter extend: [
    self >> initialize [ count := 0 ]
    self >> increment [
        count := count + 1.
        ^ count
    ]
]

c := Counter new
c initialize
c increment println

Collections

numbers := #(1 2 3 4 5)
squares := numbers collect: [:n | n * n]
evens := numbers select: [:n | (n \ 2) = 0]
sum := numbers inject: 0 into: [:a :n | a + n]

Reference Documentation

Language Reference

Project

For Smalltalk Programmers

Key Differences from Smalltalk-80

Feature Smalltalk Harding
Comments "comment" # comment
Strings 'string' "string"
Statement separator Period . only Period or newline
Class creation Class definition Object derive: #(vars)
Persistence Image-based File-based, git-friendly
Execution VM VM or Native compilation (future)
Inheritance Single Multiple

Getting Help

GitHub Issues

Bug reports and feature requests

Open Issues

Discussions

Questions, ideas, and community

Join Discussion

Contributing

Development guidelines and setup

Read Guide