freenode/#lisp - IRC Chatlog
Search
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.
9:06:49
otwieracz
I've got some function running in thread - is there any way to interrupt it, so I'll have debugger in it's context?
9:27:18
antoszka
otwieracz: This shouldn't make a difference, I think the swank protocol is network agnostic.
9:30:36
phoe
well - if it does not react to any interruptions or attempts to enter the debugger, I bet it's time for it to die, then.
9:42:15
closkar
otwieracz: I've often had the same problem. Just to confirm that your issue is not local to your system.
12:03:39
phoe
I have just successfully tested CL-LZMA on a different linux64 machine. Like, git clone into local-projects, quickloading, running the tests.
12:04:02
phoe
Once I get the libraries compiled for win{32,64}, mac{32,64} and linux32 - I think I can ship it.
12:09:07
phoe
I'll compile this on Windows and Mac when I get home. For Windows, I can cross-compile with mingw; for Mac, I'll finally install a programming environment on my hackintosh.
12:14:51
phoe
Like - can I request adding a project to Quicklisp, if the project only loads under linux64?
12:24:12
phoe
axion: it should work on any implementation that supports CFFI, and it does support only linux64 at the moment with more in plans.