News for hackers. Stuff that matters.
Re:The Nature of Lisp (2006) by DrJokepu on Tuesday May 04, 2010 @06:36PM (#1319644)
Commenting on the last paragraph: I honestly believe that one of the biggest obstacles for newcomers to Lisp is Emacs.

Don't get me wrong, I love Emacs and it is truly the superior environment to do work in Lisp. However it has a bit of a steep learning curve just like Lisp itself and fighting two battles (one with Lisp and one with Emacs) is no easy task for someone coming from a Java / C# and Eclipse / Visual Studio background. I know because I've been there. That's why I decided to start work on an open source Visual Studio add-in to support for Common Lisp in Visual Studio itself. I think being able to do the first steps in a familiar environment would be a great help for newcomers. I wonder what you guys think of the idea?

Re:The Nature of Lisp (2006) by DennisP on Tuesday May 04, 2010 @09:18PM (#1320005)
As a C# developer in my day job, I think that is a completely awesome idea.
Re:The Nature of Lisp (2006) by mahmud on Tuesday May 04, 2010 @07:45PM (#1319821)
You want LispIDE

http://www.daansystems.com/lispide/

Hardly a substitute for Emacs/Slime, but for beginners, you can get a lot done. I use it when I am not plugged into in A/C outlet; it saves battery ;-)

Re:The Nature of Lisp (2006) by DrJokepu on Tuesday May 04, 2010 @07:49PM (#1319829)
Yes I know LispIDE, however it is really nothing more than notepad.exe with syntax highlighting and some basic REPL integration. I think of the VS F# editor with REPL ("interactive mode" as it is called there) as an example of what I'm trying to achieve.
Re:The Nature of Lisp (2006) by eru on Tuesday May 04, 2010 @08:14PM (#1319873)
The other way round could also work: Make people use Emacs for C first, then switch them to Common Lisp.

(However I like Scheme better anyway.)

Re:The Nature of Lisp (2006) by jockc on Wednesday May 05, 2010 @01:14AM (#1320390)
I started using emacs as a C programmer; even for C, emacs was a great environment, especially back in 1989; good integration with the compiler and cvs, auto indent, syntax highlighting, etc..
Re:The Nature of Lisp (2006) by b-man on Tuesday May 04, 2010 @07:12PM (#1319758)
Did you ever tried Drscheme?
Re:The Nature of Lisp (2006) by DrJokepu on Tuesday May 04, 2010 @07:15PM (#1319764)
Yes, DrScheme is awesome. However, I was specifically thinking of supporting Common Lisp, not Scheme as Scheme already has enough friendly tools for beginners.
Re:The Nature of Lisp (2006) by b-man on Tuesday May 04, 2010 @08:09PM (#1319861)
How about cusp[1] then? It is an eclipse plugin. Never tried myself, but it could be a starting point.

[1] http://sergeykolos.com/cusp/intro/

Re:The Nature of Lisp (2006) by DrJokepu on Tuesday May 04, 2010 @08:16PM (#1319878)
Yes, I've never seen that one before but it definitely looks promising. I'll have a look at it and see what it can do.
Re:The Nature of Lisp (2006) by derefr on Tuesday May 04, 2010 @10:58PM (#1320198)
Why not just bootstrap knowledge of Common Lisp by learning Scheme first, then?
Re:The Nature of Lisp (2006) by pchristensen on Tuesday May 04, 2010 @04:23PM (#1319193)
An oldie but goodie. This helped explain a lot of the often-praised features of Lisp and functional programming that had never made sense before.
Re:The Nature of Lisp (2006) by eru on Tuesday May 04, 2010 @08:17PM (#1319882)
Yes. However keep in mind that Lisp has left the forefront of functional programming mostly to ML derived languages.

Common Lisp isn't even very functional. Not much more than e.g. Python. Scheme is a bit more functional oriented.

Re:The Nature of Lisp (2006) by samatman on Wednesday May 05, 2010 @01:33AM (#1320411)
Clojure, OTOH, is beautifully functional. Also, it is supported by NetBeans and Eclipse, so no SLIME needed.
Re:The Nature of Lisp (2006) by eru on Wednesday May 05, 2010 @01:41PM (#1321867)
Yes, I forgot about Clojure.
Re:The Nature of Lisp (2006) by ced on Wednesday May 05, 2010 @04:56AM (#1320698)
> Lisp has left the forefront of functional programming mostly to ML derived languages

I'd be grateful if you could expand upon that statement. I'm a Lisper, and half the time I see one of these Haskell articles, I wonder if there really is a there there. For sure, functional programming can be a whole lot better than CL or Scheme, but I'd like to know if the difference is significant.

Re:The Nature of Lisp (2006) by eru on Wednesday May 05, 2010 @01:54PM (#1321921)
Depends on what you want to achieve. If you leave out the dimension of static vs dynamic typing, you could get most of Haskell's benefits by making your Scheme pure, and confining side-effects. (Monads are one solution for this, but not the only one. Have a look at Functional reactive programming, or see how Clean uses linear typing.) You could probably hack most of the pureness stuff together with macros in an already existing Scheme.

Purity by (strong) default makes it easier to combine your programs. Lazyness can help, too, but I am not completely sure whether you should make lazy the default. Chris Okasaki's "Purely Functional Data Structures" argues for needing both lazy and strict evaluation to guarantee asymptotic run times.

Have a look at, say, Software Transactional Memory to see what purity can buy you. Combinatorial parsers are another interesting application in Haskell; however they should be easily implementable in Scheme, too.

Please have a look at how http://www.cs.kent.ac.uk/people/staff/smk/redblack/rb.html uses the type system to statically guarantee the balance of red-black trees.

Please pardon that I mostly talked about the `how' and not so much the `why'. I hope giving some examples might not totally be in vain.

Re:The Nature of Lisp (2006) by pchristensen on Wednesday May 05, 2010 @02:44PM (#1322101)
I know. The article covers both (or did I mix it in with another of coffeemug's articles?). But coming from C# 2.0, Lisp's functional-supported-but-optional was still a big jump.
Re:The Nature of Lisp (2006) by eru on Wednesday May 05, 2010 @04:16PM (#1322429)
Yes. Lisp is an acceptable functional language, and its communities also value functional approaches. (Whereas Python gives you almost the same support from the language, but much less from the communities and libraries. (My main grief is that dicts only have side-effecting operations.))
Re:The Nature of Lisp (2006) by projectileboy on Tuesday May 04, 2010 @05:26PM (#1319389)
Ditto. Thanks to the RethinkDB guys for doing these all those years ago...
Re:The Nature of Lisp (2006) by mace on Tuesday May 04, 2010 @04:56PM (#1319289)
Re:The Nature of Lisp (2006) by eru on Tuesday May 04, 2010 @08:22PM (#1319891)
> After all, I was almost blinded by the infamous Lisp parentheses!

Lisp's parenthesis seem to share their deterrence factor with Python's significant indentation. Most people who have used one of them for a while don't even notice them any longer. At least not as a problem.

Interestingly, Haskell seems to be strange enough, that nobody fears its significant indentation.

Re:The Nature of Lisp (2006) by RyanMcGreal on Tuesday May 04, 2010 @09:50PM (#1320075)
Interesting. I instantly liked Python's significant whitespace. It just made sense: I was already indenting for readability, so why not make it meaningful as well and do away with curly braces and semicolons?
Re:The Nature of Lisp (2006) by eru on Wednesday May 05, 2010 @01:30PM (#1321844)
It was the same for me. Plays nice with "Say it once and only once.".
Re:The Nature of Lisp (2006) by Xurinos on Tuesday May 04, 2010 @08:49PM (#1319953)
If it's any consolation, I do not like its line noise. I already work with perl. I wanted to step up towards beauty.
Re:The Nature of Lisp (2006) by eru on Tuesday May 04, 2010 @09:13PM (#1319992)
Yes, Common Lisp is somewhat ugly. Scheme looks nicer.
Re:The Nature of Lisp (2006) by Xurinos on Tuesday May 04, 2010 @09:28PM (#1320026)
I meant Haskell. :) Turns out CL is pretty light on the funny syntax, and the few places it is used are optional -- but nice.
Re:The Nature of Lisp (2006) by eru on Wednesday May 05, 2010 @01:56PM (#1321925)
OK, I guess then I just have different preferences. I find Haskell much more bearable than CL in terms of beauty.

Scheme is nice, too.

Re:The Nature of Lisp (2006) by Xurinos on Wednesday May 05, 2010 @02:57PM (#1322148)
I have heard similar opinions on Haskell. I am definitely attracted to the convenient function currying and composition, but I realized I could do similar in CL and make it look like whatever made sense to me. I find the ability to create my own look and feel to supercede accepting someone else's look and feel.

I have no issues with Scheme, except that I have chosen to use CL over Scheme because it does feel like something of a batteries-included system.

On the other hand, I was annoyed by what I felt was inconsistent syntax with Haskell revealed in Real World Haskell chapter 13 (unfortunately my only experience with it) when they showed this function definition:

  mkFuncRec :: String -> (Int -> Int) -> FuncRec
vs this function definition:

  simplify :: (Num a) => SymbolicManip a -> SymbolicManip a

The =>, previously used to instance types, confused me here (they never explained how this definition differed), and I was having a hard time keeping up with all the various times I needed to use each special symbol. Of course, I tolerated it through C++ and perl, so if I ever decided to try a project, I could probably get used to it.
Re:The Nature of Lisp (2006) by eru on Wednesday May 05, 2010 @04:14PM (#1322418)
I see that the namespaces for values and types are somewhat separate in Haskell. Could you please describe your confusion again in different words?

Perhaps I am too used to Haskell, but I do not see anything confusing in those two definitions. What do you mean with "previously used to instance types"? As far as I can remember => is only ever used in the context shown above.

Re:The Nature of Lisp (2006) by Xurinos on Wednesday May 05, 2010 @04:19PM (#1322440)
The book introduced the second pattern out of the blue. What is the difference between those two function definitions? What does "=>" mean in this context? a :: b -> (c d) -> e makes sense to me, but f :: (g h) => i -> j -> k does not.

Here is the page that suddenly introduced that second form: http://book.realworldhaskell.org/read/data-structures.html

It is entirely possible I missed some context somewhere in there; "namespaces for values vs types" might be my clue. :)

Re:The Nature of Lisp (2006) by eru on Wednesday May 05, 2010 @05:49PM (#1322711)
In the example

  my_fun :: (TypeClass1 a, Typeclass2 b) => a -> b
the stuff preceeding the => declares what typeclasses the types you mention later should fall into.

A good example is the module Data.Map; this module deals with finite mappings of keys to values. Since those Maps are based on balanced trees, the keys have to be orderable/comparable. So for inserting a key into a map (http://hackage.haskell.org/packages/archive/containers/0.2.0...) we get the following type

  insert :: Ord k => k -> a -> Map k a -> Map k a
This just says that the type of keys has to be an instance of the class Ord (http://haskell.org/ghc/docs/6.12.1/html/libraries/base-4.2.0...). I.e. there has to be an instance declaration with the function

  (<=) :: a -> a -> Bool
Does that help?

By the way, if you want to find documentation about a function and you know its name or type, you can use Hoogle (http://www.haskell.org/hoogle/).

Re:The Nature of Lisp (2006) by Xurinos on Wednesday May 05, 2010 @08:13PM (#1323095)
the stuff preceeding the => declares what typeclasses the types you mention later should fall into.

That makes it clear. Thank you!