Open In App

Difference Between C Language and LISP Language

Improve
Improve
Like Article
Like
Save
Share
Report

C Language: C is the procedural Programming language. It was designed to be compiled using a compiler. The Language has small and fixed number of keywords like if/else, for, while,.. etc. We can use more than one assignment that may be used in one statement in this language. Functions are also used here, it can return values that can be ignored, when not needed. All data has a type but we can convert it implicitly.

 LISP Language: LISP is the second oldest high-level language. It is influenced by the notation of Alonzo Church’s lambda calculus Linked list is one of the most important data structure of this language. It was the first programming language where the structure of code is represented directly in the standard data structure. Lisp used the concept of automatic garbage collection.

Difference Between C Language and LISP Language

COMPARISON FACTORS C Language LISP Language
Paradigm C is a procedural programming language. LISP support both functional and Object Oriented Programming Language.
Approach C Program uses top-down approach. LISP Program uses bottom-up approach.
Function In C concept of virtual function is not present. LISP supports virtual function also known as generic function.
Extension C programs are saved in file with extension .c. LISP programs are saved with extension.lisp.
Types C is a middle level language. LISP is a high level language.
Object Oriented Features In C Polymorphism and Inheritance is not possible. In LISP, it supports both Polymorphism and Inheritance.
Applications  C is commonly used for systems programming, embedded systems, and low-level hardware programming,   Lisp is often used in artificial intelligence, symbolic computing, and language processing.
Memory Management  In C, the programmer is responsible for managing memory allocation and deallocation Lisp, memory management is handled automatically by the language’s garbage collector.

Let’s see the difference in the sytnax structure of C and Lisp:

The following code is in C language to print the sum of two numbers.

C




#include <stdio.h>
 
// main function declaration and definition
int main()
{
    int x = 10;
    int y = 5;
    int sum = x + y;
 
    printf("The sum of %d and %d is %d", x, y, sum);
 
    return 0;
}


Output

The sum of 10 and 5 is 15

The above code can be written in Lisp as shown:

Lisp




; similar code in lisp
(defun main ()
  (let ((x 10)
        (y 5))
    (print (+ x y))))
 
(main)


Output

15


Last Updated : 23 Dec, 2023
Like Article
Save Article
Previous
Next
Share your thoughts in the comments
Similar Reads