在哪里学习如何实际使用Common Lisp [英] Where to learn how to practically use Common Lisp

查看:96
本文介绍了在哪里学习如何实际使用Common Lisp的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是一名试图学习Common Lisp的C ++程序员.我看过《 Lisp之地》等书籍,并阅读了许多有关Lisp各种优点的在线文章.但是,我需要一些建议.

I am a C++ programmer trying to learn Common Lisp. I have looked at some books like Land of Lisp and read numerous online articles about the various virtues of Lisp. However, I need some advice.

我所读到的有关Common Lisp的几乎所有内容都与它的惊人性,完成它的速度有多惊人,以及它如何惊人地解决了30年前现代编程语言中的许多问题有关.此外,还有多么惊人的宏,以及如何在Lisp中使用每个编程范例(OO,功能,基于actor的对象等等),以及列表如何成为最终的数据结构.基本上把Lisp当作一种研究语言,并说它是多么与众不同和具有革命性.

Almost everything I have read about Common Lisp has to do with how amazing it is and how amazingly fast you can get stuff done with it and how it amazingly solved many problems with modern programming languages 30 years ago. Also how amazing macros are, and how every every programming paradigm (OO, functional, actor based or whatever, etc) can be used in Lisp, and how lists are the ultimate data structure. Basically treating Lisp like a research language and saying how different and revolutionary it is.

所有这些东西可能都是正确的,但是问题是我还没有看到太多的东西来做一些实际的事情,例如读取文件并将其拆分为单词并对其进行一些处理.为了学习Common Lisp,我对学习Common Lisp并没有兴趣,但是为了让我以前在C ++中所做的事情更快地完成并且减少了错误.

And all that stuff is probably true, but the problem is I haven't seen much stuff how to do practical things like read a file and split it into words and do some processing on it. I'm not interested in learning Common Lisp for the sake of learning Common Lisp, but for the sake of getting thing that I used to do in C++ done faster and with fewer errors.

所以我的问题是什么是专注于教学如何使用Common Lisp来执行常见编程任务的最佳资源(无论是网站,书籍还是其他东西)喜欢

  • 如何读取文件
  • 如何读取文件,替换文件中的单词并将结果写回到文件中
  • 迭代目录中的文件和其他文件系统内容
  • 与SQL数据库交互
  • 通过套接字进行通信
  • 用于Web服务器之类的线程
  • 创建GUI
  • 对二进制文件执行操作
  • 编写一个解析器(不是Lisp中Lisp的解释器,据我了解,这就像Lisp的5行)
  • 与操作系统(即用C或C ++编写的东西)进行交互以完成Lisp本身无法做的事情
  • 如何用C语言编写Lisp扩展名(可能吗?)
  • 嵌入lua解释器(可以吗?)
  • How to read files
  • How to read a file, replace words in the file, and write the result back to the file
  • Iterate the files in a directory and other filesystem stuff
  • Interact with an SQL db
  • Do communications over sockets
  • Threading for stuff like a webserver
  • Create GUIs
  • Perform operations on binary files
  • Write a parser (not an interpreter for Lisp in Lisp, which as I understand is like 5 lines of Lisp)
  • Interact with the operating system (i.e. stuff written in C or C++) to do stuff Lisp can't do natively
  • How to write Lisp extensions in C (is that possible?)
  • Embed a lua interpreter (is that possible?)

还有一个不太实际的说明,即如何在Lisp中实现常见的数据结构,例如堆,堆栈,二进制搜索树等.但是,这可能只是使用Lisp的列表操作,例如carcdr以正确的方式.我不知道.

And also on a less immediately practical note, how to implement common data structures in lisp such as an heap, stack, binary search tree, etc. However that may be just using Lisp's list operations like car and cdr in the right way. I don't know.

我非常怀疑,对于Lisp来说,这一切(除了清单中的最后两个例外)都是不可能的,否则人们不会非常喜欢它.而且,我所阅读的上述文章提到了许多用Lisp(Yahoo!网站商店)编写的现实世界软件.

I highly doubt that any of this (with the unlikely exception of the last two in the list) is impossible with Lisp or people wouldn't love it so much. And the aforementioned stuff that I've read mentions plenty of real world software written in Lisp (Yahoo! web store comes to mind).

但是,在以前使用( the?)命令性语言进行编程之后,我急于开始使用自己获得的新知识来编写实际的应用程序.那么用Lisp学习编写实用软件的最快方法是什么?

However, having programming in a (the?) imperative language before, I am anxious to get to using what new knowledge I get to write real-world applications. So what's the quickest way to learn writing practical software with Lisp?

顺便说一句,我看过彼得·塞贝尔(Peter Seibel)的 Practical Common Lisp ,但是根据TOC的判断,它只涉及到一些我想学习的东西用Lisp来做.

By the way, I have seen Peter Seibel's Practical Common Lisp but, judging by the TOC, it only touches on some of the things I would like to learn to use Lisp to do.

我可以再问一个问题(对不起,如果将两个问题合并为一个问题),在哪里可以找到Lisp函数和内容的引用?

One more question if I may (sorry if this is combining two questions into one), where can I find a reference to Lisp's functions and stuff?

真的想要喜欢Lisp.

推荐答案

我建议阅读'实用的Lisp ",因为它已经回答了您的一些问题.

I would propose reading 'Practical Common Lisp', since it already answers some of your questions.

您应该阅读三到四本书:

  • Basic introduction to Common Lisp: Common Lisp: A Gentle Introduction to Symbolic Computation
  • Practical introduction to Common Lisp: Practical Common Lisp
  • More advanced Common Lisp: Paradigms of Artificial Intelligence Programming: Case Studies in Common Lisp. The book is interesting also for non-AI programmers.
  • Lots of practical advice: Common Lisp Recipes.

通用Lisp参考

  • Reference: Common Lisp HyperSpec
  • Printable Quick Reference: Common Lisp Quick Reference
  • Search Engine for Documentation
  • L1sp.org - redirect service for documentation

手册

现在,您应该检查的下一件事是Lisp实现的手册.它描述了许多特定的扩展:网络,线程,...

Now the next thing you should check out is the manual of your Lisp implementation. It describes a lot of specific extensions: networking, threads, ...

常见Lisp实现的文档:

Documentation for Common Lisp implementations:

  • Allegro Common Lisp
  • CLISP
  • Clozure Common Lisp
  • CMUCL
  • ECL
  • LispWorks
  • SBCL
  • Scieneer Common Lisp

SLIME (基于Emacs的Lisp-IDE)具有

SLIME (the Emacs-based Lisp-IDE) has a SLIME User Manual.

Common Lisp库的文档:

Documentation for Common Lisp libraries:

图书馆

供图书馆使用

  • Quicklisp: supported Libraries.
  • CLIKI (gives some overview)

现在查看您的一些观点:

  • 如何读取文件

HyperSpec 中查看文件和流字典. WITH-OPEN-STREAM,READ,READ-LINE,READ-CHAR,READ-BYTE,READ-SEQUENCE,...

See the files and streams dictionary in the HyperSpec. WITH-OPEN-STREAM, READ, READ-LINE, READ-CHAR, READ-BYTE, READ-SEQUENCE, ...

  • 如何读取文件,替换文件中的单词并将结果写回到文件中

在上方使用.另请参见:WRITE和相关内容.

Use above. See also: WRITE and related.

  • 迭代目录中的文件和其他文件系统内容

请参见上文.目录,路径名...

See above. DIRECTORY, pathnames, ...

  • 与SQL数据库交互

例如使用CLSQL库.

Use for example the CLSQL library.

  • 通过套接字进行通信

请参阅Lisp的手册或使用便携式库之一.请参阅Quicklisp.

See the manual of your Lisp or use one of the portable libraries. See Quicklisp.

  • 用于Web服务器之类的线程

请参阅Lisp的手册或使用便携式库之一.请参阅Quicklisp.

See the manual of your Lisp or use one of the portable libraries. See Quicklisp.

  • 创建GUI

视情况而定.请参见 Quicklisp 或特定于实现的库.

Depends. See Quicklisp or an implementation specific library.

  • 对二进制文件执行操作

有关文件和流操作的信息,请参见Hyperspec.写字节,读字节.将流作为二进制流打开.

See Hyperspec for file and stream operations. WRITE-BYTE, READ-BYTE. Open a stream as a binary stream.

  • 编写一个解析器(不是Lisp中Lisp的解释器,据我了解,这就像Lisp的5行)

为此使用现有工具之一.研究现有的解析器.有许多用Lisp编写的解析器,但是关于Lisp的书很少(除了AI语言中描述的自然语言解析器).

Use one of the existing tools for that. Study existing parsers. There are many parsers written in Lisp, but not much in books about that (other than natural language parsers, which are described in the AI literature).

  • 与操作系统(即用C或C ++编写的东西)进行交互以完成Lisp本身无法做的事情

视情况而定.请参见 Quicklisp 或特定于实现的库.

Depends. See Quicklisp or an implementation specific library.

  • 如何用C语言编写Lisp扩展名(可能吗?)

视情况而定.请参见 Quicklisp 或特定于实现的库. -> FFI

Depends. See Quicklisp or an implementation specific library. -> FFI

最终建议:阅读其他作者的代码.

研究其他Lisp代码.那里有足够多种多样的Lisp代码.从网络服务器到音乐创作软件.

Study other Lisp code. There is enough very diverse Lisp code out there. From web servers to music composition software.

这篇关于在哪里学习如何实际使用Common Lisp的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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