All Projects → veelenga → lua.cr

veelenga / lua.cr

Licence: MIT license
Crystal to Lua bridge

Programming Languages

crystal
512 projects

Labels

Projects that are alternatives of or similar to lua.cr

samp-rs
SA:MP SDK written in Rust
Stars: ✭ 36 (-35.71%)
Mutual labels:  bindings
popsicle
Popsicle aims to bridge the JUCE c++ framework to python.
Stars: ✭ 102 (+82.14%)
Mutual labels:  bindings
Hotkeys
🔤 A small C# (.NET) Library which allows binding of global HotKeys to any Application's Windows (including Windows Apps such as explorer.exe), even in Background. (using P/Invokes)
Stars: ✭ 66 (+17.86%)
Mutual labels:  bindings
hoedown
rust bindings for hoedown
Stars: ✭ 16 (-71.43%)
Mutual labels:  bindings
gfort2py
Library to allow calling fortran code from python
Stars: ✭ 60 (+7.14%)
Mutual labels:  bindings
ocaml-tracy
Bindings to the Tracy profiler
Stars: ✭ 21 (-62.5%)
Mutual labels:  bindings
Python Mpv
Python interface to the awesome mpv media player
Stars: ✭ 245 (+337.5%)
Mutual labels:  bindings
redux-polyglot
Polyglot.js bindings for Redux
Stars: ✭ 59 (+5.36%)
Mutual labels:  bindings
htaglib
Haskell bindings for TagLib, an audio meta-data library
Stars: ✭ 20 (-64.29%)
Mutual labels:  bindings
jquery-bindings
Simple two-way data binding using proxies and requestIdleCallback
Stars: ✭ 17 (-69.64%)
Mutual labels:  bindings
swift-tree-sitter
Swift bindings for the tree-sitter parsing library
Stars: ✭ 29 (-48.21%)
Mutual labels:  bindings
DotNetJS
Consume C# in JavaScript with comfort: single-file UMD library, auto-generated 2-way bindings and type definitions
Stars: ✭ 551 (+883.93%)
Mutual labels:  bindings
imgui
ImGui bindings for Nim via cimgui
Stars: ✭ 117 (+108.93%)
Mutual labels:  bindings
mapbox-ios-binding
Xamarin binding library for Mapbox iOS SDK
Stars: ✭ 15 (-73.21%)
Mutual labels:  bindings
input.rs
libinput bindings for rust
Stars: ✭ 58 (+3.57%)
Mutual labels:  bindings
RubyGateway
Embed Ruby in Swift: load Gems, run scripts, call APIs seamlessly in both directions.
Stars: ✭ 108 (+92.86%)
Mutual labels:  bindings
rsmpeg
A Rust crate that exposes FFmpeg's power as much as possible.
Stars: ✭ 390 (+596.43%)
Mutual labels:  bindings
crystal-chipmunk
Crystal bindings to Chipmunk, a fast and lightweight 2D game physics library
Stars: ✭ 38 (-32.14%)
Mutual labels:  bindings
laravel-auto-binder
Bind interfaces to concrete classes automatically
Stars: ✭ 67 (+19.64%)
Mutual labels:  bindings
cl-wlroots
Common lisp bindings for wlroots, a library for writing Wayland compositors
Stars: ✭ 32 (-42.86%)
Mutual labels:  bindings

lua.cr Build Status

Bindings to liblua and a wrapper around it. UNDER CONSTRUCTION 🚧

Only Lua 5.4 or higher is supported.

Installation

Add this to your application's shard.yml:

dependencies:
  lua:
    github: veelenga/lua.cr

Usage

First you need to require Lua:

require "lua"

Then you can run a chunk of Lua code:

Lua.run %q{
  local hello_message = table.concat({ 'Hello', 'from', 'Lua!' }, ' ')
  print(hello_message)
} # => prints 'Hello from Lua!'

Or run a Lua file and obtain results:

p Lua.run File.new("./examples/sample.lua") # => 42.0

Or even evaluate a function and pass arguments in:

lua = Lua.load
sum = lua.run %q{
  function sum(x, y)
    return x + y
  end

  return sum
}
p sum.as(Lua::Function).call(3.2, 1) # => 4.2
lua.close

More features coming soon. Try it, that's fun :)

Contributing

  1. Fork it https://github.com/veelenga/lua.cr/fork
  2. Create a feature branch git checkout -b my-new-feature and implement your feature
  3. Run tests crystal spec and format code crystal tool format
  4. Commit your changes git commit -am 'Add some feature'
  5. Push to the branch git push origin my-new-feature
  6. Create a new Pull Request
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].