Skip to content

Commit ae495a8

Browse files
committed
chore: add MIT license and contributing guide
1 parent 8c729e6 commit ae495a8

2 files changed

Lines changed: 82 additions & 0 deletions

File tree

CONTRIBUTING.md

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
# Contributing to Lazarus
2+
3+
Thanks for wanting to contribute. This document covers how to get set up, how the project is structured, and what to keep in mind before opening a PR.
4+
5+
## Getting started
6+
7+
You need Lua 5.4 installed. Clone the repo and verify everything works:
8+
9+
```sh
10+
git clone https://github.com/NightmarePog/Lazarus
11+
cd Lazarus
12+
make selfhost
13+
```
14+
15+
If `make selfhost` prints `fixpoint verified`, you're good. That command rebuilds the compiler from its own source and checks that the output is identical to the input binary.
16+
17+
## Project layout
18+
19+
```
20+
compiler/ Lazarus compiler source (written in Lazarus)
21+
std/ Standard library
22+
doc/ Documentation
23+
bin/ Compiled compiler binary (bin/lazarusc.lua)
24+
examples/ Example programs
25+
```
26+
27+
The compiler pipeline goes: Linker → Expander → Lexer → Parser → Schematic → Typecheck → Optimizer → Codegen → Bundler. Each stage has its own directory under `compiler/frontend/` or `compiler/backend/`.
28+
29+
## Adding a language feature
30+
31+
Read `doc/adding-features.md` before touching anything. The short version: one concept, one file, registered in a `HANDLERS` or `TOKENS` table. Never add to an existing `if/elseif` chain. Walk the pipeline front to back.
32+
33+
## Before submitting a PR
34+
35+
Run all three:
36+
37+
```sh
38+
make selfhost # must print "fixpoint verified"
39+
make lint # selene
40+
make format # stylua
41+
```
42+
43+
All three must pass. If `make selfhost` fails, the compiler can no longer compile itself and the PR won't be merged.
44+
45+
## Commit style
46+
47+
Conventional commits: `feat:`, `fix:`, `chore:`, `docs:`, `refactor:`. Keep the subject line under 72 characters. No `Co-Authored-By` trailers.
48+
49+
## Opening issues
50+
51+
Bug reports and feature requests are welcome. For bugs, include the source file that triggers the issue and the error output. For feature requests, check the open issues first -- a lot of planned work is already tracked there.
52+
53+
## Code style
54+
55+
- No comments that describe what the code does -- only comments that explain why something non-obvious is happening
56+
- Follow the patterns already in the file you're editing
57+
- Stylua handles formatting -- don't fight it
58+
59+
## What's a good first contribution
60+
61+
Issues tagged [`good first issue`](https://github.com/NightmarePog/Lazarus/issues?q=is%3Aopen+label%3A%22good+first+issue%22) are scoped to be approachable without deep knowledge of the full pipeline.

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2026 Lukáš Erl
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

0 commit comments

Comments
 (0)