From 18ffbf1224862b910a88041b2e3bf856a7be772d Mon Sep 17 00:00:00 2001 From: M Date: Tue, 13 Feb 2024 00:36:58 +0330 Subject: [PATCH] Update README.md --- README.md | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index ad8b4a0..31f9b88 100644 --- a/README.md +++ b/README.md @@ -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 script 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[]); } @@ -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`.* @@ -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.