Skip to content

Commit

Permalink
📝 Update readme
Browse files Browse the repository at this point in the history
semver: chore
  • Loading branch information
Somfic committed Jan 1, 2025
1 parent c3375d8 commit f8128fe
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 64 deletions.
62 changes: 3 additions & 59 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,63 +3,7 @@
> An idiot admires complexity, a genius admires simplicity.
```rust
enum breed:
siamese
persian
maine_coon
sphynx
other ~ string

type cat:
name ~ string
age ~ number
breed ~ breed

spec purrer:
pur ~ fn (self) -> number

code purrer for cat:
pur: (self) -> {
12
}
```

```rust
struct Name:
name ~ string;

struct Age: age ~ number;

enum tail_length:
short,
medium,
long;

type Cat
tail_length ~ tail_length,
+ Name,
+ Age;

spec Purrer:
pur ~ fn(self) -> number;

code Purrer for Cat:
fn pur(self) -> number {
print`($"{self.name} ({self.age}) is purring");
};

```


```
install cmake
install strawberryperl
winget install Ninja-build.Ninja
cargo install llvmenv
llvmenv init
llvmenv entries
llvmenv build-entry 10.0.0
fn fib(n ~ int) -> int {
n if n < 2 else fib(n - 1) + fib(n - 2)
}
```
6 changes: 1 addition & 5 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,7 @@ pub mod parser;

const INPUT: &str = "
fn fib(n ~ int) -> int {
if n < 2 {
return n;
};
fib(n - 1) + fib(n - 2)
n if n < 2 else fib(n - 1) + fib(n - 2)
}
";

Expand Down

0 comments on commit f8128fe

Please sign in to comment.