hewih wrote:how is the code of the function stored (function-pointers in cons-cells or bytecode)? is it interpreted everytime i call it or compiled beforehand and how long does the compilation take?
That depends on the implementation. There are many implementations with different objectives. Of the open source ones, with which I am most familiar, SBCL compiles everything to native code all the time (there is an interpreter mode, but that is rarely useful), with good performance of resultant code, but the compilation itself is slow, CCL also compiles to native code, with somewhat less performant code, but faster compilation, CLISP uses bytecode (although it has JIT compiler now) and ECL compiles to C, and also uses bytecode for some things.
In general, if you are interested in what function is doing, you can always use
DISASSEMBLE, which is a defined by standard Common Lisp function which prints the function in more or less the form it is compiled to. On SBCL it will be assembler listing of the platform you are on.
hewih wrote:but is there some information and guidance about what will happen when i do some of this stuff, so i can get a feeling about the major does and don'ts and rethink my architecture early on?
I don't remember seeing anything which would spell that out, and it is probably not possible, since performance is always relative to bottlenecks. Experience is key, as is profiling. Well, and basic awareness of time complexity of algorithms, not specific to Lisp, these days there are more and more "programmers" who do not understand the difference between a vector and linked list...
Just keep writing code, and possibly read the source of some good existing libraries. Anything done by
Edi Weitz is usually presented as a good example. Especially
cl-ppcre, which is very interesting regular expression engine with performance comparable to that of Perl.
hewih wrote:when i create a lot of functions with higher-order function at runtime, what will happen?
This reminds of an
article. In general, firing up the entire compiler at runtime is neither necessary or a good idea, it is better to compile a restricted language, and it works equally well.