freenode/#lisp - IRC Chatlog
Search
20:46:01
antoszka
slark: The Norvig book is actually the best programming *and* CL book ever in my opinion :)
20:50:55
slark
was trying to find lib for GUI app, and found that lispworks made them easy to use on all OS
20:56:32
antoszka
slark: Hard to quantify, but I think most people here will use open-source implementations (sbcl and clozurecl being probably the two most popular) with open source UI libraries.
20:56:44
fiveop
I have a problem that I can best describe by an example (http://paste.lisp.org/display/351183) and the question "How can I conditionally splice a comma form into a backquoted list?"
20:57:35
antoszka
slark: Open source GUI libraries aren't the strongest side of CL these days, unfortunately, but most progress seems to be going on the McCLIM refresh and QT5 fronts (the latter in the form of Shinmera's work).
20:58:56
Bike
`(a ,@(when t `((+ b c))) d) => (a (+ b c) d), `(a ,@(when nil `((+ b c))) d) => `(a d)
21:00:06
Bike
double backquote kind of shuts my brain down, but the same principle shouldn't stop working
22:08:31
ptdel
hello I am very new to lisp, I have a question that is probably really silly. If I want to load multiple libraries at runtime, should I be making an .asd file that loads all of my libs or just use quicklisp?
22:09:04
ptdel
when I want to load lots of libs I am doing (mapcar #'ql:quickload :lib1 :lib2 :lib3) I'm guessing this is a jank way
22:10:56
ptdel
ah ok, correct me if I am off base, I would use the defsystem form for this correct? with each of my libs being in the :depends-on or :component keywords?
22:13:07
phoe
I have pushed the first seemingly working version of CL-LZMA on github, https://github.com/phoe/cl-lzma/blob/master/cl-lzma.lisp
22:19:18
phoe
Can any of you guys on linux64 pull this and check if it builds and if the tests pass?
6:37:39
closkar
hey. Are there any CL libraries that incorporate well with the modern/popular javascript plotting libraries? Fx. D3.js, plot.ly or three.js?
6:38:21
closkar
Currently I'm plotting with plot.ly through parenscript, but frankly it is a bit of a pain (for me anyways).
6:41:02
fiddlerwoaroof
Yeah, a good thing to do is to right a bit of parenscript to see what the patterns are and then use defpsmacro to clean the structure up
6:42:12
fiddlerwoaroof
closkar: there isn't much choice here. People have written little extensions here and there to integrate parenscript with various libraries but, in general, you have to do most of the heavy-lifting with parenscript
6:42:36
fiddlerwoaroof
It would be nice, though, to have something that could complete with clojurescript here...
6:43:28
closkar
Hm. It would be cool if someone/many actually hacked together a high quality lib for one of the JS solutions out there.
6:43:56
clintm
I had a figwheel proof of concept (mostly) working a while back. Not sure why I quit working on it.
6:44:31
closkar
Not that I would mind spending the time writing a DSL, but sometimes getting-things-done takes precedence in the short term.
6:44:56
clintm
Sounds like there's actually interest in it though. I think my problem is that I work in such isolation, I just assume no one needs or wants it.
6:46:01
clintm
To be clear, I had all of the reloading working but did not have any integration with the goog closure compiler.
6:47:49
closkar
All I can say for my part is that the lack of high quality plotting options kept me stuck in python for several years (still is in some ways). And even python hooks onto the JS libraries when working with the web.
6:50:24
closkar
clintm: I can't say anything for the general demand, but I know that currently I am building a slow, bug-ridden, informatlly specified implementation of some percentage of plot.ly in cl.
6:55:40
closkar
i'll afk a bit, but if anyone has more or different opinions on the matter I am all ears.
6:55:42
clintm
I also wanted it to be able to easy run over an ssh tunnel, instead of requiring that you use it on localhost.
7:27:16
phoe
clintm: you mean that I make a SSH tunnel that binds localhost:4005 to remote's localhost:4005?
7:29:28
clintm
phoe: Well, speaking of figwheel specifically, you'd have the tunnel for swank, but you'd also need another one for your image to talk to the browser.
7:30:40
clintm
Wait, that's done over websockets. It's been a year and a half since i worked on this. Apparently my memory of it is a little more cloudy than I thought.
7:31:17
clintm
I'll dredge up the code I had later tonight after I finish the project that pays me. hehe.
7:32:27
fiddlerwoaroof
I spent a couple hours today trying to figure out how to get my development environment setup again before giving up
7:38:22
muyinliu
can anyone tell me why simple code wrap by defun cost 10x CPU time? demo here: http://pasteall.org/476608/lisp
7:39:52
fiddlerwoaroof
Is there a simple way to implement something like the touch command in common lisp?
7:39:59
clintm
fiddlerwoaroof: if you want to try it all out on the clojure side, there's a video series called parens of the dead. It assumes experience with emacs, but I thought it was pretty well done.
7:43:29
phoe
fiddlerwoaroof: (with-open-file (s "/tmp/goop.lisp" :direction :output :if-does-not-exist :create))
7:44:43
fiddlerwoaroof
The W-O-F snippet handles creating a file, but it doesn't actually have feature parity with the coreutil
7:44:58
clintm
I think you'd have to write to it to update the time. You could also 'touch' it programatically by changing its permissions.
7:47:04
beach
muyinliu: Second, if you have a decent compiler, it will notice that the first expression you submitted does nothing, so it can remove the entire calculation.
7:47:37
beach
muyinliu: Benchmarking is hard stuff, because you need to know enough about compiler design to know what a good compiler is capable of.
7:48:38
beach
muyinliu: And SBCL has a very good compiler in terms of optimizations and performance of generated code.
7:49:37
beach
muyinliu: If you have an application where the overhead of calling a function is unacceptable (which is unlikely), then you can often declare the function INLINE.
7:54:11
beach
muyinliu: Even if SBCL does not remove the entire calculation in the first case, it will recognize that you have an addition of two constant numbers, so it will perform this addition at compile time, effectively generating a constant. A function call is definitely much more expensive than computing the value of a constant, because in the latter case, the constant is just returned.
7:54:39
beach
muyinliu: So you see why it is important to understand what the compiler is capable of if you are going to make benchmarks like this.
7:57:32
muyinliu
beanch: after wrap the C call with defcfun to create my get-universal-time, it's much more slow than SBCL's get-universal-time.
7:59:33
muyinliu
beach: the only diff is that SBCL use syscall directly and my version call with a defcfun
8:00:15
beach
muyinliu: I think the benchmark you showed us have very little in common with the real thing you are trying to measure.
8:03:35
beach
muyinliu: I know very little about FFI stuff, but my guess would be that there is a lot of time spent in converting data between the way SBCL represents things an d the way C represents things.
8:05:12
beach
muyinliu: If so, the benchmark you submitted has absolutely nothing to do with your original problem.
8:05:57
muyinliu
beach: I don't think it's about CFFI. I compare same code between Common Lisp and Clojure, Clojure's function version is only take 2 times of the CPU time(Common Lisp's function version take 10 times of the CPU time).
8:08:19
phoe
beach: technically speaking, Java has its Java Native Interface, and Clojure is capable of leveraging that.
8:08:56
beach
muyinliu: So if Clojure is not using CFFI but SBCL is, what made you conclude that this additional time is NOT due to CFFI?
8:14:48
beach
muyinliu: For one thing, the cost of a function depends on the implementation, not on the language.
8:15:34
beach
muyinliu: Second, it depends on the safety of the code. In safe code, many things are checked. If you compare to something else, you have to make sure that the same work is done.
8:16:17
beach
muyinliu: Third, your problem was with FFI, but then you benchmarked an ordinary Common Lisp function call.
8:18:31
beach
muyinliu: Fourth, you executed the call (or so we think) one hundred million times. That means the call took 4ns or so. That is not very much.