4 points par xguru 2019-12-01 | 1 commentaires | Partager sur WhatsApp

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

 
xguru 2019-12-01

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