Domain: b9.com
Stories and comments across the archive that link to b9.com.
Comments · 6
-
Re:Things I Miss
You're completely right. Having said that, I would like to point you to CLSQL, which takes database access way beyond what DBI provides. You can do SQL queries...but you can also embed SQL fragments in Lisp code, and even tie database records to CLOS objects and relations to Lisp functions. I'm sure the same functionality exists in some Perl module (as well as in Ruby on Rails), but it's still amazing.
-
Re:Better APIs
Assuming you meant the link to my essay, it's right in my original post, but here goes again: Better Software Through Better Languages. It doesn't actually contain the source for the macro, but the following works:
(defmacro query (&rest parts)
(format nil "~{~A~}" (mapcar (lambda (part)
(if (stringp part) part (sql-escape part))) parts)))
where sql-escape should return an appropriately escaped string.
However, I guess it would be a better idea to just use CL-SQL. -
Re:I Prefer the Elisp Implementation
My biggest gripe with LISP is that there are so many fragmented implementations that if you're looking for an app that does something cool (Like dynamic web page generation) it typically won't be in the variant of Lisp that you're currently using.
While this does happen in areas which are not treated by the Common Lisp standard (notably network programming and concurrency), it really isn't the problem you make it out to be.
Here's just a handful of code libraries and frameworks for Common Lisp and the implementations they support:
- Araneida, an extensible web server and webapp framework: SBCL, CMUCL, OpenMCL, ABCL, CLISP, AllegroCL, LispWorks
- UnCommonWeb, a continuations-based web application framework: OpenMCL, CMUCL, SBCL, CLISP, AllegroCL
- CL-SQL, a powerful database library: AllegroCL, LispWorks, SBCL, CMUCL, OpenMCL
- McCLIM, a free implementation of the CLIM user interface library: AllegroCL, CMUCL, SBCL, OpenMCL, LispWorks, CLISP
- Cells-GTK, a GTK library built on top of Cells, for declarative UI development (a very powerful approach): AllegroCL, LispWorks, CMUCL, CLISP
- CL-PPCRE, a fast Perl-compatible regular expression library (which is faster than Perl's regexp engine, incidentally): AllegroCL, CLISP, CMUCL, Corman Lisp, ECL, MCL, OpenMCL, SBCL, SCL, LispWorks, Genera
- XMLisp, a very interesting intersection of XML and CLOS objects: MCL, LispWorks, OpenMCL, SBCL, CLISP
- ACL-COMPAT , a library with socket programming support (et. al.): CLISP, CMUCL, Corman Lisp, LispWorks, MCL, OpenMCL, SBCL, SCL
-
Re:Use Lisp
> LOL. Where are the Lisp bindings for MySQL?
http://clsql.b9.com
-Peter -
Re:O'Caml....the future today
(here, Lisp = Common Lisp)
Depending on the implementation, you can get some type checking (CMUCL and SBCL do type inference a lot, iirc).
While ML has type checking, it also needs a different operator for each type of argument. It probably affects refactoring a little and is sort of annoying, but nothing serious.
Just consider the Lisp "system" as a library. Depending on the smartness of the compiler, it can be shaken down to a smaller size.
FFI isn't exactly hard to do. From UFFI's (LGPL) manual:
def-function name args &key module returning
(def-function "gethostname"
((name (* :unsigned-char))
(len :int)) :returning :int)
Bah syntax. Both our opinions are probably extremely well anchored :)
How's Lisp harder to use imperatively? Just about every control operator has an implicit progn.
Faster. Often true, but how much so? Lisp, with annotations and compiled for speed instead of safety, is pretty to close to C. (Here's the last troll-induced response I can remember: http://home.comcast.net/~bc19191/blog/040308.html) . However, how much and how often does it matter?
Better metaprogramming support. -
alternatives