No I meant FFI, the thing that allows using C structs. If you use JIT alone, performance will be not quite as good - you'll have to use tables instead, and the abstraction level of those prevents deep optimization.
I did also mentioned hooking up compiled libraries, which is what you do if you're provided with one. But if you have to write them yourself then that defeats the purpose, doesn't it? You delegate the whole thing to a dll. What's the point of even using Lua then, if you're not actually using it?
Calling other languages from love2d?
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
Re: Calling other languages from love2d?
You mean JS surely. That doesn't count - people who write web apps simply have no other choice, on account of JS bring the single supported language.
-
- Citizen
- Posts: 87
- Joined: Tue Dec 30, 2014 6:07 pm
Re: Calling other languages from love2d?
Thanks for the help and for all the comments I guess.
I think I'm going to look into going Love2d/LuaJIT -> LuaJIT FFI -> C -> Haskell FFI -> Haskell if possible.
I imagine I should dive into using Haskell on its own first to actually learn it properly without being able to jump back to imperative code so it might be a while before I really get around to making a meaningful hybrid program, but I've got some ideas already.
I think I'm going to look into going Love2d/LuaJIT -> LuaJIT FFI -> C -> Haskell FFI -> Haskell if possible.
I imagine I should dive into using Haskell on its own first to actually learn it properly without being able to jump back to imperative code so it might be a while before I really get around to making a meaningful hybrid program, but I've got some ideas already.
Re: Calling other languages from love2d?
Keep in mind that language is a tool to achieve your goal, but not the goal itself. If you want to write a game in Haskell, consider using a Haskell game framework.
Re: Calling other languages from love2d?
Not only also ActionScript. There are tons of games written in Action Script sometimes converted into desktop games. And yes they had an choice but some started that stupid misery and many other jumped on. So it not every time best what is chosen by the masses.
Re: Calling other languages from love2d?
Kinda thought of it but being phased out, I omitted it. I suppose some methodology is to be addressed - if a separate framework used a language, that would count as a use instance, but not if a separete game made with that framework used its language. E.g. LOVE adds 1 point to the Lua use tally, but every LOVE game - doesn't. With that in mind, JS enjoys extremely narrow usage, with only a handful of runtimes supporting it altogether. Lua on the other hand is ubiquitous. World of Warcraft, Factorio, Roblox, you name it. Large array of non-games also use Lua for embedded scripting language, such as Rainmeter. These people had good reasons to choose Lua for scripting - can't be said for people who chose Javascript, let alone Action Script.
Re: Calling other languages from love2d?
Thanx men.. now got it.MasterLee wrote: ↑Fri Mar 24, 2017 9:11 amSource pleaseThere are many shortcomings in Lua http://nekovm.org/luaraidho36 wrote: ↑Fri Mar 24, 2017 4:45 am It's the fastest, most flexible, and easiest to integrate into parent program, which in context of the LOVE framework have already been done for you. Some functionality may be available as a dynamic link library (aka shared object) and LuaJIT had the FFI to load those.
BY the way hsLua is an Lua Interpreter written in Haskell. So you can use Lua in Haskell as an scripting language.
For other language for example Red the is no sense in embedding Red in any other language or embedding any other languages in Red. Because you can do both sides in Red.
Who is online
Users browsing this forum: Google [Bot], Majestic-12 [Bot] and 4 guests