New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

@bscript/lang

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@bscript/lang

## Requirement

Source
npmnpm
Version
1.1.5
Version published
Weekly downloads
5
400%
Maintainers
1
Weekly downloads
 
Created
Source

Run BlueScript on 64bit-Linux (or macOS) systems

Requirement

  • node.js

  • The cc command for compilation of C programs

Installation

Download BlueScript from GitHub:

git clone https://github.com/csg-tokyo/bluescript.git

and install it.

npm install

Move to the ./lang directory.

cd lang

Run the REPL

To run the REPL (Read-Eval-Print Loop) of BlueScript,

npm run shell

Built-in utility functions print(v: any), print_i32(v: integer), and performance_now() are available.

To close the shell,

> .quit

To read a source file and run its content,

> .load foo.bs

This reads foo.bs and runs the BlueScript program contained in that source file.

The source files can be given as command-line arguments.

npm run shell foo.bs bar.bs

This reads and runs foo.bs and bar.bs in this order when the REPL starts running.

Note that the REPL separately compiles every code fragment by users. It performs the reading, compiling, running, and printing loop. All the temporary files are stored in ./lang/temp-files.

Compile a BlueScript program

To compile a BlueScript program,

npm run compile foo.bs bar.bs

This compiles foo.bs and bar.bs and generates the native binary, which first runs foo.bs and then bar.bs. If a function called in foo.bs is defined in bar.bs, a compilation error will be reported.

The compiled programs can access the same built-in functions as the ones available in the REPL.

To give an optional argument to the backend C compiler,

npm run compile foo.bs bar.bs -- -args=-g,-o,foo

Arguments specified with -args= are passed directly to the C compiler. Commas within the argument string are automatically replaced with whitespace to separate individual compiler options. For example, the input -args=-g,-o,foo results in the compiler receiving the arguments -g -o foo.

Alternatively, use +args= without the -- separator.

npm run compile +args=-g,-o,foo foo.bs bar.bs

For debugging, pass the -g or +g option to the compiler. This prevents the compiler from removing working files such as generated source files in C.

npm run compile foo.bs bar.bs -- -g -args=-g,-o,foo

FAQs

Package last updated on 21 Dec 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts