Lua with Rust programming! Why and How!F
ull code example in 4 chapters: simple eval, scope, Rust calls a Lua function, and Lua calls a Rust function.
- 00:00 - c00 - Intro
- 00:36 - c01 - Cargo Toml & Setup
- 01:43 - c01 - First Lua exec & eval
- 05:03 - c02 - Scope - Globals
- 07:14 - c02 - Scope - set_environment
- 09:41 - c03 - call lua fn - why
- 11:27 - c03 - call lua fn - load Lua function
- 13:11 - c03 - call lua fn - calling
- 14:58 - c03 - call lua fn - with args
- 16:23 - c04 - Lua calls Rust Functions
- 21:52 Thanks
rust-xp-lua - GitHub Repo - https://github.com/jeremychone-channel/rust-xp-lua
*Why Lua?*
- Light - only ~300 KB when embedded.
- Simple - Thanks to the mlua crate (https://crates.io/crates/mlua), it's a blast to use in Rust programming.
- Efficient - Small Memory footprint, fast.
- Powerful - Supports multithreading, async, and ergonomic APIs for Rust integration.
- Designed for embeddability, making it efficient, simple, and battle-tested for scripting needs.
== Jeremy Chone:
- Discord general-rust - https://discord.gg/W2besKCzjx
- Discord rust10x - https://discord.gg/XuKWrNGKpC
- Twitter - https://twitter.com/jeremychone
https://britesnow.com - BriteSnow is my enterprise consulting company I have been running for 15 years. We help enterprises build and modernize next-gen applications. Feel free to send an email to [email protected] if you have any questions.
Big thanks to CrabNebula (https://crabnebula.dev/) for sponsoring this channel.
== Jeremy Chone Rust Video Playlists:
- JC - Rust - Everything Rust Programming - Tutorials, Courses, Tips, Examples: https://youtube.com/playlist?list=PL7r-PXl6ZPcCIOFaL7nVHXZvBmHNhrh_Q
- JC - Rust & AI Programming: https://www.youtube.com/playlist?list=PL7r-PXl6ZPcBcLsBdBABOFUuLziNyigqj
- JC - Software Engineering: https://www.youtube.com/playlist?list=PL7r-PXl6ZPcChyMZuJt1aqdvpqAEPLV9O
- JC - Rust Web App Production Coding Series: https://www.youtube.com/playlist?list=PL7r-PXl6ZPcCTTxjmsb9bFZB9i01fAtI7
- JC - Rust For Desktop App: https://youtube.com/playlist?list=PL7r-PXl6ZPcAQAi1lfVrtHCSbaJbwZ4O8
- JC - Rust Programming for Web Development: https://youtube.com/playlist?list=PL7r-PXl6ZPcCLvwpdD2Vj1O4CyoFTiHKd
- JC - Rust Courses: https://youtube.com/playlist?list=PL7r-PXl6ZPcB4jn1_VR3D8tSK9DxOaiQE
- JC - Rust for Java Developers: https://youtube.com/playlist?list=PL7r-PXl6ZPcD63DS2djSiz4SlXkaTfobc