luau bindings for the Rust programming language

Overview

🌔 luau-rs

Luau bindings for the Rust programming language using bindgen

⚠️ Disclaimer

This does not provide bindings for everything as luau does not provide an adequate API for C bindings, which trips up bindgen & makes ffi exponentially more difficult (thanks to using C++'s std::string and whatnot). See luau/121. (It is also untested thanks to this..)

Usage

Add this to your Cargo.toml

[dependencies]
luau = { version = "0.1.0", package = "luau-src" }

Requirements

See the requirements for bindgen here

You might also like...
Lisp-style programming language

Bobbylisp A programming language, syntax are like mal and clojure. This project follow mal guides, Planning to add some more features after finishing

An interpreter for the esoteric programming language, Brainf*ck.

Brainf*ck Interpreter This is just a normal Brainf*ck interpreter written in Rust. If you don't know what Brainf*ck is, you can check out the wikipedi

Pua-lang - a dialect of The Monkey Programming Language

pua-lang PUA Programming Language written in Rust. What's pua-lang? pua-lang is a dialect of The Monkey Programming Language, intended to mirror the i

The Fluet programming language.

fluet Fluet is a scripting language. License Fluet is licensed under the Mozilla Public License, v. 2.0. Contributors may dual license their contribut

Ethereal - a general-purpose programming language that is designed to be fast and simple
Ethereal - a general-purpose programming language that is designed to be fast and simple

Ethereal is a general-purpose programming language that is designed to be fast and simple. Heavly inspired by Monkey and written in Rust

Dc improved: Feature-added rewrite of a 50+ year old RPN calculator/stack machine/programming language

dcim [WIP] dc improved: Feature-added rewrite of a 50+ year old RPN calculator/stack machine/programming language This readme is currently incomplete.

Squirt is a easy-to-use programming language.

Squirt is a easy-to-use programming language.

Osmon's compiler crate. Programming language made for starter & novice Uzbek audience.

Osmon Tili Osmon bu registrlarga asoslangan virtual mashinalik va yengil dasturlash tili Osmon boshqa o'zbek open source dasturchisi Sukhrob Khakimovn

Rust based WASM/JS bindings for ur-rust

ur-wasm-js WASM/JS bindings for the ur-rust rust library Getting started Installation Either build the library yourself with wasm-pack or install for

Comments
  • Usage from Safe Rust

    Usage from Safe Rust

    I noticed that you snagged a couple names on crates.io as well, so I came to take a look at what you were working on.

    I'm opening this issue to help track the addition of an API that can be used from Safe Rust. My crate has an example of what using Luau from Safe Rust might look like; it compiles and runs but that's about all the functionality that's implemented right now:

    use std::ffi::CStr;
    
    use luau::vm::{Luau, StackValue, Value};
    
    fn main() {
    	let vm = Luau::new().expect("failed to create Luau VM");
    	let compiled = Luau::compile("return ...")
    		.expect("failed to compile function");
    
    	let chunkname = CStr::from_bytes_with_nul(b"=basic_run.luau\0").expect("die");
    	let main_thread = vm.main_thread();
    	let function = main_thread.load_compiled(compiled, chunkname)
    		.expect("failed to load function");
    
    	println!("{:?}", function.call_sync([
    		Value::new_string(&main_thread, "hello world").unwrap(),
    		Value::new_string(&main_thread, "I like trains").unwrap(),
    		Value::new_string(&main_thread, "how about a table?").unwrap(),
    		Value::new_table(&main_thread, 0, 0).unwrap(),
    		Value::new_string(&main_thread, "I like trains").unwrap()
    	]));
    
    	// assert stack usage is balanced
    	assert_eq!(unsafe { StackValue::stack(main_thread.as_ptr()) }, Vec::new());
    }
    

    If you can manage to get autocxx to generate bindings to the high-level C++ magic like analysis and AST, your crate could pretty quickly speed ahead of mine in the compilation/analysis department, since I'm focusing on VM right now. Different versions of Luau can't be mixed in the same application (or else linking errors result), so I've just added a feature to my crate that allows users to disable compilation and linking to Luau so that people have the choice to use your crate as the compiler if they so choose.

    Good luck and may the best crate win! :)

    enhancement A-priority.medium 
    opened by LoganDark 3
  • Is this project still active?

    Is this project still active?

    Hello, I'm mlua author and currently working on adding Luau support to it. I see you registered a few crates on crates.io and curious do you have any plans to support the rluau in future? I'm asking because created a new dependency for mlua named luau-src, similar to lua-src and luajit-src that I maintain. But seems the name luau-src is already taken so if you don't have future plans for rluau, can I kindly ask to transfer ownership of luau-src to myself? Or I will register another name.

    PS I already added initial Luau support to the mlua on dev branch.

    opened by khvzak 2
  • Autocxx

    Autocxx

    Use autocxx. Library is in a usable state now. Would prefer to move most of these bindings to raw externs where possible like the lua* api so you don't need useless struct wrappers that autocxx forces

    enhancement 
    opened by Vurv78 0
Owner
Vurv
Ask me about Lua/Rust/Haxe
Vurv
Tyrade: a pure functional language for type-level programming in Rust

A pure functional language for type-level programming in Rust

Will Crichton 286 Jan 1, 2023
Czech for the Rust programming language

rez Nejsi you tired from writing Rust programs in English? Do you like saying do prdele or pivo a lot? Would you like to try something different, in a

Radek VĂ­t 13 Oct 9, 2022
The official home of the Nyson Programming Language, built off Rust.

Nyson Programming Language The official home of the Nyson Programming Language, built off Rust. (created by Nyelsonon and AMTitan, 2021) Advertisement

Nyson-Programing-Language 19 Aug 10, 2022
A simple programming language made for scripting inspired on rust and javascript.

FnXY Programming Language Quick move: CONTRIBUTING | LICENSE What? FnXY is a simple programming language made for scripting inspired on rust and javas

null 2 Nov 27, 2021
An OOP programming language I am making by following Crafting Interpreters.

horba An OOP programming language I am making by following Crafting Interpreters. https://craftinginterpreters.com/ I intend it to have a somewhat C-s

Thomas 3 Dec 5, 2021
Yet Another Programming Language

Yet Another Programming Language

null 4 Sep 15, 2021
The programming language for scalable development

Pen programming language Pen is the programming language that makes software development scalable, focusing on software maintainability and portabilit

Pen programming language 390 Dec 30, 2022
A newborn programming language for extensible software

A newborn programming language for extensible software.

Alexey Shmalko 17 Nov 29, 2022
A multithreaded programming language!

hydracane A multithreaded programming language! Getting started Coming Soon! Features: Multithreaded Platform independent Folders: src/vm: The Virtual

Krishna Ramasimha 0 Dec 10, 2021
CARBON is an interface-centric programming language named after the concept of an allotropy.

CARBON programming language Status: just an idea CARBON is an interface-centric programming language named after the concept of an allotropy. It is an

Tim McNamara 4 Aug 18, 2022