Lisp, or formerly LISP, is not just a programming language but a family of programming languages, that’s right!
It’s a standard that there are several dialects, and it’s one of the oldest standards in the middle of “high-level programming languages”, it’s only 1 year younger than Fortran which is considered the oldest of all.
More precisely in 1958 Lisp was developed John McCarthy.
The name would be LISt Pprocessor, something like 😃 . Lisp pioneered many ideas that are widely used today, such as:
Although many think that Artificial Intelligence is something modern, at that time Lisp was the favorite for AI, research and data science, to this day it is still that way. Many.
Its syntax is considered a real bizarre, that is, everything, absolutely everything is enclosed in parentheses ( )
.
The most famous Lisp programming languages or dialects are:
And several others.
There are estimated to be over 30 Lisp dialects, the most famous and current being Clojure .
According to research by Stackoverflow Clojure is the programming language that offers the best salaries in the world!!!
The syntax is very simple and easy to learn and remember: there will always be parentheses!
If you wrote JavaScript in Lisp, an example code would look like this:
But there are many programmers in the world of Lisp, and they are totally used to it and form a large community compared to many other more famous programming languages today. And many companies out there are looking for Clojure and Lisp programmers in general.
Clojure was named the second most loved programming language among programmers in 2021, according to Stackoverflow .
Well, leaving the talk about Lisp aside, but still talking about Lisp… There is a minimalist version written in C++(that is, very easy to install , by the way, make it easy) which is Wisp .
It’s a personal project that implements Lisp in a very simple way and it might be your best alternative for entering the Lisp world, if you want to enter that world.
The cool thing about this dialect is for you who like C++ it has a well written code and ideal for those who want to create their own programming language in the future and understand concepts of: tokens, lexicography, parser and others.
The entire interpreter was written in a single wisp.cpp
file and this makes code analysis a lot easier and everything within it is well organized.
As I said, the installation is very simple, first just use Git to clone the project:
Now just have a compiler, preferably g++, enter the directory and compile with the command below.
Note, it only compiles on C++ 2003.
And to install on the system, copy it to a directory that is in your $PATH
, I always recommend /usr/local/bin
:
Wisp has no parameters for version and no help
, but we’ll see that using it is very simple!
I still don’t understand much about Lisp, but I intend to learn because I’m a fanatic about learning programming languages.
But the basics would be a Hello, World! of life and there are 3 ways to do that with Wisp:
For that use the -c
parameter and then the Lisp code in single quotes and logical in parentheses:
Create a file with .lisp
extension, example: nvim hello.lisp
and insert the content below:
And to run it use the -f
parameter of file:
If you just run the command wisp
you enter the subshell that runs commands Lisp, example:
Note that to exit is
(exit)
(in parentheses) and avoid using directional arrows(→ ↓ ←), it will interpret it literally, that is, it will appear:^[[A^[ [D^[[C
.
For more information, access the official repository and the examples directory, learning by examples is cool!