Goa
- 8 Devlogs
- 12 Total hours
A small expression-based programming language designed to be lightweight and easy for people to understand.
A small expression-based programming language designed to be lightweight and easy for people to understand.
i’m tired boss image here
Wow, I’m never writing documentation again. This sucks.
RAND and ABS
I don’t even know how this happened. I swear I added this, and it was in past documentation, but it’s not just in the code. I had to quickly write them in.
More complex comparators like <= and >= were being split apart, and so it wasn’t being understood. I also had to rewrite the logic for IF and ELSE IF blocks.
BASE returning NaN for bases above 10
Ok I’m sorry, but I’m too lazy to actually fix this. BASE will now just return an error if you try to convert a number past base 10. I want to keep Goa without any strings.
The new LOG statement allows you to do logarithms for any base. Hooray!
I added SIN, COS, TAN, ARCSIN, ARCCOS, and ARCTAN statements. Should I call the last 3 ASIN, ACOS, and ATAN? Let me know your thoughts.
You can now use the ROUND statement to round to a certain number of decimal places. I also added FLOOR and CEIL functions.
I added RANDFLOAT and RANDSIGN for generating random floats and generating a random sign (-1, 1), respectively.
pretty self explanatory
Guess my old programs doing factorials are now useless….
In this update, I think I did a good amount of work on the language. I have added float support. Basically, for each variable, now instead of just storing a value, each variable also stores a type - integer or float.
Firstly, I’m making Goa have strict typing. To convert between types, use the TOINT and the TOFLOAT statements. Goa also uses safe promotion, meaning calculations involving two integers will produce an integer, while calculations involving at least one float will always produce a float.
I can’t believe I didn’t include this earlier, but now here they are! The <= and the >= comparators!
The DIV statement now only returns integers. The EXP statement now only takes positive exponents and if your base is negative, only odd exponents. The BASE statement now only takes integer statements.
With the DIV statement now only returning integers, run the FDIV statement to return floats! Now that the EXP statement no longer takes negative exponents, run the ROOT statement to do roots!
For the 1.0 full release, I plan to add a lot of statements. I also want to add OR and AND statements… but that’s a little too much work for me. I don’t know, I’ll see. I’m planning on adding trig functions, more random functions, gcd and lcm, and more.
Documentation for Goa is now complete. This is Goa 0.8 Beta, because I’ve also finished some final touches to Goa. Before the full release, I plan to add more comparators, floats, and more math functions.
Now when you use the left sidebar to navigate the documentation, the site smoothly scrolls to that section.
Localstorage now saves theme choice, allowing your theme to be saved when switching pages and when reloading (which I think is kinda sick)
Once you scroll down a bit, a back to top button shows at the bottom right, allowing you to scroll all the way back up! (also, it has a pretty cool pop up animation)
For the tag, I’ve added formatting making it stand out more from normal text!
I’ve added several hover animations for navigation links both on the sidebar and within the docs, animations for the back to top button, and a quick pop up animation when you first open up the docs!
i made my own scrollbar 
now my nested commands work again heheheh
Anyway, so for the past like 2 hours of coding, I’ve been working on my documentation. And I’ve got to say, it absolutely sucks. It’s like I’m writing an essay for my English class. I’m have like 20000 characters, so in like one day my html becomes the largest file here. Big sigh. I’m not even done yet T-T. The reason that I’m so pissed off is I found another bug that I can’t even explained what happened.
So in programming languages, if you want to change a variable by some amount you would run (I’m just gonna explain in pseudocode)
x = x + 1
And this is what you would run (or x += 1 or x ++ or ++x but you get the idea).
SET (x ADD (x 1))
Basically, it sets the value of x to the sum of x and 1. However, when I run this, I get ERROR: Undefined variable: ADD. However, when I run
SET (x ADD(x 1)) with no space between the ADD statement and the arguments, it works! I have no idea why I can put a space after the SET statement but not after the ADD! I need to check through my tokenizer and parser to see where it is, but the closest issue I can think of is that my code is looking for the next character after the statement, not the next character after the first whitespace.
wow I feel like i’ve coded a lot today cuz im jet lagged
Anyway, on to the actual devlog!
I noticed in the last devlog I posted an image of everything I worked on, like if loops, light mode, nested commands, etc. However, I realized that the output had 4 statements instead of 2. What happened was that the program produced both the outputs for the ELSE IF block AND the ELSE block. That’s now fixed by ensuring that blocks are skipped if the block above them is true. (Also something else I noticed in the screenshot was that the second line of the first IF block actually has an error - whoops, guess I suck at my OWN coding language)
It now has a description of the language, example code, and some examples of functions. I’m probably gonna work on it more later though.
There’s now an icon on the tab. I also renamed the code editor from “Goa Language” to “Goa IDE”; although IDE is an overstatement for something as basic as mines.
I have fixed major bugs concerning the basic workings of Goa.
First, nested commands now work.
Commands like RETURN (BASE (MAX (MULT (ADD (INPUT SUB (INPUT 5)) EXP (2 3)) MIN (10 20)) 2))
now work! I had to add a recursive parser. The old system was based on string splitting, which does not work for nested commands, and caused the system to read nested commands as arguments instead of different commands.
When running If statements in Goa, an error would come out, saying that “handled is not defined.” This is because handled was being declared outside the scope of the function that it need to be in. However, if, else if, and else statements should now work.
I forgot to list this in the commit, but now when you use multiple RETURN statements (like in a while loop or printing out multiple values), each value will print on a different line in the output. Originally, each number would print on the same line, separated by a space. This happened even though I added “\n” to the end of each number. I fixed this by changing the tag that held the output from to to hold pre-formatted text.
Hooray! Light mode now exists for anyone who wants to burn their eyes! I just chose the opposite color for every color on the page. However, I’m not sure if I like the idea of using white lines to divide sections instead of something like dark gray, as white seems like it stands out too much for being a divider. Other than that, I’m pretty proud of how it looks.
You can now save to browser local storage, save to a .goa file on your drive, or load a .goa file :)
Firstly, obviously documentation. It is the last thing to go before the basic skeleton of the editor is done. Secondly, I want to add more functions to Goa. Thirdly, I am considering adding string and float compatibility, but I’m not sure yet. Fourthly, I need to save the user’s choice for light/dark mode to localstorage. Finally, just for fun, I want to solve a Codeforces problem with Goa (just to prove that it can work).
I have finished coding the basic structure of the code. It uses parentheses in a lisp style, so the function is not connected to the parentheses. In the screenshot attached below, you can see a basic function that converts numbers into binary. Users will be able to add, multiply, divide, subtract, mod, abs, min, max, and use random numbers. There will also be while, for, and if loops. Comparators work, and comments use hashtags. I plan for Goa to basically act as a customizable calculator, as it only supports integers (I may add string support later). You can use it to automate boring actions ( cough like a binary worksheet in your Intro to Software Class). I’ve also added saving to localstorage and saving to files (it saves to a .goa file :)).
As of right now, simpler commands like RETURN (ADD (INPUT INPUT)) do work. However, long nested commands like RETURN (ADD (INPUT ADD (INPUT INPUT))) do not work. I am yet to find out why. Probably due to problem 3 (look below)
For some reason, For and While loops work, but If loops don’t. I don’t know why yet.
It’s not that it doesn’t work, I just haven’t implemented it yet :3
I’ve been wanting to make a coding language for some time now. I want to make a language that can be easily learned. It’s not going to be that powerful, but I want it to basically allow anyone to repeat math functions.
I have finished the basic outline of the UI. It was heavily influenced by the USACO IDE (as you can see in the screenshot below). It gives a basic outline to the features that I want to build. First, on the left half of the screen is the area where you can code. It is basically a big textarea input. For the input area, this is where people will put in inputs for the code. Same thing here, it is a textarea input. Finally, there is also an output area. Right now, there is just a placeholder, but that will change later.
For the navbar at the top, there are 4 buttons. The first is a link to the documentation. I plan to build another website for the documentation, and I want it to be really easy to understand. Next is a “Save to browser” button that will save the code to localstorage. Next to that button is a “Save to file” button, which I plan to make the website download a .txt file to the computer. The “Load file” basically will allow users to upload code to the website.
That’s really it for now, I’ll come back when I want to explain how I plan how the language will work!