[q-lang-users] Re: Some questions about Q
Brought to you by:
agraef
From: Albert G. <ag...@mu...> - 2004-01-07 15:09:31
|
Hi, Daniel, (I hope you don't mind that I'm cc'ing this to the new q-lang-users list, see http://lists.sourceforge.net/lists/listinfo/q-lang-users, as your questions might be relevant to other users.) > -does (or can) Q remember past evaluations to speed > up future evaluations. For instance, if I ask Q to rewrite ' f(a, b) ', > and then I ask Q to rewrite ' f(c, f(a, b)) ', will it remember that > it had already rewritten ' f(a, b) '? The interpreter doesn't do this automatically, but it's easy to implement it yourself. For an example, please take a look at the "hashed fib function" in the section on expression references in the Clib chapter of the manual. The 'hashed' function in that example is fairly generic and should be applicable to your problem, too. > -can Q be integrated into a C/C++ project. A large part > of my compiler would be writtin in C++. Can Q be linked > directly into a C++ program? Is there an C->Q API > (so I don't mean using C functions from Q, as documented > in appendix C of the Q programming manual, but rather using > Q functions from C). Not in a direct manner, at present. But it's one of the next things on my TODO list, as several ppl have already requested just that, and now I also need it myself, in order to implement a Q module for the Apache web server. > -would it be possible to write a Q -> C translator. So give > a set of .q files, 'compile' them into C? That's a big project. ;-) I've considered it, but it's hard to do this right. At the moment I'm just too busy with the Q library and other stuff to embark on this. So, if you really need a compiled functional language then I'm afraid I must direct you to the competition for now. ;-) Probably Ocaml would be your best bet (www.ocaml.org). Cheers, Albert -- Dr. Albert Gr"af Dept. of Music-Informatics Johannes Gutenberg-University Mainz, 55099 Mainz, Germany Phone: +49 6131 39-25142, Fax: -24717 Email: ag...@mu..., Dr....@t-... WWW: http://www.musikwissenschaft.uni-mainz.de/~ag |