SHOC: A Hebrew language compiler banner

SHOC: A Hebrew language compiler

3 devlogs
16h 26m 54s

a compiler for my ancient-biblical hebrew programming language
the name of the language is Shoresh ("root" in hebrew)
!the code will be compiled to linux x86_64 asm!

(screenshot was taken inside my tui text editor written in rust with syntax …

a compiler for my ancient-biblical hebrew programming language
the name of the language is Shoresh (“root” in hebrew)
!the code will be compiled to linux x86_64 asm!

(screenshot was taken inside my tui text editor written in rust with syntax highlighting for shoresh)

This project uses AI

no use of ai at all in code generation/debugging
minor use of gemini for overall project architecture

Demo Repository

Loading README...

acetim100

FINAL DEVLOG(BEFORE SHIPPING)

shoc- now available on npm!!!
full documentation is available on the github repo in the link below, documentation contains guide on how you can install the compiler , how to use it & how to write in the language

what did i do since the last devlog?

i just finished testing and and fixing bugs in the assembly part and in the program itself
also added shabatchk function to the compiled asm- it checks if its sabbath today and if it is it will not run (no work is permitted on sabbath)
i also have a repo in my github account that contains the notepad++ config for the user defined language - it provides syntax highlighting for shoresh and a nice development env

planning do add:

i will add support for arm64 linux native asm a
and i will prb add arrays sometime soon

github repo

Attachment
0
acetim100

CODE GENERATION & I\O &BUG FIXES

fixed some bugs in semantic validation(concerning stack alignment in x64 architecture asm)

implemented some of the code generation(to x86_64 GAS intel syntax asm) functions (not all of them)
with the most important one being the AstExpression and made a recursive algorithm to traverse the AST tree and convert it to asm code
the algorithm itself isnt the most efficent because it uses the stack to store intermediate values during calculation and i will prb implement a register map to use the registers instead of the stack (until they are all in use ofc)

i also added io functions to let you input a number to a variable, a function that lets you print an expression and a function that lets you print a string

printing and input is handled by libc

Attachment
Attachment
0
acetim100

ADDED UNARY EXPRESSIONS AND FIXED SOME BUGS
i added the possibility to use unary expressions like -,! inside my expression parser
the image shown is a debugging functions output that prints out the structred nodes that define the program
the highlighted part is the not operator (לא in hebrew) being parsed correctry
the expression is printed in prefix notation or how some may call it - “polish notation”
i also fixed a bug in the typeCheker that caused the type checker to not check the validity of the expressions it passes to the function

Attachment
0