Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 4 additions & 8 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ loon/
├── crates/
│ ├── loon-lang/ # Core: parser, type checker, interpreter
│ ├── loon-cli/ # CLI: run, repl, fmt, explain
│ ├── loon-kernel/ # RISC-V unikernel: Loon as the kernel (own workspace)
│ ├── loon-lsp/ # Language server protocol
│ └── loon-wasm/ # WASM bindings for browser
├── web/ # Website (written in Loon, uses .loon files)
Expand All @@ -42,15 +41,12 @@ cargo test --workspace # Run all tests
cargo run -p loon-cli -- run samples/hello.oo # Run a sample
cargo run -p loon-cli -- fmt samples/ # Format files
cargo run -p loon-cli -- new test-proj # Creates pkg.oo + src/main.oo
cargo run -p loon-cli -- image prog.oo # Compile to a bare-metal boot image

make -C crates/loon-kernel run # Boot Loon under QEMU (needs qemu + riscv64gc target)
make -C crates/loon-kernel check # Boot it and diff against the host
cargo run -p loon-cli -- image prog.oo # Compile to a boot image (consumed by fxos)
```

`crates/loon-kernel` is deliberately outside the root workspace — it only
builds for `riscv64gc-unknown-none-elf` and must not be swept into
`cargo build --workspace`.
The OS built on Loon lives in its own repo: https://github.com/ecto/fxos.
`loon image` + `eir/image.rs` are the ABI it consumes; `tests/boot_image.rs`
pins that format.

## Key Patterns

Expand Down
13 changes: 10 additions & 3 deletions crates/loon-cli/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ enum Command {
/// Run a Loon file (interpreter)
Run {
file: PathBuf,
/// Skip the static checker and go straight to the VM. The VM still
/// fails loudly at runtime; this only drops the up-front pass.
#[arg(long)]
unchecked: bool,
/// Run via WASM compilation + wasmtime instead of interpreter
#[arg(long)]
wasm: bool,
Expand Down Expand Up @@ -166,6 +170,7 @@ fn main() {
match cli.command {
Command::Run {
ref file,
unchecked,
wasm,
legacy,
native,
Expand All @@ -186,7 +191,7 @@ fn main() {
} else if legacy {
run_file_legacy(file);
} else {
run_file(file, record.as_deref());
run_file(file, record.as_deref(), unchecked);
}
}
Command::Replay {
Expand Down Expand Up @@ -276,7 +281,7 @@ fn precheck_source(path: &std::path::Path, source: &str) {
}
}

fn run_file(path: &PathBuf, record: Option<&std::path::Path>) {
fn run_file(path: &PathBuf, record: Option<&std::path::Path>, unchecked: bool) {
let source = match std::fs::read_to_string(path) {
Ok(s) => s,
Err(e) => {
Expand All @@ -285,7 +290,9 @@ fn run_file(path: &PathBuf, record: Option<&std::path::Path>) {
}
};

precheck_source(path, &source);
if !unchecked {
precheck_source(path, &source);
}
let base_dir = path.parent().unwrap_or_else(|| std::path::Path::new("."));
let result = match record {
Some(trace_path) => {
Expand Down
6 changes: 0 additions & 6 deletions crates/loon-kernel/.cargo/config.toml

This file was deleted.

2 changes: 0 additions & 2 deletions crates/loon-kernel/.gitignore

This file was deleted.

7 changes: 0 additions & 7 deletions crates/loon-kernel/Cargo.lock

This file was deleted.

23 changes: 0 additions & 23 deletions crates/loon-kernel/Cargo.toml

This file was deleted.

47 changes: 0 additions & 47 deletions crates/loon-kernel/Makefile

This file was deleted.

124 changes: 0 additions & 124 deletions crates/loon-kernel/README.md

This file was deleted.

20 changes: 0 additions & 20 deletions crates/loon-kernel/bench.sh

This file was deleted.

15 changes: 0 additions & 15 deletions crates/loon-kernel/boot/bench.oo

This file was deleted.

31 changes: 0 additions & 31 deletions crates/loon-kernel/boot/gui.oo

This file was deleted.

Loading
Loading