Programming language from down under, inspired by this Reddit post.

Overview

aussie_plus_plus

aussie++

Programming language from down under, inspired by this Reddit post.

View live demo here.

Special thanks to MarkWhyBird, louis100, and others who came up with the language spec.

Key Features

  • 🇦🇺 Syntax entirely comprised of Australian lingo and slang
  • 🪃 Wield an Australian's greatest weapon: use boomerangs (angle-brackets) instead of curly braces
  • True aussie mode, where uʍop ǝpᴉsdn characters become valid code

Example

G'DAY MATE!

THE HARD YAKKA FOR fibonacci IS ( x ) <
    YA RECKON x <= 1 ? BAIL x;

    BAIL fibonacci(x - 1) + fibonacci(x - 2);
>

GIMME fibonacci(30);

Docs

aussie++ is a dynamically-typed and interpreted language inspired by this Reddit post.

General

All keywords are case-insensitive, meaning CHEERS C***! is equivalent to cheers c***!, but all caps is strongly recommended.

We use boomerangs (< >) instead of curly braces ({ })

// Use this to indicate end of program CHEERS C***! ">
// Programs must start with `G'DAY MATE!`
G'DAY MATE!

// Prints "crikey mate!" to console
GIMME "crikey mate!";

// Boomerangs for blocks/scopes
<
	I RECKON x = 5;
>

// Use this to indicate end of program
CHEERS C***!

Types / Variables

Declare booleans, numbers, strings and nil/null like so:

// Booleans
I RECKON thisIsFalse = YEAH, NAH;
I RECKON thisIsTrue = NAH, YEAH;

// Numbers
I RECKON regularInteger = 42069;
I RECKON tinyNum = 0.00001;
I RECKON negativeNum = -1;

// Strings
I RECKON goodStr = "fair dinkum mate!";

// Nil/Null
I RECKON emptiness = BUGGER ALL;

Control flow

aussie++ supports if statements and basic pattern matching:

WHATABOUT NAH, YEAH == YEAH, NAH ? < GIMME "strewth we broke boolean logic!"; > WHATABOUT ? < GIMME "the universe is okay"; > // Pattern matching YA RECKON randomBeer() IS A < "Fosters" ~ GIMME "Flamin' hell!"; "Coopers" ~ GIMME "You Beauty!"; somethinElse ~ GIMME "Yeah, dunno that one: " + somethinElse; > ">
// If/else statemets
YA RECKON 1 == 2 ? <
	GIMME "fark we broke maths!";
> WHATABOUT NAH, YEAH == YEAH, NAH ? <
	GIMME "strewth we broke boolean logic!";
> WHATABOUT ? <
	GIMME "the universe is okay";
>

// Pattern matching
YA RECKON randomBeer() IS A <
	"Fosters"    ~ GIMME "Flamin' hell!";
	"Coopers"    ~ GIMME "You Beauty!";
	somethinElse ~ GIMME "Yeah, dunno that one: " + somethinElse;
>

Loops

aussie++ has for and while loops. With for loops the main thing to note is that the ranges are specified using interval notation ([ or ] is inclusive, and ( or ) is exclusive). You can mix and match. You can break out of a loop by saying MATE FUCK THIS:

// From 0-100
I RECKON x IS A WALKABOUT FROM [0 TO 100] <
	GIMME x;
>

// From 0-99
I RECKON x IS A WALKABOUT FROM [0 TO 100) <
	GIMME x;
>

// Breaking with `MATE FUCK THIS`
I RECKON x IS A WALKABOUT FROM [0 TO 999999] <
	YA RECKON x > 1000 ? MATE FUCK THIS;
>

While loops are similar to those you would find in other languages, except that the loop only executes if the condition is false.

GIMME "BLOODY OATH I'M TIRED!"; ">
// OI MATE, PAY ATTENTION! THIS LOOP STOPS WHEN I'VE WALKED OVER 3 KM!

I RECKON kmWalked = 0;
I RECKON I'LL HAVE A WALKABOUT UNTIL (kmWalked > 3) <
	GIMME "i walked 1 km!";
	kmWalked = kmWalked + 1;
>
GIMME "BLOODY OATH I'M TIRED!";

Functions

Define functions like so, using BAIL to return values:

GIMME greeting(); ">
THE HARD YAKKA FOR greeting() IS <
	BAIL "G'day mate!";
>

GIMME greeting();

Standard library / Built-ins

Use IMPOHT ME FUNC to import built-in functions. The language currently comes with two built-ins, ChuckSomeDice(start, end) and HitTheSack(ms):

goIntoAComa(); ">
IMPOHT ME FUNC ChuckSomeDice;
IMPOHT ME FUNC HitTheSack;

THE HARD YAKKA FOR goIntoAComa() IS <
	// Return a random integer from 0-99
	I RECKON duration = ChuckSomeDice(0, 100);

	// Sleep for `duration` seconds
	HitTheSack(duration * 1000);

	GIMME "strewth! i went into a coma!";
>

goIntoAComa();
Comments
  • Increment/decrement statements

    Increment/decrement statements

    GOOD ON YA as increment statement:

    I RECKON x = 0;
    GOOD ON YA x;
    GIMME x;
    // Output is 1
    

    PULL YA HEAD IN as decrement statement:

    I RECKON x = 1;
    PULL YA HEAD IN x;
    GIMME x;
    // Output is 0
    

    I would expect these to be pre-inc/decrements, where that's relevant

    IDEA 
    opened by jwfxpr 10
  • Arse-backward US date format? Faark!

    Arse-backward US date format? Faark!

    Urgently needs a fix in the GimmeTime function. The sample program time.aussie:

    G'DAY MATE!
    
    IMPOHT ME FUNC GimmeTime;
    
    GIMME "the time in sydney is: " + GimmeTime();
    

    produces

    the time in sydney is: 10/30/2021, 12:14:29 AM
    

    If I get a chance this weekend I'll have a look at the source and submit a patch.

    FUCKUP 
    opened by ian-barnes 5
  • Add examples/comeinspinner.aussie

    Add examples/comeinspinner.aussie

    Inspired by the suggestion in #1 of ComeInSpinner as an alias for ChuckSomeDice, I've written a small example module that demonstrates pattern matching to figure out the result of a two-up coin toss, returning Tails, Heads, or Odds depending upon the values supplied.

    With apologies to @timshepherd-academy for mangling his suggestion! 😆

    Please double-check and correct my syntax as necessary, this was written in the text editor and I haven't actually tried to compile it.

    opened by jwfxpr 4
  • Fix quotes in upside-down mode

    Fix quotes in upside-down mode

    Right now, both and " are valid in upside-down mode, while only the latter are valid in rightside-up mode.

    Relatedly, examples/upsidedown.aussie needs to be changed.

    opened by bbrk24 2
  • Broken Sample code

    Broken Sample code

    This example code:

    I RECKON x IS A WALKABOUT FROM [0, 100) <
    	GIMME x;
    >
    

    Fails with the following errors:

    OI MATE! EXPECTED to BUT GOT ','
    EXPECTED NUMBER, STRING, BOOLEAN, NIL, OR IDENTIFIER BUT GOT ','
    OI MATE! EXPECTED ; BUT GOT ')'
    EXPECTED NUMBER, STRING, BOOLEAN, NIL, OR IDENTIFIER BUT GOT ')'
    
    FUCKUP 
    opened by bbrk24 2
  • thread 'main' panicked at 'Unable to resolve var'

    thread 'main' panicked at 'Unable to resolve var'

    Perhaps a mistyped variable name should give a more readable error message than this?

    thread 'main' panicked at 'Unable to resolve var: Var { ident: Ident { name: "h", line: 11 }, scope_distance: 4294967295 }', src/resolver.rs:211:9
    note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
    

    Hitting "Run" a second time without fixing the issue also yields the thread panicked while panicking. error mentioned in #16.

    opened by bbrk24 1
  • Extra output: `EXpr is: ExprNode ...`

    Extra output: `EXpr is: ExprNode ...`

    This short program, which should print nothing:

    G'DAY MATE!
    
    I RECKON i IS A WALKABOUT FROM [1 TO 7] <
    >
    
    CHEERS C***!
    

    Instead prints:

    EXpr is: ExprNode { expr: Literal(Number(7.0)), line: 3 }
    
    opened by bbrk24 1
  • Function definitions erase previous definitions

    Function definitions erase previous definitions

    G'DAY MATE!
    
    // declare function `f()`
    THE HARD YAKKA FOR f IS () <
        GIMME "No args";
    >
    
    // intended to be an overload, ends up being a silent redefinition
    THE HARD YAKKA FOR f IS (x) <
        GIMME x;
    >
    
    f(); // <- OI MATE, CAN YA FUCKIN' COUNT?? EXPECTED 1 ARGUMENTS BUT GOT 0
    
    CHEERS C***!
    

    That feels like the wrong error for that context. If the language doesn't support overloading, you shouldn't be able to redefine a function with the same name.

    FUCKUP 
    opened by bbrk24 1
  • thread 'main' panicked at 'cannot sample empty range'

    thread 'main' panicked at 'cannot sample empty range'

    Apparently ChuckSomeDice really doesn't like non-integers, as this code:

    G'DAY MATE!
    IMPOHT ME FUNC ChuckSomeDice;
    ChuckSomeDice(0, 0.5);
    CHEERS C***!
    

    outputs the following error:

    thread 'main' panicked at 'cannot sample empty range', /Users/zackradisic/.cargo/registry/src/github.com-1ecc6299db9ec823/rand-0.8.4/src/rng.rs:134:9
    note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
    
    opened by bbrk24 2
  • Number-string addition always puts the string first

    Number-string addition always puts the string first

    For the following program:

    G'DAY MATE!
    
    GIMME 5 + "foo";
    GIMME "foo" + 5;
    GIMME "" + 5 + "foo";
    
    CHEERS C***!
    

    I would expect this output:

    5foo
    foo5
    5foo
    

    However, the actual output is:

    foo5
    foo5
    5foo
    
    opened by bbrk24 1
  • Strange pattern-matching error

    Strange pattern-matching error

    This program:

    G'DAY MATE!
    
    YA RECKON x IS A <
        y ~ BAIL NAH, YEAH!;
        z ~ GIMME z;
    >
    
    CHEERS C***!
    

    Gives the expected errors:

    [line 5] TOO MANY DEFAULT BRANCHES IN MATCH STATEMENT, YA DAFT BUGGER
    [line 6] EXPECTED NUMBER, STRING, BOOLEAN, NIL, OR IDENTIFIER BUT GOT '>'
    

    However, if you change it from z to other:

    G'DAY MATE!
    
    YA RECKON x IS A <
        y ~ BAIL NAH, YEAH!;
        other ~ GIMME other;
    >
    
    CHEERS C***!
    

    It now gives a much more confusing error message:

    [line 8] OI MATE! EXPECTED [Number(420.0), String("any string literal"), True, False, BuggerAll, Ident("any identifier")] BUT GOT 'EOF'
    
    opened by bbrk24 0
  • Numerical improvements

    Numerical improvements

    Should we consider bitwise operators? I imagine << and >> will run into parsing issues, but |, &, ^, and ~ should be doable. Alternatively, we could use words for all six. (I have no suggestions for what.)

    Why does !0 == !1? They both evaluate to YEAH, NAH! which doesn't make sense to me. Typically, 0 corresponds to one boolean and all other integers to the other. This isn't always completely accurate -- for example, Objective-C does this mod 256 -- but I'd say it's pretty uncontroversial that 0 and 1 should have different boolean values.

    Should we have literals for NaN and Infinity? It is possible to get them (0 / 0 and 1 / 0 respectively) but I'd prefer them to have names. They currently print as NaN and inf respectively, so if we give them names then the string conversion has to be updated to match.

    The syntax highlighting shows literals like 1e9 as if they're numbers, but they don't work: OI MATE! EXPECTED ; BUT GOT 'e9'. It would be nice to be able to express large or small numbers using scientific notation, or have an exponentation operation (like pow() or **) -- preferably both.

    opened by bbrk24 2
  • Add LICENSE

    Add LICENSE

    I noticed here that you appear to have chosen an MIT license for the website. It's also wise to add a LICENSE to the repository to disambiguate and clearly document the license in use; people are much more likely to contribute to (or use) projects that have a clear licence that they understand.

    GitHub allows for you to do this easily 👍 Alternatively, if the MIT license wasn't an active choice, it's worth considering what license might suit, for example https://choosealicense.com/ and other similar sites might be of help. 😊

    opened by jwfxpr 0
Owner
Zack Radisic
Building stuff @modfy
Zack Radisic
Libreddit - An alternative private front-end to Reddit

Libreddit - An alternative private front-end to Reddit

Spike 3.9k Jan 6, 2023
Uradhura is a telegram bot that fetches information and media from reddit

Pathetic little Telegram bot that fetches information from Reddit posts(with gif, image(post with single image) and video)

The Penguins Org 3 May 28, 2022
A simple clone of reddit r/place

Run First install rustup with instructions on Rustup. Then run it: cargo run Endpoints There is two endpoints, one for getting canvas and the other fo

Kaveh 1 Sep 12, 2022
The language that eats the stack. Heavily inspired by porth which is inspired off of forth

Snack The language that eats the stack. Heavily inspired by porth which is inspired off of forth Install To use Snack you will need Rust and fasm Afte

Cowboy8625 2 Mar 20, 2022
Programming Language Inspired by Brainfuck

Brainsuck Brainfuck but not really... like... a better version of it. Installation Requirements: Rust version 1.50 or higher Linux curl https://raw.gi

Derin Önder Eren 27 Nov 18, 2022
A Star Wars inspired by programming language

The Force The Force is a gateway to abilities many believe are unnatural... Getting Started Install Rust. We also provide a Dev Container if you would

Matthew Booe 14 Dec 21, 2022
tr-lang is a language that aims to bring programming language syntax closer to Turkish.

tr-lang Made with ❤️ in ???? tr-lang is a language that aims to bring programming language syntax closer to Turkish. tr-lang is a stack based language

Kerem Göksu 10 Apr 2, 2022
A simple programming language for everyone.

Slang A simple programming language for everyone, made with Rust. State In very early stages. Plan is to create a byte-code compiler and make that exe

Slang, Inc. 11 Jul 1, 2022
A programming language. Better mantra pending.

Dusk Dusk is a programming language I've been working on on and off for the past while now. It's still very much in its infancy (... a quick look thro

Kaylynn Morgan 14 Oct 24, 2022
Ruxnasm is an assembler for Uxntal — a programming language for the Uxn stack-machine by Hundred Rabbits

Ruxnasm is an assembler for Uxntal — a programming language for the Uxn stack-machine by Hundred Rabbits. Ruxnasm strives to be an alternative to Uxnasm, featuring more user-friendly error reporting, warnings, and helpful hints, reminiscent of those seen in modern compilers for languages such as Rust or Elm.

Karol Belina 44 Oct 4, 2022
Frame is a markdown language for creating state machines (automata) in 7 programming languages as well as generating UML documentation.

Frame Language Transpiler v0.5.1 Hi! So very glad you are interested in Frame. Frame system design markdown language for software architects and engin

Mark Truluck 35 Dec 31, 2022
beat saber is a strongly typed, self-documenting and highly performant programming language

beatsaber beat saber is a strongly typed, self-documenting and highly performant programming language. With beat saber we aimed to create a language t

Untitled 4 Jan 17, 2022
Analogous, indented syntax for the Rust programming language.

Note: After experimenting with this in the wild, I have found representing keywords as symbols to be far less readable in large codebases. Additionall

null 42 Oct 2, 2021
A cell-based esoteric programming language

Tape A cell-based esoteric programming language Tape is a cell-based, brainfuck-like programming language that has a readable syntax and a non-wasted

Gabriel Pacheco 2 Feb 23, 2022
An incremental programming language

Differential Datalog (DDlog) DDlog is a programming language for incremental computation. It is well suited for writing programs that continuously upd

VMware 1.2k Dec 28, 2022
🤯 A brainf*ck-style programming language, but readable

?? Brainease Brainease is a brainf*ck-style programming language, but readable. $ cargo install brainease # brainease -f examples/hello.bz save 'H

Arthur Fiorette 11 Sep 30, 2022
Simple programming language that speaks the ones you already know!

Simple programming language that speaks the ones you already know!

LyonSyonII 2 Feb 12, 2022
simple, C-like programming language

CUP: C(ompiler) U(nder) P(rogress) A badly named, in-progress programming language just to learn how these things work. Wait, doesn't everyone write a

Mustafa Quraish 287 Dec 28, 2022
A fast & light weight Discord Client made with love using the Rust programming language.

LemonCord A fast & light-weight Discord Client written in Rust using the wry crate. Features Fast, light-weight, easy to use. 100% Open sourced. No su

Lemon Rose 5 Jan 30, 2023