stare#
gleam add stare@1
import gleam/io
import stare
import stare/function
import stare/value
import stare/type_
import stare/import_
pub fn main() -> Nil {
let assert Ok(code) = stare.module(
imports: [
import_.import_(
module: ["gleam", "io"],
types: [],
constructors: [],
functions: [],
alias: None,
),
],
functions: [
function.function(
name: "main",
public: True,
parameters: [],
return_type: Some(type_.nil),
statements: [
function.call(
module: Some("io"),
function: "println",
arguments: [stare.value(value.string("Hello World!"))],
),
],
),
],
)
io.println(code)
// import gleam/io
//
// pub fn main() -> Nil {
// io.println("Hello World!")
//}
}
Further documentation can be found at https://hexdocs.pm/stare.
Development#
gleam run -m birdie # Run birdie
gleam test # Run the tests
Nix#
nix run .#birdie # Run birdie
nix run .#test # Run the tests