Thanks to visit codestin.com
Credit goes to lib.rs

7 releases (breaking)

0.7.0 Sep 11, 2025
0.6.0 Sep 11, 2025
0.5.0 Sep 11, 2025
0.4.0 Jan 8, 2025
0.1.0 Sep 18, 2024

#1111 in Parser implementations

Codestin Search App Codestin Search App Codestin Search App Codestin Search App Codestin Search App Codestin Search App Codestin Search App Codestin Search App

294 downloads per month
Used in 3 crates

Custom license and GPL-3.0 licenses

22KB
542 lines

Introduction

The bundcore Rust crate is a library that implements a basic API for multi-stack virtual machine functionality and the BUND concatenative programming language. This crate does not implement any VM or parser logic, but it provides a convenient interface for feeding source code to the parser and executing it on the VM.

Show me the code!

First, let's define a static string containing a classic HelloWorld program written in Bund language

const TEST2: &str = r#"
//
// This is BUND Hello World program
//
"Hello world!" println
"#;

Then, let's parse and run this code

let mut bc = Bund::new();
bc.eval(TEST2).expect("Fail to parse BUND program");

Both, parser and run-time error returned as one of the outcomes of this call. And output of this Bund::eval call is:

---- tests::test_parse_hello_world stdout ----
Hello world!

What is API ?

Function name Description
Bund::new() Create and initialize interface to Bund parser and VM
Bund::eval() Evaluate the code passed as string and return a reference to Bund object or Error
Bund::run() Evaluate the code passed as string and return ether value stored in Workbench or if Workbench is empty, stored on top of the stack
Bund::init_stdlib() Run standard library initialization routine

Dependencies

~26MB
~404K SLoC