freenode/lisp - IRC Chatlog
Search
0:55:51
aeth
_death: Ideally, you don't want to directly write assembly, you want to have a conversation with the compiler to try to produce the correct (disassemble #'foo) result automatically. Then it stays portable, but slow, in other circumstances and you probably save effort anyway.
0:55:56
fiddlerwoaroof
I have a friend who did something like that in Racket: https://github.com/lexi-lambda/hackett
0:57:13
aeth
fiddlerwoaroof: I think (I haven't had the time to look into it) you can do something with this library: https://github.com/Bike/introspect-environment
0:57:41
aeth
Unfortunately, it only supports SBCL, CCL, and CMUCL. If ECL supported the ncessary features, too, that would make a huge difference.
0:58:03
fiddlerwoaroof
Yeah, I think the common lisp type system is too powerful for good type inference :)
0:58:13
aeth
_death: A compiler with enough information will generate better assembly than you can write by hand. The problem is when the compiler doesn't have enough information.
0:59:36
aeth
fiddlerwoaroof: I suspect that that's a problem with C being high-level PDP-7 assembly and not really matching modern hardware too well.
1:00:27
fiddlerwoaroof
I think auto-vectorization, like auto-parallelization is a surprisingly hard problem
1:00:45
_death
aeth: sometimes it's enough just to be able to generate the instructions you need for the particular case..
1:01:18
aeth
fiddlerwoaroof: But in something like Lisp, you don't need auto-vectorization, you can make anything look like it was a built-in part of the language. Auto-vectorization is afaik more like C programmers wanting to stick to their increasingly-outdated for loops.
1:01:55
_death
aeth: you have all the control you need then, and an assembler is much faster than an optimizing compiler as well
1:02:21
aeth
Make a language where the problem isn't hard, rather than trying to make C-style semantics do something totally alien to the PDP-7 it was designed for.
1:08:35
caffe
not any one in particular... mostly a set of bash scripts that prompt for a few lines of input and exit
1:09:11
Xach
I'm actually thinking of making something expect-like for sbcl's run-program pty stuff.
1:12:08
Xach
caffe: no, just use the :pty argument to run-program and you will have a lot lower-level control over input and output of the process
1:13:11
Xach
fiddlerwoaroof: you don't need to directly open a pty, run-program does it on your behalf.
1:15:24
fiddlerwoaroof
Cool, I just meant to say that you don't need to get the user's pty, you just start your own---implicitly or explicitly
1:31:13
fiddlerwoaroof
https://github.com/sbcl/sbcl/blob/f685c4dacde06c9a2bcb2be5f24eca987d4f4188/src/code/run-program.lisp#L708
1:31:46
fiddlerwoaroof
It's also available here: http://www.sbcl.org/manual/#Running-external-programs
1:37:56
fiddlerwoaroof
Does anyone know if lispworks automatically adds (:use :cl) to a defpackage without any (:use...) clause)
1:42:41
caffe
(run-program "/bin/program" '() :input *standard-input* :output *standard-output*) gets the farthest, but fails at the first interactive prompt of the program being run
1:46:50
fiddlerwoaroof
Even in the terminal, it shows the output, but doesn't really respond to input
1:47:39
malice
well, for me, if working with sbcl, if I create a code.lisp (run-program "/bin/echo" nil) and then run it like "sbcl --load code.lisp" - it will work
1:48:07
malice
for clim - I remember trying to debug something in there with *standard-input* and *standard-output*, and it looked like they were changed somehow
1:48:37
malice
so e.g. #'print wouldn't print anything to standard-output, at least with slime, but slime changes *standard-output* too
1:49:19
malice
I mean, if the simple "echo" program works for you in SBCL then other programs should work too
1:51:41
caffe
no, as in when a bash script i'm trying to execute (or just read itself) just goes nowhere. it doesn't respond to input
1:59:55
malice
well, if I do (run-program "/usr/bin/python" nil :input t :output t) in my terminal, it opens Python interpreter just fine
2:01:48
fiddlerwoaroof
but this doesn't: sbcl --eval '(run-program "/usr/bin/python" '"'"'() :input *standard-output* :output *standard-input*)'
2:03:38
fiddlerwoaroof
This doesn't work: sbcl --eval '(run-program "/usr/bin/python" '"'"'() :input *standard-input* :output *standard-output*)'
2:05:13
caffe
now, one more question... is there a way to do this and have it return to sbcl's prompt upon exiting?
2:06:16
malice
If I run the bin/python example and then call quit() in Python, it returns to REPL just fine
2:06:40
malice
fiddlerwoaroof: this *might* have something to do with "If t, the standard output for the current process is inherited." bit (I'm guessing though)
2:10:30
malice
caffe: then I don't really know what to do. (run-program "usr/bin/python" nil :input t :output t) pasted into SBCL after running "sbcl" command
2:16:50
fiddlerwoaroof
it's really annoying to me that the python library cffi interferes with the lisp one in google search results
6:59:06
drmeister
::notify shiho - pull clasp, cando and the master branch of quicklisp/cl-jupyter and rebuild everything. I fixed the python crashes when evaluating cells in Jupyter notebooks. It was a threading problem.
6:59:19
drmeister
::notify Kevslinger - pull clasp, cando and the master branch of quicklisp/cl-jupyter and rebuild everything. I fixed the python crashes when evaluating cells in Jupyter notebooks. It was a threading problem.
10:08:31
loke
beach: No need to invoke him. I'm not ashamed of the fact that I still find toilet umour incredibly funny.
10:13:35
loke
And here's another swedish metal song, different band, different style and probably more popular, but also good: https://www.youtube.com/watch?v=_FSFIOGNYyM
10:18:58
beach
Boy, band members are such good instrumentalists these days. A few decades ago, they were mostly just bad.
10:22:14
dim
well in my experience pop music band players have always been quite good, but you would typically pay no attention to them, only to the front man
12:37:15
pjb
(let ((s (funcall (if (zerop (random 2)) 'list 'vector) 1 2 3 4))) (elt s 2)) #| --> 3 |#
12:39:41
pjb
Murii: the trick is to take the chapters of clhs, and to read all the section but the dictionary. Just browse the dictionary to have an idea of what's available. Then when you look for a function, go to the chapters relevant to your question (eg. here, you would search in the Conses, Arrays, Strings and Sequences chapters), and look in their dictionaries for the function you want.