Fireship · @fireship
Lisp in 100 Seconds
Uploaded October 14, 2022 · Length 2:39
Summary
Lisp explained in 100 seconds, its history, features and basic syntax.
- lisp programming language
- functional programming
- dynamic typing
- garbage collection
Transcript preview
The first 2 minutes of the transcript. Select a timestamp to watch that moment on YouTube.
- 0:00
lisp a dynamic general purpose
- 0:02
programming language famous for
- 0:03
pioneering many of the programming
- 0:05
techniques we take for granted today it
- 0:07
was created in 1958 by John McCarthy at
- 0:10
MIT making it the second highlevel
- 0:12
language ever after Fortran the year
- 0:14
before however it was the first
- 0:15
interpreted language that could be
- 0:17
executed step by step without a compiler
- 0:19
in addition it's responsible for a
- 0:20
variety of other language Innovations
- 0:22
like recursion Dynamic typing garbage
- 0:25
collection first class functions and
- 0:27
more its name stands for list processor
- 0:29
and since tactically it's known for its
- 0:31
prolific use of parentheses because at
- 0:33
its core almost everything is treated as
- 0:35
a linked list data structure each
- 0:37
element in the list is called aons or
- 0:39
Constructor which contains two pointers
- 0:41
the car points to the actual data while
- 0:43
the CDR points to the next element in
- 0:46
the list developers write s Expressions
- 0:48
which might start with a function or
- 0:49
operator followed by one or more
- 0:51
arguments this gives rise to a powerful
- 0:53
macros feature where developers can
- 0:55
extend the syntax of list and create
- 0:57
domain specific languages it's like a
- 0:59
programmable programming language common
- 1:01
lisp is still in use today but it's
- 1:03
directly inspired many other languages
- 1:05
like scheme closure Ruby and JavaScript
- 1:07
just to name a few to get started
- 1:09
install common Lis on your machine then
- 1:11
create a file ending in LSP first create
- 1:14
an S expression which can represent an
- 1:16
atom like a number or symbol or a list
- 1:18
of multiple values to print to the
- 1:20
standard output we can reference the
- 1:22
format function followed by T for true
- 1:24
then the string we want to print out and
- 1:26
it contains a ton of built-in functions
- 1:28
like print to simplify things Define a
- 1:30
local variable with a let keyword and it
- 1:32
will be lexically scoped to the context
- 1:33
in which it's defined however you can
- 1:35
also define global variables with def
- 1:37
parameter or def VAR which are
- 1:39
dynamically scoped and can be used
- 1:40
anywhere all these variables can be
- 1:42
modified however you can also create
- 1:44
immutable data with def constant lisp is
- 1:46
multi Paradigm but most wellknown as a
- 1:48
functional language use the def unkey
- 1:50
word which is definitely the way you
- 1:52
pronounce it to define a function it can
- 1:54
take one or more parameters and is
- 1:55
optionally followed by a string to
- 1:57
Define its purpose we can use the star
- 1:59
operator to multiply Pi by the input


