Skip to content

acetim/SHOC-ShoreshCompiler

Folders and files

NameName
Last commit message
Last commit date

Latest commit

c3c94ce · · Mar 25, 2026

History

68 Commits
Mar 25, 2026
Mar 25, 2026
Mar 25, 2026
Mar 24, 2026
Mar 25, 2026
Mar 25, 2026
Mar 25, 2026
Mar 25, 2026

Repository files navigation

SHOC-Shoresh Compiler- a biblical hebrew language compiler

shoresh

Installation

Install shoc with npm (only for linux))

  sudo npm install -g shoc-shoresh-compiler

i also recommend installing the complementary notepad++ UDL pack to edit .sho files and code with syntax highlighting and logical mirroring when using RTL

Usage

this will compile your shoresh source code into a linux native asm(x86_64) file

shoc output .s file>gt; input .sho file>gt;

to assemble and link this file to an executable:

gcc -o your executable name>gt; the compiled .s file>gt;

use the -no-shabat-chk flag to bypass shabat check func (prevents you from compiling during the sabbath) in the compiler & to not add the function that runs at the start of each program (thats compiled with shoc) that prevents the user from running it in sabbathbath

shoc -no-shabat-chk output .s file>gt; input .sho file>gt;

how to write in shoresh?

i will use this fibonnacci program as an example:

this is the fibbonacci func: img

you should always start your program with a בסד statement

your entry point function should be called בראשית ,take no args and return void(תהו_ובהו)

FUNCTION DECLERATION:

func

use the ויברא keyword to start func decleration then specify return value (currently shoresh has only int (שלם) and void(תהו_ובהו) types ) then specify your func name and its argument in the parenthesess

now open a new code block using ויעש and then when you want to close it use ויתם (same goes for if and while)

to return a value (or just return from a void func) use the keyword אמן and then your return value + a semicolon (or just אמן and a semicolon if returning no value)

INTEGER DECLERATION:

int

you can initilize it with a number and you can leave it blank make sure you pay attention to the scopes!! an integer defined inside a code block (e.g if or while blocks) wouldnt be accessible out of that block!!

BASIC OPERATIONS:

ops

available logic operations:
or-או�
not-לא�
and- וגם�

other available operations : + - * / = > <; <
you can also use parentheses in your expressionss
!!!make sure you end EACH INDIVIDUAL EXPRESSION WITH ;!!!!

IF AND WHILE:

controlflow

use בעוד for while and אם_יהיה for if statements
make sure your statement is a boolean value!!

FUNCTION CALLING

func

to call a void returning func use ויקרא

to call a value returning func just call it inside an expression

make sure all arguments that are passed to the func end in a semi colon; remember - they are all individual expressions and as i mentioned-EACH INDIVIDUAL EXPRESSION SHOULD END IN A SEMICOLON

OTHER FUNCTIONS

imgf

to print an expression: ויאמר_שלם

to print a string:ויאמר

to use SYSEXIT : ויהי_חושך with your exit code

TBC!!

probably gonna do arm64 compilation and add arrays

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages