Dogescript 2.4

Howdy everyone, 2020 was a wild ride. If you’re reading this, hang in there. Side note, sorry for the radio silence and not keeping up with “State of Doge”, things got a bit hectic and lost track. Don’t worry though, work on your favorite language progressed.

Today, we’re glad to announce the first release candidate for 2.4.0.

What’s Changed

A lot, like alot alot.

See the 2.4.0-rc1 release with the notes on everything that has changed.

Feel free to head on over to the Try Online page as well, which has been updated with the 2.4.0-rc1 tag. Here’s a quick highlight of some of the new cooler features.

Classes

dogescript now supports classes, declare them with classy and extend them with grows:

classy Shape
wow

classy Square grows Shape
wow

very sq is new Square

More indepth doc for classes can be found in classes section of the spec.

Operators/Expressions

Operators were fixed to work almost everywhere, except in ambiguous cases. A couple of new ones like and same were added to get around some ambiguity when using is in certain conditionals.

A couple of new ones, giv and levl are used to access properties.

Some additional ones, like bigify and smallified were added to support those fancy pre/post arithmetic operations.

For a full list of new operators, check the operators section of the spec.

Module Support

Exporting of modules has been added, woof to your heart’s content.

Invocation Enhancements

Better chaining support was added with a new keyword, thx which should remove some of the awkwardness of having to use the &plz style syntax with multiple lines.

plz foo with a b thx dose bar with c d

On that note, a bunch of the syntax was improved to try to have things be called in a single line. 3 spaces is no longer needed (and won’t be supported, say goodbye to truedoge mode in the future).

Returning values was also enhanced to not require wow [return] style syntax. The amaze keyword supports multiple expressions after it, where as the wow style return was limited to a single expression, to avoid breaking many things. This new keyword is particularly useful when trying to use a function call as the return.

such fib much n
amaze plz foo with bar
wow

such fib2 much n
shh this next bit doesn't do the same thing
wow plz foo with bar

The amaze example will create valid javscript, while the wow example would break invocations.

function fib(n) {
    return foo(bar);
}

function fib2(n) {
    return plz foo with bar;
}

Repl Enhancements

The REPL got a couple of enhancements.

dogescript --run file.djs can now run the source!

.plz-load within the repl can load a source file into the environment .plz-exit will exit the repl (mostly useful on windows where CTRL+C isn’t handled greatly)

Testing Focus

Give the release candidate a shot, uplift your existing 2.3 code and let us know what breaks. There’s a couple of things left in our backlog before 2.4.0 is ready, but we felt having a release candidate out to play with would be nice.

Regards, the dogescript crew

Published: August 10 2020

blog comments powered by Disqus