Skip to main content
Version: Next

Try Without Microcontroller

BlueScript is designed primarily for microcontroller development (ESP32). If you do not have hardware yet—or want a faster path for language and compiler checks—you can run BlueScript on the host runtime on your development machine.

For the main ESP32 workflow, see Get Started.

Prerequisites

Quickstart

1. Install the CLI

If you have not installed the CLI yet:

git clone https://github.com/csg-tokyo/bluescript.git
cd bluescript
npm install
npm run build:all
cd cli
npm link
info
The Next version is not released yet, so it cannot be installed from npm. For the released package, switch to the latest version (2.1.x).

On Windows, install the Visual C++ Build Environment before running this command.

2. Set up the host runtime

bscript board setup host

3. Create a host project

bscript project create hello-host -b host
cd hello-host

4. Write your program

Edit src/index.bs:

src/index.bs
console.log("Hello from host runtime!");

5. Run

bscript project run

You can also start interactive mode:

bscript project run --with-repl
# or
bscript project run --with-notebook

Notes

  • bscript board flash-runtime is for microcontrollers and is not supported for host.
  • GPIO and other ESP32-specific libraries are not available on host.

Host vs ESP32

TopicHost (-b host)ESP32 (-b esp32)
Main use caseFast local testingReal hardware development
Runtime locationLocal process on the development machineRuntime on the microcontroller
Setupbscript board setup hostbscript board setup esp32 + bscript board flash-runtime esp32
Connection during runLocal processBluetooth
-d / --device-nameNot usedBLE device name to connect to (must match flash-runtime)
Hardware libraries (GPIO, PWM, I2C)Not availableAvailable via packages
flash-runtimeNot supportedRequired for first-time setup

Choose ESP32 if you are building applications for real devices. Choose host if you want a no-hardware path for syntax checks, compiler behavior checks, or CI-like validation.