# Using the Toolchain The ARK front-end tools use the command line interaction mode and convert JS code into ARK bytecodes that can run on ARK runtime. The toolchain supports Windows, Linux, and macOS. ## JS Bytecode Compiler Front-end tools, converting JS source code into ARK bytecode, can be built by specifying the `--build-target` with `ark_ts2abc`. Build tools: ``` $ $ ./build.sh --product-name rk3568 --build-target ark_ts2abc_build ``` Install `node` and `npm`, then use tools: ``` $ cd out/rk3568/clang_x64/arkcompiler/ets_frontend/build $ npm install $ node --expose-gc src/index.js [option] file.js ```

Option

Abbreviation

Description

Value Range

Default Value

--modules

-m

Compiles JS files based on the module.

-

-

--debug-log

-l

Enables the log function.

-

-

--dump-assembly

-a

Outputs a text ARK bytecode file.

-

-

--debug

-d

Provides debug information.

-

-

--show-statistics

-s

Displays statistics about bytecodes.

-

-

--output

-o

Specifies the path of the output file.

-

-

--timeout

-t

Specifies the timeout threshold.

-

-

--help

-h

Displays help information.

-

-

--bc-version

-v

Outputs the current bytecode version.

-

-

--bc-min-version

  

Outputs the lowest bytecode version supported.

-

-

## Assembler ark\_asm The ark\_asm assembler converts the text ARK bytecode file into a bytecode file in binary format. Command: ``` ark_asm [Option] Input file Output file ```

Option

Description

--dump-scopes

Saves the result to a JSON file to support the debug mode in Visual Studio Code.

--help

Displays help information.

--log-file

Specifies the log file output path after log printing is enabled.

--optimize

Enables compilation optimization.

--size-stat

Collects statistics on and prints ARK bytecode information after conversion.

--verbose

Enables log printing.

Input file: ARK bytecodes in text format Output file: ARK bytecodes in binary format ## Disassembler ark\_disasm The ark\_disasm disassembler converts binary ARK bytecodes into readable text ARK bytecodes. Command: ``` ark_disasm [Option] Input file Output file ```

Option

Description

--debug

Enables the function for printing debug information.

--debug-file

Specifies the path of the debug information output file. The default value is std::cout.

--help

Displays help information.

--verbose

Outputs the comments of the output file.

Input file: ARK bytecodes in binary format Output file: ARK bytecodes in text format