Fork me on GitHub
  May 20, 2018, 05:23:57 pm
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: Plugins & Multiple languages  (Read 3057 times)
Trigg
Newbie
*
Posts: 1


View Profile
« on: January 05, 2011, 04:02:23 pm »

Wall Of Text Warning

I'm currently editing a fork of Mineserver which is aimed at allowing Python to be embedded and used as plugins.

I've come to a point where I want to ask the community and devs how they would like to see this implemented, Here are the options I appear to have so far:

Option 1 - Each language wrapper as a seperate plugin

[MineServer(C++)] -> [Wrapper Plugin(C++)] -> [Script(Other language)]

This method will separate out the scripted language into another plugin. This other plugin will be required to load ALL the python scripts the user wants to run, because we currently cannot pass information to plugins at load time to tell it which ONE python script to load.

Advantages:
Python (And other languages that are made in this manner) are not a build requirement of the server itself, Less bloat and overhead for Admin who will not want Python plugins

Disadvantage:
No Transparency, The Admin needs to be aware if a script is a python one and load it differently
Higher learning bar for new Admin who will likely just want a simple language to code in
Possibility of two differently maintained plugins for the same language, causing inconsistent APIs and other problems

Option 2 - Compile each language into the server

[MineServer(C++)]->[Script(Other language)]

This method will separate Scripts/Libraries transparently, If a Python script is loaded, the boilerplate loading code for python is used, if a Lib(dll/so) is passed, the code for Libraries is used.

Advantages:

Admin need not know what language a plugin is written in
Admin can just write a script in their favorite language and go, no further thought required

Disadvantages:

The Server will gain embedding support for Python, Perl, Lua and other languages, and all will be compiled into it... This will bloat the server size, and probably add overhead
Building the server code will require extra libraries for each language added (although we could probably only compile languages into it based on what libs are available at compile time)

Option 3- Hybrid option

[MineServer(C++)] -> [Wrapper Plugin(C++)] -> [Script(Other language)]

(This looks just like Option 1!!!!!111one)
This one will work similar to Option 2, internally to the server, when passed a script file it will load the related Wrapper Plugin, pass it the name of the script, and allow the Wrapper plugin to interact as necessary on behalf of the script

Advantages:

A single, consistent API for the language
Can be maintained in-tree
Will never be loaded if the Admin does not have a script in that language

Disadvantages:

Currently plugins do not allow you to pass them information on loading - This can be patched by myself but it will change the way other plugins work (Better to break them now rather than later! Wink )
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.21 | SMF © 2015, Simple Machines Valid XHTML 1.0! Valid CSS!