zackradisic / aussieplusplus Goto Github PK
View Code? Open in Web Editor NEWProgramming language from down under
Home Page: aussieplusplus.vercel.app
Programming language from down under
Home Page: aussieplusplus.vercel.app
I'm unfamiliar with vercel (I'm not a web dev at all), but I noticed that updates and corrections that have been made to ./DOCS.md
and the contents of ./examples/
are not (yet) reflected on the aussieplusplus.vercel.app landing page. ๐
The contents of DOCS.md should be rendered to the Docs
section towards the bottom of the page.
The contents of the examples folder should be populated to the drop-down list for the editing area.
Surely there should be a straightforward way to automate that...?
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
As well as importing built-in functions with IMPOHT ME FUNC
, a keyword for importing user-defined modules should be defined. I suggest OI
, or COOEE
.
E.g.
IMPOHT ME FUNC ChuckSomeDice;
COOEE utilities.aussie;
IMPOHT ME FUNC HitTheSack;
OI gizzabeerdahl.aussie;
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
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. ๐
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
I had written this program:
G'DAY MATE!
THE HARD YAKKA FOR recursiveFunc IS () <
GIMME"running...";
recursiveFunc();
>
recursiveFunc();
CHEERS C***!
Notice the typo -- GIMME"
rather than GIMME "
. The program failed with a syntax error. However, when I fixed it and ran it again, I got this error:
thread 'main' panicked at 'already borrowed: BorrowMutError', /Users/zackradisic/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/library/std/src/io/stdio.rs:872:20 note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
The more I click run, the worse the errors get, saying thread panicked while panicking. aborting.
and then thread panicked while processing panic. aborting.
.
Thingamejig is an object
Rustle up is the initiator
Buggered is the destructor
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.
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'
The syntax highlighting suggests /* ... */
comments exist, but using one causes an error.
I was messing around with callbacks, and I noticed something interesting:
G'DAY MATE!
IMPOHT ME FUNC HitTheSack;
THE HARD YAKKA FOR performAfter IS (callback, duration) <
HitTheSack(duration);
callback();
>
THE HARD YAKKA FOR helloWorld IS () <
GIMME "Hello, World!";
>
I RECKON duration = 1000;
// What combinations of literal/variable are legal?
performAfter(helloWorld, 1000); // works
performAfter(helloWorld, duration); // works
performAfter(// wait, do function literals/closures even exist?
1000);
CHEERS C***!
I don't have any ideas for what they would be called, but I'm not even sure words would be necessary -- they tend to be pretty punctuationful. Consider how the NOP lambda is []() { }
in C++ and () => {}
in JS.
Syntactically, I perfer how Swift and Ruby handle it, where the entire closure body is wrapped in braces (in contrast with the closure syntax in JS, which consists of multiple separate parts).
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 }
The following program never terminates:
G'DAY MATE!
I RECKON _ IS A WALKABOUT FROM [1 TO 1] <
GIMME "Looping...";
>
It is not clear whether BONZA and FAIR DINKUM are reserved words.
Also, whether it's FAIR DINKUM or FAIRDINKUM!
There doesn't seem to be any documentation on block comments or increment/decrement statements, even though the issues for them were closed.
Crack a tinne (...) returns an open tinnie/file
Swig tinnie to read a line
Sip tinnie to get a character
Wif tinnie to find out where the file Pointer is at
Here's a weird asymmetry: "" + 5
works but 5 + ""
doesn't. The latter gives the error message in the issue title.
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.
Zack, Thanks so much. This is delightful. I had a suggestion.
A built-in "class" should be beer. You can have sizes (jug, pony, middy, pint, schooner, etc), and drinking speed (sip, gulp, scull, etc), type (lager, ale, microbrew) and probably much more.
Then you can have DRINK beer(size, speed, type) as an equivalent to the sleep(T ms) function of other languages.
It occurs to me belatedly that you could use a DRINK UNTIL construct for coroutine synchronization.
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 ')'
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.
Surely all loops are "blocky's" or "alley loops"
WHATYARECKON<> AAHSHELLBERIGHT <>
) and throwing errors (STREWTH <value>
) #1YA RECKON
s expressions, see #15If you have any ideas for any of the features above, feel free to make an issue so we can discuss about it there
What kind of things do we need to streamline the contribution process? Let me know if I have missed anything:
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.
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.
Boolean values are currently represented by NAH, YEAH
and YEAH, NAH
, which are perfectly clear and understandable truth statements that all humans should immediately understand, obviously.
Of course we all know that these are the simplest, most idealised ways to express true and false values. A truly aussie boolean representation will need to be more flexible than this.
I would suggest that, in true aussie fashion, the following values should all resolve to true
:
NAH, YEAH
YEAH, NAH, YEAH
NAH, NAH, YEAH, NAH, YEAH
YEAH, YEAH, NAH, NAH, NAH, YEAH
etc. Similar patterns for false
statements, obviously.
I'd suggest that ,
separators between NAH
and YEAH
tokens should also be optional. I.e., the following should all evaluate to true
:
NAH, YEAH
NAH YEAH
NAHYEAH
The syntax highlighting colors 0x2
the same way it does 012
, but the former causes an error.
Some Slavic languages do quotes like โ...โ
, so the double comma is legitimately a quotation mark anyways.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.