Skip to content

Commit 3e2053c

Browse files
committed
feat: Phase 0 — branding, community infrastructure, and CI
- Logo: assets/logo.png + 64px, 128px, favicon, social preview - README: centered logo, badges (build, version, license, docs), Franco-Arab positioning - Docs site: favicon, OG meta tags, logo in header and hero - Community: issue templates, PR template, CONTRIBUTING, CODE_OF_CONDUCT, SECURITY - CI: build.yml (gcc+clang Ubuntu, clang macOS), release.yml (tag-triggered binaries) - Branch refs updated from dev to main
1 parent 9e8aaa1 commit 3e2053c

17 files changed

Lines changed: 426 additions & 10 deletions
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
---
2+
name: Bug Report — shoo el mushkile?
3+
about: Something broke? Tell us what happened.
4+
title: "[bug] "
5+
labels: bug
6+
assignees: ''
7+
---
8+
9+
## shoo sar? (What happened?)
10+
11+
A clear description of the bug.
12+
13+
## shoo lazem ysar? (Expected behavior)
14+
15+
What you expected to happen instead.
16+
17+
## keef t3eedo? (Steps to reproduce)
18+
19+
1. Write this code: `...`
20+
2. Run with: `mansaf run file.nsh`
21+
3. See error: `...`
22+
23+
## NashmiC code
24+
25+
```nsh
26+
// Paste your .nsh code here
27+
```
28+
29+
## Error output
30+
31+
```
32+
// Paste compiler/runtime output here
33+
```
34+
35+
## Environment
36+
37+
- OS: [e.g., Ubuntu 24.04, macOS 15]
38+
- Compiler: [e.g., gcc 14, clang 18]
39+
- NashmiC version: [e.g., v0.1.0-alpha]
40+
- Installed via: [curl installer / built from source]
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
---
2+
name: Feature Request — shoo bedak?
3+
about: Got an idea for NashmiC? Let's hear it.
4+
title: "[feat] "
5+
labels: enhancement
6+
assignees: ''
7+
---
8+
9+
## shoo el fekra? (What's the idea?)
10+
11+
A clear description of the feature you'd like.
12+
13+
## leesh? (Why?)
14+
15+
What problem does this solve? What does it enable?
16+
17+
## keef tshoof-ha? (How would it look?)
18+
19+
Show us the NashmiC syntax you'd want to write:
20+
21+
```nsh
22+
// Example of how you'd use the feature
23+
```
24+
25+
## Alternative ideas
26+
27+
Any other ways this could be solved?
28+
29+
## Context
30+
31+
Any additional context, links, or references.

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
## shoo 3malt? (What did you do?)
2+
3+
Brief description of the changes.
4+
5+
## leesh? (Why?)
6+
7+
What problem does this solve or what feature does it add?
8+
9+
## Type
10+
11+
- [ ] Bug fix
12+
- [ ] New feature
13+
- [ ] Refactor
14+
- [ ] Documentation
15+
- [ ] CI/Build
16+
17+
## Checklist
18+
19+
- [ ] `make` builds without warnings
20+
- [ ] `make run-all` passes all examples
21+
- [ ] New examples added (if new language feature)
22+
- [ ] Docs updated (if user-facing change)
23+
24+
## Test plan
25+
26+
How did you verify this works?
27+
28+
```bash
29+
# Commands to test
30+
```

.github/workflows/build.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Build & Test
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
jobs:
10+
build:
11+
strategy:
12+
matrix:
13+
include:
14+
- os: ubuntu-latest
15+
cc: gcc
16+
- os: ubuntu-latest
17+
cc: clang
18+
- os: macos-latest
19+
cc: clang
20+
21+
runs-on: ${{ matrix.os }}
22+
env:
23+
CC: ${{ matrix.cc }}
24+
25+
steps:
26+
- uses: actions/checkout@v4
27+
28+
- name: Build mansaf
29+
run: make clean && make
30+
31+
- name: Run all examples
32+
run: make run-all

.github/workflows/docs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: Deploy Docs
22

33
on:
44
push:
5-
branches: [dev]
5+
branches: [main]
66
paths:
77
- "docs/**"
88
workflow_dispatch:

.github/workflows/release.yml

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*'
7+
8+
permissions:
9+
contents: write
10+
11+
jobs:
12+
build:
13+
strategy:
14+
matrix:
15+
include:
16+
- os: ubuntu-latest
17+
cc: gcc
18+
artifact: mansaf-linux-x86_64
19+
- os: macos-latest
20+
cc: clang
21+
artifact: mansaf-macos-x86_64
22+
23+
runs-on: ${{ matrix.os }}
24+
env:
25+
CC: ${{ matrix.cc }}
26+
27+
steps:
28+
- uses: actions/checkout@v4
29+
30+
- name: Build mansaf
31+
run: make clean && make
32+
33+
- name: Run all examples
34+
run: make run-all
35+
36+
- name: Package binary
37+
run: |
38+
mkdir -p dist
39+
cp build/mansaf dist/${{ matrix.artifact }}
40+
cp runtime/nsh_runtime.c dist/
41+
cp runtime/nsh_runtime.h dist/
42+
tar -czf ${{ matrix.artifact }}.tar.gz -C dist .
43+
44+
- name: Upload artifact
45+
uses: actions/upload-artifact@v4
46+
with:
47+
name: ${{ matrix.artifact }}
48+
path: ${{ matrix.artifact }}.tar.gz
49+
50+
release:
51+
needs: build
52+
runs-on: ubuntu-latest
53+
steps:
54+
- uses: actions/checkout@v4
55+
56+
- name: Download all artifacts
57+
uses: actions/download-artifact@v4
58+
with:
59+
path: artifacts
60+
61+
- name: Create release
62+
uses: softprops/action-gh-release@v2
63+
with:
64+
generate_release_notes: true
65+
files: artifacts/**/*.tar.gz

CODE_OF_CONDUCT.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# Code of Conduct
2+
3+
## Our Pledge
4+
5+
NashmiC is a project born in Jordan, built for the Arab developer community and everyone who wants to try something different. We are committed to providing a welcoming, inclusive, and harassment-free experience for everyone.
6+
7+
## Our Standards
8+
9+
**Positive behavior:**
10+
- Being respectful and constructive
11+
- Welcoming newcomers and helping them learn
12+
- Accepting constructive feedback gracefully
13+
- Focusing on what is best for the community
14+
15+
**Unacceptable behavior:**
16+
- Harassment, trolling, or personal attacks
17+
- Discriminatory language or behavior
18+
- Publishing others' private information
19+
- Any conduct that would be considered inappropriate in a professional setting
20+
21+
## Enforcement
22+
23+
Project maintainers will remove, edit, or reject comments, commits, code, and other contributions that violate this Code of Conduct. Repeated violations may result in a temporary or permanent ban.
24+
25+
## Reporting
26+
27+
Report issues to: ziad1sharif@gmail.com
28+
29+
All reports will be reviewed and investigated promptly and fairly.
30+
31+
## Attribution
32+
33+
This Code of Conduct is adapted from the [Contributor Covenant](https://www.contributor-covenant.org/), version 2.1.

CONTRIBUTING.md

Lines changed: 125 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,125 @@
1+
# Contributing to NashmiC
2+
3+
Ahlan wa sahlan! Thanks for wanting to contribute to NashmiC.
4+
5+
## Getting Started
6+
7+
### Prerequisites
8+
9+
- C11 compiler (`gcc` or `clang`)
10+
- `make`
11+
- `git`
12+
- Linux or macOS
13+
14+
### Build from source
15+
16+
```bash
17+
git clone https://github.com/Ziadstr/nashmic.git
18+
cd nashmic
19+
make
20+
```
21+
22+
### Run examples
23+
24+
```bash
25+
make run-all # All examples
26+
NASHMIC_ROOT=. ./build/mansaf run examples/marhaba.nsh # Single example
27+
```
28+
29+
### Run tests
30+
31+
```bash
32+
make test
33+
```
34+
35+
## Project Structure
36+
37+
```
38+
compiler/src/ # mansaf compiler (C11)
39+
main.c # CLI entry point
40+
lexer.c/h # UTF-8 tokenizer
41+
keywords.c/h # Franco-Arab keyword table
42+
parser.c/h # Recursive descent + Pratt parser
43+
ast.c/h # AST node types
44+
codegen_c.c/h # C transpiler backend
45+
diagnostics.c/h # Errors with Jordanian proverbs
46+
runtime/ # Runtime library
47+
nsh_runtime.c/h # I/O, easter eggs
48+
examples/ # Working example programs (.nsh)
49+
docs/ # Documentation site
50+
tests/ # Test suite
51+
```
52+
53+
## Compilation Pipeline
54+
55+
```
56+
.nsh source -> Lexer -> Parser -> AST -> C Codegen -> .c file -> cc -> binary
57+
```
58+
59+
## How to Contribute
60+
61+
### Adding a keyword
62+
63+
1. Add the token type in `compiler/src/lexer.h`
64+
2. Register it in `compiler/src/keywords.c`
65+
3. Handle parsing in `compiler/src/parser.c`
66+
4. Add AST node (if needed) in `compiler/src/ast.h` and `compiler/src/ast.c`
67+
5. Generate C code in `compiler/src/codegen_c.c`
68+
6. Add an example in `examples/`
69+
7. Add a Makefile target to run it
70+
71+
### Fixing a bug
72+
73+
1. Write a minimal `.nsh` file that reproduces the issue
74+
2. Fix the bug with minimal changes
75+
3. Verify `make run-all` still passes
76+
4. Add a test case if applicable
77+
78+
### Documentation
79+
80+
Docs live in `docs/site/index.html` (the live site) and `docs/src/` (mdBook source). Update both if changing user-facing features.
81+
82+
## Code Style
83+
84+
- C11 standard
85+
- 4-space indentation
86+
- `snake_case` for functions and variables
87+
- `PascalCase` for types and enum values
88+
- `UPPER_SNAKE_CASE` for constants and macros
89+
- Keep functions under 40 lines where possible
90+
- Comments for non-obvious logic only
91+
92+
## Commit Style
93+
94+
Conventional commits, one line, concise:
95+
96+
```
97+
feat: add saff<T> array type
98+
fix: correct range codegen for negative steps
99+
docs: update pattern matching examples
100+
chore: clean up unused AST nodes
101+
```
102+
103+
## Submitting a PR
104+
105+
1. Fork the repo
106+
2. Create a branch from `main`: `git checkout -b feat/my-feature main`
107+
3. Make your changes
108+
4. Verify: `make clean && make && make run-all`
109+
5. Push and open a PR against `main`
110+
111+
## Franco-Arab Naming Guidelines
112+
113+
NashmiC keywords use Franco-Arab (Arabizi) — the way Arabs text. When naming new keywords:
114+
115+
- Use Jordanian/Levantine dialect, not Modern Standard Arabic
116+
- Spell it how you'd text it to a friend
117+
- Numbers replace Arabic letters: `3` = ع, `2` = ء/ق, `7` = ح, `5` = خ
118+
- Keep it short and natural
119+
- Test it: would a Jordanian CS student actually say this word?
120+
121+
Examples: `khalli` (let), `dalle` (function), `rajje3` (return), `ba3dain` (later/defer)
122+
123+
## Questions?
124+
125+
Open an issue or start a discussion. We don't bite — unless you use `npm`.

0 commit comments

Comments
 (0)