Goa
- 4 Devlogs
- 4 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
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!