Menu

PodballScripting

Lars Ruoff

Scripting

This page is about using scripting technologies to provide the Pod control functions instead of native DLLs.

Advantages of scripting:

  • Scripts are platform independent by nature.
  • Scripts can be run in a sandbox, thus malicious or bugged scripts can do less harm to the host system.
  • Easier and faster development. Thus more developers to develop in scripting languages?

Disadvantages of scripting:

  • By default, a script is plain text. Since this is a programming contest, we need to find a way of hiding the code between different developers. Otherwise cheating would be too easy.

Candidates

See also Comparison of embeddable scripting languages.

List of scripting language candidates.

Common requirements:

  • Must be embeddable in C/C++.
  • Several instances of the same script must be able to run at once. Requires a mechanism to switch contexts.
  • It should be possible to run the script in a sandbox environment, with only minimum library support.
  • There must be a mechanism to compile or obfuscate scripts so they're don't need to be distributed in plain text.

Javascript

To be embedded via the Google V8 Javascript engine:

See also:

Meets requirements?

  • Embeddable: OK.
  • Context management: OK.
  • Sandbox?
  • Distribution?

Lua

Meets requirements?

  • Embeddable: OK.
  • Context management: OK. Different independent Lua states can be instantiated with lua_State *L = lua_open();
  • Sandbox: OK. Open all or only part of the standard libs.

(see also ​http://stackoverflow.com/questions/966162/best-way-to-omit-lua-standard-libraries)

  • Distribution: OK. Lua scripts can be compiled to byte code.

Update 2018-03-15: As of version 2.2, Lua has been fully imtegrated as a scripting language!

Python

Meets requirements?

  • Embeddable: OK.
  • Context management? To check. Different "Threads" can be craeted for Python interpreter.
  • Sandbox?
  • Distribution? Python scripts can be compiled.

Last modified 4 years ago Last modified on 07/23/10 15:24:04


Related

Wiki: Home

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.