Writing modules in Rust?
Writing modules in Rust?
Is it possible to write modules like a mapgen or other Mods in Rust? What are the requirements?
- rubenwardy
- Moderator
- Posts: 6978
- Joined: Tue Jun 12, 2012 18:11
- GitHub: rubenwardy
- IRC: rubenwardy
- In-game: rubenwardy
- Location: Bristol, United Kingdom
- Contact:
Re: Writing modules in Rust?
You either need to:
Rewrite the lua api cpp code in src/scripting/ to support multiple languages including Rust
or
Run Rust binaries from Lua: https://github.com/tomaka/hlua#creating-a-lua-module
Rewrite the lua api cpp code in src/scripting/ to support multiple languages including Rust
or
Run Rust binaries from Lua: https://github.com/tomaka/hlua#creating-a-lua-module
Re: Writing modules in Rust?
That's if I want to write a mod. And I'm not sure if this works because it is for Lua 5.2. Nothing about luajit so farrubenwardy wrote:You either need to:
Rewrite the lua api cpp code in src/scripting/ to support multiple languages including Rust
or
Run Rust binaries from Lua: https://github.com/tomaka/hlua#creating-a-lua-module
But what if I want to write a native mapgen, e.g. by replacing the Boilerplate Code with Rust?
- rubenwardy
- Moderator
- Posts: 6978
- Joined: Tue Jun 12, 2012 18:11
- GitHub: rubenwardy
- IRC: rubenwardy
- In-game: rubenwardy
- Location: Bristol, United Kingdom
- Contact:
Re: Writing modules in Rust?
It's possible to call Rust from C: http://siciarz.net/24-days-of-rust-call ... languages/
Re: Writing modules in Rust?
Is the Boilerplate still valid code? Can't find any registerMapgen Function in the current dev
- kaadmy
- Member
- Posts: 706
- Joined: Thu Aug 27, 2015 23:07
- GitHub: kaadmy
- IRC: KaadmY
- In-game: KaadmY kaadmy NeD
Re: Writing modules in Rust?
Another language I've found recently is Wren (http://wren.io/). It's not as fast as Lua (without JIT), but it's simpler to use and has more refined syntax and layout that Lua/Rust IMO.
Re: Writing modules in Rust?
Wow. Wren looks like a cool language. The documentation doesn't seem finished, though. The section on the C API says "TODO", so I guess we're on our own there.
Do what you love, and you will love what you do! :)
- kaadmy
- Member
- Posts: 706
- Joined: Thu Aug 27, 2015 23:07
- GitHub: kaadmy
- IRC: KaadmY
- In-game: KaadmY kaadmy NeD
Re: Writing modules in Rust?
The header file for the C-side API is commented nicely, it includes enough information to use it.
- numzero
- New member
- Posts: 8
- Joined: Tue Apr 21, 2015 18:51
- GitHub: numberZero
- IRC: numzero
Who is online
Users browsing this forum: No registered users and 2 guests