Skip to content

Commit ccd8277

Browse files
author
tars-swarm[bot]
committed
docs: large update of docs to reflect compiler state/trajectory more accurately
1 parent d387323 commit ccd8277

49 files changed

Lines changed: 3101 additions & 1382 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

docs/pages/compiler/overview.md

Lines changed: 113 additions & 87 deletions
Large diffs are not rendered by default.

docs/pages/compiler/quickstart.md

Lines changed: 70 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -10,44 +10,61 @@ This page gives you the fastest path from a fresh checkout to compiling an
1010

1111
## Install
1212

13-
Install the Edge toolchain with `edgeup`:
13+
Install `edgeup`, the Edge toolchain manager:
1414

15-
```sh
15+
```bash
1616
curl -fsSL https://raw.githubusercontent.com/refcell/edge-rs/main/etc/install.sh | sh
1717
```
1818

19-
Or build the compiler from source:
19+
Then install the Edge compiler:
2020

21-
```sh
22-
cargo install --path bin/edgec
21+
```bash
22+
edgeup install
2323
```
2424

25-
## Compile a Contract
25+
`edgeup` detects your shell (bash, zsh, or fish) and appends the toolchain
26+
directory to your `PATH` automatically. Restart your shell or run the printed
27+
`source` command before continuing.
28+
29+
**Supported platforms:** Linux x86_64, macOS x86_64, macOS arm64 (Apple
30+
Silicon). Windows is not supported.
31+
32+
## Compile a contract
2633

2734
Pass a source file directly to `edgec` to compile it. By default, the compiler
2835
prints EVM bytecode as a hex string to stdout.
2936

30-
```sh
37+
```bash
3138
edgec examples/counter.edge
3239
edgec examples/counter.edge -o counter.bin
3340
edgec -v examples/expressions.edge
3441
```
3542

36-
## Inspect Intermediate Stages
43+
## Inspect intermediate stages
44+
45+
The compiler can stop after earlier phases of the pipeline using subcommands
46+
or the `--emit` flag:
3747

38-
The compiler can also stop after earlier phases of the pipeline:
48+
```bash
49+
# Subcommands
50+
edgec lex examples/counter.edge # print tokens
51+
edgec parse examples/counter.edge # print AST
52+
edgec check examples/counter.edge # type-check only, no output
3953

40-
```sh
41-
edgec lex examples/counter.edge
42-
edgec parse examples/counter.edge
43-
edgec check examples/counter.edge
54+
# --emit flag variants
55+
edgec --emit tokens examples/counter.edge # lex only
56+
edgec --emit ast examples/counter.edge # parse only
57+
edgec --emit ir examples/counter.edge # IR (s-expression)
58+
edgec --emit pretty-ir examples/counter.edge # IR (pretty-printed)
59+
edgec --emit asm examples/counter.edge # pre-final assembly
60+
edgec --emit bytecode examples/counter.edge # EVM bytecode (default)
4461
```
4562

46-
## ABI Output
63+
## ABI output
4764

4865
Passing `--emit abi` prints the contract ABI as JSON to stdout, compatible with the Ethereum ABI specification. This is useful for generating interface files consumed by frontends, deployment scripts, and other tooling.
4966

50-
```sh
67+
```bash
5168
edgec --emit abi examples/counter.edge
5269
# [{"type":"function","name":"increment","inputs":[],"outputs":[],"stateMutability":"view"}, ...]
5370
```
@@ -56,12 +73,48 @@ edgec --emit abi examples/counter.edge
5673

5774
The `edgec standard-json` command implements the standard JSON IPC protocol used by Foundry and solc-compatible toolchains. It reads a JSON request from stdin containing source files and compiler settings, compiles every source, and writes a JSON response to stdout with ABI and bytecode fields for each contract. The command always exits 0; compilation errors are reported inside the JSON response rather than as a non-zero exit code. This is the interface that the `foundry-compilers` crate uses to drive external compilers.
5875

59-
```sh
76+
```bash
6077
echo '{"language":"Edge","sources":{"counter.edge":{"content":"..."}}}' | edgec standard-json
6178
# {"sources":{"counter.edge":{"id":0}},"contracts":{"counter.edge":{"Counter":{"abi":[...],"evm":{"bytecode":{"object":"604d..."},...}}}}}
6279
```
6380

64-
## Explore the Reference Programs
81+
## Optimization flags
82+
83+
Control the optimization level and target metric:
84+
85+
```bash
86+
edgec -O2 examples/counter.edge # optimization level 0–3 (default: 0)
87+
edgec --optimize-for size examples/counter.edge # optimize for bytecode size
88+
edgec --optimize-for gas examples/counter.edge # optimize for gas cost (default)
89+
```
90+
91+
## Standard library path
92+
93+
The compiler embeds the Edge standard library at build time. To use a local
94+
checkout of the stdlib instead, set `--std-path` or the `EDGE_STD_PATH`
95+
environment variable:
96+
97+
```bash
98+
edgec --std-path ./std examples/counter.edge
99+
EDGE_STD_PATH=./std edgec examples/counter.edge
100+
```
101+
102+
## Language server
103+
104+
Edge ships an LSP server for editor integration. Start it with:
105+
106+
```bash
107+
edgec lsp
108+
```
109+
110+
The server communicates over stdin/stdout and provides parse and type-check
111+
diagnostics with precise source spans.
112+
113+
:::warning
114+
Hover, completions, and go-to-definition are not yet implemented.
115+
:::
116+
117+
## Explore the reference programs
65118

66119
The repository includes a growing set of example contracts under
67120
[`examples/`](https://github.com/refcell/edge-rs/tree/main/examples), ranging

docs/pages/contact/contact.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@ title: Contact
77
If none of the below methods work, reach out to [refcell](https://github.com/refcell)
88
on [x.com @ andreaslbigger](https://x.com/andreaslbigger).
99

10-
## Telegram Channel
10+
## Telegram channel
1111

1212
:::note
1313
Telegram details have not been published in this repository yet. Until they are,
1414
use GitHub issues or X for project contact.
1515
:::
1616

17-
## Opening an Issue
17+
## Opening an issue
1818

1919
For bugs, compiler regressions, documentation fixes, or feature requests, open
2020
an issue in the

docs/pages/contributing/contributing.md

Lines changed: 69 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,79 @@ title: Contributing
44

55
# Contributing
66

7-
This document breaks down [edge-rs](https://github.com/refcell/edge-rs)
8-
repository contribution guidelines.
7+
This document covers contribution guidelines for [edge-rs](https://github.com/refcell/edge-rs).
98

109
## Issues
1110

12-
## Pull Requests
11+
Search [existing issues](https://github.com/refcell/edge-rs/issues) before
12+
opening a new one. When reporting a bug, include the `edgec --version` output,
13+
the source file that triggered the problem, and the full error output.
14+
15+
## Pull requests
16+
17+
1. Fork the repository and create a branch from `main`.
18+
2. Build the project: `just build` (or `cargo build --workspace`).
19+
3. Run the test suite before submitting: `just test` (or `cargo test --workspace`).
20+
4. Run the linter: `just lint`.
21+
5. Open a pull request against `main` with a clear description of the change.
22+
23+
## Development workflow
24+
25+
The repository includes a [`Justfile`](https://github.com/casey/just) with
26+
common workflows:
27+
28+
```bash
29+
just build # build all crates
30+
just test # run all tests
31+
just lint # run all lints (format, clippy, deny, docs)
32+
just e2e # run end-to-end tests
33+
just bench # run benchmarks
34+
just check-examples # parse all example contracts
35+
just check-stdlib # parse all stdlib contracts
36+
just docs # serve the documentation site locally
37+
just docs-build # build the documentation site
38+
```
39+
40+
:::note
41+
`just lint` runs four checks: `check-format` (requires `cargo +nightly fmt`),
42+
`check-clippy`, `check-deny`, and `check-docs`. All four must pass for CI to
43+
be green.
44+
:::
45+
46+
## Crate structure
47+
48+
The compiler is organized into these crates:
49+
50+
| Crate | Path | Purpose |
51+
|---|---|---|
52+
| `edge-lexer` | `crates/lexer/` | Tokenization |
53+
| `edge-parser` | `crates/parser/` | Parsing |
54+
| `edge-ast` | `crates/ast/` | AST types |
55+
| `edge-types` | `crates/types/` | Shared type definitions |
56+
| `edge-typeck` | `crates/typeck/` | Type checking |
57+
| `edge-diagnostics` | `crates/diagnostics/` | Error reporting |
58+
| `edge-ir` | `crates/ir/` | IR lowering + egglog optimization |
59+
| `edge-codegen` | `crates/codegen/` | Bytecode generation + optimizer |
60+
| `edge-driver` | `crates/driver/` | Pipeline orchestration |
61+
| `edge-lsp` | `crates/lsp/` | Language server |
62+
| `edge-evm-tests` | `crates/evm-tests/` | EVM test host |
63+
| `edge-bench` | `crates/bench/` | Benchmarks |
64+
| `edge-e2e` | `crates/e2e/` | End-to-end tests |
65+
66+
For a detailed walkthrough of the compiler pipeline, see
67+
[Compiler Architecture](/compiler/overview).
1368

1469
## Labels
1570

71+
Issues and PRs are tagged to indicate their status and area:
72+
73+
- **bug** — something is broken
74+
- **enhancement** — new feature or improvement
75+
- **documentation** — docs-only changes
76+
- **good first issue** — suitable for first-time contributors
77+
1678
## Assistance
79+
80+
For questions or discussion, open an issue on
81+
[GitHub](https://github.com/refcell/edge-rs/issues) or see the
82+
[Contact](/contact/contact) page for other ways to reach the team.

docs/pages/index.mdx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,4 +40,9 @@ the developer workflow from there.
4040
<strong>Contributing</strong>
4141
<span>See repository conventions, contribution guidance, and how to get involved.</span>
4242
</a>
43+
44+
<a className="edge-home-card" href="/compiler/quickstart">
45+
<strong>Quickstart</strong>
46+
<span>Install the Edge toolchain and compile your first contract in minutes.</span>
47+
</a>
4348
</div>

docs/pages/intro.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,16 @@ title: Introduction
44

55
# Introduction
66

7-
Edge is a domain specific language for the Ethereum Virtual Machine (EVM):
7+
Edge is a domain-specific language for the Ethereum Virtual Machine (EVM):
88
high-level, strongly statically typed, and designed to make smart contract
99
development more expressive without giving up control over execution.
1010

1111
It is the brainchild of [jtriley](https://github.com/jtriley-eth), to whom
12-
all specifications are attributable.
12+
the current specifications are attributable.
1313

14-
The Edge documentation is broken down into the following sections:
14+
The Edge documentation is organized into the following sections:
1515

16-
* [Specifications](/specs/overview): An in-depth blueprint to the Edge language.
16+
* [Specifications](/specs/overview): An in-depth blueprint to the Edge language, including syntax showcase examples.
1717
* [Compiler](/compiler/overview): The inner workings of the Rust compiler implementation.
1818
* [Tooling](/tools/overview): An overview of Edge tooling and other developer utilities.
1919
* [Contributing](/contributing/contributing): Repository contribution guidelines.

0 commit comments

Comments
 (0)