Skip to content

A simple language for easy physics calculations.

Notifications You must be signed in to change notification settings

JoelCourtney/hadron

Repository files navigation

Hadron

A small (and slow) language for physics calculations.

Install

Download the hadron file from the latest Release, and put it somewhere in your path.

Build from Source

You must have Java and a recent version of Gradle installed.

Clone this repo in a permanent location, then build it. The gradle command may take a while.

git clone git@github.com:JoelCourtney/hadron.git
cd hadron
gradle hadron

Link the hadron executable to somewhere in your path, or add the repo to your path.

Lastly, create the $HADRON_ROOT environment variable, pointing to the hadron repo (NOT the hadron script). You can also put this in your shell rc file.

export HADRON_ROOT="/LOCATION/OF/hadron"

You can build the documentation to the doc directory with:

gradle dokka

Usage

Running a file

Write a hadron file (for example example.hn), and run it with:

hadron example.hn

You can also make a hadron executable file with a typical shabang:

#! /usr/bin/env hadron

println("Hello World!")

REPL Mode

Just run hadron and type line-by-line:

$ hadron
Hadron v0.1-alpha REPL mode.
There is no help feature.
> "Hello World!"
Hello World!
> 

It currently does not support moving the cursor or using the up/down arrow keys to select previous lines.

Syntax

See this page. Most of the features are not implemented yet; I'm adding them as I need them.

About

A simple language for easy physics calculations.

Resources

Stars

Watchers

Forks

Packages

No packages published