MAL - Créer un Lisp
(github.com)MAL est un interpréteur LISP inspiré de Clojure, implémenté séparément dans 79 langages de programmation.
Le même interpréteur ayant été implémenté dans plusieurs langages, il peut servir à apprendre un nouveau langage.
Le code est divisé en 11 étapes, et l’étape finale est l’auto-hébergement (une implémentation de MAL exécute à nouveau MAL).
1 commentaires
On peut l’utiliser directement dans l’implémentation MAL basée sur Javascript.
Mal Web REPL - https://kanaka.github.io/mal/
Explication étape par étape de l’implémentation
https://github.com/kanaka/mal/blob/master/process/guide.md
The Make-A-Lisp Process
Step 0: The REPL
Step 1: Read and Print
Step 2: Eval
Step 3: Environments
Step 4: If Fn Do
Step 5: Tail call optimization
Step 6: Files, Mutation, and Evil
Step 7: Quoting
Step 8: Macros
Step 9: Try
Step A: Metadata, Self-hosting and Interop