Author Topic: Scripting in Javascript?  (Read 2213 times)

Offline michal

  • Commander
  • *****
  • Posts: 629
    • View Profile
Scripting in Javascript?
« on: December 09, 2014, 09:47:21 am »
Hello,

First of all i have to say that i hate javascript ;)

Anyway, if someone is so crazy to try it in OpenXcom, there is some new project to easily embedd javascript into any application. You just need to add two (yes, two!) files to project.

Quote from project readme:
Quote
Duktape is an embeddable Javascript engine, with a focus on portability and compact footprint.

Duktape is easy to integrate into a C/C++ project: add duktape.c and duktape.h to your build, and use the Duktape API to call Ecmascript functions from C code and vice versa.

Project is here:
https://duktape.org/
« Last Edit: December 13, 2014, 08:32:56 pm by michal »

Offline Jo5hua

  • Captain
  • ***
  • Posts: 78
  • ModSite
    • View Profile
Re: Scripting in Javascript?
« Reply #1 on: December 19, 2014, 12:15:51 am »
HMM! Very interesting. I'm a javascript master.. Wouldn't javascript libraries need to be created specifically to interface with openxcom components and files though? Integration starts with two files, but one would need to create the actual interface or API for openxcom and which ever aspects it would use. I'm just curious how this would work.