Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(silo): Initial Silo scaffolding #2096

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

feat(silo): Initial Silo scaffolding #2096

wants to merge 1 commit into from

Conversation

ospencer
Copy link
Member

This PR does some initial project scaffolding for Silo, Grain's new project manager and build system. This isn't quite an initial version, but rather some project setup to provide a foundation for us to work from as we build out functionality. It's not yet hooked up to our release process to allow us to continue Grain releases while we develop Silo in tandem.

Two commands are present, new and build:

$ silo --help
Build and manage Grain projects 馃尵

Usage: silo [options] <command>

Options:
    -h, -help, --help  Display help
    -v, --version      Print version and exit

Commands:
    new    Create a new Grain project
    build  Compile the current project

Run silo <command> --help for help with individual commands.

Silo will eventually manage build artifacts itself rather than offload that functionality to grainc, manage dependencies (including the standard library), run wasm files, and more (though not necessarily all of these before an initial release).

As Silo does not yet handle dependencies/stdlib, build.stdlib must be set in your silo.toml to build projects.

I put together a Silo README as a basis for our Silo documentation which includes the following silo.toml configuration information, but I put it here in the PR description as well for easy access.

[package]
name = "my-package" # the name of this package

[build]
elide-type-info = false # compiles without Grain type info
include-dirs = ["../dir1", "../dir2"] # add paths to compiler code lookup
import-memory = false # imports the wasm memory instead of exporting one
initial-memory-pages = 64 # the number of wasm memory pages to start with
maximum-memory-pages = 128 # the limit of wasm memory pages to grow to
memory-base = 4096 # the memory address to begin Grain allocations
gc = true # enable or disable Grain's garbage collector
stdlib = "../custom-stdlib" # set the location of the standard library to use
use-start-section = false # use a wasm (start) section to run code on startup
wasi-polyfill = "src/wasi-polyfill.gr" # code to polyfill wasi imports

[build.wasm-features]
bulk-memory = true # enable or disable wasm bulk memory
tail-call = true # enable or disable wasm tail calls

[bin]
name = "my-name.wasm" # the name of the resulting wasm file
path = "src/main.gr" # the entrypoint of compilation
source-map = false # produce a source map file
wat = false # produce a WebAssembly Text (.wat) file

@ospencer ospencer requested a review from a team April 21, 2024 22:26
@ospencer ospencer self-assigned this Apr 21, 2024
@ospencer ospencer requested a review from phated as a code owner April 21, 2024 22:26
Copy link
Member

@spotandjake spotandjake left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me.

Copy link
Member

@marcusroberts marcusroberts left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is great code to read and very comprehensible. A great start to Silo!

@spotandjake spotandjake added the silo Issues related to Silo label Apr 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
silo Issues related to Silo
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants