Rename the language from Dino to Rex
Files use .rex, the command is rex, and the crate, runtime prefixes, docs, editor files and examples all use the new name. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
2f44f09b6a
commit
7cf9727bcd
94 files changed
+858
-858
No files matched your search
+20
-20
@@ -2,40 +2,40 @@
|
||||
|
||||
## Running a program
|
||||
|
||||
Save this as `hello.dino`:
|
||||
Save this as `hello.rex`:
|
||||
|
||||
```dino
|
||||
```rex
|
||||
func main() {
|
||||
print("Hello, Dino!")
|
||||
print("Hello, Rex!")
|
||||
}
|
||||
```
|
||||
```text
|
||||
Hello, Dino!
|
||||
Hello, Rex!
|
||||
```
|
||||
|
||||
Every program starts at `func main()`. Run it from the project folder:
|
||||
|
||||
```text
|
||||
cargo run -q -- run hello.dino
|
||||
cargo run -q -- run hello.rex
|
||||
```
|
||||
|
||||
The compiler turns your Dino code into C and builds it with your C compiler (`cc`, so you
|
||||
need gcc or clang installed). If you build the `dino` binary once, the commands are:
|
||||
The compiler turns your Rex code into C and builds it with your C compiler (`cc`, so you
|
||||
need gcc or clang installed). If you build the `rex` binary once, the commands are:
|
||||
|
||||
| Command | What it does |
|
||||
|---------|--------------|
|
||||
| `dino run file.dino [args...]` | Compile and run. Extra words are given to the program (`os.args`). |
|
||||
| `dino build file.dino -o out` | Make an executable you can keep. |
|
||||
| `dino check file.dino` | Look for errors without building. |
|
||||
| `dino emit-c file.dino` | Print the generated C. |
|
||||
| `dino fmt file-or-folder...` | Tidy the code in place (`--check` only reports). |
|
||||
| `rex run file.rex [args...]` | Compile and run. Extra words are given to the program (`os.args`). |
|
||||
| `rex build file.rex -o out` | Make an executable you can keep. |
|
||||
| `rex check file.rex` | Look for errors without building. |
|
||||
| `rex emit-c file.rex` | Print the generated C. |
|
||||
| `rex fmt file-or-folder...` | Tidy the code in place (`--check` only reports). |
|
||||
|
||||
## print
|
||||
|
||||
`print` takes any number of values, separates them with spaces, and ends the line.
|
||||
It can print numbers, strings, lists, maps, structs, enums and more.
|
||||
|
||||
```dino
|
||||
```rex
|
||||
func main() {
|
||||
print("score:", 42, true)
|
||||
print([1, 2, 3])
|
||||
@@ -52,7 +52,7 @@ Notice that a float always shows a `.0` so you can tell `3.0` from `3`.
|
||||
|
||||
## Comments
|
||||
|
||||
```dino
|
||||
```rex
|
||||
// a comment runs to the end of the line
|
||||
func main() {
|
||||
print("hi") // so does this
|
||||
@@ -64,7 +64,7 @@ hi
|
||||
|
||||
## Reading the error messages
|
||||
|
||||
Dino tries hard to explain mistakes. For example, forgetting that `int` and `float`
|
||||
Rex tries hard to explain mistakes. For example, forgetting that `int` and `float`
|
||||
don't mix:
|
||||
|
||||
```text
|
||||
@@ -79,16 +79,16 @@ message and worth fixing.
|
||||
`editors/` has colours, live error underlines and format-on-save for VS Code, Neovim, Vim and
|
||||
Helix (any editor that can run a language server works). See `editors/README.md`. It is the
|
||||
compiler itself doing the checking, so you see the same messages as in the terminal. The
|
||||
server is started with `dino lsp`.
|
||||
server is started with `rex lsp`.
|
||||
|
||||
## Formatting your code
|
||||
|
||||
`dino fmt` rewrites your files in one standard style, so you never argue about spaces:
|
||||
`rex fmt` rewrites your files in one standard style, so you never argue about spaces:
|
||||
|
||||
```text
|
||||
dino fmt hello.dino # one file
|
||||
dino fmt src/ # every .dino file in a folder
|
||||
dino fmt --check src/ # change nothing; exit code 1 if something is untidy
|
||||
rex fmt hello.rex # one file
|
||||
rex fmt src/ # every .rex file in a folder
|
||||
rex fmt --check src/ # change nothing; exit code 1 if something is untidy
|
||||
```
|
||||
|
||||
It uses 4-space indents, one space around operators, `a: int` colons, `Point{x: 1}` literals,
|
||||
|
||||
Reference in new issue
Block a user