Browse Source

chore: rename sabre to antimony

Signed-off-by: Garrit Franke <garrit@slashdev.space>
pull/24/head
Garrit Franke 3 years ago
parent
commit
8e82c2d19a
  1. 2
      .builds/ci.yml
  2. 8
      CHANGELOG.md
  3. 10
      CONTRIBUTING.md
  4. 20
      Cargo.lock
  5. 10
      Cargo.toml
  6. 8
      Dockerfile
  7. 22
      README.md
  8. 2
      book.toml
  9. 18
      contrib/PKGBUILD
  10. 4
      docs/concepts/SUMMARY.md
  11. 2
      docs/concepts/comments.md
  12. 16
      docs/concepts/control-flow.md
  13. 14
      docs/concepts/datatypes.md
  14. 10
      docs/concepts/functions.md
  15. 6
      docs/concepts/variables.md
  16. 2
      docs/developers/SUMMARY.md
  17. 2
      docs/developers/backends.md
  18. 10
      docs/developers/contributing.md
  19. 4
      docs/introduction/SUMMARY.md
  20. 10
      docs/introduction/hello-world.md
  21. 12
      docs/introduction/installation.md
  22. 8
      docs/modules/SUMMARY.md
  23. 4
      src/ast/README.md
  24. 4
      src/builder/README.md

2
.builds/ci.yml

@ -3,7 +3,7 @@ packages:
- rust
- node
sources:
- https://git.sr.ht/~garritfra/sabre
- https://git.sr.ht/~garritfra/antimony
tasks:
- build: |
cargo build

8
CHANGELOG.md

@ -39,7 +39,7 @@ None
## v0.3.0 (2021-02-12)
This release adds type inference to Sabre. There are also a lot of improvements in terms of documentation. The docs are now at a state that can be considered "usable".
This release adds type inference to Antimony. There are also a lot of improvements in terms of documentation. The docs are now at a state that can be considered "usable".
**Features**
@ -77,7 +77,7 @@ This version introduces a lot of improvements regarding loops and arrays.
**Documentation**
- Link to our matrix channel in README
- Install Sabre via Cargo
- Install Antimony via Cargo
## v0.1.1 (2021-02-06)
@ -85,7 +85,7 @@ Follow-up release that fixes some issues with the published crate.
## v0.1.0 (2021-02-06)
This release is the first to be published to crates.io. The crate is called [sabre-lang](https://crates.io/crates/sabre-lang).
This release is the first to be published to crates.io. The crate is called [antimony-lang](https://crates.io/crates/antimony-lang).
**Features**
@ -157,7 +157,7 @@ Garrit Franke (74):
Implement returning variables
Pretty print AST output
Add strings
Rename flex -> sabre
Rename flex -> antimony
Fix example filename
Add parser tests
Add multiple functions test

10
CONTRIBUTING.md

@ -1,23 +1,23 @@
# Contributing
The easiest way to contribute to the Sabre project is by writing code in the language. The more the language is battle-tested, the more bugs can be found and therefore the language becomes more stable.
The easiest way to contribute to the Antimony project is by writing code in the language. The more the language is battle-tested, the more bugs can be found and therefore the language becomes more stable.
## Getting in touch
If you have a question, found a potential bug or want to engage with the community, you can join the [matrix room](https://matrix.to/#/#sabre:matrix.slashdev.space?via=matrix.slashdev.space) of this project. If you prefer to stay away from matrix, you can also send a mail (or a patch) to the [public mailing list](https://lists.sr.ht/~garritfra/sabre).
If you have a question, found a potential bug or want to engage with the community, you can join the [matrix room](https://matrix.to/#/#antimony:matrix.slashdev.space?via=matrix.slashdev.space) of this project. If you prefer to stay away from matrix, you can also send a mail (or a patch) to the [public mailing list](https://lists.sr.ht/~garritfra/antimony).
## Fixing things and adding features
If you want to contribute to the compiler itself, the easiest way to get started is to look at the [open issues](https://github.com/garritfra/sabre/issues) of the project. Usually, this is where important todo items are jotted down and bugs are reported.
If you want to contribute to the compiler itself, the easiest way to get started is to look at the [open issues](https://github.com/garritfra/antimony/issues) of the project. Usually, this is where important todo items are jotted down and bugs are reported.
You could also run the tests (`cargo test`) and see if any tests are ignored. Usually, if a bug is found in the wild, a failing but ignored test is written, so that it can be further investigated later.
## Writing documentation
As with all software, Sabre needs good documentation. Since Sabre is still in early development, things change constantly. This means that docs will be out of date in a lot of cases, or not written at all. Any help with the documentation is greatly appreciated!
As with all software, Antimony needs good documentation. Since Antimony is still in early development, things change constantly. This means that docs will be out of date in a lot of cases, or not written at all. Any help with the documentation is greatly appreciated!
## Submitting your code
If you want to contribute code, please open a pull request on [GitHub](https://github.com/garritfra/sabre). There is also a [SourceHut mirror](https://sr.ht/~garritfra/sabre/), if you're trying to avoid GitHub. Feel free to send a patch to the [public mailing list](https://lists.sr.ht/~garritfra/sabre). Check out [this guide](https://slashdev.space/posts/patch-based-git-workflow) to learn about the patch based workflow.
If you want to contribute code, please open a pull request on [GitHub](https://github.com/garritfra/antimony). There is also a [SourceHut mirror](https://sr.ht/~garritfra/antimony/), if you're trying to avoid GitHub. Feel free to send a patch to the [public mailing list](https://lists.sr.ht/~garritfra/antimony). Check out [this guide](https://slashdev.space/posts/patch-based-git-workflow) to learn about the patch based workflow.
Before submitting the code, please make sure that it is **sufficiently documented and tested**.

20
Cargo.lock generated

@ -18,6 +18,16 @@ dependencies = [
"winapi",
]
[[package]]
name = "antimony-lang"
version = "0.5.0"
dependencies = [
"inkwell",
"rust-embed",
"structopt",
"tempfile",
]
[[package]]
name = "atty"
version = "0.2.14"
@ -363,16 +373,6 @@ dependencies = [
"walkdir",
]
[[package]]
name = "sabre-lang"
version = "0.5.0"
dependencies = [
"inkwell",
"rust-embed",
"structopt",
"tempfile",
]
[[package]]
name = "same-file"
version = "1.0.6"

10
Cargo.toml

@ -1,17 +1,17 @@
[package]
name = "sabre-lang"
name = "antimony-lang"
version = "0.5.0"
authors = ["Garrit Franke <garrit@slashdev.space>"]
description = "The sabre programming language"
description = "The Antimony programming language"
license = "Apache-2.0"
documentation = "https://garritfra.github.io/sabre"
repository = "https://github.com/garritfra/sabre"
documentation = "https://garritfra.github.io/antimony"
repository = "https://github.com/garritfra/antimony"
edition = "2018"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[[bin]]
name = "sabre"
name = "sb"
path = "src/main.rs"
[features]

8
Dockerfile

@ -7,7 +7,7 @@ RUN rustup target add x86_64-unknown-linux-musl
# Create a dummy project and build the app's dependencies.
# If the Cargo.toml or Cargo.lock files have not changed,
# we can use the docker build cache and skip these (typically slow) steps.
WORKDIR /usr/src/sabre
WORKDIR /usr/src/antimony
COPY Cargo.toml Cargo.lock ./
# Copy the source and build the application.
@ -23,8 +23,8 @@ FROM alpine:3.13
LABEL maintainer="Garrit Franke <garrit@slashdev.space>"
COPY --from=build /usr/local/cargo/bin/sabre /bin
COPY --from=build /usr/local/cargo/bin/antimony /bin
RUN sabre --version
RUN antimony --version
ENTRYPOINT ["sabre"]
ENTRYPOINT ["antimony"]

22
README.md

@ -1,16 +1,16 @@
# The Sabre Programming language
# The Antimony Programming language
[![](https://img.shields.io/crates/v/sabre-lang.svg)](https://crates.io/crates/sabre-lang)
![Continuous integration](https://github.com/garritfra/sabre/workflows/Continuous%20integration/badge.svg?branch=master)
[![docs](https://img.shields.io/badge/docs-mdBook-blue.svg)](https://garritfra.github.io/sabre/latest)
[![Chat on Matrix](https://img.shields.io/badge/chat-on%20Matrix-green)](https://matrix.to/#/#sabre:matrix.slashdev.space?via=matrix.slashdev.space)
[![](https://img.shields.io/crates/v/antimony-lang.svg)](https://crates.io/crates/antimony-lang)
![Continuous integration](https://github.com/garritfra/antimony/workflows/Continuous%20integration/badge.svg?branch=master)
[![docs](https://img.shields.io/badge/docs-mdBook-blue.svg)](https://garritfra.github.io/antimony/latest)
[![Chat on Matrix](https://img.shields.io/badge/chat-on%20Matrix-green)](https://matrix.to/#/#antimony:matrix.slashdev.space?via=matrix.slashdev.space)
Sabre is a bullshit-free (©) programming language that gets out of your way.
Antimony is a bullshit-free (©) programming language that gets out of your way.
It is meant to "just work", without adding unnecessary and bloated language features.
## Why yet another language?
The goal of Sabre is to be a simple language that anyone - beginner and expert - can pick up and use. A "bullshit-free programming language" is of course a highly subjective opinion, and this project is my very own attempt at this. There are plenty of great programming languages out there, and Sabre is not meant to replace any of them. Currently, Sabre is just a general-purpose toy language. Its primary goal is to be simple and easy to understand, not to be efficient.
The goal of Antimony is to be a simple language that anyone - beginner and expert - can pick up and use. A "bullshit-free programming language" is of course a highly subjective opinion, and this project is my very own attempt at this. There are plenty of great programming languages out there, and Antimony is not meant to replace any of them. Currently, Antimony is just a general-purpose toy language. Its primary goal is to be simple and easy to understand, not to be efficient.
## Example
@ -35,17 +35,17 @@ fn fib(n: int) {
## State of this project
Most algorithms should run fine, but some features may be unstable. Standard library and documentation are still incomplete. See the [open issues](https://github.com/garritfra/sabre/issues) for upcoming todos.
Most algorithms should run fine, but some features may be unstable. Standard library and documentation are still incomplete. See the [open issues](https://github.com/garritfra/antimony/issues) for upcoming todos.
The Sabre compiler emits JavaScript for the Node.js runtime, and a C backend is currently under development. Backends for WASM and LLVM are planned.
The Antimony compiler emits JavaScript for the Node.js runtime, and a C backend is currently under development. Backends for WASM and LLVM are planned.
## Documentation
Documentation is hosted [here](https://garritfra.github.io/sabre).
Documentation is hosted [here](https://garritfra.github.io/antimony).
## Getting started
See the [installation](https://garritfra.github.io/sabre/latest/introduction/installation.html) instructions to get started.
See the [installation](https://garritfra.github.io/antimony/latest/introduction/installation.html) instructions to get started.
## Chat on matrix

2
book.toml

@ -3,4 +3,4 @@ authors = ["Garrit Franke"]
language = "en"
multilingual = false
src = "docs"
title = "The Sabre Programming Language"
title = "The Antimony Programming Language"

18
contrib/PKGBUILD

@ -1,10 +1,10 @@
# Maintainer: Garrit Franke <garrit@slashdev.space>
# Contributor: Alexey Yerin <yyp@disroot.org>
pkgname="sabre-git"
pkgname="antimony-git"
pkgver=v0.4.0.r7.fe7b035
pkgrel=1
pkgdesc="The bullshit-free programming language"
url="https://github.com/garritfra/sabre"
url="https://github.com/garritfra/antimony"
license=("Apache")
arch=("x86_64" "pentium4" "i686")
makedepends=("git" "cargo")
@ -12,32 +12,32 @@ optdepends=(
"node: Node.js backend"
"llvm: LLVM backend"
)
provides=("sabre")
provides=("antimony")
source=(
"sabre::git+https://github.com/garritfra/sabre"
"antimony::git+https://github.com/garritfra/antimony"
)
sha256sums=("SKIP")
pkgver() {
cd "${srcdir}/sabre"
cd "${srcdir}/antimony"
printf "%s" "$(git describe --long | sed 's/\([^-]*-\)g/r\1/;s/-/./g')"
}
build() {
cd "${srcdir}/sabre"
cd "${srcdir}/antimony"
cargo build --release
}
check() {
cd "${srcdir}/sabre"
cd "${srcdir}/antimony"
cargo test
}
package() {
cd "${srcdir}/sabre"
cd "${srcdir}/antimony"
install -Dm755 target/release/sabre "${pkgdir}/usr/bin/sabre"
install -Dm755 target/release/antimony "${pkgdir}/usr/bin/antimony"
}

4
docs/concepts/SUMMARY.md

@ -1,5 +1,5 @@
# Common language concepts
This chapter covers concepts that appear in almost every programming language and how they work in Sabre. Many programming languages have much in common at their core.
This chapter covers concepts that appear in almost every programming language and how they work in Antimony. Many programming languages have much in common at their core.
Specifically, you’ll learn about variables, basic types, functions, comments, and control flow. These foundations will be in every Sabre program, and learning them early will give you a strong core to start from.
Specifically, you’ll learn about variables, basic types, functions, comments, and control flow. These foundations will be in every Antimony program, and learning them early will give you a strong core to start from.

2
docs/concepts/comments.md

@ -8,7 +8,7 @@ Here’s a simple comment:
// I'm a comment!
```
In Sabre, the idiomatic comment style starts a comment with two slashes, and the comment continues until the end of the line. For comments that extend beyond a single line, you’ll need to include `//` on each line, like this:
In Antimony, the idiomatic comment style starts a comment with two slashes, and the comment continues until the end of the line. For comments that extend beyond a single line, you’ll need to include `//` on each line, like this:
```
// So we’re doing something complicated here, long enough that we need

16
docs/concepts/control-flow.md

@ -1,6 +1,6 @@
# Control Flow
Deciding whether or not to run some code depending on if a condition is true and deciding to run some code repeatedly while a condition is true are basic building blocks in most programming languages. The most common constructs that let you control the flow of execution of Sabre code are `if` expressions and loops.
Deciding whether or not to run some code depending on if a condition is true and deciding to run some code repeatedly while a condition is true are basic building blocks in most programming languages. The most common constructs that let you control the flow of execution of Antimony code are `if` expressions and loops.
## `if` Expressions
@ -27,7 +27,7 @@ Optionally, we can also include an `else` expression, which we chose to do here,
Try running this code; You should see the following output:
```
$ sabre run main.sb
$ sb run main.sb
condition was true
```
@ -40,7 +40,7 @@ let number = 7
Run the program again, and look at the output:
```
$ sabre run main.sb
$ sb run main.sb
condition was false
```
@ -69,11 +69,11 @@ fn main() {
This program has four possible paths it can take. After running it, you should see the following output:
```
$ sabre run main.sb
$ sb run main.sb
number is divisible by 3
```
When this program executes, it checks each `if` expression in turn and executes the first body for which the condition holds true. Note that even though 6 is divisible by 2, we don’t see the output `number is divisible by 2`, nor do we see the `number is not divisible by 4, 3, or 2` text from the else block. That’s because Sabre only executes the block for the first true condition, and once it finds one, it doesn’t even check the rest.
When this program executes, it checks each `if` expression in turn and executes the first body for which the condition holds true. Note that even though 6 is divisible by 2, we don’t see the output `number is divisible by 2`, nor do we see the `number is not divisible by 4, 3, or 2` text from the else block. That’s because Antimony only executes the block for the first true condition, and once it finds one, it doesn’t even check the rest.
### Value matching
@ -113,9 +113,9 @@ Keep in mind that excessive use of this could hurt the readability of your code.
## Loops
It's often useful to execute a block of code more than once. For this task, Sabre provides different kind of _loops_. A loop runs through the code inside the its body to the end and then starts immediately back at the beginning.
It's often useful to execute a block of code more than once. For this task, Antimony provides different kind of _loops_. A loop runs through the code inside the its body to the end and then starts immediately back at the beginning.
Sabre has two types of loops: `while` and `for`. Let's go through each of them.
Antimony has two types of loops: `while` and `for`. Let's go through each of them.
### Conditional Loops with `while`
@ -157,7 +157,7 @@ fn main() {
Here, the code counts up through the elements in the array. It starts at index `0`, and then loops until it reaches the final index in the array (that is, when `index < 5` is no longer true). Running this code will print every element in the array:
```
$ sabre run main.sb
$ sb run main.sb
the value is: 10
the value is: 20
the value is: 30

14
docs/concepts/datatypes.md

@ -1,10 +1,10 @@
# Datatypes
Sabre comes with some generic data types.
Antimony comes with some generic data types.
## The Boolean type
As in most other programming languages, a Boolean type in Sabre has two possible values: `true` and `false`. Booleans are one byte in size. The Boolean type in Sabre is specified using `bool`. For example:
As in most other programming languages, a Boolean type in Antimony has two possible values: `true` and `false`. Booleans are one byte in size. The Boolean type in Antimony is specified using `bool`. For example:
```
fn main() {
@ -27,7 +27,7 @@ fn main() {
```
```
$ sabre run main.sb
$ sb run main.sb
1 + 2 is 3
```
@ -43,7 +43,7 @@ fn main() {
```
```
$ sabre run main.sb
$ sb run main.sb
Hello Jon
```
@ -62,7 +62,7 @@ fn main() {
```
```
$ sabre run main.sb
$ sb run main.sb
Banana
Apple
Pineapple
@ -85,7 +85,7 @@ fn print_anything(x: any) {
```
```
$ sabre run main.sb
$ sb run main.sb
5
Hello
```
@ -104,7 +104,7 @@ fn main() {
```
```
$ sabre run main.sb
$ sb run main.sb
1
Two
3

10
docs/concepts/functions.md

@ -1,8 +1,8 @@
# Functions
Functions are pervasive in Sabre code. You’ve already seen one of the most important functions in the language: the `main` function, which is the entry point of many programs. You've also seen the `fn` keyword, which allows you to declare new functions.
Functions are pervasive in Antimony code. You’ve already seen one of the most important functions in the language: the `main` function, which is the entry point of many programs. You've also seen the `fn` keyword, which allows you to declare new functions.
Sabre code uses snake_case as the conventional style for function and variable names. In snake case, all letters are lowercase and underscores separate words. Here’s a program that contains an example function definition:
Antimony code uses snake_case as the conventional style for function and variable names. In snake case, all letters are lowercase and underscores separate words. Here’s a program that contains an example function definition:
```
fn main() {
@ -15,13 +15,13 @@ fn another_function() {
}
```
We can call any function we’ve defined by entering its name followed by a set of parentheses. Because `another_function` is defined in the program, it can be called from inside the main function. Note that we defined `another_function` after the `main` function in the source code; we could have defined it before as well. Sabre doesn’t care where you define your functions, only that they’re defined somewhere.
We can call any function we’ve defined by entering its name followed by a set of parentheses. Because `another_function` is defined in the program, it can be called from inside the main function. Note that we defined `another_function` after the `main` function in the source code; we could have defined it before as well. Antimony doesn’t care where you define your functions, only that they’re defined somewhere.
## Function parameters
Functions can also be defined to have parameters, which are special variables that are part of a function’s signature. When a function has parameters, you can provide it with concrete values for those parameters. Technically, the concrete values are called arguments, but in casual conversation, people tend to use the words parameter and argument interchangeably for either the variables in a function’s definition or the concrete values passed in when you call a function.
The following rewritten version of `another_function` shows what parameters look like in Sabre:
The following rewritten version of `another_function` shows what parameters look like in Antimony:
```
fn main() {
@ -63,6 +63,6 @@ fn add_one(x: int): int {
```
```
$ sabre run main.sb
$ sb run main.sb
2
```

6
docs/concepts/variables.md

@ -1,6 +1,6 @@
# Variables
If you are familiar with some other programming language, the way Sabre handles variables won't surprise you.
If you are familiar with some other programming language, the way Antimony handles variables won't surprise you.
To declare a variable, the `let` keyword is used. The type of the variable is infered, but can be specified explicitly.
@ -15,9 +15,9 @@ fn main() {
}
```
Run this code using the sabre CLI:
Run this code using the antimony CLI:
```
$ sabre run variables.sb
$ sb run variables.sb
15
```

2
docs/developers/SUMMARY.md

@ -1 +1 @@
This chapter includes resources that might be helpful for developers hacking on the Sabre compiler.
This chapter includes resources that might be helpful for developers hacking on the Antimony compiler.

2
docs/developers/backends.md

@ -1,6 +1,6 @@
# Backends
Sabre currently implements a JavaScript backend, but a C backend is in development. WASM, ARM and x86 are planned.
Antimony currently implements a JavaScript backend, but a C backend is in development. WASM, ARM and x86 are planned.
The backend can be specified in the `Cargo.toml` file in the root of the project:
```toml

10
docs/developers/contributing.md

@ -1,23 +1,23 @@
# Contributing
The easiest way to contribute to the Sabre project is by writing code in the language. The more the language is battle-tested, the more bugs can be found and therefore the language becomes more stable.
The easiest way to contribute to the Antimony project is by writing code in the language. The more the language is battle-tested, the more bugs can be found and therefore the language becomes more stable.
## Getting in touch
If you have a question, found a potential bug or want to engage with the community, you can join the [matrix room](https://matrix.to/#/#sabre:matrix.slashdev.space?via=matrix.slashdev.space) of this project. If you prefer to stay away from matrix, you can also send a mail (or a patch) to the [public mailing list](https://lists.sr.ht/~garritfra/sabre).
If you have a question, found a potential bug or want to engage with the community, you can join the [matrix room](https://matrix.to/#/#antimony:matrix.slashdev.space?via=matrix.slashdev.space) of this project. If you prefer to stay away from matrix, you can also send a mail (or a patch) to the [public mailing list](https://lists.sr.ht/~garritfra/antimony).
## Fixing things and adding features
If you want to contribute to the compiler itself, the easiest way to get started is to look at the [open issues](https://github.com/garritfra/sabre/issues) of the project. Usually, this is where important todo items are jotted down and bugs are reported.
If you want to contribute to the compiler itself, the easiest way to get started is to look at the [open issues](https://github.com/garritfra/antimony/issues) of the project. Usually, this is where important todo items are jotted down and bugs are reported.
You could also run the tests (`cargo test`) and see if any tests are ignored. Usually, if a bug is found in the wild, a failing but ignored test is written, so that it can be further investigated later.
## Writing documentation
As with all software, Sabre needs good documentation. Since Sabre is still in early development, things change constantly. This means that docs will be out of date in a lot of cases, or not written at all. Any help with the documentation is greatly appreciated!
As with all software, Antimony needs good documentation. Since Antimony is still in early development, things change constantly. This means that docs will be out of date in a lot of cases, or not written at all. Any help with the documentation is greatly appreciated!
## Submitting your code
If you want to contribute code, please open a pull request on [GitHub](https://github.com/garritfra/sabre). There is also a [SourceHut mirror](https://sr.ht/~garritfra/sabre/), if you're trying to avoid GitHub. Feel free to send a patch to the [public mailing list](https://lists.sr.ht/~garritfra/sabre). Check out [this guide](https://slashdev.space/posts/patch-based-git-workflow) to learn about the patch based workflow.
If you want to contribute code, please open a pull request on [GitHub](https://github.com/garritfra/antimony). There is also a [SourceHut mirror](https://sr.ht/~garritfra/antimony/), if you're trying to avoid GitHub. Feel free to send a patch to the [public mailing list](https://lists.sr.ht/~garritfra/antimony). Check out [this guide](https://slashdev.space/posts/patch-based-git-workflow) to learn about the patch based workflow.
Before submitting the code, please make sure that it is **sufficiently documented and tested**.

4
docs/introduction/SUMMARY.md

@ -1,9 +1,9 @@
# Introduction
Sabre is a bullshit-free (©) programming language that gets out of your way.
Antimony is a bullshit-free (©) programming language that gets out of your way.
It is meant to "just work", without adding unnecessary and bloated language features.
To get started with Sabre, continue with the [installation](introduction/installation.md).
To get started with Antimony, continue with the [installation](introduction/installation.md).
> **Note**: Some parts of this documentation have been copied from the [Rust book](https://doc.rust-lang.org/book/).

10
docs/introduction/hello-world.md

@ -1,10 +1,10 @@
# The command line interface
Now that you have installed Sabre, it is time to write our first program. This is a program that will simply print a string to the screen.
Now that you have installed Antimony, it is time to write our first program. This is a program that will simply print a string to the screen.
# Creating a project directory
Let's begin by setting up our development workspace. Sabre really doesn't care where you store the code, so feel free to choose a different directory, than the one in this example.
Let's begin by setting up our development workspace. Antimony really doesn't care where you store the code, so feel free to choose a different directory, than the one in this example.
```
mkdir ~/sources
@ -15,7 +15,7 @@ cd hello_world
# Writing and running a program
Next, make a new source file and call it `main.sb`. Sabre files should always end with `.sb` by convention.
Next, make a new source file and call it `main.sb`. Antimony files should always end with `.sb` by convention.
Now open the main.sb file you just created and enter the following code:
@ -28,7 +28,7 @@ fn main() {
Save the file and go back to your terminal window. Now, run the following command to compile and run your program:
```
sabre run main.sb
$ sb run main.sb
```
You should see the string `Hello World!` on the screen. Congrats! You have officially written a Sabre Program!
You should see the string `Hello World!` on the screen. Congrats! You have officially written a Antimony Program!

12
docs/introduction/installation.md

@ -1,18 +1,18 @@
# Installation
> **Note:** An installation of the Rust programming language is needed to compile Sabre.
> **Note:** An installation of the Rust programming language is needed to compile Antimony.
## Cargo
The fastest way to get up and running is to install the [latest published version](https://crates.io/crates/sabre-lang) via cargo:
The fastest way to get up and running is to install the [latest published version](https://crates.io/crates/antimony-lang) via cargo:
```sh
cargo install sabre-lang
cargo install antimony-lang
```
## Git
To get the current development version, you can clone the Git [repository](https://github.com/garritfra/sabre) and run the following command:
To get the current development version, you can clone the Git [repository](https://github.com/garritfra/antimony) and run the following command:
```sh
cargo install --path .
@ -20,8 +20,8 @@ cargo install --path .
## Docker
Sabre provides a [Docker image](https://hub.docker.com/r/garritfra/sabre). It currently only supports the x64 architecture. Please reach out if you need a ARM variant (needed for Raspberry Pi). If you don't want to wait, you can build the image yourself by running this command in the root of the project:
Antimony provides a [Docker image](https://hub.docker.com/r/garritfra/antimony). It currently only supports the x64 architecture. Please reach out if you need a ARM variant (needed for Raspberry Pi). If you don't want to wait, you can build the image yourself by running this command in the root of the project:
```
docker build . -t sabre
docker build . -t antimony
```

8
docs/modules/SUMMARY.md

@ -4,7 +4,7 @@ Projects naturally grow over time, and digging through 10.000 lines of code in a
The programs we've written so far have been in one file. As a project grows, you can organize code by splitting it into multiple modules with a clear name.
In Sabre, every file is also a module. Let's take a look at a project structure and identify its modules.
In Antimony, every file is also a module. Let's take a look at a project structure and identify its modules.
```
.
@ -37,7 +37,7 @@ In the `foo` directory, there is another directory called `baz`, containing a si
import "foo/baz/module"
```
we can simply import the module containing this file, and Sabre will import the contained `module.sb` instead.
we can simply import the module containing this file, and Antimony will import the contained `module.sb` instead.
```
// main.sb
@ -58,9 +58,9 @@ fn main() {
}
```
If we run `main.sb`, we should see the expected output. Sabre has imported the `add` function from the `math` module.
If we run `main.sb`, we should see the expected output. Antimony has imported the `add` function from the `math` module.
```
$ sabre run main.sb
$ sb run main.sb
3
```

4
src/ast/README.md

@ -1,5 +1,5 @@
# AST
This module contains the node types of the Sabre AST.
This module contains the node types of the Antimony AST.
The most important node is `Module`, which is the abstract representation of a Sabre file.
The most important node is `Module`, which is the abstract representation of a Antimony file.

4
src/builder/README.md

@ -1,5 +1,5 @@
# Builder
The builder module provides a simple interface to compile a Sabre program.
The builder module provides a simple interface to compile a Antimony program.
The `Builder` structure takes in a path to a Sabre program. Calling `.build()` will construct the internal representation of the program, and `.generate()` outputs the program to a target file.
The `Builder` structure takes in a path to a Antimony program. Calling `.build()` will construct the internal representation of the program, and `.generate()` outputs the program to a target file.

Loading…
Cancel
Save