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

Aglang

  • 7 Devlogs
  • 29 Total hours

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

Ship #1 Pending review

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 cli at https://github.com/0xF1dev/aglang (main repo)
- the web interpreter at https://github.com/0xF1dev/aglang-website

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
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
2
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
3
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
4
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
1
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
2
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
3
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
1

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…