Ahlan wa sahlan! Thanks for wanting to contribute to NashmiC.
- C11 compiler (
gccorclang) makegit- Linux or macOS
git clone https://github.com/Ziadstr/nashmic.git
cd nashmic
makemake run-all # All examples
NASHMIC_ROOT=. ./build/mansaf run examples/marhaba.nsh # Single examplemake testcompiler/src/ # mansaf compiler (C11)
main.c # CLI entry point
lexer.c/h # UTF-8 tokenizer
keywords.c/h # Franco-Arab keyword table
parser.c/h # Recursive descent + Pratt parser
ast.c/h # AST node types
codegen_c.c/h # C transpiler backend
diagnostics.c/h # Errors with Jordanian proverbs
runtime/ # Runtime library
nsh_runtime.c/h # I/O, easter eggs
examples/ # Working example programs (.nsh)
docs/ # Documentation site
tests/ # Test suite
.nsh source -> Lexer -> Parser -> AST -> C Codegen -> .c file -> cc -> binary
- Add the token type in
compiler/src/lexer.h - Register it in
compiler/src/keywords.c - Handle parsing in
compiler/src/parser.c - Add AST node (if needed) in
compiler/src/ast.handcompiler/src/ast.c - Generate C code in
compiler/src/codegen_c.c - Add an example in
examples/ - Add a Makefile target to run it
- Write a minimal
.nshfile that reproduces the issue - Fix the bug with minimal changes
- Verify
make teststill passes - Add a test case if applicable
Docs live in docs/site/index.html (the live site) and docs/src/ (mdBook source). Update both if changing user-facing features.
- C11 standard
- 4-space indentation
snake_casefor functions and variablesPascalCasefor types and enum valuesUPPER_SNAKE_CASEfor constants and macros- Keep functions under 40 lines where possible
- Comments for non-obvious logic only
Conventional commits, one line, concise:
feat: add saff<T> array type
fix: correct range codegen for negative steps
docs: update pattern matching examples
chore: clean up unused AST nodes
- Fork the repo
- Create a branch from
main:git checkout -b feat/my-feature main - Make your changes
- Verify:
make clean && make && make test - Push and open a PR against
main
NashmiC keywords use Franco-Arab (Arabizi) — the way Arabs text. When naming new keywords:
- Use Jordanian/Levantine dialect, not Modern Standard Arabic
- Spell it how you'd text it to a friend
- Numbers replace Arabic letters:
3= ع,2= ء/ق,7= ح,5= خ - Keep it short and natural
- Test it: would a Jordanian CS student actually say this word?
Examples: khalli (let), dalle (function), rajje3 (return), ba3dain (later/defer)
Open an issue or start a discussion. We don't bite — unless you use npm.