DEV Community

Ethan Onstott
Ethan Onstott

Posted on

StormScript: Year in Review

It has been over a year since I created the StormScript programming language. Since then, I have not only fixed many issues with the language, but I have also introduced many new features to the language. In this post, I will go over them.

Syntax Changes

Keyword Changes

Initially, the keyword out was used to print. This was a fine keyword, but I feel that print would make more since in this setting.

do {
    out "Hello, World!";
}end;
Enter fullscreen mode Exit fullscreen mode

was changed to

do {
    printl "Hello, World";
}end;
Enter fullscreen mode Exit fullscreen mode

This change also allowed there to be 2 forms of print, print and printl. printl adds a newline to the end of the value that is printed.

@args was originally used to add function arguments. The problem with this is that it required the arguments to be on a separate line than the function.

The removal of end;

Originally, StormScript used two ways to end a code block. Many people commented on this in my first post. Not only would users have to put curly braces to end a scope, they would also have to put the end; keyword. This proved to be redundant and was removed.

Code was changed from

do {
    printl "Hello, World!";
}end;
Enter fullscreen mode Exit fullscreen mode

to

do {
    printl "Hello, World!";
}
Enter fullscreen mode Exit fullscreen mode

This not only makes long files look nicer, but it also saves time.

Static to Dynamic Type

StormScript was planned to be statically typed, but this changed after I realized how much this kills the readability of the language. As a result,

do {
    str name: "Ethan";
    printl "Hello, ", name;
}
Enter fullscreen mode Exit fullscreen mode

would become

do {
    name: "Ethan";
    printl "Hello, ", name;
}
Enter fullscreen mode Exit fullscreen mode

Comparisons

As with any programming language, StormScript has many different comparison operators. These have not changed much over time, although StormScript uses keywords rather than symbols. These keywords are is, not, less, greater, lesseq, and greatereq.

Website

In early March, I decided that StormScript should migrate to its own website.

The Future

Looking forward, I hope to publish version 1.0.0 by the end of the year. For now, version 0.7.0 just came out, and I am currently working on version 0.8.0. Here are some new things.

String Concatenation

For string concatenation, I am using the $ symbol followed by a variable name inside of a string literal.

do {
    int i: randomrange => min: 0, max: 100;
    printl i, " is my favorite number";
}
Enter fullscreen mode Exit fullscreen mode

is now

do {
    int i: randomrange => min: 0, max: 100;
    printl "$i is my favorite number";
}
Enter fullscreen mode Exit fullscreen mode

Live interpretation

Live interpretation allows code to be run and changes to be reflected live. This would save variable states, as well as location. In the current development branch, live interpretation only reruns the program when changes are made.

$ stormscript test FILENAME
Enter fullscreen mode Exit fullscreen mode

I am happy to say that the file that runs live interpretation is completely written in StormScript.

Afterword

Be sure to check out the website at stormscript.dev as well as contribute to the repository.

I am happy to answer any questions you may have, so please feel free to ask.

Top comments (0)