Fireship · @fireship

Lisp in 100 Seconds

Uploaded October 14, 2022 · Length 2:39

Lisp in 100 Seconds

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.

  1. 0:00

    lisp a dynamic general purpose

  2. 0:02

    programming language famous for

  3. 0:03

    pioneering many of the programming

  4. 0:05

    techniques we take for granted today it

  5. 0:07

    was created in 1958 by John McCarthy at

  6. 0:10

    MIT making it the second highlevel

  7. 0:12

    language ever after Fortran the year

  8. 0:14

    before however it was the first

  9. 0:15

    interpreted language that could be

  10. 0:17

    executed step by step without a compiler

  11. 0:19

    in addition it's responsible for a

  12. 0:20

    variety of other language Innovations

  13. 0:22

    like recursion Dynamic typing garbage

  14. 0:25

    collection first class functions and

  15. 0:27

    more its name stands for list processor

  16. 0:29

    and since tactically it's known for its

  17. 0:31

    prolific use of parentheses because at

  18. 0:33

    its core almost everything is treated as

  19. 0:35

    a linked list data structure each

  20. 0:37

    element in the list is called aons or

  21. 0:39

    Constructor which contains two pointers

  22. 0:41

    the car points to the actual data while

  23. 0:43

    the CDR points to the next element in

  24. 0:46

    the list developers write s Expressions

  25. 0:48

    which might start with a function or

  26. 0:49

    operator followed by one or more

  27. 0:51

    arguments this gives rise to a powerful

  28. 0:53

    macros feature where developers can

  29. 0:55

    extend the syntax of list and create

  30. 0:57

    domain specific languages it's like a

  31. 0:59

    programmable programming language common

  32. 1:01

    lisp is still in use today but it's

  33. 1:03

    directly inspired many other languages

  34. 1:05

    like scheme closure Ruby and JavaScript

  35. 1:07

    just to name a few to get started

  36. 1:09

    install common Lis on your machine then

  37. 1:11

    create a file ending in LSP first create

  38. 1:14

    an S expression which can represent an

  39. 1:16

    atom like a number or symbol or a list

  40. 1:18

    of multiple values to print to the

  41. 1:20

    standard output we can reference the

  42. 1:22

    format function followed by T for true

  43. 1:24

    then the string we want to print out and

  44. 1:26

    it contains a ton of built-in functions

  45. 1:28

    like print to simplify things Define a

  46. 1:30

    local variable with a let keyword and it

  47. 1:32

    will be lexically scoped to the context

  48. 1:33

    in which it's defined however you can

  49. 1:35

    also define global variables with def

  50. 1:37

    parameter or def VAR which are

  51. 1:39

    dynamically scoped and can be used

  52. 1:40

    anywhere all these variables can be

  53. 1:42

    modified however you can also create

  54. 1:44

    immutable data with def constant lisp is

  55. 1:46

    multi Paradigm but most wellknown as a

  56. 1:48

    functional language use the def unkey

  57. 1:50

    word which is definitely the way you

  58. 1:52

    pronounce it to define a function it can

  59. 1:54

    take one or more parameters and is

  60. 1:55

    optionally followed by a string to

  61. 1:57

    Define its purpose we can use the star

  62. 1:59

    operator to multiply Pi by the input