announce: ncurses bindings for v8

4 views
Skip to first unread message

Stephan Beal

unread,
Mar 2, 2009, 6:29:20 PM3/2/09
to v8-users
Hi, all!

The past two evenings i've made good progress on ncurses bindings for
v8. The sources are available here:

http://fossil.wanderinghorse.net/repos/v8-addons/

It's currently got 83 bound functions, but a lot of bindings haven't
yet been ported, so it's not all that terribly usable yet (e.g. you
can create all the windows you want, but can't add text to them just
yet). The original port (in SpiderMonkey/SpiderApe) wraps about 150
ncurses functions, so i've still got some work ahead of me (most copy/
paste/adjust-to-v8-api), but it shouldn't take more than a few more
days.

So, if you're into curses programming, you will soon be able to do it
in v8. And if you're into curses but haven't yet tried it in JS,
you're in for a treat. Writing curses apps in JS is several times
faster than writing them in C, and JS is a perfect glue for the event
model of curses, making it simple to attach arbitrary JS event
handlers to keys. That said, it's *still* curses, so one still has to
fight with it a bit sometimes ;).

Happy hacking!

Stephan Beal

unread,
Mar 3, 2009, 6:21:12 PM3/3/09
to v8-users
On Mar 3, 12:29 am, Stephan Beal <sgb...@googlemail.com> wrote:
> The past two evenings i've made good progress on ncurses bindings for
> v8. The sources are available here:
>
> http://fossil.wanderinghorse.net/repos/v8-addons/

The ncurses wrapper is now ready for use (see above link). It's got
126 bound functions, covering all of the most common ncurses
operations. Some stuff is still on the porting-todo list (e.g. the
ripoffline() API), and there's still lots of testing to do, but the
vast majority of the API is in place and "appears to work [for me [at
the moment]]".

Thanks again to those of you who have helped to answer my v8 questions
along the way!

Happy hacking!

Ondrej Zara

unread,
Mar 4, 2009, 2:31:01 AM3/4/09
to v8-u...@googlegroups.com
Hi Stephan,

thanks for this work, it is really beneficial to have more V8 bindings.

Have you ever thought about making these libraries available in an
object-oriented way? For instance, have a look at my MySQL
(http://code.google.com/p/v8cgi/wiki/API#MySQL_functions) or GD
(http://code.google.com/p/v8cgi/wiki/API_GD) bindings in v8cgi - these
basically define one or two JS "classes" (functions) and wrap relevant
functions as their methods.


Sincerely,
Ondrej Zara

Stephan Beal

unread,
Mar 4, 2009, 5:40:42 AM3/4/09
to v8-users
On Mar 4, 8:31 am, Ondrej Zara <ondrej.z...@gmail.com> wrote:
> Have you ever thought about making these libraries available in an
> object-oriented way? For instance, have a look at my MySQL
> (http://code.google.com/p/v8cgi/wiki/API#MySQL_functions) or GD
> (http://code.google.com/p/v8cgi/wiki/API_GD) bindings in v8cgi - these
> basically define one or two JS "classes" (functions) and wrap relevant
> functions as their methods.

Hi!

i have indeed thought about it, but these two particular bindings
won't be OO - doing a port of a C binding is much simpler (IMO), and i
needed a simple starting point (i just started programming for v8 last
Thursday or Friday, and wanted to learn the basics before i got into
wrapping native classes). As part of SpiderApe i originally wrote OO
bindings for ncurses and sqlite3, but wasn't happy with them. So i
went back and implemented the low-level wrappers, and THEN went back
and made OO wrappers on top of the bound low-level APIs. That's my
plan here, too - write another (OO) layer on top of the lower-level
API.


Reply all
Reply to author
Forward
0 new messages