Skip to content

Commit

Permalink
Merge branch 'main' of https://github.com/figlang/fig
Browse files Browse the repository at this point in the history
  • Loading branch information
nyzd committed Feb 12, 2024
2 parents 043df2a + 13bb842 commit a771550
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,16 @@ Fig-lang source code, containing the compiler, CLI, web, and examples
# Stage
Fig-lang is currently in the early stages of development. You can test the Early development version on [Playground](https://fig-lang.github.io/fig/).

# Try Fig-lang local
First compile the FigCli with `cargo build --release`
# Installation
Here's an bash command that will download the latest FigLang release and install it on you Linux or MacOs machine.

then create a file `example.fig`:
```bash
curl https://raw.githubusercontent.com/fig-lang/fig/main/install.sh | bash
```

# Hello World in Fig
```
external fig {
external io {
fn print_str(str: char[]);
}
Expand All @@ -19,7 +22,7 @@ export fn main() {
}
```

finally run `./target/release/fig run ./example.fig`
To run this fig program simply run `fig run ./{file name}`

*The output should be `Hello World`.*

Expand All @@ -32,7 +35,7 @@ each time an request arives the cli will run the script and pass the HTTP reques
### Server command
Here is an example usage of the `server` command:

`./target/release/fig server ./test.fig --addr localhost:8080`
`fig server ./test.fig --addr localhost:8080`

### Example server side code
Here is an example source code of using server feature in FigCli, It's just like an ordinary Fig program but the main function will get one parameter, Which will contain the content of HTTP request as `char[]` or a string.
Expand Down

0 comments on commit a771550

Please sign in to comment.