Crossfire Archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
FW: CF: Newbie hints
Whoops, sent this to the author instead of the mailing list. My fault
-- I used a nasty so-called email client.
> -----Original Message-----
> From: Scott MacFiggen [SMTP:smurf@csua.berkeley.edu]
> Subject: Re: CF: Newbie hints
>
> >> This reminds me... A friend of mine at LucasArts clued me into
> >> a decent embeddable scripting language called Lua. I remember
> >> some discussion a while ago about a possible scripting language
> >> for crossfire so if anyone is interested:
>
> >> http://www.tecgraf.puc-rio.br/lua/
>
> > Is there a reason why lua is cooler/better than one of the other
> >choices? AFAIK, most of the others are better supported, and some
> are
> >smaller or can be stripped down to be smaller (not that it matters).
>
> I'm assuming because it is very small, and designed from
> the beginning to be embedded. It just compiles as a
> library you link with your program..
>
> Python is cool but I don't see it being embedded so easily
> into crossfire.. Assuming someone wanted to do it.
>
> Well, that's all Python is... It's a set of libraries. You link them
> together with GNU Readline and and main.c provided with the Python
> distribution (and a few other things, supposing that you want to be
> able to load DLLs or do other things), and you get a simple but
> powerful general-purpose script interpreter.
>
> Or instead, you could write a C-like header file (described at
> www.swig.org) and run it through SWIG, and compile the libraries with
> your application. The result is a scriptable application, with Python
> functions named the same as the C functions.
>
> The process without SWIG is a little more complicated, but there's no
> reason to do that, since it involves little more than writing CPython
> wrappers for your functions. Unless you want to get fancy and make
> your datatypes imitate Python classes (thus allowing them to be
> subclassed) rather than Python types -- but even then I'd start with
> SWIG and just modify the generated code.
>
> This is actually how all of Python is written -- they first write each
> module in Python itself, then if it's important enough they rewrite it
> in C as an extension and link it in.
>
> Or you could write JPython wrappers instead, if you were working on
> the Java CF client -- there's a version of Python written in Java,
> too. Nearly 100% compatible, but with Java GC instead of reference
> counting (which is the source of most of the incompatibilities).
>
> -Scott
>
> -Billy
>
-
[you can put yourself on the announcement list only or unsubscribe altogether
by sending an email stating your wishes to crossfire-request@ifi.uio.no]