You are browsing as a guest. Sign up (or log in) to start making projects!

Aglang

  • 13 Devlogs
  • 55 Total hours

A basic esoteric language made to be similar to Assembly. Both a compiler and an interpreter (web and local) are implemented.

Ship #2

hello! this is aglang, my own esoteric language made to be similar to assembly.


it offers 13 operators, and with those (almost) anything is possible!

you can try aglang by either downloading the cli (in the repo the “Source code” button links to) or by using the online interpreter (“Try project” button).

if you’re confused and want to learn aglang, try the new interactive course, available on the website in the “learn” section: it will guide you through everything the language can do in only 10 short lessons and exercises.

the cli includes an interpreter, a C transpiler and a compiler (note: the compiler needs GCC to be installed)!

if you want to develop aglang programs more easily, we even have a vscode extension, with syntax highlighting and statement templates


that said, go on and try aglang! its easier than you would expect

  • 6 devlogs
  • 26h
  • 18.44x multiplier
  • 473 Stardust
Try project → See source code →
Open comments for this post

2h 14m 27s logged

NOTE FOR THE SHIP: you dont have to try everything! even just the online interpreter is fine, it includes examples!


Aglang devlog #12

im ready for the ship!


i completed the vscode extension, and (for the third time) I. HATE. MICROSOFT. this might sound excessive, but anyone that ever tried reading their docs can surely understand, right? right…?

but finally, after like 2 hours, i made the most basic of extensions! it has syntax highlighting (the thing that i wanted most) and a simple statement templating snippet.

and now, i can pretty confidently say that aglang is completed! surely i wont abandon the project, that would just be a waste of the 50 hours i spent on this, but i consider the project to be mostly finished.

see ya soon!

0
0
7
Open comments for this post

6h 24m 20s logged

Aglang devlog #11

why did i decide to do this lmao.


lets go in order: first of all, i added transpiling! currently, only C is supported as target, but i plan on adding python soon.

it actually wasnt that hard, especially considering i basically never wrote C in my life.

but this was the least interesting part of this devlog, cause i managed to optimize the compiler a bit! now this… this was hard. but now, when printing many characters in a row (like in the hello world example), instead of printing each character one by one, the full string gets stored in the .text (or .data on windows) section of the assembly and gets printed once! this reduced the size of the hello world program from ~1kb down to 633b, almost half!

needless to say that this needed a few attempts… now the project’s folder looks kinda full… but oh well!

and i can AGAIN say that GOD I HATE WINDOWS: it took a while to get shadow allocations right, especially since pushing to the stack in aglang means pushing to the stack in assembly too, so i had to keep track of where the old and original pointers were before allocating it.

i fully expect this optimization to have some bugs, since i dont really trust the logic i wrote.

i didnt add it in the transpile feature, since i imagine that modern c compilers optimize it on their own.

now i promise that ill get to writing the vscode extension!

0
0
8
Open comments for this post

7h 9m 53s logged

Aglang devlog #10

well this took a while.


so, i came to the conclusion that an lsp server is kinda overkill, so, to make up for it, i decided to make an interactive lesson system on the website, like svelte!

and well i didnt expect it to take 7 hours…

i have to admit, it came out pretty good! they have code challenges, too :D

anyways, for the autocomplete feature, ill still make it into the vscode extension (if i dont give up on that too)

oh and i added shareable code in the web interpreter!

0
0
10
Open comments for this post

4h 46m 23s logged

Aglang devlog #9

the windows compiler is here!


and i can finally say GOD I HATE WINDOWS why was it so simple in linux with just a syscall and in windows to not pull my hair out i have to link c with the executable lmao

but, a wise man once said:

the past is gone, think about the future…

or something like that idk

while i worked on that, i ended up even fixing some problems too, so thats good. and i made the cli a bit prettier too, with spinners!


in the meanwhile i was looking at lsp servers too, and they look… overly complicated… yep i guess i already did enough today not gonna get into allthat!

see ya tomorrow!

0
0
4
Open comments for this post

2h 13m 25s logged

Aglang devlog #9

there now is a compare statement in aglang!


i had this idea for a while, but i thought it would make the language too easy… but i ended up making it anyway!
together with it, i made labels too!

so if, for example, you wanted to skip a section of code if the number 2 is bigger than 1, you would write it like so:

10?1; $ compare 2 (10 in binary) and 1 (still 1 in binary) $
^.; $ if 2 is bigger, jump to label . (labels are can only be named with dots, it would have been to easy otherwise :) ) $
(other code...)

~.; $ define label . $
(do more stuff...)

and this makes the fibonacci example easier, since now, instead of using counters in the stack, you can simply check if the current number isnt 233 and go back to a previous label.

i still have to implement it in the web interpreter, but i guess it shouldnt take long!

next step: windows compiler! (note: will probably require mingw to be installed)

0
0
9
Open comments for this post

2h 49m 48s logged

Aglang devlog #8

the first ship is done!


but before getting to the actual devlog, i want to respond to some of the best feedback i got:

  1. why spend 29 (now 32) hours on a joke?: well, you see… uhh… next question please
  2. you should see a psychiatrist: i know thanks lmao

and now, back to aglang developments!


the first version of aglang is finally completed! i want to thank everybody for the feedback i received, it even gave me some ideas, thanks!

in these 3 hours, i improved the website, so now instead of just the compiler it even has a full homepage with downloads: this was on my checklist for a while, but first i wanted to ship a first version to get some initial thoughts.

next up for this project, i have a two ideas:

  1. conditionals and labels: i want to add a way of comparing registers/stack values/literals, and jump to a label or part of the program if that condition is met; with that, aglang would basically be a basic assembly language with a few restrictions
  2. windows compiler: the thing thats missing the most in the cli is a windows compiler, and since probably there are quite a few people that use windows more than linux :|

and a few other things if i have the time:

  1. a vscode extension: this could have themes and docs on the side, minor stuff (i dont think anyone will use aglang in vscode) but idk i wanted to do it
  2. an lsp server: for autocompletions, error checking, etc… it could be integrated in more ides too
0
0
12
Ship #1

hello! this is Aglang, my own esoteric language.
an esoteric language (or esolang) is a language made as a joke or to be hard to use, like brainf*ck.
my language is made to be really basic: you only have two 8bit registers, and a stack; there are only 18 valid characters in Aglang, easy to remember, right?

in the cli, i implemented both an interpreter (works everywhere) and a compiler (only x86-64 linux); a guide on installation and usage is in its readme, but if you dont want to install it, you can try Aglang in the web interpreter.

this project is split into two repositories:

the website includes some examples and a link to both repos and the documentation.

the “Try project” button is linked to the web interpreter (if the domain doesnt work, use https://aglang-website.vercel.app/), while the “See source code” takes to the cli’s repository.


and now, go crazy and write some code!

  • 7 devlogs
  • 29h
  • 17.01x multiplier
  • 501 Stardust
Try project → See source code →
Open comments for this post

3h 22m 15s logged

Aglang devlog #7

whooo! the documentation is done!


im officially ready to ship! i finished writing the documentation and the repo readmes, and im ready to release this into the wild!

the docs are availabe in the cli’s repo, but they’re linked in the website too.

this took a few days, since i was working on another personal project, but im finally back!

0
0
5
Open comments for this post

7h 55m 35s logged

Aglang devlog #6

the web interpreter is done!


after almost 1000 lines of svelte and 8 hours of boredom, im happy to announce that the js implementation of the aglang interpreter is completed! it is now available at https://aglang.0xf1.dev (the dns changes might take some time to fully propagate, so if it isnt loading, it probably will in a few hours…)

it is basically a 1:1 copy of the rust code, but prettier! ahem… because of the ui, not the code… and i even designed a logo for it! in it are all the valid characters in aglang.

in the meanwhile, i fixed and refactored the loop system in both the js and rust versions.


the next steps are writing the docs, preparing a good readme and then i can finally ship the project! see ya then!

and p.s. i havent optimized the website for mobile, but i imagine nobody uses stardance on a smartphone, right?

0
0
5
Open comments for this post

6h 52m 56s logged

Aglang devlog #5

no yeah im officially going crazy


so, after a bit, the compiler is DONE!

now it spits valid x86-64 asm and even automatically compiles it to an executable with gcc!

and i even managed to make a fibonacci sequence example program! (it only computes numbers up to 144 since its the highest fibonacci number in the unsigned 8bit integer limit) but to make that, i had to spend HOURS thinking about how to do it.

the problem was that in Aglang, you have 2 registers and a stack, and for that fibonacci program i couldnt make it print random ascii characters, but instead the actual numbers in the decimal system: for that i tried making loops that converted a number into the digits that composed it, buuuuut you still need the 2 registers to keep the fibonacci numbers you have!

i even surrendered and tried asking gemini, but it would go absolutely CRAZY: it would give really long responses and contradict itself in the code… a bit of like when you ask an ai to give you the seahorse emoji.


so, the ultimate solution was to implement a “numeric value” parameter to the stdout argument.
therefore, now, if you write something like

01000001>\#;

you would get the actual 65 number instead of the character ‘A’ and all the problems would go to the compiler and assembly!

but i dont care now, cus its DONE!!!


the next steps, i think, should be making a js interpreter, so that the language can be tried online without downloading anything, so ill work on that tomorrow…

0
0
6
Open comments for this post

2h 14m 45s logged

Aglang devlog #4

it was the comments IT HAD ALWAYS BEEN THE COMMENTS


i think im about to go crazy, cuz im trying to manually write assembly to know that the compiler should write, and trying the basic alphabet loop i couldnt get it to work, no matter what it was always printing .
i tried everything, i even managed to get SATAN ITSELF to write my output (check attached image)… but finally… i tried deleting the comments i put with the original aglang line… and it worked.

i found out that the stdout token in aglang (“\”, i even have to write it twice here in the post because stardance has the same problem lmao) was making nasm think that i was trying to escape the newline after the comment, thus making the next assembly line part of the comment.

as you can see from the logged time it literally took over 2 hours of my life because of a single backslash.

0
0
3
Open comments for this post

1h 28m 26s logged

Aglang devlog #3

so i uhh… kinda refactored everything?

i realized that to make the compiler i had 2 options:

  1. make a separate project (and repo)
  2. integrate it in the existing interpreter
    the latter option made more sense, because since the project is small i can just split into two commands. so, after 1.30hrs, i managed to split and reorganize the code! now to run the aglang interpreter you can run:
aglang run ./main.ag

the next step is building the compiler itself, but ill leave that to tomorrow. (and i think itll just support linux elf64 x86-64 architectures, sorry arm friends!)


oh wait! i forgot to tell y’all why the name “Aglang”! nothing special actually, “Ag” just stands for “Ugly” lmao

0
0
3
Open comments for this post

4h 14m 59s logged

Aglang devlog #2

the interpreter is done faster than i expected and after some issues i settled on the syntax. ive added comments (kinda hated working on them), changed the input structure a little bit (now the input gets directly stored on the stack).
the next step is building a compiler to x86-64 assembly, i dont think i’ll make it for other architectures. i guess it shouldnt be that hard since the language’s features are pretty similar to how assembly works (obvious foreshadowing)

this example outputs every uppercase letter in the alphabet:

01000001>''; $ move 65 (A char in ascii) to reg2 $
11010>:; $ push alphabet counter (from A to Z) into stack $
[ $ loop (ends when first value in stack is 0) $
    ''>\; $ output the letter $
    1010>\; $ newline $
    ''+1; $ add 1 to the ascii value to go to the next letter $
    :>'; $ move counter to reg1 $
    :!; $ pop old counter $
    '-1; $ remove 1 from the counter $
    '>:; $ push the updated counter to the stack $
]

(the text between the $ are comments)

0
0
4
Open comments for this post

3h 19m 19s logged

Aglang devlog #1

i’m finally building a language!

Aglang is an esoteric language (like brainf*ck) with 15 possible characters (not including the 0’s and 1’s of binary literals) where you are given two 8-bit registers and a stack: their values can be moved and deleted and arithmetic operations can be done with their respective characters.

i’m currently building an interpreter in Rust, but i hope once im done with that to start creating a compiler to x86-64 assembly.

i’ve attached a scheme made in KDE Drawy (i changed it like 8 times already) describing the language (sorry it’s in italian and my writing sucks), an aglang snippet and the parsed output in the interpreter.

0
0
3

Delete project?

Are you sure you want to permanently delete this project? This action cannot be undone.

All devlogs, followers, and associated data will be removed.

Followers

Loading…