Quick Start
This chapter introduces the basic workflow for creating, running, and checking a Feng program with a minimal project.
Create a Project
feng init must be run in an empty directory:
mkdir hello_feng
cd hello_feng
feng init hello_feng
The command creates the project manifest feng.fm and the entry file src/main.ff.
Write the Program
Replace src/main.ff with:
module hello_feng;
import std.io;
func main(args: string[]) {
println("Hello, world!");
}
Every source file begins by declaring its module. import std.io; brings the standard output function into the current file, and main(args: string[]) is the entry point of an executable project.
Run the Program
Run this command in the directory containing feng.fm:
feng run
Output:
Hello, world!
To pass program arguments, place -- after the Feng options:
feng run -- first second
The arguments are available in the args array passed to main.
Check and Build
Check the entire project without producing a final artifact:
feng check
Create a debug build:
feng build
Create a release build:
feng build --release
Development artifacts are stored by platform under build/<platform>/. Executables are placed in build/<platform>/bin/.
Next Step
Read Your First Project to learn how to organize multiple files, then continue with Values and Bindings and the remaining language chapters.