Sample module template for ThinBASIC module in Rust to enable the community to create safe, high-performance extensions for our precious interpreter.
The main goal is to provide example showing how to reach for thinCore functions and some really minimal examples of module function implementation.
The thinCore interface is work in progress and not yet complete.
You will need Rust and thinBasic Core SDK to compile the module and ThinBASIC to call it.
- Download and install the Build Tools for Visual Studio.
- Install Rust via Rustup. Please customize the installation to ensure 32 bit pipeline currently needed by ThinBASIC:
- Run the rustup-init.exe
- Press 2 to alter the default settings
- For Default host triple? enter i686-pc-windows-msvc
- For Default toolchain? enter stable
- For Modify PATH variable? enter y
- Proceed with installation with 1
Retrieving thinBasic Core SDK is as simple as cloning the thinBasic Core SDK. Once the API stabilises a bit, it will be available as crate from crates.io.
A bit more basic indeed. Just download the installer of the bleeding edge version.
- Checkout this repo and GOTO root directory (where this README is).
- Open console and run the
cargo build --releasecommand. thinbasic_rusty.dllwill appear intarget/release
- Copy the dll to thinBasic/Mod directory
- Run the script tests/test_module.tbasic.
I strongly recommend Sublime Text 3 for Rust editing. It is very elegant. Just boost it with rust-enhanced plugin.
For ThinBASIC, grab ThinAIR, which is part of the default installation. Made with love.