Hello World
Hello World
Section titled “Hello World”const message be ///Hello, World///console.log[message]This compiles to:
const message = "Hello, World";console.log(message);Running
Section titled “Running”Compile to a file:
purus build hello.purusnode hello.jsOr run directly:
purus run hello.purusKey differences from JavaScript
Section titled “Key differences from JavaScript”| JavaScript | Purus |
|---|---|
= | be |
"string" | ///string/// |
fn(args) | fn[args] |
{ } blocks | indentation |
function | fn |
+ - * / | add sub mul div |
=== !== | eq ne |
&& || ! | and or not |
Variables
Section titled “Variables”const x be 42let y be 3.14y be 100Functions
Section titled “Functions”fn greet name console.log[///Hello/// add name]
greet[///World///]Expression body with to:
fn double x to x mul 2