IT

왜 Lisp를 배워야합니까?

lottoking 2020. 7. 7. 07:23
반응형

왜 Lisp를 배워야합니까? [닫은]


저는 Lisp 를 배워야한다고 생각하며 저를 도와 줄 좋은 자료가 많이 있습니다.

복잡한 구문을 사용하지는 않지만 "전통적인 상업 프로그래밍"에서 절차 적 언어 대신 사용하는 것이 좋습니다.

Lisp로 작성된 상용 킬러 앱이 있습니까?


Lisp의 주요 용도 중 하나는 인공 지능입니다. 대학 친구 중 한 명이 대학원 AI 과정을 수강하고 주요 프로젝트를 위해 Lisp에서 " Lights Out "솔버를 작성했습니다. 그의 프로그램의 여러 버전은 약간 다른 AI 루틴을 사용했으며 40 대 정도의 컴퓨터에서 테스트를 수행하면 꽤 깔끔한 결과를 얻었습니다 (연결을 위해 온라인 어딘가에 있었으면 좋겠다고 생각하지는 않습니다).

두 학기 전에 저는 Scheme (Lisp 기반 언어)을 사용하여 Abbott과 Costello의 "Who 's on First"루틴을 시뮬레이션 한 대화식 프로그램을 작성했습니다. 사용자의 입력은 꽤 복잡한 데이터 구조 (다른 언어의 맵과 유사하지만 훨씬 더 유연함)와 비교되어 적절한 응답을 선택할 수 있습니다. 또한 3x3 슬라이드 퍼즐 (큰 슬라이드 퍼즐로 쉽게 확장 할 수있는 알고리즘) 을 해결하는 루틴을 작성했습니다 .

요약하면 학습 Lisp (또는 체계)는 AI 이외의 많은 실제 응용 프로그램을 제공하지는 않지만 다른 많은 사람들이 언급했듯이 매우 귀중한 학습 경험입니다. Lisp와 같은 기능적 언어로 프로그래밍하면 재귀 적으로 생각하는 데 도움이됩니다 (다른 언어로 재귀에 문제가 있으면 큰 도움이 될 수 있습니다).


Lisp는 크고 복잡한 런타임을 지원하는 크고 복잡한 언어입니다. 이러한 이유로 Lisp는 크고 복잡한 문제에 가장 적합합니다.

이제, 복잡한 문제는 동일하지 않습니다 복잡 하나. 복잡한 문제는 작은 세부 사항이 많은 하나이지만, 어려운 일이 아니다한다. 항공사 예약 시스템을 작성하는 것은 복잡한 사업이지만 충분한 돈과 프로그래머가있는 것은 어렵지 않습니다. 차이가 있습니까?

복잡한 문제는 복잡하고 전통적인 분할과 정복이 효과가없는 문제입니다. 로봇을 제어하거나 테이블 형식이 아닌 데이터 (예 : 언어) 또는 매우 역동적 인 상황에 대한 작업.

Lisp는 솔루션을 확장 할 수 있어야하는 문제에 매우 적합합니다. 전형적인 예는 emacs 텍스트 편집기입니다. 그것은 완전히 프로그래밍 가능하므로 프로그래밍 환경 자체입니다.

Norvig는 그의 유명한 책 PAIP 에서 Lisp가 탐색 적 프로그래밍에 이상적이라고 말합니다. 즉, 온라인 예약 시스템과 달리 완전히 이해되지 않은 문제에 대한 솔루션을 프로그래밍합니다. 다시 말해, 복잡한 문제.

또한 Lisp를 배우면 잊혀진 근본적인 무언가를 떠올리게됩니다. Von Neumann과 Turing의 차이점. 우리가 알고 있듯이 Turing의 계산 모델은 흥미로운 이론적 모델이지만 컴퓨터 설계 모델로는 쓸모가 없습니다. 반면에 Von Neumann은 컴퓨터와 계산이 어떻게 실행되는지에 대한 모델을 설계했습니다 : Von Neumann 모델. Von Neumann 모델의 핵심은 하나의 메모리 만 있고 코드와 데이터를 모두 저장한다는 것입니다. Java 프로그램 (또는 C # 또는 원하는 것)은 Turing 모델의 표현입니다. 프로그램을 구체적으로 한 번에 설정하십시오. 그런 다음 모든 데이터를 처리 할 수 ​​있기를 바랍니다.

Lisp는 Von Neuman 모델을 유지합니다. 코드와 데이터 사이에는 예리하고 미리 결정된 경계가 없습니다. Lisp에서의 프로그래밍은 Von Neumann 모델의 힘을 열어줍니다. Lisp에서 프로그래밍하면 오래된 개념을 새로운 시각으로 볼 수 있습니다.

마지막으로 대화식으로 프로그램을 개발할 때 (컴파일 및 실행이 아닌) 프로그램과 상호 작용하는 방법을 배웁니다. 또한 프로그래밍 방식과 프로그래밍 방식도 변경됩니다.

이 소개를 통해 나는 당신의 질문에 대한 답을 드디어 제공 할 수 있습니다 : "전통적인"언어보다 더 나은 곳을 찾을 수 있습니까?

고급 프로그래머라면 고급 도구가 필요합니다. 그리고 Lisp보다 더 진보 된 도구는 없습니다. 즉, 문제가 어렵다면 대답은 '예'입니다. 그렇지 않다.


에 대한 응답으로 @lassevk :

대체 텍스트


복잡한 구문 ??

lisp 구문은 매우 간단 합니다.

lisp로 작성된 킬러 앱 : emacs . Lisp를 사용하면 에디터가 할 수있는 거의 모든 것을 할 수 있도록 emacs를 자유롭게 확장 할 수 있습니다.

그러나 원하는 경우에만 lisp를 배워야 하며 직장에서 절대로 사용하지 못할 수도 있지만 여전히 굉장합니다.

또한 추가하고 싶습니다 : lisp가 의미가있는 장소를 찾더라도 java, c ++, c #, python, ruby ​​등에서 사용해야한다고 다른 사람을 설득하지 않을 것입니다.


직접적인 경험으로는 대답 할 수 없지만 Paul Graham 이 Lisp에 쓴 글 읽어야합니다 . "killer-app"부분에 대해서는 Beating the averages를 읽으십시오 .


나는 약 1 년 동안 전문적으로 Lisp에서 프로그램을했으며, 학습 할 가치가 있습니다. 가능한 모든 상용구 코드를 함수로 대체하고 그렇지 않은 경우 매크로를 사용하여 코드에서 중복성을 제거 할 수있는 최고의 기회를 갖게됩니다. 또한 코드와 데이터 간을 자유롭게 변환하여 런타임시 탁월한 유연성에 액세스 할 수 있습니다. 따라서 사용자 작업으로 복잡한 구조를 동적으로 구축해야하는 상황이 Lisp가 진정으로 빛나는 곳입니다. 인기있는 항공사 스케줄러는 Lisp로 작성되었으며 Lisp에는 많은 CAD / CAM도 있습니다.


프로그래밍이 마음에 드시면 순수한 즐거움을 위해 Lisp를 배워야합니다. XKCD 는 다음과 같은 지적 깨달음을 완벽하게 표현합니다. 리스프를 배우는 것은 스님에게 명상이 무엇인지 프로그래머를위한 것입니다 (그리고 나는 신성 모독없이 이것을 의미했습니다).


Lisp는 작은 DSL을 만드는 데 매우 유용합니다. 직장에서 실행되는 Box에 Lisp 사본이 있으며 SQL Server 데이터베이스를 조사하고 C #에서 데이터 계층 등을 생성하기 위해 DSL을 거의 작성하지 않았습니다. 모든 보일러 플레이트 코드는 이제 lisp 매크로로 작성되어 C #으로 출력됩니다. HTML, XML 등 모든 종류의 것들을 생성합니다. 일상적인 코딩에 Lisp를 사용할 수 있기를 원하지만 Lisp는 실질적인 이점을 제공 할 수 있습니다.


언어의 일반적인 들여 쓰기 규칙을 사용하지 않으면 모든 언어가 훨씬 더 어려워 보입니다. Lisp를 따르는 경우 구문 트리 구조를 매우 쉽게 표현하는 방법을 알 수 있습니다 (미리보기가 약간 있으므로 r이 재귀 적 quicksort 인수에서 fns와 정렬되어야 함).

(defun quicksort (lis) 
  (if (null lis) 
      nil
      (let* ((x (car lis)) 
             (r (cdr lis)) 
             (fn (lambda (a) 
                   (< a x))))
         (append (quicksort (remove-if-not fn 
                                           r)) 
                 (list x)
                 (quicksort (remove-if fn 
                                       r))))))

나는 새로운 언어를 배우는 것이 항상 당신이 이미 알고있는 언어의 프로그래밍 스타일에 영향을 미친다는 것을 알았습니다. 나를 위해 항상 주 언어 인 Java 인 문제를 해결하는 다른 방법으로 생각하게했습니다. 나는 일반적으로 프로그래밍 측면에서 당신의 시야를 넓 힙니다.


I took a "lisp class" in college back in the eighties. Despite grokking all the concepts presented in the class, I was left without any appreciation for what makes lisp great. I'm afraid that a lot of people look at lisp as just another programming language, which is what that course in college did for me so many years ago. If you see someone complaining about lisp syntax (or lack thereof), there's a good chance that they're one of those people who has failed to grasp lisp's greatness. I was one of those people for a very long time.

It wasn't until two decades later, when I rekindled my interest in lisp, that I began to "get" what makes lisp interesting--for me anyway. If you manage to learn lisp without having your mind blown by closures and lisp macros, you've probably missed the point.


Learning LISP/Scheme may not give you any increased application space, but it will help you get a better sense of functional programming, its rules, and its exceptions.

It's worth the time investment just to learn the difference in the beauty of six nested pure functions, and the nightmare of six nested functions with side effects.


From http://www.gigamonkeys.com/book/introduction-why-lisp.html

One of the most commonly repeated myths about Lisp is that it's "dead." While it's true that Common Lisp isn't as widely used as, say, Visual Basic or Java, it seems strange to describe a language that continues to be used for new development and that continues to attract new users as "dead." Some recent Lisp success stories include Paul Graham's Viaweb, which became Yahoo Store when Yahoo bought his company; ITA Software's airfare pricing and shopping system, QPX, used by the online ticket seller Orbitz and others; Naughty Dog's game for the PlayStation 2, Jak and Daxter, which is largely written in a domain-specific Lisp dialect Naughty Dog invented called GOAL, whose compiler is itself written in Common Lisp; and the Roomba, the autonomous robotic vacuum cleaner, whose software is written in L, a downwardly compatible subset of Common Lisp. Perhaps even more telling is the growth of the Common-Lisp.net Web site, which hosts open-source Common Lisp projects, and the number of local Lisp user groups that have sprung up in the past couple of years.


"Lisp is worth learning for the profound enlightenment experience you will have when you finally get it; that experience will make you a better programmer for the rest of your days, even if you never actually use Lisp itself a lot."

--Eric S. Raymond, "How to Become a Hacker"

http://www.paulgraham.com/avg.html


I agree that Lisp is one of those languages that you may never use in a commercial setting. But even if you don't get to, learning it will definitely expand your understanding of programming as a whole. For example, I learned Prolog in college and while I never used it after, I gave me a greater understanding of many programming concepts and (at times) a greater appreciation for the languages I do use.

But if you are going to learn it...by all means, read On Lisp


Okay, I might be weird but I really don't like Paul Graham's essays that much & on Lisp is a really rough going book if you don't have some grasp of Common Lisp already. Instead, I'd say go for Siebel's Practical Common Lisp. As for "killer-apps", Common Lisp seems to find its place in niche shops, like ITA, so while there isn't an app synonymous with CL the way Rails is for Ruby there are places in industry that use it if you do a little digging.


If you have to ask yourself if you should learn lisp, you probably don't need to.


Learning lisp will put Javascript in a completely different light! Lisp really forces you to grasp both recursion and the whole "functions as first class objects"-paradigm. See Crockfords excellent article on Scheme vs Javascript. Javascript is perhaps the most important language around today, so understanding it better is immensely useful!


Gimp's Script-Fu is lipsish. That's a photoshop-killer app.


Complicated syntax? The beauty of lisp is that it has a ridiculously simple syntax. It's just a list, where each element of the list can be either another list or an elementary data type.

It's worth learning because of the way it enhances your coding ability to think about and use functions as just another data type. This will improve upon the way you code in an imperative and/or object-oriented language because it will allow you to be more mentally flexible with how your code is structured.


To add to the other answers:

Because the SICP course (the videos are available here) is awesome: teaches you Lisp and a lot more!


Killer app? Franz Inc. has a long list of success stories, but this list only includes users of AllegroCL... There are probably others. My favourite is the story about Naughty Dog, since I was a big fan of the Crash Bandicoot games.

For learning Common Lisp, I'd recommend Practical Common Lisp. It has a hands-on approach that at least for me made it easier than other books I've looked at.


You could use Clojure today to write tests and scripts on top of the Java VM. While there are other Lisp languages implemented on the JVM, I think Clojure does the best job of integrating with Java.

There are times when the Java language itself gets in the way of writing tests for Java code (including "traditional commercial programming"). (I don't mean that as an indictment of Java -- other languages suffer from the same problem -- but it's a fact. Since the topic, not Java, I won't elaborate. Please feel free to start a new topic if someone wants to discuss it.) Clojure eliminates many of those hindrances.


Lisp can be used anywhere you use traditional programming. It's not that different, it's just more powerful. Writing a web app? you can do it on Lisp, writing a desktop application? you can do it on Lisp, whatever, you can probably do it on Lisp, or Python, or any other generic programming (there are a few languages that are suited for only one task).

The biggest obstacle will probably be acceptance of your boss, your peers or your customers. That's something you will have to work with them. Choosing a pragmatic solution like Clojure that can leverage the current install base of Java infrastructure, from the JVM to the libraries, might help you. Also, if you have a Java program, you may do a plug-in architecture and write Clojure plug-ins for it and end up writing half your code in Clojure.


Not a reason but (trivial) AutoCAD has LISP & DCL runtime support. It is a convenient way to write complex macros (including ActiveX automation) if you don't want to use VBA or their C++ or .NET SDKs, or if a DIESEL expression doesn't cut it.

A lot of AutoCAD's functions are actually LISP routines.


This is a topic i myself have pondered for a while but I have not really come to a decision, as usual time is the main problem... ;)

And since I can´t find these links sofar in this post i add them for public interest:

Success and Failure story: Lisping at JPL

Really impressive success story: Lisp in use at the Orbitz corporation

Comparison and analysis of whether to use Lisp instead of Java: Lisp as an Alternative to Java


Syntax is irrelevant, readability is not!


Not saying this is a killer app but it looks like it could be cool http://code.google.com/p/plop/


Killer app? The flight search engine by ITA Software is one.

"왜"에 관해서는 아마도 당신을 더 나은 개발자로 만들 것이며 아마도 당신을 더 나쁘게 만들지 않을 것입니다. 그러나 다른 언어에 대한 lisp 방언을 선호 할 수도 있습니다.

참고 URL : https://stackoverflow.com/questions/4724/why-should-i-learn-lisp

반응형