Book guide about C language and create own programming language Lisp.
"If you're looking to learn C, or you've ever wondered how to build your own programming language, this is the book for you.
In just a few lines of code, I'll teach you how to use C, and together, we'll start building your very own language.
Along the way we'll learn about the weird and wonderful nature of Lisps, how to develop a real-world project, concisely solve problems, and write beautiful code!
This book is free to read online, so you can get started right away! But for those who want to show their support, or who want the best reading experience, this book is also available for purchase in print format, or for cheap in all major e-book formats."
"Cookbook, n.
a book containing recipes and other information about the preparation and cooking of food.
A Cookbook is an invaluable resource, as it shows how to do various
things in a clear fashion without all the theoretical context. Sometimes
you just need to look things up. While cookbooks can never replace
proper documentation such as the HyperSpec or books such as Practical
Common Lisp, every language deserves a good cookbook, Common Lisp
included.
The CL Cookbook aims to tackle all sort of topics, for the beginner as for the more advanced developer."
Lisp é uma família linguagens de programação que se encaixa no paradigma funcional tendo surgido por volta da década de 50 com John McCarthy tendo padrão Common Lisp estabelecido na década de 80 e possuindo vários dialetos.
Uma possibilidade para rodar códigos em lisp, em particular o Common Lisp, é através do compilador de lisp SBCL ou com CLisp. Em ambientes Linux é possível usar o Emacs para editar os códigos lisp com SBCL e Slime. No Windows é possível usar a combinação Emacs, SBCL, Slime e Quicklisp através do Portacle.
Sintaxe
Uma das características comuns da linguagem Lisp é o uso de parênteses e o fato de operadores antecederem operandos em uma notação conhecida como prefixa.
Exemplo (no dialeto "common lisp") abaixo calcula o fatorial de um número $ n \in \mathbb{N} $definido como $ n! = n \times (n - 1) \times ( n - 2) \times \cdots \times 2 \times 1 $ com $ 0! = 1 $.
( defun fat ( n )(if(= n 1)1(*( fat (- n 1)) n )))
Deixo algumas dicas de sites sobre a linguagem Lisp como o site https://lisp-lang.org/ com referências sobre a linguagem.
Algumas implementações lisp:
Usuários Windows podem considerar usar o Portacle que combina o uso do EMacs, SLime, SBCL e Quicklisp (gestor de packages lisp) https://portacle.github.io/
GUI
Para criação de interfaces gráficas há possibilidade de usar a biblioteca IUP conforme pode ser visto neste link https://github.com/lispnik/iup.
Detalhes e explicações de implementação do interpretador de Lisp em Python com Ramalho, em uma Live para o canal do Eduardo Mendes (Dunossauro) abaixo.