Verify the install
After installing, check the compiler version, read the doctor report, and run a small program. Open a new terminal first, so the updated PATH is active.
1. Check the version
Section titled “1. Check the version”beansc --versionbeansc 0.1.53 (language 1.0, runtime ABI 23)This tells you three things: the compiler version (0.1.53), the language
contract it implements (1.0), and the runtime ABI (23).
2. Run the doctor
Section titled “2. Run the doctor”beansc doctordoctor reports what your install can build and how to fix any gaps. For
example, if a native build needs a C compiler that is not on your PATH,
doctor says so and tells you what to install.
doctor always exits with code 0. It is a report, not a pass/fail gate, so read
what it prints.
3. Run a program
Section titled “3. Run a program”Save this as hello.b:
import std.io
fn main() { let name: string = "beans" io.println("hello from {name}")}Run it on the reference interpreter:
beansc run hello.bhello from beansThese checks confirm that beansc is available and can run this program.
Next, write and run your first program or
set up a project. For
more on beansc doctor, see doctor and upgrade.