Live data from Hacker News

Answers from 2017 Common Lisp experts

blog.teknik.io

11–20 of 48 posts

Re: Answers from 2017 Common Lisp experts

#11
I really don't get the lispm's answer about cl21. What are the hidden treasures of the genuine Common Lisp we are ignorant of?

In my humble opinion Common Lisp is the classic example of the kitchen sink syndrome, where many pieces taken from various dialects were put together in a hurry. The results is not that bad (like, say, C++) but we know, arguably, a much more refined versions of Lisp, such as the dialect from Symbolics and Arc.

So, honestly, what are these hidden gems?

cl21, it seems, was an attempt to unify some syntactic forms rather than re-define what a Common Lisp is or should be. In that respect it is very remarkable effort. It is also a package - don't use if don't like.

The fair point that Common Lisp is a truly multi-paradigm language, so it includes mutating primitives alongside with "pure" functions and supports lexical and dynamic scooping, is rather difficult to grasp, but there is a lot of possibilities at the level of syntactic forms and embedded specialized DSLs, which, arguably, is what makes a Lisp Lisp.

It is never too much of embedded DSLs and syntactic sugar.

Re: Answers from 2017 Common Lisp experts

#13

Wow, that is great, thanks for putting it together! I have been using CL since the mid 1980s, but cumulatively have just used the language for perhaps five years. While I find myself using Python a lot because it wraps so many machine learning libraries and Java because of the ecosystem, there are other languages like CL, Ruby, and Haskell that all just make me feel good when I use them.

I have used Python, Java and C# in commercial projects for years, however i've started in CL some months ago and from my experience, it is much more suitable to general purpose development, including, definitively, commercial software development.

There have been voices that lament the supposed lack of libraries in CL, however i've found libraries for most of the things I would need anyways on a project, like ORMs, database access, compression, encryption, communication, etc.

There are also other voices that are scared by the lack of static typing, however CL is very strongly typed (it will strongly enforce types at runtime), and popular compilers like SBCL will accept type declarations that will also do many static-time type checks, plus these declarations will also greatly speed up the code.

Re: Answers from 2017 Common Lisp experts

#14
post #5

Earlier quoted context omitted.

I really wish I could use CL more. It's just that in almost every domain, the new libraries are elsewhere. You could use lisp for scientific computing, for example, but it'd be crazy to do so because you'd be reinventing so much that's getting built elsewhere. Similarly with games, C++ just has a lot more libraries available (you could FFI I guess, but that's never as bulletproof). Not sure lisp is better at any one…

You don't have to reinvent a thing, just use some ffi (foreign function interface) implementation and call into whatever you want.

To add to this reply, interfacing in C with Common Lisp is pretty easy today. There are at least two portable libraries to do this.

Also, you can also interface with Java libraries on the JVM by using the ABCL lisp implementation.

Re: Answers from 2017 Common Lisp experts

#16
post #5

Earlier quoted context omitted.

You don't have to reinvent a thing, just use some ffi (foreign function interface) implementation and call into whatever you want.

To add to this reply, interfacing in C with Common Lisp is pretty easy today. There are at least two portable libraries to do this. Also, you can also interface with Java libraries on the JVM by using the ABCL lisp implementation.

>There are at least two portable libraries to do this.

What are they?

Re: Answers from 2017 Common Lisp experts

#17
post #16

Earlier quoted context omitted.

To add to this reply, interfacing in C with Common Lisp is pretty easy today. There are at least two portable libraries to do this. Also, you can also interface with Java libraries on the JVM by using the ABCL lisp implementation.

>There are at least two portable libraries to do this. What are they?

I'd guess one is cffi:

https://www.quicklisp.org/beta/UNOFFICIAL/docs/cffi/doc/Intr...

Maybe with the help of cl-autowrap:

https://github.com/rpav/cl-autowrap/blob/master/README.md

There are others... :

http://www.cliki.net/FFI

Re: Answers from 2017 Common Lisp experts

#18
post #16

Earlier quoted context omitted.

To add to this reply, interfacing in C with Common Lisp is pretty easy today. There are at least two portable libraries to do this. Also, you can also interface with Java libraries on the JVM by using the ABCL lisp implementation.

>There are at least two portable libraries to do this. What are they?

One is CFFI, widely known and well documented, with tutorial and tooling:

https://common-lisp.net/project/cffi/

The other was UFFI, older; but then there are others. In fact, there are a ton of other projects for doing FFI in Common Lisp!

http://www.cliki.net/FFI

And then you can also use the FFI functionalities provided by the particular Lisp implementation (i.e. SBCL, LispWorks, ABCL, etc.)

However, the use of a portable library like CFFI means that you can take your code that runs correctly in SBCL, and then run the very same code in CLISP (other Lisp implementation) with no change at all.

CFFI works for the following Lisp implementations or "compilers": ABCL, Allegro CL, Clasp, CLISP, Clozure CL, CMUCL, Corman CL, ECL, GCL, LispWorks, MCL, SBCL and the Scieneer CL.

That's a lot of implementations!

Re: Answers from 2017 Common Lisp experts

#19
post #16

Earlier quoted context omitted.

To add to this reply, interfacing in C with Common Lisp is pretty easy today. There are at least two portable libraries to do this. Also, you can also interface with Java libraries on the JVM by using the ABCL lisp implementation.

>There are at least two portable libraries to do this. What are they?

[deleted]

Re: Answers from 2017 Common Lisp experts

#20
post #5

Earlier quoted context omitted.

You don't have to reinvent a thing, just use some ffi (foreign function interface) implementation and call into whatever you want.

To add to this reply, interfacing in C with Common Lisp is pretty easy today. There are at least two portable libraries to do this. Also, you can also interface with Java libraries on the JVM by using the ABCL lisp implementation.

Are there performance implications using FFI ?
Post reply on HN