Re: libseed-list questions about libseed and javascriptcore in general



Replies below (hopefully iPhone goes along with that, if not I apologize).

Tim Vera

On Aug 13, 2009, at 13:50, Christian Betz <christian betz gmail com> wrote:

Tim,

is that jstest.c something you found or something you (just) wrote?

I just wrote it in a few minutes to send to you, by quickly poking through the headers to remember function names.

if found, where did you find it?
if wrote, do you mind if I republish it (with small changes and attribution)?

You're welcome to do whatever you'd like with it :-)

I ask only because I plan on writing a series of articles discussing
available JS native APIs on Linux (jsc, spidermonkey, and v8).
Actually I think I want to include libseed too. I have always found
the lack of clear examples/tutorials on the subject troubling and want
to do something about it [seed not included].

The first part will be basically consist of a how-to guide for getting
all the libraries/headers setup followed by versions jstest.c using
all the APIs. The second part will show how to do more common things
like create singleton objects and native host object constructors (aka
classes). I also hope to go into a little more detail covering and
cover how the GC process works with native objects on different
engines.

This sounds like a great idea! There's a lot of documentation lacking around these things, so anything you can do is _awesome_! If you send us a link when you're done, I'm sure we could stick said link in various seed-related places, and it would be very helpful.

After that, I might be crazy enough to tackle the ambitious project of
making the libseed API work with jsc, spidermonkey, AND v8. I have
seen some postings on this topic and I agree it is a tricky task (with
V8 perhaps being the most tricky due to it's API being c++ based). If
you ask me, having a single native API that could used for extending
the js environment in ALL open source browsers would be the greatest
thing since sliced bread.

Ack! Hahaha that sounds like *quite* the project. Good luck, if you do get there :-)

But I am getting ahead of myself. Thanks again for your help. You'll
hear from me again ;)

Any time, and feel free to email us about any such things!

Christian

On Thu, Aug 13, 2009 at 11:01 AM, Timothy P. Horton<hortont424 gmail com > wrote:
On 2009.08.13, at 08:40, Christian Betz wrote:

You both just told me exactly what I wanted to hear!

Awesome :-)

BTW, I *was* trying to compile my hello world app without (lib) seed at
all. From what I can tell the jsc API is not very developer friendly
so I am definitely going to use libseed instead. I will checkout the
turtle example using libseed and keep you posted.

The JSCore API isn't *that* bad, it's just not very well documented nor highly used outside of WebKit. The attached file does basically what you
were asking for without Seed or GLib, but - especially in the type
conversion stuff - Seed is a good bit more friendly. Still, it can be done!

Thanks Again, and keep up the great work,

Christian





On Thu, Aug 13, 2009 at 12:37 AM, Robert Carr<racarr gnome org> wrote:

On Wed, Aug 12, 2009 at 10:42 PM, Christian
Betz<christian betz gmail com> wrote:

Hello.

I managed to build seed on ubuntu 9.04 without much trouble. I am
impressed and I have a very, very good feeling that seed will catch
on. So, what are the major issues remaining before I can begin hyping
this awesome technology? ;)

It really needs some testing for larger projects, so far all there is
is the few games in GNOME Games, and they really only test a few
things.

Some background -- I've been working with the spidermonkey API for
some time and was looking to dive into JavaScriptCore. The nice thing about spidermonkey is that there is a nice package available so that
getting started embedding is a breeze. I struggled for a while with
building trying to build a simple hello world type app using the jsc API, but failed (what I really wanted was a nice "-dev" type package
with shared library/header files for jsc). I had given up until I
found your project.

i read that the only dependencies are webkit and
gobject-introspection. does that mean that *in-theory* I can use
libseed without the higher level gtk/gnome levels of the stack? the
reason I ask is that I would like to use the libseed API on servers
and embedded systems without X. If the answer is no, then I have a
side question: what do you recommend as the path of least resistance towards using the javascriptcore api directly (without seed)? do you think there is ever a chance of getting just the engine/API split out of webkit as a separate package? is that something that people might
be receptive to?


My planned future structure for seed is something like this:

- Have seed-api.c, which has the friendlified/glibstyleified wrappers
around JSC functions. Still part of libseed.
- libseed will also contain a sort of "Seed core" which will contain
things like: the imports system, the JavaScript builtins, JavaScript
"classes" (a concept internal to the JSC C API), which various modules
use (such as, FFI structures, and GObject-introspection boxed types,
will both inherit from "seed_pointer" or whatever it's named).
- All the GObject introspection functionality will be moved in to a
module, this will not change code at all, because it will still exist
as the imports.gi object. At this point libseed will only depend on
WebKit and GLib.
- There will be a sort of cohesive set of "standard modules" which
cover things that GI doesn't, most of these will depend on GLib (and
any library they happen to wrap). This includes things like the FFI
module, the os module, readline module, or sqlite module.
- Probably a large number of other modules built on top of things like
FFI or GI in JS, to provide convenient bindings.

in other words, this is all I want to do right now:
write some C code defines a print() function in the global context and then evaluate "print('hello world')". I *can* get this to work using
the PPA packages you guys provide -- but it segfaults when i call
JSGarbageCollect at the end :(

Christian

The C extension modules (in modules/ folder of source), are probably
the best examples of the C API, just imagine if you were calling the
"seed_module_init" function from your main.


Robb,

_______________________________________________
libseed-list mailing list
libseed-list gnome org
http://mail.gnome.org/mailman/listinfo/libseed-list





--
"I'd rather have a bottle in front of me, than a frontal lobotomy." --
Dorothy Parker
_______________________________________________
libseed-list mailing list
libseed-list gnome org
http://mail.gnome.org/mailman/listinfo/libseed-list






--
"I'd rather have a bottle in front of me, than a frontal lobotomy." --
Dorothy Parker


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]