Static typing
Many mistakes show up at compile time, which makes day-to-day coding and refactoring more predictable.
Clear syntax, reliable types, smooth workflow
Official website for the Feng language
Feng combines static typing, explicit contracts, modular organization, and a straightforward workflow, so you can build everyday apps and libraries, call into C when needed, and ship packages with the same toolchain.
If you want a language with compact syntax and clear rules for types, abstractions, error handling, and C interop, Feng aims to offer a more direct path.
Language features
Many mistakes show up at compile time, which makes day-to-day coding and refactoring more predictable.
Object types and ABI-fixed layout types live in the same language, so you spend less time switching mental models.
`spec` and `fit` keep contracts and adaptation rules in the source, which makes intent easier to read and maintain.
You can write straightforward application code and still lift behavior into reusable functions, lambdas, and closures.
Error handling stays explicit, and ordinary objects are managed by the runtime, which helps keep everyday code clean.
When you need to call C libraries or ship binary packages, the language already gives you a clear path.
Code sample
One shows syntax, the other shows a minimal project setup.
mod app.hello;
@cdecl("libc")
extern fn puts(msg: string): int;
type User {
let name: string;
let age: i32;
fn say(msg: string): void {
puts(msg);
}
}
fn main(args: string[]): void {
let user = User {
name: "Houfeng",
age: 18
};
user.say("Hello World: " + user.name);
}
[package]
name: "demo"
version: "0.1.0"
target: "bin"
src: "src/"
out: "build/"
Workflow
Start with `feng init` to get a project skeleton, a manifest, and an entry template so you can begin immediately.
feng init demo
Run `feng check` while you work so you can catch problems early instead of waiting for a later build failure.
feng check
`feng build` reads the project manifest and produces the target artifact through one straightforward path.
feng build
Use `feng run` for applications, and switch to `feng pack` when you want a `.fb` package for a library.
feng run
# for library projects
feng pack
What to learn next
These are the main topics to explore after the homepage overview.