把xj池的评论转过来——

About functional language (36574)
Posted by: weiqj
Date: November 27, 2006 12:23PM

Sorry I didn't read the article very carefully because I was reading the web page on my cell phone.
I browse through the article again. Frankly, I think the article can be better organized. I mean the original article of course. The translation is very good.
I've dealt with Lambda expression and functional language a little bit. If I'm going to give a brief introduction to functional language I would concentrate on the history of functional language instead of the history of general computer science and technology.
About the history of stack machine I think I would organize my article in such way:

1. Relationship between functional language and Stack machine.
[http://en.wikipedia.org/wiki/Stack_machine]

2. Mathematically we can prove stack machine is equivalent to Turing machine (computers nowadays are more like general Turing machine). Functional language is as powerful as any other programming language.

3. Java and .Net virtual machines are stack machines. The Just-In-Time compiler compiles the byte code/IL-Code into machine code of native machine and run at full speed (remember they are equivalent, so translation is doable).

4. Lambda expression and lisp language.

5. Functional language and recursive functions.

6. Although functional language is equivalent to any other languages, it does require programmers to think in a slightly different way while programming. One needs practice to master that language. The reason that functional language is not popular any more is that it was difficult to optimize the functional language so there's usually a performance hit.

7. I have a whole new idea to visualize the functional language to make it extremely useful in business applications. But forgive me I can not disclose the details.

♦ 我上周略看了一下, 感觉翻译者水平较低, 还没有真的理解FP. (114 字节) - apple 06-11-27, 06:36PM (36605)

小魏下面说的问题也有不少. 不过这已经不是翻译问题了. 是讨论技术, 而且是较高级的内容,可能需要到一些技术论坛比较好。

◊ Well, Stack machine is dead anyway. (646 字节) - weiqj 06-11-27, 07:10PM (36607)

Yeah. Stack machine can be very much optimized from hardware level as well (Papers from Philip Koopman of CMU). But the industry has already discarded it.
Virtual machines will live on. The same optimization used in virtual machine JITs can be used on functional languages such as Lisp as well.
.Net 3.0 has Lambda expression as a new feature. The purpose is to work with LINQ as an OODB implementation. But I'm a little bit disappointed. I think it's too marrow to be included at the language level.
As for the translation, it has to stick to the original version. The translation is OK but maybe the original version isn't very well written.

♦ Stack machine itself can be a very good intermediate ISA (1429 字节) - apple 06-11-27, 08:12PM (36613)

to represent semantics because of its succinctness (in both syntax and size and expressivity), so it is widely used in modern languages distribution (like PE and bytecode) and compilation IR. (I guess this is what you meant with "Virtual machines will live on").

Lambda Calculus expression is the fundamental construct of functional programming, in that it can be used to build up virtually any level complexity and language features, only because of its simplicity and primitive, like gene to human being, list to LISP. List is a primitive data structure; but only because of its primitiveness, it can be used to build the most powerful (expressive) programming language. There is no difference in data and code, everything is a list. For LISP functional programming, Lambda defines its operational and List defines its implementation; all of them can be reasoned in mathematics. That is why LISP is favorite of language scientists.

The problem in performance is caused by the primitiveness as well. LISP is in nature most suitable for interpretation. JIT compilation definitely can improve the performance, but that virtually only maps list to Von Neumann which is not a perfect match. The problem is, Von Neumann is acutally "load/store machine" as many people call, it is the best matching result of the industry, e.g., DRAM. Without real breakthrough in semiconductor, LISP would always leg behind load/store machine.

◊ I mean stack machine hardware is dead (577 字节) - weiqj 06-11-27, 09:07PM (36614)

I think stack machine is the hardware counterpart of Lambda expression while LISP is the software counterpart. They even share the same syntax and semantics, from compiler point of view.

They were popular and discarded for pretty much the same reason.

Anyway, I had the idea of VisualLambda, a language in which programming can be done by using a mouse on a graphical interface. The result will be compiled into byte code and ultimately into machine code by JIT. I will publish the full implementation at an appropriate time.
(http://en.wikipedia.org/wiki/Visual_Lambda)


回复

此内容将保密,不会被其他人看见。
  • 允许的 HTML 标签: <a> <em><img> <strong> <cite> <code> <small> <table> <th> <tr> <td> <ul> <ol> <li> <dl> <dt> <dd> <hr>
  • 行和段被自动切分。
  • 网页地址和电子邮件地址将会被自动转换为链接。
  • Images can be added to this post.

更多格式化选项信息