I've been seeing so much recently about functional programming and Clojure looks particularly interesting. While I 'understand' the basic description of what it is, I can't figure out how I would use it on a day to day basis as a web developer, if I can at all. A lot of what I have read focuses on the maths side of functional programming rather then typical programming situations found in regular OO.
我最近看到很多关于函数式编程的知识,而Clojure看起来特别有趣。虽然我“理解”它的基本描述,但我无法弄清楚如何在网络开发人员的日常工作中使用它,如果我可以的话。我所阅读的很多内容都集中在函数式编程的数学方面,而不是常规OO中的典型编程情况。
Have I got the wrong end of the stick? Is functional programming totally un-related to web development? If not, are there any examples of it being used 'for the web'?
我有错误的结束吗?函数式编程与Web开发完全无关吗?如果没有,是否有任何“用于网络”的例子?
18 个解决方案
#1
29
A few examples off the top of my head:
我头顶的几个例子:
- Yahoo! Store is powered by Lisp (originally named Viaweb prior to acquisition)
- Reddit was fully prototyped in Lisp, although they switched to Python in 2005
- Hacker News is written entirely in Arc (a Lisp dialect)
雅虎Store由Lisp提供支持(最初在收购前命名为Viaweb)
Reddit在Lisp中完全是原型,尽管他们在2005年转向Python
黑客新闻完全用Arc(一种Lisp方言)编写
#2
60
Functional programming matches web apps very well. The web app recieves a HTTP request and produces a HTML result. This could be considered a function from requests to pages.
功能编程非常适合Web应用程序。 Web应用程序接收HTTP请求并生成HTML结果。这可以被视为从页面请求的功能。
Compare with desktop apps, where we typically have a long running process, a stateful UI and dataflow in several directions. This is more suited to OO which is concerned about objects with state and message passing.
与桌面应用程序相比,我们通常具有长时间运行的进程,有多个方向的有状态UI和数据流。这更适合关注具有状态和消息传递的对象的OO。
#3
20
I don't see why not - so long as you're delivering standards-compliant HTML to browsers, they don't care what you used to produce it, be that a functional language, an imperative language, or trained monkeys.
我不明白为什么不 - 只要你为浏览器提供符合标准的HTML,它们就不关心你用来制作它的东西,无论是功能语言,命令式语言还是训练有素的猴子。
#4
20
Pure functional programming might not map very well into the web programming environment. But the main impediment is just the lack of infrastructure (frameworks and APIs). It will be a long time (probably never, honestly) before a functional language has as rich a web programming environment as Java, Python, or Ruby.
纯函数式编程可能无法很好地映射到Web编程环境中。但主要障碍是缺乏基础设施(框架和API)。在函数式语言具有与Java,Python或Ruby一样丰富的Web编程环境之前,这将是一段很长的时间(可能永远不会,老实说)。
That said, there are some options.
也就是说,有一些选择。
- HAppS - a Haskell web application server
- Haskell Server Pages
- Links - a functional web programming language
- mod_caml - an OCaml CGI module for Apache
- Ocsigen/Eliom - an OCaml web server/programming framework
- OPA - a commercial web application framework
- Yesod - a web framework for Haskell
HAppS - 一个Haskell Web应用程序服务器
Haskell服务器页面
链接 - 一种功能性的网络编程语言
mod_caml - Apache的OCaml CGI模块
Ocsigen / Eliom - OCaml Web服务器/编程框架
OPA - 商业Web应用程序框架
Yesod - Haskell的Web框架
I don't have any experience with any of these. Maybe commenters can weigh in on what's worked well for them.
我没有任何经验。也许评论者可以权衡什么对他们有用。
#5
15
Twitter rewrote their backend in Scala, a JVM language that supports both the Object Oriented and Functional paradigms.
Twitter在Scala中重写了它们的后端,Scala是一种支持面向对象和功能范例的JVM语言。
Also, the Lift web framework is written in Scala.
此外,Lift Web框架是用Scala编写的。
#6
4
For Clojure, there's an interesting startup (TheDeadline) that developed using Clojure and Google App Engine. They have a good ppt on Slideshare and an interview on InfoQ.
对于Clojure,有一个有趣的创业公司(TheDeadline)使用Clojure和Google App Engine开发。他们在Slideshare上有一个很好的ppt和InfoQ的采访。
For a good discussion on deploying Clojure with GAE: http://news.ycombinator.com/item?id=1239788
有关使用GAE部署Clojure的详细讨论:http://news.ycombinator.com/item?id = 1239788
As far as I know, Clojure has a few web development libraries. Compojure Ring Conjure
据我所知,Clojure有一些Web开发库。 Compojure Ring Conjure
Hope this answers some of your questions =) (I'm just starting out too..)
希望这能回答你的一些问题=)(我刚开始......)
Best, Ryan
#7
3
It is not totally unrelated to web development. The app sitting on the server can very well take advantage of functional features like closures, higher-order functions, immutability, referential transparency... for instance, you sure have collections that you need to transform or manipulate in whatever way. Functional programming helps here, and it is for a reason that its idioms are penetrating mainstream languages. Functional features help in conciseness, testability, parallelization, and they can also provide native solutions to problems you would otherwise solve with patterns.
它与Web开发并不完全无关。坐在服务器上的应用程序可以很好地利用闭包,高阶函数,不变性,引用透明等功能特性......例如,您确定需要以任何方式转换或操作的集合。函数式编程在这里有所帮助,这是因为它的成语正在渗透主流语言。功能特性有助于简洁,可测试性和并行化,并且它们还可以为您使用模式解决的问题提供本机解决方案。
Update: there are web frameworks for functional languages too. Weblocks for Common Lisp, Lift for Scala. These are the ones I've heard of, there might be more... however you don't necessarily have to be purely functional -- for example Scala is not pure and should work with any Java framework, you'd still be able to use functional programming for the business layer, etc.
更新:还有功能语言的Web框架。用于Common Lisp的Weblocks,用于Scala的提升。这些是我听说过的,可能还有更多...但是你不一定非必须是纯粹的功能 - 例如Scala不是纯粹的并且应该适用于任何Java框架,你仍然可以为业务层等使用函数式编程
#8
3
Check out Ur/Web. It's very fast and its static type system knows about things like HTML and SQL so it can guarantee all sorts of nice things about security.
查看Ur / Web。它非常快,它的静态类型系统知道像HTML和SQL这样的东西,所以它可以保证各种关于安全性的好东西。
#9
3
Erlang seems to be getting a lot of use in some of the infrastructure for scalable web apps. the CouchDB and Riak databases are written mostly in Erlang, as is the RabbitMQ message queueing server. One of the keys to its success is that it handles concurrency through message-passing, with no shared mutable state. It's this way of thinking about problems that is useful, more than any particular functional programming language.
Erlang似乎在可扩展Web应用程序的某些基础架构中得到了大量使用。 CouchDB和Riak数据库主要在Erlang中编写,RabbitMQ消息队列服务器也是如此。它成功的关键之一是它通过消息传递处理并发,没有共享的可变状态。正是这种思考问题的方式比任何特定的函数式编程语言更有用。
Or, look at MapReduce. It's a very functional way of looking at computation, even if your map and reduce functions happen to be internally stateful -- and for that reason, it's a very nice fit to querying large datasets in a fault-tolerant, distributed way.
或者,看看MapReduce。它是一种非常实用的查看计算方式,即使你的map和reduce函数恰好是内部有状态的 - 因此,它非常适合以容错,分布式方式查询大型数据集。
By all means, go with whatever seems most practical for you. But always keep functional programming in the back of your mind, because you never know when it might come in handy.
无论如何,请选择对您来说最实用的东西。但是总是把功能性编程放在脑海中,因为你永远不知道什么时候会派上用场。
#10
2
They are doing some pretty cool things at Edinburgh University with functional programming for the web.
他们正在爱丁堡大学做一些非常酷的事情,为网络提供功能性编程。
#11
2
Language and paradigm doesn't matter for web apps, they're all equally good and bad. If you are looking for a reason to learn a new paradigm, just dive in. My advice would be to analyze the problem you're trying to solve and select the appropriate toolset.
语言和范例对于网络应用无关紧要,它们都同样好坏。如果您正在寻找学习新范例的理由,请深入了解。我的建议是分析您尝试解决的问题并选择合适的工具集。
#12
2
Javascript (the language of the FE portion of the web and increasingly the BE as well) isn't functional per se but functions are first order functional
Javascript(Web的FE部分的语言以及越来越多的BE)本身并不功能,但功能是一阶功能
#13
2
We have just launched an online spreadsheet where the backend is written entirely in Erlang.
我们刚刚推出了一个在线电子表格,后端完全用Erlang编写。
By any standards this is one of the most complex web-apps you can build with a ginormous GUI with mental complexity.
按照任何标准,这是最复杂的网络应用程序之一,您可以使用具有心理复杂性的巨大GUI构建。
#14
2
Here is a web developer experience in building web apps using Haskell. Although functional languages are very type safe and have good concurrency, they always lacked best of the breed api's since it has been darling of the academia since long and yet to be strongly embraced in the real world. I hope it's not too far away. Erlang had already got into it.
以下是使用Haskell构建Web应用程序的Web开发人员体验。尽管函数式语言非常类型安全并具有良好的并发性,但它们始终缺乏最佳的api,因为它长期以来一直是学术界的宠儿,但却在现实世界中得到了强烈的支持。我希望它不会太遥远。 Erlang已经进入了它。
#15
1
The reason why functional programming is popular with web programming is that it explicits shared and changing state and allows the programmer to express the purely functional parts as pure functions. Pure functions have the advantage of being very simple to run in parallel - as they have no side-effects.
函数式编程受Web编程欢迎的原因在于它表示共享和改变状态,并允许程序员将纯函数部分表示为纯函数。纯函数具有并行运行非常简单的优点 - 因为它们没有副作用。
At least that's my reason.
至少这是我的理由。
#16
1
Another short answer: http://www.mlstate.com -- a full web development platform, based on FP. The clean semantics of the language permit all sorts of automated safety and security analysis, optimizations, etc.
另一个简短的答案:http://www.mlstate.com - 一个完整的Web开发平台,基于FP。语言的干净语义允许各种自动化安全和安全分析,优化等。
Caveat: I work there.
警告:我在那里工作。
#17
1
Functional languages may not be directly useful for building great apps but we use functional programming paradigm heavily for building our Apps. Pure functional programming puts the constraint of "no side effects". This ensures that pure functional calls will yield same result in what ever order they are called. This is not ideal for web-development but if functional programming is combined with a state-changing system, a robust web app can be built. Have a look at my paper for more details: FAST Server Also these slides.
功能语言可能不会直接用于构建优秀的应用程序,但我们大量使用函数式编程范例来构建我们的应用程序。纯函数式编程提出了“无副作用”的约束。这可以确保纯函数调用在调用它们的顺序时产生相同的结果。这对于Web开发并不理想,但如果将函数式编程与状态更改系统相结合,则可以构建强大的Web应用程序。有关更多详细信息,请查看我的论文:FAST Server也是这些幻灯片。
#18
-2
You probably won't use it and shouldn't use it but when you say that someone will always find an exception to the rule (Viaweb, etc.). Basically there is no "super language" there are only working lines of code, usually in "Blub." Even Paul Graham says that the main (in fact only) benefit to a Lisp is one's ability to rapidly prototype.
您可能不会使用它而不应该使用它,但是当您说某人总是会发现规则的异常时(Viaweb等)。基本上没有“超级语言”只有代码的工作线,通常在“Blub”中。即使是保罗·格雷厄姆(Paul Graham)说,Lisp的主要(实际上是唯一的)好处是能够快速制作原型。
Also "super languages" usually impinge rather than increase code readability, meaning that the one "genius" who wrote it has to maintain it forever since no one else can understand it, especially since he is likely to write it in his own modified dialect. This decreases the possible scope of any project, which means that even if new, innovative things can be done, they are not extensible and so remain at a relatively small scale (like Hacker News in Arc).
此外,“超级语言”通常会影响而不是提高代码的可读性,这意味着编写它的那个“天才”必须永远保持它,因为没有其他人能够理解它,特别是因为他很可能用他自己修改过的方言来编写它。这减少了任何项目的可能范围,这意味着即使可以完成新的创新事物,它们也不可扩展,因此保持相对较小的规模(如Arc中的Hacker News)。
That's not to say that someone can't have a genius idea and implement it in a incomprehensible style that then can be re-written in Blub and extended so that lots of people can benefit from it. Actually, that's exactly what has happened in all of the Lisp success stories, not to mention every famous philosopher that's ever lived. But of course, if you are a "genius" you might also be able to prototype your product some other way.
这并不是说有人不能有一个天才的想法,并以一种难以理解的风格实现它,然后可以在Blub中重写并扩展,以便许多人可以从中受益。实际上,这正是所有Lisp成功故事中发生的事情,更不用说每一位曾经生活过的着名哲学家。但是,当然,如果你是一个“天才”,你也可以通过其他方式对产品进行原型设计。
As for FP on the JVM, there are limited but cool things possible. Although I would personally use it for prototyping only, it is possible you might have a use case (usually something to do with multi-threading) where it provides some improvement.
对于JVM上的FP,可能存在有限但很酷的事情。虽然我个人只会将其用于原型设计,但您可能会有一个用例(通常与多线程有关),它可以提供一些改进。
#1
29
A few examples off the top of my head:
我头顶的几个例子:
- Yahoo! Store is powered by Lisp (originally named Viaweb prior to acquisition)
- Reddit was fully prototyped in Lisp, although they switched to Python in 2005
- Hacker News is written entirely in Arc (a Lisp dialect)
雅虎Store由Lisp提供支持(最初在收购前命名为Viaweb)
Reddit在Lisp中完全是原型,尽管他们在2005年转向Python
黑客新闻完全用Arc(一种Lisp方言)编写
#2
60
Functional programming matches web apps very well. The web app recieves a HTTP request and produces a HTML result. This could be considered a function from requests to pages.
功能编程非常适合Web应用程序。 Web应用程序接收HTTP请求并生成HTML结果。这可以被视为从页面请求的功能。
Compare with desktop apps, where we typically have a long running process, a stateful UI and dataflow in several directions. This is more suited to OO which is concerned about objects with state and message passing.
与桌面应用程序相比,我们通常具有长时间运行的进程,有多个方向的有状态UI和数据流。这更适合关注具有状态和消息传递的对象的OO。
#3
20
I don't see why not - so long as you're delivering standards-compliant HTML to browsers, they don't care what you used to produce it, be that a functional language, an imperative language, or trained monkeys.
我不明白为什么不 - 只要你为浏览器提供符合标准的HTML,它们就不关心你用来制作它的东西,无论是功能语言,命令式语言还是训练有素的猴子。
#4
20
Pure functional programming might not map very well into the web programming environment. But the main impediment is just the lack of infrastructure (frameworks and APIs). It will be a long time (probably never, honestly) before a functional language has as rich a web programming environment as Java, Python, or Ruby.
纯函数式编程可能无法很好地映射到Web编程环境中。但主要障碍是缺乏基础设施(框架和API)。在函数式语言具有与Java,Python或Ruby一样丰富的Web编程环境之前,这将是一段很长的时间(可能永远不会,老实说)。
That said, there are some options.
也就是说,有一些选择。
- HAppS - a Haskell web application server
- Haskell Server Pages
- Links - a functional web programming language
- mod_caml - an OCaml CGI module for Apache
- Ocsigen/Eliom - an OCaml web server/programming framework
- OPA - a commercial web application framework
- Yesod - a web framework for Haskell
HAppS - 一个Haskell Web应用程序服务器
Haskell服务器页面
链接 - 一种功能性的网络编程语言
mod_caml - Apache的OCaml CGI模块
Ocsigen / Eliom - OCaml Web服务器/编程框架
OPA - 商业Web应用程序框架
Yesod - Haskell的Web框架
I don't have any experience with any of these. Maybe commenters can weigh in on what's worked well for them.
我没有任何经验。也许评论者可以权衡什么对他们有用。
#5
15
Twitter rewrote their backend in Scala, a JVM language that supports both the Object Oriented and Functional paradigms.
Twitter在Scala中重写了它们的后端,Scala是一种支持面向对象和功能范例的JVM语言。
Also, the Lift web framework is written in Scala.
此外,Lift Web框架是用Scala编写的。
#6
4
For Clojure, there's an interesting startup (TheDeadline) that developed using Clojure and Google App Engine. They have a good ppt on Slideshare and an interview on InfoQ.
对于Clojure,有一个有趣的创业公司(TheDeadline)使用Clojure和Google App Engine开发。他们在Slideshare上有一个很好的ppt和InfoQ的采访。
For a good discussion on deploying Clojure with GAE: http://news.ycombinator.com/item?id=1239788
有关使用GAE部署Clojure的详细讨论:http://news.ycombinator.com/item?id = 1239788
As far as I know, Clojure has a few web development libraries. Compojure Ring Conjure
据我所知,Clojure有一些Web开发库。 Compojure Ring Conjure
Hope this answers some of your questions =) (I'm just starting out too..)
希望这能回答你的一些问题=)(我刚开始......)
Best, Ryan
#7
3
It is not totally unrelated to web development. The app sitting on the server can very well take advantage of functional features like closures, higher-order functions, immutability, referential transparency... for instance, you sure have collections that you need to transform or manipulate in whatever way. Functional programming helps here, and it is for a reason that its idioms are penetrating mainstream languages. Functional features help in conciseness, testability, parallelization, and they can also provide native solutions to problems you would otherwise solve with patterns.
它与Web开发并不完全无关。坐在服务器上的应用程序可以很好地利用闭包,高阶函数,不变性,引用透明等功能特性......例如,您确定需要以任何方式转换或操作的集合。函数式编程在这里有所帮助,这是因为它的成语正在渗透主流语言。功能特性有助于简洁,可测试性和并行化,并且它们还可以为您使用模式解决的问题提供本机解决方案。
Update: there are web frameworks for functional languages too. Weblocks for Common Lisp, Lift for Scala. These are the ones I've heard of, there might be more... however you don't necessarily have to be purely functional -- for example Scala is not pure and should work with any Java framework, you'd still be able to use functional programming for the business layer, etc.
更新:还有功能语言的Web框架。用于Common Lisp的Weblocks,用于Scala的提升。这些是我听说过的,可能还有更多...但是你不一定非必须是纯粹的功能 - 例如Scala不是纯粹的并且应该适用于任何Java框架,你仍然可以为业务层等使用函数式编程
#8
3
Check out Ur/Web. It's very fast and its static type system knows about things like HTML and SQL so it can guarantee all sorts of nice things about security.
查看Ur / Web。它非常快,它的静态类型系统知道像HTML和SQL这样的东西,所以它可以保证各种关于安全性的好东西。
#9
3
Erlang seems to be getting a lot of use in some of the infrastructure for scalable web apps. the CouchDB and Riak databases are written mostly in Erlang, as is the RabbitMQ message queueing server. One of the keys to its success is that it handles concurrency through message-passing, with no shared mutable state. It's this way of thinking about problems that is useful, more than any particular functional programming language.
Erlang似乎在可扩展Web应用程序的某些基础架构中得到了大量使用。 CouchDB和Riak数据库主要在Erlang中编写,RabbitMQ消息队列服务器也是如此。它成功的关键之一是它通过消息传递处理并发,没有共享的可变状态。正是这种思考问题的方式比任何特定的函数式编程语言更有用。
Or, look at MapReduce. It's a very functional way of looking at computation, even if your map and reduce functions happen to be internally stateful -- and for that reason, it's a very nice fit to querying large datasets in a fault-tolerant, distributed way.
或者,看看MapReduce。它是一种非常实用的查看计算方式,即使你的map和reduce函数恰好是内部有状态的 - 因此,它非常适合以容错,分布式方式查询大型数据集。
By all means, go with whatever seems most practical for you. But always keep functional programming in the back of your mind, because you never know when it might come in handy.
无论如何,请选择对您来说最实用的东西。但是总是把功能性编程放在脑海中,因为你永远不知道什么时候会派上用场。
#10
2
They are doing some pretty cool things at Edinburgh University with functional programming for the web.
他们正在爱丁堡大学做一些非常酷的事情,为网络提供功能性编程。
#11
2
Language and paradigm doesn't matter for web apps, they're all equally good and bad. If you are looking for a reason to learn a new paradigm, just dive in. My advice would be to analyze the problem you're trying to solve and select the appropriate toolset.
语言和范例对于网络应用无关紧要,它们都同样好坏。如果您正在寻找学习新范例的理由,请深入了解。我的建议是分析您尝试解决的问题并选择合适的工具集。
#12
2
Javascript (the language of the FE portion of the web and increasingly the BE as well) isn't functional per se but functions are first order functional
Javascript(Web的FE部分的语言以及越来越多的BE)本身并不功能,但功能是一阶功能
#13
2
We have just launched an online spreadsheet where the backend is written entirely in Erlang.
我们刚刚推出了一个在线电子表格,后端完全用Erlang编写。
By any standards this is one of the most complex web-apps you can build with a ginormous GUI with mental complexity.
按照任何标准,这是最复杂的网络应用程序之一,您可以使用具有心理复杂性的巨大GUI构建。
#14
2
Here is a web developer experience in building web apps using Haskell. Although functional languages are very type safe and have good concurrency, they always lacked best of the breed api's since it has been darling of the academia since long and yet to be strongly embraced in the real world. I hope it's not too far away. Erlang had already got into it.
以下是使用Haskell构建Web应用程序的Web开发人员体验。尽管函数式语言非常类型安全并具有良好的并发性,但它们始终缺乏最佳的api,因为它长期以来一直是学术界的宠儿,但却在现实世界中得到了强烈的支持。我希望它不会太遥远。 Erlang已经进入了它。
#15
1
The reason why functional programming is popular with web programming is that it explicits shared and changing state and allows the programmer to express the purely functional parts as pure functions. Pure functions have the advantage of being very simple to run in parallel - as they have no side-effects.
函数式编程受Web编程欢迎的原因在于它表示共享和改变状态,并允许程序员将纯函数部分表示为纯函数。纯函数具有并行运行非常简单的优点 - 因为它们没有副作用。
At least that's my reason.
至少这是我的理由。
#16
1
Another short answer: http://www.mlstate.com -- a full web development platform, based on FP. The clean semantics of the language permit all sorts of automated safety and security analysis, optimizations, etc.
另一个简短的答案:http://www.mlstate.com - 一个完整的Web开发平台,基于FP。语言的干净语义允许各种自动化安全和安全分析,优化等。
Caveat: I work there.
警告:我在那里工作。
#17
1
Functional languages may not be directly useful for building great apps but we use functional programming paradigm heavily for building our Apps. Pure functional programming puts the constraint of "no side effects". This ensures that pure functional calls will yield same result in what ever order they are called. This is not ideal for web-development but if functional programming is combined with a state-changing system, a robust web app can be built. Have a look at my paper for more details: FAST Server Also these slides.
功能语言可能不会直接用于构建优秀的应用程序,但我们大量使用函数式编程范例来构建我们的应用程序。纯函数式编程提出了“无副作用”的约束。这可以确保纯函数调用在调用它们的顺序时产生相同的结果。这对于Web开发并不理想,但如果将函数式编程与状态更改系统相结合,则可以构建强大的Web应用程序。有关更多详细信息,请查看我的论文:FAST Server也是这些幻灯片。
#18
-2
You probably won't use it and shouldn't use it but when you say that someone will always find an exception to the rule (Viaweb, etc.). Basically there is no "super language" there are only working lines of code, usually in "Blub." Even Paul Graham says that the main (in fact only) benefit to a Lisp is one's ability to rapidly prototype.
您可能不会使用它而不应该使用它,但是当您说某人总是会发现规则的异常时(Viaweb等)。基本上没有“超级语言”只有代码的工作线,通常在“Blub”中。即使是保罗·格雷厄姆(Paul Graham)说,Lisp的主要(实际上是唯一的)好处是能够快速制作原型。
Also "super languages" usually impinge rather than increase code readability, meaning that the one "genius" who wrote it has to maintain it forever since no one else can understand it, especially since he is likely to write it in his own modified dialect. This decreases the possible scope of any project, which means that even if new, innovative things can be done, they are not extensible and so remain at a relatively small scale (like Hacker News in Arc).
此外,“超级语言”通常会影响而不是提高代码的可读性,这意味着编写它的那个“天才”必须永远保持它,因为没有其他人能够理解它,特别是因为他很可能用他自己修改过的方言来编写它。这减少了任何项目的可能范围,这意味着即使可以完成新的创新事物,它们也不可扩展,因此保持相对较小的规模(如Arc中的Hacker News)。
That's not to say that someone can't have a genius idea and implement it in a incomprehensible style that then can be re-written in Blub and extended so that lots of people can benefit from it. Actually, that's exactly what has happened in all of the Lisp success stories, not to mention every famous philosopher that's ever lived. But of course, if you are a "genius" you might also be able to prototype your product some other way.
这并不是说有人不能有一个天才的想法,并以一种难以理解的风格实现它,然后可以在Blub中重写并扩展,以便许多人可以从中受益。实际上,这正是所有Lisp成功故事中发生的事情,更不用说每一位曾经生活过的着名哲学家。但是,当然,如果你是一个“天才”,你也可以通过其他方式对产品进行原型设计。
As for FP on the JVM, there are limited but cool things possible. Although I would personally use it for prototyping only, it is possible you might have a use case (usually something to do with multi-threading) where it provides some improvement.
对于JVM上的FP,可能存在有限但很酷的事情。虽然我个人只会将其用于原型设计,但您可能会有一个用例(通常与多线程有关),它可以提供一些改进。