Poll: Do you want to have ability to write plugins in C++ or another language?
You do not have permission to vote in this poll.
Yes
11.11%
1 11.11%
No ( post why not , if you can )
88.89%
8 88.89%
Total 9 vote(s) 100%
* You voted for this item. [Show Results]

Another plugin language - beacos LUA is hard for some ppl
#1
Hello evryone, i'm minigame server owner and i want to make my minigames with something else that Java. I'm not that good at LUA, i was trying one time - and i didnt like it / got it. I'm liking a lot more C++ or Java.

Also, what i'm not liking in java at all that is its memory usage - for server with 4 ppl online it takes 512 mb. A lot of it is core memory usage. So for small server ( like minigames ... ) java isnt perfect. Yes, you could do arena based plugins - but that is harder to mantain beacos Bukkit, and other cores arent multithreaded. Oh btw, we arent speaking about other servers ... Lets get to main topic of this thread.

So , what i wanted to say - i want to make minigames more efficiently. Server uses 71 mb vs 500 mb of java's impls. That is what i want, but how i sad - i dont know LUA.

So question is - why you cant add support for C++ plugins ? Yes, its harder to make them multiplatform. But you can - just same as Java. Have multiple libs for diffrent OS version. Also "deny" any system calls ( you can't do that good, but ... What we can do ? ). And that would be plugin author problem - not yours.

Second solution is to take compiler with you, and build plugins on go. That is a litle bit dummy idea beacos all C++ plugins will be OpenSource ( but all LUA plugins alredy OS, arent they ? ).

Maybe there are more solutions , that i'm not aware of. Also i can help with making C++ plugin api and stuff like that if you want. If i did miss something then correct me if you can.

Also sorry for my for my bad english - its isnt my native language.
Reply
Thanks given by:
#2
The problem is a c++ plugin API is complicated to create. The big problem is dynamic loading and registration. Every platform has its own dynamic loading API, and c++ has no built in way of doing it. And that's before you get into c++ linking issues. (It would be easier to create a c API, but that still has issues with cross platform API's). As for bringing a c++ compiler, that's just as complicated, as licensing issues would basically make it impossible to build the official builds with visual studio, a major problem for this project.

Writing a c++ API would either be as hard/harder to maintain as the lua one, and previous experience of this project has been that maintaining multiple languages is not worth the effort. There's almost never enough of a benefit.
Reply
Thanks given by:
#3
There is MinGW for compiler. And for sending information to dll - you need only one function that could be C style. You can send pointers to functions throught C functions.

And also, thread is about implementing other that LUA languages. JS is ok too. Or python ... Or something else, beside LUA.
Reply
Thanks given by:
#4
Does MinGW have a compatible c++ ABI with MSVC? If not then you can't send c++ function pointers. And Data is much more of a problem.
Reply
Thanks given by:
#5
I didn't test, but this page sad what it can work. I didn't test MinGW and MSVC, so i dont know. But really , luas "idea" around table as OOP structure is stupid for me. OOP is diffrent from table for me. Also OOP has private / protected stuff - idk if is there something like that in LUA ( i didnt info about it ).

So, if no one wants C++ as plugin language - is there any other good alternatives ?
Reply
Thanks given by:
#6
Also MinGW weighs in at a couple of MB, which is the same as MCServer. So including a compiler would double the size of the project binaries.

As for the others, most major JS engines are huge, and frankly I don't see a convincing arguments over lua.
Python is a mess for embedding, with the GIL in CPython being a major sticking point.

This has been discussed before: forum.mc-server.org/showthread.php?tid=1632.
Reply
Thanks given by:
#7
We talked about AngelScript, but didn't continue due to the lack of documentation and will to create the API for it.
Reply
Thanks given by:
#8
  • Lua is lightweight, and it has tiny interpreter compared to others.
  • Lua is built exactly for this task - extending C/C++ apps, it's the most used scripting language for games, it's the right tool for the job and is the de-facto standard for the job.
  • The question should be the other way around: why not Lua? If your only argument is "because I don't know Lua", I don't think anyone will be convinced.
Reply
Thanks given by: NiLSPACE
#9
It doesn't help that the vast majority of major programming languages have runtimes larger than the MCServer project.
Reply
Thanks given by:
#10
Why not lua:
1. It doesnt have "right" OOP with protected and private variables. You can only make local variable, or named protected variable. Isnt problem for plugins , its more for API with other plugins ( if there would be something like that ? )
2. LUA is fast, but i saw page with performance comparisons and lua wasnt best in speed.
3. Beacos i want low memory usage, almost any scripting language wont be that good.

Its really isnt that big problems, but for me they are. Even not first problem ( i can learn new languages, that isnt a problem ) - but 2 second ones are. Again , not big problem for some one - but its big for me. If you dont wont implement C++ plugins - i can implement by myself beacos MCServer is open sourceTongue
Reply
Thanks given by:




Users browsing this thread: 1 Guest(s)