How to write a LISP interpreter for ActionScript 3?

I know that there is one, but it is not easy to implement the way I want.

I would like to know the steps for interpreting lisp and what functions are needed to implement it.

+4
source share
7 answers

You will learn Lisp first, then read LiSP and (if you know ActionScript well enough), you are just getting started. PAIP also contains sections on using Lisp interpreters and compilers.

To understand how you can get close to it, you can take a look at writing a chart for yourself after 48 hours . It uses Haskell as its implementation language, but it will give you an idea.

This, of course, would not be trivial, but it was done quite often, and much could be learned from it.

+10
source

danlei's recommendations are excellent. If you want to learn Lisp, PAIP is the best choice to start with, because it will teach you a lot about Common Lisp and a small fragment of the Schema.

However, my recommendation would be to start with the structure and interpretation of computer programs , which will teach you at least about Lisp as PAIP (you won’t learn so much about AI, though), has a longer and more complete section on how to write Lisp interpreters, and this is a terrific book. In addition, it is fully available online. I had to order both PAIP and Lisp by mail.

+2
source

Check out the book Essentials of Programming Languages ​​(also known as EoPL).

+1
source

You can check sporklisp (which is a variant of lisp written in vba) and works in excel.

https://github.com/spoonix/sporklisp

PS I also managed to send this message to MS Access without problems.

------ note from the author sporklisp -------

Many of the concepts came from lisp masters, particularly from the structure and interpretation of computer programs (SICP), Peter Norwig, excellent tutorials for LisPy and JScheme, and Christian Queinnec lisp in Small Pieces.

0
source

If you want to implement a basic lisp language of a higher level, you can get a run from the following chapters of The Little Schemer (which shows how to write a meta-circular evaluator in a Scheme), the completeness of WYAS48 (where it is shown how to implement R5RS in Haskell ), and these two Norvig articles (where it implements a basic lisp-like in Python).

0
source

I would recommend reading one of the famous dragon books . This largely explains the whole process of parsing, compiling, code generation, optimization, etc.

-2
source

If you need to ask, you cannot do this.

Implementing a programming language is a terribly complicated thing, even if you don't need to do it from scratch. And I don't think there will be many helper tools / libraries for ActionScript. In addition, LISP is a functional programming language that will require quite a few additional tricks in addition to the usual language implementation in order to get decent performance.

-9
source

Source: https://habr.com/ru/post/1304941/


All Articles