Which lisp should i use




















If Lisp is so great, why don't more people use it? The root cause is probably that it looks hard , but it would help if there were a dialect with extensive libraries. Where can I get a copy of On Lisp? Thanks to Chip Coldwell, you can now get a Postscript file of it online. It looks as if the book is going to be in print again soon, but if you are determined to have a valuable first edition, you can get a used copy at Amazon.

Some databases say that there is, but there isn't; not yet at least. Unfortunately not. I was supposed to write one, but we started Viaweb right after the book went to press, and I never got around to it. Where can I get a job hacking Lisp? Try the companies with Lisp applications. Or you could start your own. I like Lisp but my company won't let me use it. What should I do? Try to get them to let you use Python.

Often when your employer won't let you use Lisp it's because whatever the official reason the guy in charge of your department is afraid of the way Lisp source code looks. Python looks like an ordinary dumb language, but semantically it has a lot in common with Lisp, and has been getting closer to Lisp over time.

So with Common Lisp, you have a much larger overlap between implementations. For development, SBCL is great, as it is a free and open source implementation of Common Lisp which also has one of the best compilers to native code around, with well written code, you can get amazingly fast speed.

Practicall Common Lisp is a great resource for learning. It is very comprehensive, covering the important parts of the language and has some real-world examples. Land of Lisp is very nice, a bit more playful. I would say that the principle of scheme with a few well chosen primitives that compose into efficient abstractions is something I will forever carry with me. Common lisp is amazing as well. Have you tried Chicken? I'm playing with Scheme again and trying to decide between Chicken and Chez.

A bunch of very nice people. I have called it the friendliest place online for years. I ended up having to write some portable r6rs code, and that is easier in guile and chez, so that's why I went. I still feel a bit like I owe them to spread the word. Chicken is a very capable and plenty fast scheme.

I would say that it is slightly faster than, or just as fast as guile3, but slower than chez. Thanks for your assessment. Chicken's community looks pretty cool. I'm not super concerned about speed or portability right now, I'm just scratching a personal itch.

I'll have to check out Chez soon though. The course teaches the Racket language, but proceeds at a rapid pace. It follows the "How to Design Programs" methodology developed in the s?

There is a follow-up course, "How to Code: Complex data" but I didn't take it. I would start with Common Lisp. Best way to learn any language: build something. I picked Clojure and haven't looked back since.

If you keep wondering what's the best implementation, then you will suffer from analysis paralysis -- you'll end up spinning your wheels and doing nothing. Flip a coin, pick something, and start building. I can't say its the best way, but I found learning Clojure as my first was really helpful for me.

Like you, I prefer working on real projects as well. Given how easy it is to use both Java and JS libraries Clojurescript there's a bunch of real-world project ideas I could execute on web apps, CLI tools, cloud-related tooling. I'd say via Emacs is the easiest way. When you want to adapt Emacs to your workflow you are kind of forced to learn Lisp and once you have learned the basics you may be seeing yourself writing Emacs packages even. Progress with learning Clojure from there.

This is how I learned Lisp. It's not just a good way to learn lisp, it's also fun and has some nice side effects. Elisp is a bit quirky, I don't think it makes sense to invest time in it unless you plan to become an Emacs power user. That said Steve Yegge "Emergency Elisp" is a great intro. Try learning Common Lisp. Meta programming is way easier with Lisps. Python would not normally be classified as functional btw. For that matter, Common Lisp isn't a functional language by the modern definition either.

Python doesn't really have anonymous functions unless they are 1-line functions, which, in python, means they can't do much. This pretty much disqualifies it as a functional programming language.

Additionally, Guido and the community in general discourage functional programming. CL certainly supports a functional programming style, and there are some good libraries designed for this, and it certainly lends itself more to functional programming than python.

But CL isn't a functional programming language the way haskell, or even other lisps like scheme and clojure, are. CL is really a multi-paradigm language. You can use it for FP, or OOP, or straight imperative, and probably some other less-mainstream paradigm. It's up to you. I would recommend learning Clojure because you can immediately build useful and fun programs with it e.

If you're not familiar with lambda calculus - and if you do, you wouldn't likely ask this question - this article has a good chance to make you pause and re-evaluate importance and versatility of functions. The benefit of this article is that the code is in a more traditional JavaScript, and it talks about just some ideas - not the whole landscape, so it's relatively short. It's quite a project to read this an make all tacitly suggested exercises. The big point is that you can have an expression, which evaluates other expressions - in a chunk one can hope to bite.

After this you can aim to write your own interpreters. By this time you'll have some practical ideas about how closures are built; Michael Nielsen uses Python's functions for that.

Look at "Structure and interpretation of Computer Programs" for solid foundations. Look at "On Lisp" for e. I'd also recommend checking "Paradigms of Artificial Intelligence Programming" - another book by Norvig available on the Internet to read - which teaches Lisp while providing plenty of examples of its use for interesting problems.

You will probably get most out of pp. You'd see why Lisp is at times called "a big ball of mud", and how this old language somehow manages to become inspiration for new languages, while absorbing new ideas from modern language research.

I would recommend Racket over CL and Clojure. The ecosystem is self-contained unlike Clojure and the design is very clean unlike Common Lisp. Also it comes bundled with a nice and simple IDE. An award-winning book that serves as a serious introduction to the language with many practical projects. A fun introduction involving writing silly retro games in Lisp. I would recommend against learning Clojure because the error messages often tie too closely to the JVM, which might be annoying.

But really the main thing is macros which enable the above , macros allow for easy customisation of the language syntax to better suit the problem at hand. I had exposure to Scheme during my undergraduate years taking courses in programming languages and compilers, but earlier this year I started learning Common Lisp and I'm really enjoying the language.

I'm pining for the days of Symbolics Genera, the operating system for Symbolics LISP machines, but sadly it's not open source and it's extremely difficult to obtain a legal copy these days. This does not cover the entire language, but it covers the basics of the language, including macros. I went through this text and enjoyed its gentle introduction to the language. Good luck and have fun! Get hold of the educational versions of Allegro or Lisp Works and learn the real deal.

Unless you go with commercial Lisps, you likely won't get far without Emacs. Thus, one option to consider esp. No need for books, no need to setup anything, you're simply dropped into a huge introspection-enabled sandbox that is about to become your main tool. I started on Emacs with elisp. Then picked up Clojure afterwards. What features of lisp are you looking forward to?

If you just want to learn new concepts you want to keep things simple so could just stick with mit-scheme. You could start with How to Design Programs 2e, free[1]. You'll get good feeling of Lisp working with Racket-like language it's not a book about Racket. Then you could go with Clojure and work on some real projects. There are two MOOCs based on this on edx. Check out DrRacket and associated books. Your best bet is a wonderful book, The Little Schemer. Frankly, everybody speaks so highly of it, but I'm not getting it.

Since you're a newcomer I'd go by community. Clojure has by far the biggest and the friendliest community. Then there's scheme with an equally friendly but smaller community. And then theres common lisp. The community is probably bigger than the scheme one, but it's also where the zealots are.

This thread is the perfect example, all the non CL posts get downvoted no matter how well reasoned they are. Don't complain that you get downvoted, when you post nonsense. Clojure is not a dialect of Common Lisp. They are both Lisps, but neither is a dialect of one another.

I use Clojure at work and recreationally, and I learned Lisps first from it, so I am a bit biased, but I do think Clojure is a good Lisp to learn in I'd say Racket is a close second. So my rec would be to learn Clojure, and this is my curriculum of choice: 1. Bookmark them. Even better, get the Android app, so you can practice on the go, the bus, the bathroom. Also for some reason the order of exercise in the Android app is the best, so I'd try and follow that. Personally I like this kind of freedom that the language allows you to express a solution to a problem in the most suitable way.

You should note that above function is tail-recursive. However, you should also know that the Common Lisp ANSI standard does not specify that implementations should provide support for tail recursion.

Some implementations such as SBCL support tail recursion, while others simply do not, since this is not a strict requirement of the standard. The function below uses the DO iteration macro. Now we have solutions expressed in recursive, iterative and functional style. We do have now functions to fetch keys in nested hash tables, but is there a way we can tell what are all the keys in a given hash table?

In other words we want to know the key paths we can fetch in a hash table using above functions. Another possible approach to above function is to completely get rid of the recursion as a whole and use a stack data structure along with iteration.

Then we will see another implementation using a Depth-First Search approach. Another useful function from Clojure is select-keys. Another useful bit from the functional world is the group-by function. Check out group-by in Racket and group-by in Clojure for more info. Using group-by we can group items in equivalence groups. Say for example we want to group all items in a list in groups determined by their length. Another example showing how to group items in a list based on whether the item is being an odd number.

One final word about group-by - you should note that this functionality can already be used as part of the group-by library , which is available in Quicklisp, and contains more features out of the box such as using custom functions to extract the keys and values from items. Often times I find myself needing to repeat some sequence of items a given number of times. Here is how we can implement them.

When you need to partition a list of items into groups we can use the partition function as described below. Here is a recursive approach to implementing this function. And the iterative approach using DO iteration macro looks like this. However, see what happens if we try partitioning with a number greater than the items we can put in the group.

The last group contains only two items, since there was nothing left to fill in it. We can improve our first version of the partition function to support padding as well. Using the :pad key we can now fill our groups with whatever items is required to make it up for the number of items we initially requested, e. Implementing DFS is one of the things I tend to implement when starting with a new language. It is a good task to practice on. The solution below is more-or-less a translation of how I would implement this in Scheme for example.

I will use a property list to represent the adjacency list of vertices in my sample graph. Perhaps a better way to represent this would be to use a class, but I have yet to learn about CLOS in my Common Lisp journey, so for now a plist would be more than enough.

This works fine for our sample graph, but what if we wanted to traverse other data structures? Turns out that with slight modifications to above code we can make our DFS function work just fine with anything that can be traversed.



0コメント

  • 1000 / 1000