HNHacker News
TopNewBestAskShowJobs

pavelludiq

2,130 karma · joined June 6, 2008

Nerd from Bulgaria. Im lazy, inpatient and excessively proud of my self.
submissionscomments
pavelludiq··on Mocl – a Common Lisp implementation for mobile platforms
A month ago mocl was considered vaporware by many. Not releasing it was damaging their "brand".
pavelludiq··on Mocl – a Common Lisp implementation for mobile platforms
It's actually cheap for a production ready(if it is) commercial cl implementation, but I agree, a trial version is essential.
pavelludiq··on Free "Lisp Hackers" Ebook
I am a huge common lisp fan and I recommend it to anyone interested in better ways of doing software. Start with Practical Common Lisp: http://www.gigamonkeys.com/book/

http://www.cliki.net/ has a lot of useful resources for people who are just starting.

If you prefer a functional language(Common Lisp is multi-paradigm, and isn't particularly better at FP than say python) clojure and scheme are good options. I recently started reading Realm of Racket, which seems like a pretty good introduction to Racket(a scheme like language).

I recommend learning all 3 dialects, all of them deserve deep study and I strongly favor Common Lisp as the most mature and versatile one.

pavelludiq··on Free "Lisp Hackers" Ebook
"We pay a royalty pf 90%, minus 50 cents, on your sales." https://leanpub.com/help/author_faq

So if you pay 10$ the author gets 8.50$. As a leanpub author myself, I find this arrangement very good. The only problem with leanpub I have is that the 45 day money back guarantee is too long, and if that period happens to end in the beginning of a month, you have to wait for the start of the next one in order to get paid(leanpub pays in the first 3 days of a month). I had to wait two months for my first payment. I'm not complaining, leanpub haven't wronged me in any way, and in fact I have benefited from people paying much more than the suggested price(15$ for my book, 5$ minimum price). Leanpub is a great service! I recommend more people republish their blogs or publish new material with it.

pavelludiq··on Clojure Cookbook is now accepting contributions
There is also Marco Baringer's screencast on using slime to work with common lisp: http://www.youtube.com/watch?v=_B_4vhsmRRI
pavelludiq··on Electronic Frontier Foundation Survives on $5M/year
I've just set up for 10% of my royalties from https://leanpub.com/lispwebtales to go to the EFF. It's a very modest contribution(I made ~150$ this month from the book, and expect slightly less next one) but I intend to increase the percentage if sales go up.

Leanpub makes it very easy to set up such donations, if you are an author, consider doing so. You owe it to the free internet that you have such an opportunity in the first place. At least that is my reasoning.

pavelludiq··on SICP distilled (2009)
You have taken a statement that essentially means "Lisp is a pretty good general purpous language" and interpreted it as "If I use lisp I have to create the universe from scratch in order to make an apple pie, and others will have to rediscover all of physics to exist in my universe".

Common Lisp, Clojure and Racket all have at the very least a descent set of libraries. And if you use clojure or ABCL, you get all of the jvm libraries too. With FFI you can use any C library from Common Lisp or Racket too. On top of that you get to use languages designed for extensibility, which means that there are actual best practices and examples of how to extend a language without painting yourself into a corner with an unmaintainable mess. Lispers have been doing stuff like this for decades, some of it is very well understood in the various lisp communities.

My favorite example of this power are the various sql DSLs, I can write in lisp something like (query (:select :* :from 'some-table :where ...)) without having to concatenate strings and worry about injections. Yes, I have to learn a new language on top of Common Lisp to use it, but if you know SQL and Lisp, you already know 90% of it. Now I have all the power of lisp in my queries, isn't that cool?

pavelludiq··on Ten Years of Purely Functional Data Structures (2008)
Common Lisp is in the same category as a FP-ish language but still mostly used in a mutable OO fashion. We have a library called FSET written in CL to add persistent data structures and convenient syntax for them to the language. I don't know how powerful ruby meta-programming is, but I imagine it isn't as easy to do(like add a syntax for persistent maps that is as convenient as the built in one). Not to mention that ruby has a reputation for much worse performance than CL, so you'll likely have to use FFI and write most of it in C.

As for clojure, I think they are all implemented in java, but I haven't been following clojure development in two years, so maybe with protocols they moved them(or could) to clojure? I don't know.

pavelludiq··on Lisp In Summer Projects: Coding Competition
There is a book called Lisp in Small pieces, which I assume inspired the name, also a lisp tutorial called "Lisp in small parts": http://lisp.plasticki.com/ also probably inspired by the book title.
pavelludiq··on BODOL – inspired by Haskell, Clojure and Shen
Obviously you haven't seen the lisp ads from the 80's :) Lisp was surely hyped then. Not to mention all the hype from people like ESR and PG. Even clojure owes part of it's success to the great presentation skills of Rick Hickey and the other early clojure adopters. Languages DO succeed mostly because of marketing, if it was features, then smalltalk would have won, and C++ and Java never would have existed, Lisp would have won and python, ruby and perl would have been forgotten. Even other technologies works that way too, NeXT and the other Unixes would have won, and windows would have never had a chance if what you are saying is true.

As for the name, if clojure was named anything that had the word "lisp" in it, like "foo lisp" or the like, it would have been dead already. Even racket had to get rid of the word "scheme" from their name for marketing reasons.

pavelludiq··on Clojure is not a Lisp [2009]
I haven't read the article, but when I say, in a certain context, that I don't consider clojure a Lisp, what I might mean is that clojure is not descendant from the original McCarty lisp. You can trace Common Lisps or Emacs Lisps roots from MACLISP back to that. In such a context where the definition of "lisp" is sufficiently narrow, I might call languages like clojure and scheme "lisp like languages", or "distant dialects".

It isn't any different from saying Linux is not Unix, but the various BSDs are. It doesn't really matter at all, and when used in the wrong context, such phrases can be confusing.

pavelludiq··on Learning Lisp The Bump Free Way
You meant Eclipse, obviously. But I'm not sure that is a good platform for a lisp IDE, cusp probably became abandonware for a reason. Perhaps something half usable can be done with sublime?
pavelludiq··on Learning Lisp The Bump Free Way
Scheme emphasizes building your software out of a small set of primitives. These primitives are themselves as conceptually simple as possible. an example is the map function which works on lists. In cl, the map function takes a designator for a return type and can take an arbitrary sequence(list, array or string). so if I want to turn a string into a list of characters in CL it would be (map 'list #'identity "hello") and I would get (#\h #\e #\l #\l #\o). For the special case, there is mapcar, which is the equivalent of map. There are also a bunch of other "map" like functions in CL. CL emphasizes a rich set of tools in this way.

Another example is the member function. member checks to see if an element is in a list. In CL member takes an element, a list as well as several keyword arguments that control how the searching is conducted. One such keyword argument is test which is used to compare the element to the items in the list, and another one is key, which is called on the items in the list before they are compared to the searched element. In scheme you don't have the key argument, which is already a drag, and instead of having a test argument, you have 3 functions: member, using equal?, memq which uses eq?, and memv, which uses eqv? for comparison. If you need anything more than that, in scheme you'll have to write your own such function. in CL, you just pass two functions to member to control how it works. In that way, CL is actually much more conceptually simpler than scheme, but we have to keep myths alive, don't we :)

Another example is the CL concept of a generalized boolean. In CL nil is false, and everything else is true, with T being the canonical true value. In scheme you have special values representing true and false, which again complicates code a bit, but is more conceptually simpler. I consider this to be a great design blunder on schemes part.

Another example is that CL is very much an OO language, much more than an FP one. You have classes, methods, inheritance, mutable slots, and all sort of messy and complicated things that come in handy every once in a while.

I can go on for ever, but I won't even get to clojure, which is I think much more interesting. Clojure emphasizes immutability and laziness. Neither CL nor Scheme force you to be use immutability, but clojure does everywhere it makes sense to do so. Laziness is something else clojure emphasizes. And although there are libraries for CL to make it very much a clojure like language, it isn't the default.

pavelludiq··on Learning Lisp The Bump Free Way
There isn't really a great cost to learning the basics of a language. Lisp dialects are very easy to learn, at least to a beginner level. You can learn enough of any lisp dialect to start writing "useful" programs in a few days, just try them out in whatever order you prefer and see which one you like to get deeper into.
pavelludiq··on Learning Lisp The Bump Free Way

  So, to answer your question, there's no reason why one should learn Scheme over Common Lisp (or vice versa), if all you're looking to do is learn the concepts.
Once you scratch the surface, Scheme, Common Lisp and Clojure emphasize very different concepts, in some cases they even conflict in philosophy fundamentally. I'd say give all three a chance and pick a favorite. I picked Common Lisp, but that's just me.
pavelludiq··on Learning Lisp The Bump Free Way
I'll see what I can do about that.
pavelludiq··on Lisp Is Too Powerful
As e certified smug lisper(you get to be one when another smug lisper calls you one :), I would say that there are many of us who just don't care whether or not lisp gets more popular, but I don't think I've ever come across anyone who would intentionally drive away new users(except for obvious trolls, who come to #lisp and ask what it is used for, and get angry when we answer: "Writing software", one even called us cts :).

I don't really mind more popularity, but my definition of a mainstream language is "The non-technical boss prefers it, because of reasons completely unrelated to its technical qualities.", in which case I agree with the snobs, we don't need that at all.

But if by mainstream you mean "It moves up from its current position as 33th most popular language on github", sure, why not. If by mainstream you mean "more companies start using it for useful software that makes money": http://this-plt-life.tumblr.com/post/36425247242/when-i-hear...

I consider Common Lisp to be a tremendous success, some of the coolest software was written or prototyped in it, including many language implementations. Not to mention what a tremendous achievement it is for a modern lisp system to be able to run 4 decades old code with little or no modification. Being mainstream was probably never a design goal, but the things listed above are, and that is probably why many lispers simply don't care about being mainstream, the language is not optimized for that at all. I don't thing that makes lispers snobs, they've just self-selected for people who can work with less community support. It's like a low-econ game of starcraft :)

pavelludiq··on Lots of Irritating Spurious Parentheses (2005)
My keyboard setup is as follows: dvorak layout, with the parens remapped where the "w" and "e" are on querty. In order to make emacs easier to use, I have the Ctrl mapped to the Alts and meta mapped to the win key. Caps Lock is backspace. Some people map Caps Lock to Ctrl, but this isn't needed in my setup. I've read about custom layouts with the parens on the home row.
pavelludiq··on Show HN: I'm writing a leanpub book about Common Lisp web programming
I have decided to investigate the possibility to include a sub-chapter to chapter 3 to discuss Caramel for people who like enlive(me included). I didn't already do so because caramel is brand new, and I haven't had the time to try it out beyond a few simple examples.

The choice to use s-expressions was made because It makes it easier to just type code in a repl and experiment, without having to worry about dealing with templates, and also because I wanted the first example to fit in a single file.

pavelludiq··on Show HN: I'm writing a leanpub book about Common Lisp web programming
There is also a recent Common Lisp enlive like library called Caramel: https://github.com/pocket7878/Caramel
pavelludiq··on Show HN: I'm writing a leanpub book about Common Lisp web programming
It's in the appendix A: http://lispwebtales.ppenev.com/chap06.html#appendix-a-gettin...
pavelludiq··on Show HN: I'm writing a leanpub book about Common Lisp web programming
There is a port of Googles closure-template system. It compiles closure templates to CL functions. They work pretty well. I have written about them in the book: http://lispwebtales.ppenev.com/chap04.html#closure-template

It also compiles to js, so you can even share templates between the client and the backend.

I'm experimenting with using both sexml and closure-template, but in the book I use almost exclusively sexml to make the code simpler. Also s-expressions are much easier to type in than sgml :)

pavelludiq··on Show HN: I'm writing a leanpub book about Common Lisp web programming
Many lispers prefer to roll their own thin layers on top of hunchentoot, or even use it raw, but I prefer the slightly ticker layer of restas.
pavelludiq··on Show HN: I'm writing a leanpub book about Common Lisp web programming
In general if you prefer FP, clojure is a great choice. If you like multi-paradigm, and mixing up OO with FP, and procedural as you see fit, go with CL. I'm a multi-paradigm kind of guy, but clojure remains my second favorite language :)
pavelludiq··on Show HN: I'm writing a leanpub book about Common Lisp web programming
Functions starting with <: are generated by the sexml library for outputting xml and html from lisp expressions. There are many similar libraries in pretty much every lisp dialect.
pavelludiq··on Show HN: I'm writing a leanpub book about Common Lisp web programming
Link to leanpub page: https://leanpub.com/lispwebtales
pavelludiq··on Ask HN: Why is HN based on tables?
They actually rewrote it in python because in 2003 open source implementations were of much lesser quality, also, hunchentoot didn't exist, and neither did the modern lisp frameworks like caveman/clack or restas. CCL and SBCL are way better than CMUCL and clisp, which is what I believe they used(CMUCL is barely used these days, and clisp has a bunch of rough edges and being byte compiled is slow, unlike ccl and sbcl which are pretty fast). These problems are no longer valid, and if reddit were to be written today, it would be less likely to be rewritten in python. Lisp has gone a very long way in the last 10 years.

Using common lisp and restas + Postmodern(for postgreSQL access) today is actually a better choice than using something like flask or sinatra. And since i dislike full stack frameworks, my personal opinion is that it's better than django or rails too, for a small team of good hackers.

pavelludiq··on Not Lisp again (2009)
Which means little. Scheme and CL have been going in very different directions pretty much since the beginning. Idiomatic Scheme code and idiomatic CL code are very different.
pavelludiq··on Readable Lisp S-expressions Project
This is the response anybody who tries to make s-expressions "more readable" will get from lispers: don't bother. It didn't work in the 60's, why would it work now?

Parens aren't unreadable, not like a sigil and punctuation heavy language, and on top of actually being reasonably readable, they are also extremely easy to edit with something like paredit in emacs and vim. So reasonable readability and extremely easy editing are working against you, also making the code easy to parse gives you not one, but three reasons not to waste time on such ideas.

Now, let's look at the reasoning this page gives for this endeavor(from http://sourceforge.net/p/readable/wiki/Problem/):

"Many people find Lisp's s-expressions hard to read as a programming notation, and thus reject them both."

And many find them perfectly readable.

"As noted below, even Lisp luminary Paul Graham agrees that Lisp notations have readability problems!"

The page lists several quotes from various people. Interestingly, the two quotes from PG aren't good very good support. The first one talks about mathematical expressions, but I tend not to write many of those in my code, so it is a minor problem at best. And there are macros that let you write infix math in Common Lisp, surely there exist equivalents for scheme and clojure.

The second doesn't even talk about lisp, but about code readability in general:

"When you program, you spend more time reading code than writing it... a language that makes source code ugly is maddening to an exacting programmer, as clay full of lumps would be to a sculptor."

Although I do agree with this quote, I don't believe it applies to lisp, all of the readability problems I have with lisp code have to do with bad naming, bad indentation(something parens actually help with, because the editor can indent your code automatically, since it is easy to parse) and really, nothing unique to lisp.

"I have more faith that you could convince the world to use esperanto than [to use] prefix notation." By Paul Prescod

function(argument1,argument2) is not prefix? Sure Object.method(args) is infix, but in general, programmers use prefix all the time. Command lines are prefix, nobody writes "filename copyfile /destination/directory" in the shell. Bullshit argument.

"Lisp has all the visual appeal of oatmeal with fingernail clippings mixed in." A Larry Wall quote in an argument about readability, this one might actually work in my favor :)

"After 13 years of doing Lisp and 3 or 4 years of Python, I agree: I prefer writing Lisp, but Python is easier to read." By John Wiseman

I agree, Python is easier to read. This is not an argument for lisp being hard to read, it's an argument for python being easier.

"LISP: ... mythically from ‘Lots of Irritating Superfluous Parentheses’ " Jargon File

HaHa, actually none of the parens are superfluous, unlike in C like languages, where they are, if only you can remember all the damn operator precedence rules, if you can't, they aren't superfluous there either, and you need them to actually make the code more readable. HaHa indeed :)

"... and don't ask me about the extraneous parenthesis. I bet some LISP programmer felt alone and decided to make it a bit more homey." Linus Torvalds

I don't know the context of this, but I'm willing to bet he was talking about C code.

"[If only] we could find characters or signs suited for expressing all our thoughts as clearly and as exactly as arithmetic expresses numbers" Gottfried Wilhelm Leibniz

WTF? I'm pretty sure Leibniz was slamming Newton and not Lisp :)

"A language should be designed in terms of an abstract syntax and it should have perhaps, several forms of concrete syntax: one which is easy to write and maybe quite abbreviated; another which is good to look at and maybe quite fancy... and another, which is easy to make computers manipulate... all should be based on the same abstract syntax... the abstract syntax is what the theoreticians will use and one or more of the concrete syntaxes is what the practitioners will use." John McCarthy

This is a bit difficult to refute, since on the one hand, it sounds reasonable, but on the other hand history didn't work out that way. Some of this is here today, Common Lisp has reader macros, and in Racket you can insert the Greek symbol lambda, instead of typing it out in English. But at least with reader macros, being as conservative about adding them is a good idea, since ultimately they make the code harder to read if overused. I think McCarthy was just throwing ideas out there, and didn't have the decades of hindsight we have today, people have been writing and reading Lisp code for 50 years with little difficulty, and only introducing new people has been a problem, and only because these people have been introduced to alternative notations earlier. Start small children on Lisp, and they would think 5 + 3 * 4 is unreadable, and (+ 5 (* 3 4)) is easy to read.

The page continues to say:

"Indeed, Lisp notation has changed over time; the quote operator ' was not in the original Lisps, and was added because that construct was so common that it was worth creating an abbreviation. We're just working to add new abbreviations."

As I mentioned, that can actually make code less readable if overused. Common Lisp has many such abbreviations: #' for function, #() for vectors, #P"" for pathnames, etc. And the mechanism is extensible, so you can go crazy if you want, adding #{} for hash tables is only a few lines of code.

I'd like to conclude with this great essay I came across yesterday: http://www.storytotell.org/essays/good-for-whom.html

pavelludiq··on Dialects of Lisp
You are somewhat correct, but one of the reasons I love common lisp is exactly because it sort of overcame this "bad timing", which is very unforgiving to lesser languages. The fact that today I can write lisp apps in a language whose primary platform(the lisp machine) died 20 years ago, and still enjoy a relatively active ecosystem is quite impressive.

Do you think clojure has the potential to be useful in 20 years if the JVM dies today hypothetically? I don't know, I think yes, because it has a bunch of good ideas, but it isn't at all clear. Take JS as an opposite example, if the web is to disappear, JS will disappear as well, no matter how many other platforms it is ported to, it just isn't good enough to stand on its own.

I could be talking out of my ass here, but my point was that CL has a good track record for survival, so it has the potential for a 100 year language, while clojure is yet to prove itself for such a task. These things are extremely hard to predict, tech history has a habit of throwing such wild-cards as personal computing and the web. We'll see.

← PreviousPage 4 of 22Next →