From: Daniel B. F. <fa...@ca...> - 2005-08-01 03:47:28
|
Hello, I've put up an early version of my Scheme scripting bindings for Chromium (chromium.sourceforge.net) at: http://www.cascv.brown.edu/~faken/sscriptedSPU-0.1a.tgz The included README follows. Comments, etc. are welcome (though I'll be on vacation until Aug 8th). cheers, Daniel Faken --------------------------------------------------------------------- | README for Scheme-Scripted SPU - A.K.A. sscriptedspu --------------------------------------------------------------------- Version: 0.1 (alpha) - July 31, 2005 This is a SPU (Stream-Processing Unit) for "Chromium" v1.8. More information on Chromium is at http://chromium.sourceforge.net. This SPU allows callbacks into Scheme, using the 'Chicken' scheme->C compiler. More information on Chicken is at http://www.call-with-current-continuation.org. ---------------- LICENSE ---------------- This is released under the Lesser GNU Public License. ----------------- INSTALLATION ----------------- Chromium 1.8 and Chicken 2.0 are required to build this. For Chicken, you should also have installed the 'debug' and 'opengl' eggs. Once you have built chromium, move this directory to the 'spu' subdirectory of the chromium distribution, and type 'make'. Then go into the 'scm_crif' ("scheme-chromium-interface") directory, make sure 'crhome' is a symlink to the top-level chromium directory, and run "chicken-setup chromium.setup". This should build and install the support libraries used by the 'sscriptedSPU'. To remove the temporary files afterwards, run "chicken-setup chromium.setup clean". To test, there is an example 'conf' file in the directory; run 'python sscripted.conf 10000 glxgears &' and then 'crappfaker'. This will (by default) run 'print.scm' which will print out all OpenGL commands. There is also a file 'sputest.scm' in the scm_crif directory which is the equivalent of cr/spu/tester/sputest.c (provided here as orig-sputest.c), but in Scheme. To run, execute 'csi sputest.scm' (with no mothership running). I have only tested this with gcc, on Linux so far (FC3 and Kanotix 2005). ----------------- USAGE ----------------- Documentation is lacking right now. Please consult the example scripts: motionblur.scm & print.scm - these are (fairly) equivalent to the SPUs of the same names that come with chromium. To execute code at startup, just set the 'startup_code' Chromium parameter for this SPU to your desired Scheme code. By default it is something like '(load "print.scm")'. You can set the environment variable SSCRIPTED_SPU_DEBUG_LEVEL to a positive number to enable some verbose debugging info. ('10' is the highest effective setting) There are several currently-not-full-functional pieces (which are not used in the examples), namely * this is designed to generate multiple, independent, simultaneously-functional scripted-spus. See sscriptedspu.c's use of sscriptedspu-template.c. Currently only one copy is created/available. * the [Get]ChromiumParameter*() API, which will allow access to the scripted-spu through the Chromium API. * This is set up to use the "##sys#call-host" (for lack of a better name) FFI discussed at http://lists.gnu.org/archive/html/chicken-users/2005-07/msg00074.html. There are some features supporting the original/official (as of Chicken 2.0) 'entry points' API, but they are not used. * I've tried to structure things to be easily switcheable to another scripting language (indeed, I had a functioning TCL interface) - only sscriptedspu.c (& the files it includes & files generating those) is Chicken/Scheme dependent. * a few other things scattered about. ---------------- ACKNOWLEDGEMENTS ---------------- Thanks to Felix Winkelmann, the creator of 'Chicken', for his helpfulness and responsiveness, as well as for Chicken itself. And, of course, thanks to the developers of Chromium. The code in sscripted/scm_crif/generate_glenum_strings.py is taken from the original "print SPU". ---------------- AUTHOR ---------------- Daniel B. Faken email: Daniel_Faken -at- brown.edu Some of this work was funded by grants from the U.S. Department of Energy. |