Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8615277
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T05:20:10+00:00 2026-06-12T05:20:10+00:00

I don’t understand how Lisp can be compiled and dynamic. For a language to

  • 0

I don’t understand how Lisp can be compiled and dynamic. For a language to be able to manipulate and modify and generate code, isn’t it a requirement to be interpreted? Is it possible for a language to be completely compiled and still be dynamic? Or am I missing something? What is Lisp doing that allows it to be both compiled and dynamic?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T05:20:12+00:00Added an answer on June 12, 2026 at 5:20 am

    Lisp is a wide family of language and implementations.

    Dynamic in the context of Lisp means that the code has a certain flexibility at runtime. It can be changed or replaced for example. This is not the same as dynamically typed.

    Compilation in Lisp

    Often Lisp implementations have a compiler available at runtime. When this compiler is incremental, it does not need whole programs, but can compile single Lisp forms. Then we say that the compiler supports incremental compilation.

    Note that most Lisp compilers are not Just In Time compilers. You as a programmer can invoke the compiler, for example in Common Lisp with the functions COMPILE and COMPILE-FILE. Then Lisp code gets compiled.

    Additionally most Lisp systems with both a compiler and an interpreter allow the execution of interpreted and compiled code to be freely mixed.

    In Common Lisp the compiler can also be instructed how dynamic the compiled code should be. A more advanced Lisp compiler like the compiler of SBCL (or many others) can then generate different code.

    Example

    (defun foo (a)
      (bar a 3))
    

    Above function foo calls the function bar.

    If we have a global function bar and redefine it, then we expect in Lisp usually that the new function bar will be called by foo. We don’t have to recompile foo.

    Let’s look at GNU CLISP. It compiles to byte code for a virtual machine. It’s not native machine code, but for our purpose here it is easier to read.

    CL-USER 1 > (defun foo (a)
                  (bar a 3))
    FOO
    
    CL-USER 2 > (compile 'foo)
    
    FOO
    NIL
    NIL
    
    [3]> (disassemble #'foo)
    
    Disassembly of function FOO
    (CONST 0) = 3
    (CONST 1) = BAR
    1 required argument
    0 optional arguments
    No rest parameter
    No keyword parameters
    4 byte-code instructions:
    0     (LOAD&PUSH 1)
    1     (CONST&PUSH 0)                      ; 3
    2     (CALL2 1)                           ; BAR
    4     (SKIP&RET 2)
    

    Runtime lookup

    So you see that the call to BARdoes a runtime lookup. It looks at the symbol BAR and then calls the symbol’s function. Thus the symbol table serves as a registry for global functions.

    This runtime lookup in combination with an incremental compiler – available at runtime – allows us to generate Lisp code, compile it, load it into the current Lisp system and have it modify the Lisp program piece by piece.

    This is done by using an indirection. At runtime the Lisp system looks up the current function named bar. But note, this has nothing to do with compilation or interpretation. If your compiler compiles foo and the generated code uses this mechanism, then it is dynamic. So you would have the lookup overhead both in the interpreted and the compiled code.

    Since the 70s the Lisp community put a lot of effort into making the semantics of compiler and interpreter as similar as possible.

    A language like Common Lisp also allows the compiler to make the compiled code less dynamic. For example by not looking up functions at run time for certain parts of the code.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Don't understand this simple code: def main(): print (This program illustrates a chaotic function)
Don't be scared of the extensive code. The problem is general. I just provided
I don't know why, but this code worked for me a month ago... maybe
don't know better title for this, but here's my code. I have class user
Don't ask why but I have the requirement to draw a border around certain
Don't know if anyone can help me with this or if it's even possible.
Don't be frightened, its a very basic code. Just wanted to check with you
Don't they both have to convert to machine code at some point to execute
Don't know why this doesn't work. I can't do implicit animation for a newly
Don't have much to say, just can get into the event handler. XAML: <Grid>

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.