LISP 如何适应业务挑战的示例

发布于 2024-12-08 13:21:13 字数 158 浏览 6 评论 0原文

几乎每个 LISP 爱好者都声称该语言的关键优势之一是它可以适应问题,而不是问题适应该语言。我正在寻找现实世界的例子,说明如何在简单的商业软件或网络应用程序领域实现这一点。除了 DSL 之外还有什么其他的东西吗?有没有足够复杂/不明显的例子?

PS:为什么我不能在标题中使用“问题”?

Almost every LISP enthusiast claims that one of the key advantages of the language is that it can be adapted to a problem rather than the problem being adapted to the language. I'm looking for real world examples of how this is possible in the field of simple business software or web apps. Is there anything more to this than DSLs? Any sufficiently complex/non-obvious examples of those?

PS: why can't I use 'problem' in the title?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

帅气称霸 2024-12-15 13:21:13

这里是 Paul Graham 网站上的 Lisp 应用程序列表。该页面包含来自许多不同领域的产品/公司。

除其他外,雅虎! Store 是基于 lisp 的 WAS(Graham 的产品被 Yahoo 收购)。感谢罗伯特的指出。

我认为以下 stackoverflow 帖子可能会让您感兴趣: lisp 今天有什么用,你认为它会走向何方?

Here is the list of lisp applications on Paul Graham's site. The page contains products/companies from many different fields.

Among other things, Yahoo! Store is WAS lisp-based (Graham's product acquired by Yahoo). Thanks robert for pointing out.

I think the following stackoverflow post might interest you: What is lisp used for today and where do you think it's going?

夏见 2024-12-15 13:21:13

Paul Graham 在 MIT 网站上发表的一篇文章讨论了他们在初创公司 Viaweb 中使用 lisp 的优势:https://ocw.mit.edu/courses/electrical-engineering-and-computer-science/6-001-struct-and-interpretation-of-computer-programs-spring-2005/lecture-notes/lecture2lispstor .pdf

这篇文章值得全文阅读,但与您的问题相关的三句话很突出:

而且我们在功能上始终遥遥领先于他们。
有时,在绝望中,竞争对手会尝试引入
我们没有的功能。但对于 Lisp 我们的开发周期
速度如此之快,以至于我们有时可以在其中复制新功能
竞争对手在新闻稿中宣布这一消息的一两天。经过
报道新闻稿的记者抽出时间打电话的时候
我们,我们也会有新功能。

在我们的竞争对手看来,我们一定有某种
秘密武器——我们正在解码他们的 Enigma 流量或者
某物。事实上我们确实有一个秘密武器,但它更简单
比他们意识到的要多。没有人向他们泄露其功能的消息
我们。我们能够比任何人更快地开发软件
认为有可能。

为了支持这一主张[该主张与上面的第一句话无关]我会告诉你
关于当我看到另一件事时我发现缺失的一件事
四种语言 [python、java、C、perl]。我想,你怎样才能在其中完成任何事情,
没有z?对我来说,最大的 zs 之一是宏。[5]
许多语言都有一种称为宏的东西。但 Lisp 宏是
独一无二。

但我想我可以给出一种可能令人信服的论证。
Viaweb编辑器的源代码大概有20-25%左右
宏。宏比普通的 Lisp 函数更难编写,
当它们不被使用时,使用它们被认为是不好的风格
必要的。所以该代码中的每个宏都在那里,因为它必须
是。这意味着此中至少 20-25% 的代码
该程序正在做一些其他程序无法轻松完成的事情
语言。

还值得注意的是,本文的主要论点不是您应该使用 lisp。主要论点是,您应该使用您可以使用的最强大的语言,而不是坚持使用您最熟悉的语言,这将是您的自然本能。就作者而言,语言是口齿不清的;对于许多现代公司来说,我想知道 Go 是否可能是当前的等价物?

An article on MIT's website by Paul Graham, discusses the advantages they got out of using lisp for their startup Viaweb: https://ocw.mit.edu/courses/electrical-engineering-and-computer-science/6-001-structure-and-interpretation-of-computer-programs-spring-2005/lecture-notes/lecture2lispstor.pdf

The article is worth reading in it's entirety but three quotes stand out in relation to your question:

And we were always far ahead of them in features.
Sometimes, in desperation, competitors would try to introduce
features that we didn't have. But with Lisp our development cycle
was so fast that we could sometimes duplicate a new feature within
a day or two of a competitor announcing it in a press release. By
the time journalists covering the press release got round to calling
us, we would have the new feature too.

It must have seemed to our competitors that we had some kind of
secret weapon-- that we were decoding their Enigma traffic or
something. In fact we did have a secret weapon, but it was simpler
than they realized. No one was leaking news of their features to
us. We were just able to develop software faster than anyone
thought possible.

And to support this claim [Claim is not related to the first quote above] I'll tell you
about one of the things I find missing when I look at the other
four languages [python, java, C, perl]. How can you get anything done in them, I think,
without z? And one of the biggest zs, for me, is macros.[5]
Many languages have something called a macro. But Lisp macros are
unique.

But I think I can give a kind of argument that might be convincing.
The source code of the Viaweb editor was probably about 20-25%
macros. Macros are harder to write than ordinary Lisp functions,
and it's considered to be bad style to use them when they're not
necessary. So every macro in that code is there because it has to
be. What that means is that at least 20-25% of the code in this
program is doing things that you can't easily do in any other
language.

It's also worth noting that the main argument in the article isn't that you should use lisp. The main argument is that you should use the most powerful language available to you and not stick to the language you're most familiar with, which will be your natural instinct. In the author's case that language was lisp; for many modern companies I wonder if Go might be the current equivalent?

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文