Practical Common Lisp

Posted on
Practical Common LispPractical Common 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. 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. 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. Closed as off-topic by,,,, Aug 22 '15 at 7:48 This question appears to be off-topic. The users who voted to close gave this specific reason: • 'Questions asking us to recommend or find a book, tool, software library, tutorial or other off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, and what has been done so far to solve it.' – Joshua Taylor, Pang, Gosu, EdChum, greg-449 If this question can be reworded to fit the rules in the, please. I would propose reading ', since it already answers some of your questions.

Practical: A Simple Database. Obviously, before you can start building real software in Lisp, you'll have to learn the language. But let's face it--you may be. Lisp is often thought of as an academic language, but it need not be. This is the first book that introduces Lisp as a language for the real world. Practical Common.

There are probably three to four books you should read: • Basic introduction to Common Lisp: • Practical introduction to Common Lisp: • More advanced Common Lisp:. The book is interesting also for non-AI programmers. • Lots of practical advice:. Common Lisp Reference • Reference: • Printable Quick Reference: • • - redirect service for documentation Manuals Now the next thing you should check out is the manual of your Lisp implementation. It describes a lot of specific extensions: networking, threads. Documentation for Common Lisp implementations: • • • • • • • • (the Emacs-based Lisp-IDE) has a.

Documentation for Common Lisp libraries: • Libraries For libraries use •:. • (gives some overview) Now looking at some of your points: • How to read files See the files and streams dictionary in the.

WITH-OPEN-STREAM, READ, READ-LINE, READ-CHAR, READ-BYTE, READ-SEQUENCE. • How to read a file, replace words in the file, and write the result back to the file Use above. See also: WRITE and related. • Iterate the files in a directory and other filesystem stuff See above. DIRECTORY, pathnames. Artromot E2 Compact Elbow Cpm Manual there.

• Interact with an SQL db Use for example the CLSQL library. • Do communications over sockets See the manual of your Lisp or use one of the portable libraries. See Quicklisp. • Threading for stuff like a webserver See the manual of your Lisp or use one of the portable libraries. See Quicklisp.

• Create GUIs Depends. See or an implementation specific library. • Perform operations on binary files See Hyperspec for file and stream operations. WRITE-BYTE, READ-BYTE. Open a stream as a binary stream. • Write a parser (not an interpreter for Lisp in Lisp, which as I understand is like 5 lines of Lisp) 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). • Interact with the operating system (i.e. Stuff written in C or C++) to do stuff Lisp can't do natively Depends. See or an implementation specific library.

• How to write Lisp extensions in C (is that possible?) Depends. See or an implementation specific library. ->FFI Final advice: Read code from other authors. Study other Lisp code. There is enough very diverse Lisp code out there.

From web servers to music composition software. Check out it provides a list of libraries available for Common Lisp which will help you accomplish all your items. Also, you're going to want to check out (there's also a more ). It has a bunch of code for common tasks such as, and. You can write extensions for Lisp in C depending on which implementation you're using. Emacs-Lisp for example allows you to do that though it isn't Common Lisp.

Usually what you want to do is write the code in Common Lisp and then optimize it as much as possible using different Lisp compiler declarations, or the other method where you use a foreign function interface. Threading depends on which implementation you use, but I think most of them have threads now. Is one of the best Lisp web servers and is pretty easy to get started with. You don't have to write any threading code yourself, you just have to write the HTTP request handler functions.