chicken-users
[Top][All Lists]
Advanced

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

Re: Trying to understand chicken limitations


From: John Cowan
Subject: Re: Trying to understand chicken limitations
Date: Mon, 23 Dec 2019 00:06:42 -0500



On Sun, Dec 22, 2019 at 7:55 PM Iain Duncan <address@hidden> wrote:

Regarding your comments about compiling, this is the area I got most confused about. 
- Assuming I have an embedded chicken REPL, does the code I send to the repl get compiled to C before it exectutes? Or can I embed an interpreter that is running chicken?

The REPL does not compile code.  The interpreter is available as the standard Scheme procedure eval.
There is also an egg (library) called compile-file, which invokes the Chicken and gcc/clang compilers to generate a shared library which can then be loaded into your program.  Of course that's slow.

- Am I correct in understanding from your explanation that I could have precompiled scheme functions and have dynamic scheme code (as in, sent to the process in real time from the user) evaluate and call those compiled functions for more performance?

Yes, definitely.
 
- Will it be possible to replace functions or other definitions on the fly?

Yes, you can do that.
 
I'm hoping to be able to achieve some sort of hot coding, where functions and definitions in my scheme environment may get overwritten by the user doing live coding.

That's practical. Eval maintains a global environment which can be changed by evaluating new definitions. 

Are there limitations on what kind of thing can be dynamically evaluated or can I evaluate anything, but with perhaps a performance penalty?

You can evaluate anything that doesn't need access to the foreign function interface. 



John Cowan          http://vrici.lojban.org/~cowan        address@hidden
To say that Bilbo's breath was taken away is no description at all.  There are
no words left to express his staggerment, since Men changed the language that
they learned of elves in the days when all the world was wonderful. --The Hobbit


reply via email to

[Prev in Thread] Current Thread [Next in Thread]