[texworks] Kroll from Scripting API
Paul A Norman
paul.a.norman at gmail.com
Tue Apr 27 02:11:17 CEST 2010
> >There is an interseting cross-platform, cross-language, cross-compile
>> opensource project I've bneen following a bit that has devised a means
>> together, quite facinating. You can actually mix language in scripts.
>> From: http://www.linuxjournal.com/article/10437 ...
>That is indeed fascinating - though I don't think something exactly like
>this will hit Tw anytime soon ;). If I understand the article correctly
>(I only browsed through it so far) they embed the code in other
>documents (html in this case). This means that they effectively have to
>parse their source for such code blocks and then distribute them to the
>different scripting interpreters. In our case, you'd still have separate
>files - although I would very much like the idea that different scripts
>can communicate with each other somehow.
Here is the site I was looking for, this will explain it all far
better than I have so far sorry:
"Kroll is a compact microkernel written in C++ for running pluggable
modules. Kroll supports a cross-language, cross-platform "binding"
and invocation framework which supports mixing and matching
code within the Kroll kernel. Yes, that means you can pass a
just that bad ass ... admit it.
"Currently, Kroll supports the following languages:
"However, any C/C++ exposed language which supports embedding most likely
can be supported with not much effort. These languages are on the
target list to be added soon:
- Lua (already in progress)
- Falcon (interest from Falcon community indicated)
- C# (maybe via Mono)
from a longer document at http://github.com/appcelerator/kroll
Some choice quotes:
" Languages are modules in Kroll and are first-class citizens in the
runtime environment. So, when using the runtime, you can pass objects
"The Kroll / Ruby Bridge
Kroll is the underlying object and communication system in Titanium.
It has its own object system, including its own spectrum of types.
data will be flowing through Kroll."
object in Ruby, that change will be reflected in the original object.
When dealing with objects that flow from one language context to
another, it suffices to think of them as the same object. "
converted using the same rules as normal variables when bubbling up
into different languages. This means that if an exception is thrown in
I think it is even possible to write dirctly in that 'script' Kroll.
More information about the texworks