freenode/#lisp - IRC Chatlog
Search
14:49:25
beach
drmeister: He mentions simulations of molecules (as I recall) as one great application for quantum computing.
15:29:36
Devon
Anyone know how to (read-byte *standard-input*) and (write-byte * *standard-output*) portably?
15:40:50
beach
Devon: As far as I know, those are character streams, so you have to write characters to them.
15:42:00
pjb
Devon: implementation dependent, you may be able to use flexi-stream to change the kind of stream, or you may be able to create binary streams on the same file descriptors.
15:42:48
pjb
Devon: for command line tools, just pass paths to the binary files as command line arguments, and open them.
15:43:36
pjb
You can then bind them to *standard-input* and *standard-output*, but I would advise against it (just use parameter named input and output). Keep *standard-input* and *standard-output* for textual I/O, you may want to issue messages, etc.
15:49:49
pjb
Devon: there's also another consideration: this is a big no-no to touch *terminal-io* and the object bound to it. (it's the stream used to report errors and by the debugger by default). But by default *standard-input* and *standard-output* may be synonym-streams to *terminal-io*; so mutating the streams bound to those variables would mutate the stream bound to *terminal-io* and this would break the implementation!
15:50:25
pjb
So, rebinding *standard-input* and *standard-output* is allowed, but not mutating (eg. changing the element-type) of those streams.
15:52:12
Devon
Since it cannot be done portably, any implementation-specific solution could carefully mutate all the standard streams without breaking anything.
15:53:01
pjb
First try flexi-stream, as I answered above. (Despite your erroneous affirmation that no solution was proposed).
15:57:05
scymtym_
jackdaniel: in https://plaster.tymoon.eu/view/686#686 in WAIT-ON-SEMAPHORE: when going back to sleep via CONDITION-WAIT, timeout should be decreased by already elapsed time
16:00:22
jackdaniel
scymtym_: good point, thanks. current version is here: github.com/dkochmanski/bordeaux-threads/ , I will incorporate your remark later today
16:01:23
jackdaniel
I've switched to internal-real-time, generic implementation had small problems when tested on CCL with timeouts like 0.1
16:08:54
jackdaniel
alright, added fix: https://github.com/dkochmanski/bordeaux-threads/blob/master/src/default-implementations.lisp#L310
18:22:59
earl-ducaine
Devon: It depends a bit on what you're trying to do. But one approach would be to create custom streams along the lines of string output stream and string input string, i.e. create a byte stream that converts and writes characters to the output stream.
18:28:48
Devon
earl-ducaine: (ccl::make-fd-stream 0 :character-p t :element-type '(unsigned-byte 8)) doc claims "bivalent" but (read-byte *) complains (typep * '(and input-stream ccl::binary-stream)) => nil
18:34:56
beach
earl-ducaine: And in one example, you have two consecutive lines with (let (rest) on them.
18:36:14
beach
earl-ducaine: Plus, when you write (let (result) ...) the reader expects RESULT to be assigned to before being used. If you want to initialize it to the empty list, it is best to write (let ((result '())) ...)
18:38:18
earl-ducaine
Devon: I think that approach would require you to create your own stream subclass. So, the flexi stream library would be a good place to see how that's down.
19:27:31
fiddlerwoaroof
Devon: I think 90% of those problems are solved by using slime and making sure that emacs is configured to indent lisp in cl-style
19:42:07
Devon
(mapcar #'fdefinition-lambda-list (apropos-list "with-" "CL")) ; oops, no obvious way to extract the lambda-list
20:00:52
fiddlerwoaroof
Then, in my emacs config, I just do (load (expand-file-name "~/quicklisp/slime-helper.el"))
20:01:18
fiddlerwoaroof
I load these contribs: slime-fancy slime-company slime-macrostep slime-trace-dialog slime-mdot-fu
20:01:23
pjb
So basically , you followed the instructions in http://cliki.net/Getting+Started Congratulations!
20:03:04
fiddlerwoaroof
I think, sometimes people have indentation issues because lisp-mode is using the emacs-lisp indentation function
20:05:16
fiddlerwoaroof
If you do M-: lisp-indent-function<RET>, you should see common-lisp-input-function in the message arez
21:54:45
drmeister
Are there any lispers who use docker-compose and know how to get 'volumes:' to work? I am building a Common Lisp docker image and I'm banging my head against a wall for the past hour trying to get volumes to work.
21:55:47
drmeister
Off topic - I know - but my cries in more appropriate wildernesses bringing no succor.
21:59:03
earl-ducaine
parjanya: I'm planning on totally revising my approach. Each post will be an org document, I'll use tangle tags to extract all the lisp code into an ASDF project and export as HTML to generate the HTML, which I'll publish to word press as files.
22:00:04
earl-ducaine
Previously my technique was just copy-and-paste from emacs to wordpress editor, which is problematic.
22:07:42
earl-ducaine
the big trick that I've run into is the to use them you need to 'run' them first, and that specifying *where* they're located no the host, i.e. host path and where they're mounted in the container is tricky.
22:08:39
drmeister
earl-ducaine: Thanks for responding! I want to mount a directory from the host that contains a .tgz file and then untar it into the docker container.
22:11:21
drmeister
I can ADD the .tgz file to the docker container but then it adds a lot of useless space to resulting image
22:13:07
earl-ducaine
drmeister: I'm not a docker expert.... so this is probably not the 'best' way. But it should work... give me a couple minututes and i'll post the example to pastebin.
22:14:57
earl-ducaine
drmeister: while your waiting.... (the code is on another machine) the command I'm using is: docker creat -v /some/directory blah blah
22:20:03
drmeister
Oh - I'm familiar with mounting directories using: docker -v ... that works very reliably.
22:21:15
drmeister
I use docker-compose kind of like a 'makefile' for docker - I was trying to get the 'volumes:' keyword of a docker-compose.yml file to work. I _thought_ it played the role of 'docker -v ...' mounting a host directory within the docker container that docker-compose starts up.
22:22:53
drmeister
I can _not_ use docker-compose and drop down to just using docker, I suppose. It just irks me when a feature that appears to be the appropriate one (volume:) fails and especially when it fails silently.
22:25:14
drmeister
Unless I misunderstand your meaning. In any event - I look forward to your advice.
22:33:53
earl-ducaine
ok. I was being an idiot (i.e. giving you the long way round) all you need to do is something like this:
22:33:58
earl-ducaine
drmeister: docker run -d -p 8090:8080 --volume $(pwd)/holt/dir:/opt/container/dir --name lisp-container my-docker-image /bin/bash
22:34:48
earl-ducaine
/holt/dir being a directory on your host. /opt/cointainer being the directory on the container where it's mapped.
22:35:57
earl-ducaine
What I was describing previously was a way to take an existing docker image and mount it as a volume in another runing instance. very powerful but not at all what you need.
22:40:46
earl-ducaine
For a moment I got exited that I could help out someone nearly as docker inept as myself! ....until you gently pointed out that I misunderstood the question.
22:49:52
drmeister
No worries - I've subsequently learned that what I want (mount a directory during docker build) is not possible!
22:50:46
drmeister
https://stackoverflow.com/questions/26050899/how-to-mount-host-volumes-into-docker-containers-in-dockerfile-during-build
0:24:54
jmercouris
I posted on #ccl, but I'll post my question here again, in case someone knows: https://gist.github.com/ea786f925cb0678690540492476feefb
0:25:40
jmercouris
Why might it be that my standalone program can call obj-c no problem, but when I use slime to call those same functions/methods, nothing is recognized
0:25:49
whoman
clim-listener i understand is close (well, Jupyter lets say is closer to original CLIM listener ?)
0:27:09
jmercouris
whoman: Well, my application works, I just can't call the obj-c functions via slime invokations
0:27:13
Bike
jmercouris: mac has a thing where you can only do things in the main thread, and the slime repl isn't the main thread. might be related, don't know.
0:27:46
jmercouris
Bike: I start swank like this: https://gist.github.com/bf90172b27c07ff9edf023d3f6e7a3e6
0:27:56
whoman
Bike: i am not sure if that has changed in objc 2.0 but that is mostly for Cocoa app main loops (NSApplication##)
0:28:39
jmercouris
though I imagine the instance should be able to respond to a selector among all threads
0:30:50
whoman
dont think that would affect the objc runtime. its never had anything much to do with threads as it is
0:31:55
jmercouris
maybe there is part of CCL that does the lisp -> objc translation that is not getting compiled into my image resulting in malformed selectors
0:32:47
whoman
ohh. objc needs a few more ABI-level stuff. not quite as heavy as C++, but it needs special handling afaik.
0:33:06
whoman
selector names at least in pre-2.0 objc were like "_i__ClassName___selectorName_arg_arg2_"
0:33:34
whoman
so yeah. its been a while, check the FFI and that sort of thing, also have a look at Objective-CL written by a local
0:36:20
whoman
nothing just ignore me im just typing completely unrelated stuff, im sure you will work out your issue soon enough
0:36:57
jmercouris
whoman: I can't tell if you are being sarcastic or not, because the thing about the threads you are correct, that is related, and would be strange if the runtime behaved that way
0:48:42
jmercouris
Subclass ccl::ccl-application in the standalone application instead of ns:ns-application
0:49:10
jmercouris
Apparently ccl::ccl-application provides some of these faculties, and I guess without them, the translation couldn't be made correctly/atall
0:51:41
jmercouris
Bike: You were also partially correct, it seems that one must launch slime on the same thread as the cocoa ui to avoid issues
0:52:27
jmercouris
yeah, so basically if you call it in the cocoa thread and it launches a new thread, it loses its mind
0:52:56
jmercouris
I don't think it ever gets correct context, I'm not super interested in debugging it actually, becuase I don't think it's a heavy penalty to have swank on the main thread, probably an advantage if anything
1:45:28
aeth
Hmm, so macros can have &optional and &key within things apparently. Time to build some really complicated macros.
1:56:40
whoman
minion memo jmercouris papyrus is lighter and cleaner, but org is structured and allows other code as well. i think i will stay with org for literate docs
2:06:01
waynecolvin
print documentation strings https://pastebin.com/V94fjqxJ works in clisp, not sbcl