Giter Club home page Giter Club logo

aussieplusplus's Introduction

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 ({ })

// 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:

// 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, 100] <
	GIMME x;
>

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

// Breaking with `MATE FUCK THIS`
I RECKON x IS A WALKABOUT FROM [0, 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.

// 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 <somethin> to return values:

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

GIMME greeting();

Standard library / Built-ins

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

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();

aussieplusplus's People

Contributors

zackradisic avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.