freenode/lisp - IRC Chatlog
Search
4:42:33
pillton
beach: In order to create an image you need to write a Docker file which provides instructions on how to create the image. In CL, you just load the system with ASDF and save the image using save-lisp-and-die.
4:43:04
ldbeth
However it is still not very gracefully if you need external C libs for your CL programs
4:46:56
dbotton_
that article is well known I am sure, but is the marketing approach that works, even 17 years later has a good angle
4:48:13
dbotton_
push the technical angle to peak interest in the right developers and peak business interest that the language has real advantages
4:51:53
beach
dbotton_: If I remember correctly, ViaWeb was sold to Yahoo, who turned it into Yahoo Store by rewriting everything in some other language. I forget which.
4:53:55
beach
Why do you think Clasp is important? I am not questioning its importance, but I would like to know your reason for saying that.
4:54:51
beach
My take on Clasp is that drmeister thought it would be better to make C++ usable from Common Lisp than to rewrite CANDO and all the other chemistry libraries in Common Lisp.
4:56:53
beach
And why is that desirable, unless you are one of the people or companies who want to take free stuff and then commercialize it for your own profit?
5:00:26
dbotton_
most rewrites are because employees think they have better chance for next job with those skills
5:00:52
beach
Let me repeat this again: It is amazing how much time and energy people are willing to spend in order to avoid learning and using Common Lisp.
5:01:18
dbotton_
that is why universities drop languages that help actually develop a programmer in to something more
5:12:55
drmeister
But it passes all but a few of the ANSI tests. Currently we are improving the compiler to improve performance.
5:13:19
drmeister
Yes - I haven't had time to update that. I've been focused on other things for the past 8 months.
5:15:34
no-defun-allowed
What makes using LLVM your code "useful many years from now", may I ask? SBCL is also public domain or BSD licensed if it's still a license thing.
5:16:32
drmeister
no-defun-allowed: If that is a question for me I don't know if using LLVM does - although it does allow us to interoperate with C++ code.
5:16:42
no-defun-allowed
Not to say you shouldn't use Clasp, but an older implementation would probably cause less headaches to set up.
5:17:23
dbotton_
and for me a possibility for using it on platforms not supported by other compilers
5:17:37
no-defun-allowed
drmeister: Yes, I was wondering what the relationship dbotton_ appeared to have between LLVM and stability.
5:18:04
drmeister
dbotton_: We are about to generalize things so that we can run on any backend that llvm has. Currently we are tied to x86_64
5:18:34
no-defun-allowed
drmeister: I suppose "more commonly used implementation" would be more accurate, but I don't want to make it sound like usage and ease of use are related.
5:18:37
drmeister
LLVM has a lot of investment in it - it's a slow - but pretty good compiler backend library.
5:19:39
drmeister
It would have been hell to achieve C++ interoperability with other Common Lisp implementations because of peculiarities of C++ - and C++ is a moving target.
5:19:42
beach
drmeister: I am betting that it is a very complex one too, partly due to the fact that it is written in a language without sophisticated development facilities like GC and CLOS.
5:19:56
no-defun-allowed
Some people have said that Clozure is nicer to work in, though it's less commonly used than SBCL, for example. And telling someone to use what's most frequently used is a good way to cause stagnation.
5:20:04
drmeister
Why maintain C++ interoperability - there are a lot of C++ libraries I want to use.
5:22:16
drmeister
beach: Yes - but there are a lot of people working on LLVM - and they do the massive amount of work it takes to move it forward.
5:22:40
drmeister
It's still slow, slow, slow. SBCL is a much faster compiler and it generates really good code.
5:23:05
beach
Sure, but it seems to be moving forward in all the ways that I see with C++ itself and other languages, making it a moving target as well.
5:23:20
no-defun-allowed
dbotton_: Also, you may get a kick out of the support grid on http://www.sbcl.org/platform-table.html
5:23:59
beach
So I am wondering whether it takes that massive amount of work because it is complicated, and meant to be used to compile a complicated moving target language.
5:25:18
drmeister
I don't know - it's a large software library written in C++ - I'd be surprised if it was fast and efficient and easy to maintain.
5:26:33
drmeister
I try not to complain about the stuff I use - I'm just glad it's there and I didn't have to write it.
5:29:32
drmeister
dbotton_: I really just care about one thing - I want to write software that works five, ten, twenty years later. That way I can build stuff over a long time that keeps working. There are only a few languages that support that. Fortran, C, C++, Common Lisp.
5:31:07
dbotton_
We were talking about Lisp and have the elements for success and that I believe is the most important point
5:31:40
drmeister
I've lost way too much code because I wrote it in poor choices like Python, TCL, and Smalltalk etc.
5:31:44
dbotton_
that my investment in a language will be there years from now, ie I can compile and run what I wrote 20 years ago
5:33:02
drmeister
Right - and I think C++ is a reasonable domain specific language for working with tightly packed structures - but I don't want to write anything too complicated or exploratory in it.
5:34:18
drmeister
I didn't think Clasp would be as much work as it turned out to be. Writing an efficient language implementation is HARD.
13:58:23
Bike
if you're adding strings rather than characters, i would use concatenate or indeed with-output-to-string
13:58:36
Nilby
from my tests reduce by conatenate is fastest on sbcl and with-output-to-string is fastest on ecl
14:01:29
phoe
if you collect into a vector then you'll need to copy it anyway in order to have ("x" "xx" "xxx" "xxxx" ...)
14:02:50
dlowe
You might want to use reduce instead of apply so as to not hit argument number limits
14:05:58
jackdaniel
(loop until (string-equal (random-string) (expected-result)) finally (return (random-string))) ; that will work under assumption, that random-string will generate the same string twice in a row
14:07:36
dlowe
an efficient implementation would sum the lengths of strings, create a new string of the proper size, and REPLACE them all into the destination
14:10:12
_death
if you know the length beforehand, allocating a string and replacing (or FORMAT :) is indeed good.. but w-o-t-s is also good enough, and apply concatenate should also be ok.. not reduce though
14:20:24
Bike
even if it is, you could probably break it up into multiple concate calls and then concat the results
14:21:04
dlowe
(defun concat-string-list (l) (let ((o 0)) (reduce (lambda (r s) (replace r s :start1 o) (incf\
14:22:30
dlowe
(defun concat-string-list (l) (loop with r = (make-string (reduce '+ l :key 'length)) for o = 0 then (+ o (length s)) for s in l do (replace r s :start1 o) finally (return r)))
14:38:36
_death
Bike: call-arguments-limit may be big, but in practice things don't go so well.. I just tried (progn (apply #'concatenate 'string (loop repeat 100000 collect "x")) nil) on sbcl
14:47:57
jackdaniel
I think that if you try to concatenate 100k strings, you may have other problems than the call arguments limit :)
14:48:37
jackdaniel
hm, too many ":)", that was obviously a joke, but not a sarcastic one, mind that!
14:50:39
_death
other problems.. I just compiled sbcl from head and trying to figure out what some strange new warnings mean
14:52:13
_death
; caught 9 WARNING conditions ; caught 500 STYLE-WARNING conditions ; printed 3604 notes
14:56:07
_death
sure.. it's my personal snippets code base after all.. but I think I'll take more time to understand it
15:43:38
_death
anyway, the warning said that the derived type of something is (values null &optional) not number because it's the result of CAR, and although I know it to always be a cons (with a number in car) sbcl thought NIL might be passed to CAR
16:19:12
_death
yes.. but if the inner IF actually comes from an inline function, that warning may not be so useful (not to mention it may cause compilation to fail...)
16:24:36
_death
correct, but like I said, change the inner IF to (F X) and have (defsubst f (x) (if (consp x) 'it-is-a-cons (* 1.0 x)))
16:26:21
_death
but SBCL will warn because of the dead code, because it doesn't know that the argument will always be CONS
16:27:03
_death
and because there's a layer of indirection (actually, there were several inline functions calling each other, so it was multiple layers) the warning was confusing
16:32:53
phoe
the real issue is the fact that SBCL derives the type of X in (defun f (x) (if (consp x) 'it-is-a-cons (* 1.0 x))) to be T, not (OR CONS REAL)
16:34:01
_death
I also note that sbcl doesn't warn on (> (CAR X) MAX) .. even though X may be NIL.. this is pragmatism.. but for example SBCL does warn on the result of POSITION