Skip to content

Commit 9d85fed

Browse files
pirapiraclaude
andcommitted
Set up Lean4 project scaffolding (Phase 0)
Establish the build system, project structure, test infrastructure, and CI pipeline for the Lython Python interpreter. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 0958c9f commit 9d85fed

15 files changed

Lines changed: 104 additions & 0 deletions

.github/workflows/ci.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
name: CI
2+
on:
3+
push:
4+
pull_request:
5+
workflow_dispatch:
6+
jobs:
7+
build:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- uses: actions/checkout@v5
11+
- uses: leanprover/lean-action@v1
12+
with:
13+
test: true

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/.lake

CLAUDE.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# Lython
2+
3+
Python 3.12 interpreter in Lean4, targeting the leanSpec Ethereum consensus spec.
4+
5+
## Build Commands
6+
7+
- `lake build` — build the Lython library and executable
8+
- `lake test` — run tests (builds LythonTest driver; `#guard` failures = build errors)
9+
- `lake exe lython` — run the interpreter
10+
11+
## Project Structure
12+
13+
```
14+
Lython.lean — umbrella import for the library
15+
Lython/
16+
Lexer.lean — tokenizer
17+
Parser.lean — PEG parser
18+
AST.lean — Python AST node types
19+
Interpreter.lean — tree-walking interpreter
20+
Runtime.lean — runtime support (types, exceptions, stdlib)
21+
Main.lean — CLI entry point
22+
LythonTest.lean — test driver root
23+
LythonTest/
24+
Basic.lean — smoke tests
25+
```
26+
27+
## Code Style
28+
29+
- `set_option autoImplicit false` at the top of every file
30+
- No trailing whitespace
31+
- Follow existing patterns in the codebase
32+
33+
## Development Plan
34+
35+
See `PLAN.md` for the full phased development plan.

Lython.lean

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import Lython.Lexer
2+
import Lython.Parser
3+
import Lython.AST
4+
import Lython.Interpreter
5+
import Lython.Runtime

Lython/AST.lean

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
set_option autoImplicit false
2+
3+
namespace Lython.AST
4+
end Lython.AST

Lython/Interpreter.lean

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
set_option autoImplicit false
2+
3+
namespace Lython.Interpreter
4+
end Lython.Interpreter

Lython/Lexer.lean

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
set_option autoImplicit false
2+
3+
namespace Lython.Lexer
4+
end Lython.Lexer

Lython/Parser.lean

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
set_option autoImplicit false
2+
3+
namespace Lython.Parser
4+
end Lython.Parser

Lython/Runtime.lean

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
set_option autoImplicit false
2+
3+
namespace Lython.Runtime
4+
end Lython.Runtime

LythonTest.lean

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
import LythonTest.Basic

0 commit comments

Comments
 (0)