"Lisp可以自己编写"是什么意思? [英] What does it mean that "Lisp can be written in itself?"

查看:91
本文介绍了"Lisp可以自己编写"是什么意思?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Paul Graham写道"Lisp的不寻常之处-实际上,是Lisp的定义质量-是它可以自己编写." 但这对我来说似乎并不稀奇或确定.

Paul Graham wrote that "The unusual thing about Lisp-- in fact, the defining quality of Lisp-- is that it can be written in itself." But that doesn't seem the least bit unusual or definitive to me.

ISTM认为编程语言由两方面定义:它的编译器或解释器通过法定命令定义该语言的语法和语义,以及它的标准库在很大程度上定义了熟练用户的习惯用法和技术.用该语言编写代码时将使用.

ISTM that a programming language is defined by two things: Its compiler or interpreter, which defines the syntax and the semantics for the language by fiat, and its standard library, which defines to a large degree the idioms and techniques that skilled users will use when writing code in the language.

除了一些特定的例外(例如,.NET家族的非C#成员),大多数语言的标准库都是用该语言编写的,这有两个很好的理由:因为它将共享同一套语法定义,函数调用约定以及该语言的一般外观",并且因为有可能为编程语言编写标准库的人是其用户,尤其是其设计人员.因此,那里没有什么独特的东西.这是很标准的.

With a few specific exceptions, (the non-C# members of the .NET family, for example,) most languages' standard libraries are written in that language for two very good reasons: because it will share the same set of syntactical definitions, function calling conventions, and the general "look and feel" of the language, and because the people who are likely to write a standard library for a programming language are its users, and particularly its designer(s). So there's nothing unique there; that's pretty standard.

同样,语言的编译器本身没有什么独特或不同寻常的地方. C编译器是用C编写的.Pascal编译器是用Pascal编写的. Mono的C#编译器是用C#编写的.哎呀,甚至某些脚本语言都具有自身编写"的实现.

And again, there's nothing unique or unusual about a language's compiler being written in itself. C compilers are written in C. Pascal compilers are written in Pascal. Mono's C# compiler is written in C#. Heck, even some scripting languages have implementations "written in itself".

那么Lisp本身就是不寻常的写意?

So what does it mean that Lisp is unusual in being written in itself?

推荐答案

Paul可能的意思是Lisp 语法作为Lisp 的表示形式是标准化且普遍的.也就是说,Lisp程序只是一种特殊的S表达式,编写处理Lisp代码的Lisp代码异常容易.用Lisp编写Lisp解释器是一个特例,并不像具有对代码和数据进行统一表示的一般能力那样令人兴奋.

Probably what Paul means is that the representation of Lisp syntax as a Lisp value is standardized and pervasive. That is, a Lisp program is just a special kind of S-expression, and it's exceptionally easy to write Lisp code that manipulates Lisp code. Writing a Lisp interpreter in Lisp is a special case, and is not so exciting as the general ability to have a unified representation for both code and data.

这篇关于"Lisp可以自己编写"是什么意思?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆