Java是如何被Lisp启发的? [英] How is Java inspired by Lisp?

查看:102
本文介绍了Java是如何被Lisp启发的?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我们是在C ++程序员之后,我们
设法将很多关于
的内容拖到了Lisp。




  • Java specspec的合着者Guy Steele


资料来源: http://www.paulgraham.com/icad.html



上下文: http://people.csail.mit .edu / gregs / ll1-discuss-archive-html / msg04045.html



我今天遇到了上述报价。我得到许多独特的java(over c ++)的功能像垃圾收集最初在Lisp中找到。但是,如何用Java拖拽c ++程序员半途而知到lisp?

解决方案

项目符号列表和比较:




  • 条件: Java有条件。


  • 函数类型: Java没有第一类函数。


  • 递归: Java支持递归。


  • 动态键入: Java是静态类型。


  • 垃圾回收: Java有垃圾收集功能。

  • Java和C ++都区分语句和表达式。


  • 符号类型:Java和C ++都不支持这种语言的一部分。


  • 同质性:同样,Java和C ++都不是同源的。


  • 整个语言一直在使用:不再需要。




因此,唯一可以说的是,Java比C ++更接近于Lisp,这是垃圾收集,在我看来,这不是一个引人注目的足够的论据来证明Steele的引用。



结论:(主观)Guy Steele的上述报价是愚蠢的。






来自comp.lang.scheme的非常有说服力的报价:


您正在发布到计划组。在这里,认为Java比C ++更好,就像争论蚱蜢比树皮更好。

  — Thant Tessman,comp.lang.scheme


: - )


"We were after the C++ programmers. We managed to drag a lot of them about halfway to Lisp."

  • Guy Steele, co-author of the Java specspec

Source : http://www.paulgraham.com/icad.html

Context: http://people.csail.mit.edu/gregs/ll1-discuss-archive-html/msg04045.html

I came across the above quote other day. I get that many features unique to java (over c++) like garbage collection were initially found in Lisp. But how else did java drag c++ programmers half way to lisp?

解决方案

Let's take Paul Graham's famous bullet list and compare:

  • Conditionals: Java has conditionals. Well, C++ had them too.

  • A Function Type: Java does not have first class functions. C++ didn't have them as well.

  • Recursion: Java supports recursion. C++ supported it too.

  • Dynamic Typing: Java is statically typed. So was C++.

  • Garbage Collection: Java has garbage collection. C++ doesn't.

  • Programs composed of expressions: Both Java and C++ make a distinction between statements and expressions. So both fail to satisfy this point.

  • A Symbol Type: Neither Java nor C++ supports this as a part of language. It's very easy to implement though.

  • Homoiconicity: Again, neither Java nor C++ are homoiconic.

  • The whole language there all the time: Nope, again.

So the only thing that you can say takes Java closer to Lisp as compared to C++ is garbage collection, which, in my opinion, is not a compelling enough argument to justify Steele's quote.

Conclusion: (subjective) Guy Steele's above-stated quote is idiotic. Period.


A very telling quote from comp.lang.scheme:

You're posting to a Scheme group. Around here, arguing that Java is better than C++ is like arguing that grasshoppers taste better than tree bark.
  — Thant Tessman, comp.lang.scheme

:-)

这篇关于Java是如何被Lisp启发的?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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