For$
<!-- begin site header -->
<div id=

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Trigg

Pages: [1]
1
Plugins / Plugins & Multiple languages
« 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! ;) )

Pages: [1]