Skip to content

Commit 844b08f

Browse files
authored
Add README (#32)
1 parent e3e1404 commit 844b08f

File tree

1 file changed

+58
-0
lines changed

1 file changed

+58
-0
lines changed

README.md

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
# Pink
2+
3+
This is a rewrite of the core of the [Codegen SDK](https://github.com/codegen-sh/codegen) in Rust.
4+
5+
## Goals
6+
7+
- Support more languages
8+
- Faster parse and execute time
9+
- More memory efficient
10+
- Incremental compilation
11+
12+
## Structure
13+
14+
- `codegen-sdk-common`: A crate that contains the common code for the SDK.
15+
- `codegen-sdk-cst`: Definitions and utilities for the CST.
16+
- `codegen-sdk-ast`: Definitions and utilities for the AST.
17+
- `codegen-sdk-cst-generator`: A crate that generates the CST for the SDK.
18+
- `codegen-sdk-ast-generator`: A crate that generates the AST and queries for the SDK. This requires the ts_query CST language to be generated first.
19+
- `languages/*`: A crate for each language that contains the language-specific code for the SDK. It's largely boilerplate, most of the work is done by the `codegen-sdk-ast-generator` and `codegen-sdk-cst-generator` crates. These are split out to make compiling the SDK faster.
20+
- `codegen-sdk-analyzer`: A crate that contains the core logic for the Incremenetal computation and state management of the SDK.
21+
- `src`: A base program that uses the SDK.
22+
23+
## Development
24+
25+
### Installing Rust
26+
27+
```bash
28+
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
29+
rustup toolchain install nightly
30+
```
31+
32+
### Installing tools
33+
34+
```bash
35+
cargo install cargo-binstall -y
36+
cargo binstall cargo-nextest -y
37+
cargo binstall cargo-insta -y
38+
```
39+
40+
### Building the project
41+
42+
```bash
43+
cargo build
44+
```
45+
46+
### Running tests
47+
48+
```bash
49+
cargo insta run --workspace --review
50+
```
51+
52+
Some of the tests use snapshots managed by [Insta](https://insta.rs/docs/cli/).
53+
54+
### Running sample program
55+
56+
```bash
57+
RUST_LOG=info cargo run --release /path/to/repo
58+
```

0 commit comments

Comments
 (0)