Skip to content

Basic (pun intended) example of interop between ThinBASIC and Rust via DLL.

License

Notifications You must be signed in to change notification settings

petrSchreiber/Calling-Rust-DLL-from-ThinBASIC

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Rust and ThinBASIC DLL interop

Basic (pun intended) example of interop between ThinBASIC and Rust via DLL to enable the community to create safe, high-performance extensions for our precious interpreter.

The main goal is to provide examples of passing of various ThinBASIC data types to and back from Rust.

Let's get started

You will need Rust, to compile the DLL and ThinBASIC to call it.

Installing Rust

  • 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

Installing ThinBASIC

A bit more basic indeed. Just download the installer of the bleeding edge version.

How to make the DLL?

  • Checkout this repo and GOTO root directory (where this README is).
  • Fire up a console and cast the spell cargo build --release.
  • You will hear a wolf howl and the DLL will appear in target/release

How to test the DLL?

Run the script test/test_lib.tbasic.

IDE recommendations

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.

About

Basic (pun intended) example of interop between ThinBASIC and Rust via DLL.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages