freenode/#lisp - IRC Chatlog
Search
19:49:37
pfdietz
Just sexprs. It also produces small structures that get stored in the compiled code (more properly, regenerated at load time using CL's mechanics for that so you aren't clobbering constants values) to record when parts are visited.
19:51:04
pfdietz
Richard Waters' portable CL coverage package. It records what part of your code you've executed.
19:52:27
pfdietz
It should be, but I think there may be portability issues? Was thinking of uploading it to github anyway (I think it's off on an ancient CMU lisp archive site.)
19:53:39
pfdietz
At one point I modified COVER for my own use to allow some extensions, like recording of coverage information in a file (so it could be combined from separate test runs) and checkpoint/rollback of coverage (useful for minimizing test cases under the constraint they still increase coverage.)
20:00:01
scymtym
eclector and concrete-syntax-tree would probably allow producing sb-cover-style annotated sources as output
20:25:23
AeroNotix
It requires that you compile your files with certain declaims active and then deactivate those declaims when you want to compile other files.
20:26:14
aeth
oni-on-ion: #'foo is the function object foo, 'foo looks up foo so if foo is redefined the 'stale' object isn't used.
20:31:39
aeth
oni-on-ion: (defun foo () (print "Hello")) (defun bar (f) (funcall f)) (let ((a (vector #'foo 'foo))) (bar (aref a 0)) (defun foo () (print "Goodbye")) (bar (aref a 0)) (bar (aref a 1)))
20:45:05
aeth
oni-on-ion: I don't want to say something incorrect, and there are test cases I wrote where even #'foo uses the redefined function (at least in SBCL), such as directly binding #'foo in the let instead of placing it in a vector
20:45:14
aeth
i.e. (defun foo () (print "Hello")) (defun bar (f) (funcall f)) (let ((f1 #'foo) (f2 'foo)) (bar f1) (defun foo () (print "Goodbye")) (bar f1) (bar f2))
20:50:01
aeth
Is there a way to check that object foo implements a method for the generic function quux? More concretely, I have an unwind-protect that is supposed to clean up all of the foreign OpenGL data at the end of the program. This actually would be a good candidate for a generic (and performance is not absolutely an issue since it's run once, at the end).
20:50:28
Bike
You can look up whether a generic function has an applicable method for a given class.
20:51:27
aeth
Bike: I think the user would probably be in for quite a surprise if (cleanup foo) failed because cleanup isn't defined for foo, and it probably would be a good thing to check for before starting instead of letting the user potentially leak memory upon closing the program. (A leak because the REPL will probably keep running.)
20:52:14
Bike
i'd usually like to avoid relying on that kind of introspection in the middle of a program, but that doesn't seem unreasonable.
20:54:07
Bike
because that method couldn't actually do any cleanup, not knowing anything about the object
20:55:14
aeth
pierpa: Even if I made it (error "You need a cleanup") instead of doing nothing, it would still be bad here.
20:56:03
Bike
oh, and you should note that compute-applicable-methods is probably going to be pretty slow.
20:56:19
oni-on-ion
AeroNotix: yes, i know. i assumed you asked because of what the library is for,not that just because its a lisp library.
20:56:37
aeth
pierpa: This is a window object. It is, ideally, run in a with-window or something along those lines, that ultimately has an unwind-protect that calls (cleanup-gl-data gl-data)
20:56:42
oni-on-ion
AeroNotix: so if you needed help with how it works and concepts behind it and whatever. no worries
20:57:02
aeth
pierpa: That's an unnecessary dependency on my gl-data object for something that's incredibly general
20:57:28
aeth
I could replace it with a cleanup generic, where there's a cleanup method implemented for gl-data. Then gl-data depends on window instead of window depending on gl-data
20:58:12
aeth
But if you pass in something else (vk-data?) that doesn't have CLEANUP, it will leak memory
20:59:20
aeth
(This is for 3D games. You're always going to have foreign data to cleanup. The options are essentially OpenGL, Vulkan, DirectX, etc. And if one day you don't need to do this, you can just make it a no-op safely.)
21:01:38
aeth
pierpa, Bike: Generally, I try to get an error early, when it's still entirely in CL, before the CFFI complicates things.
21:03:02
aeth
I guess I could make it (defgeneric cleanup (object &key actually-do-something-p)) but that seems like a big hack
22:55:52
drmeister
Folks, recently sbcl shebang scripts stopped working for me. I wonder if a kind soul with a few minutes could test something on their system.
23:00:01
oni-on-ion
it is too much to swithc workspace and type a few chars. had to do that with URL, sorry i am a bit disabled computer user =)
23:02:57
Colleen
Bike: drmeister said 51 minutes, 39 seconds ago: It just occurred to me - we are also generating a lot of metadata when generating llvm-ir - I wonder if that is costing us a lot of compilation time.
23:21:08
drmeister
Hmm, I upgraded to 1.4.11 and I noticed that the /usr/local/bin/sbcl was a symlink - so I switched to the direct path...
23:22:01
drmeister
Still no love from shebang scripts? Am I going mad? Have my years of wild hedonism taken their toll on my mind and my ability to write and execute unix scripts?
23:22:57
whartung
does sbcl work without the shebang? is shebang any different from sbcl with the code funneled in via stdin? Have you tried that?
23:37:00
drmeister
brew puts a shell script that sets the SBCL_SOURCE_ROOT environment variable and then invokes sbcl
23:43:22
drmeister
Ok - well, thank you everyone - now I don't need to rewrite all of my sbcl scripts for profiling
23:44:07
jasom
drmeister: things like this have caused me to not rely on shebangs at all, but rather use here documents.
23:50:26
drmeister
I was trying to be fancy and have one shebang script that did everything and then symlinked to the shebang script and it did different things based on what the first argument (program name) was.
23:56:37
jasom
drmeister: you can still do that with here scripts, and you can implement the multi-executable idea in either lisp or sh at your choice
23:59:25
drmeister
Here's what I'm trying to accomplish. We use dtrace to profile clasp. I have a script called 'stacks.lisp' that checks the sb-ext:*posix-argv* arguments for the name....
0:08:00
makomo
drmeister: right, but i was wondering what would happen when sbcl dies. looks like the exec builtin *replaces* the shell process
0:09:38
drmeister
The only wrinkle is communicating the arguments - they need to be escaped when they are put into *script-args*
0:13:22
jasom
drmeister: I put them in *script-args* because sbcl leaves all of the toplevel options in, and I didn't want to have to filter
0:14:25
jasom
drmeister: I have a script that puts them all in a list shomewhere so you can use "$@"...
0:14:27
drmeister
--eval "(defvar *script-args* '( $# \"$0\" \"$1\" \"$2\" \"$3\" \"$4\" \"$5\" \"$6\" \"$7\" ))" \
0:15:29
jasom
drmeister: also this assumes that there won't be any #\" characters in the arguments. Fortunately it's an easy fix if you care
0:15:31
drmeister
./count-calls a b c --> (3 "./count-calls" "a" "b" "c" "" "" "" "") I'm printing the *script-args* at the start.
0:16:31
drmeister
No - that's ok - these don't need to bullet proof. They just need to handle argument lists like: -i foo -o bar -s baz
0:17:57
drmeister
These scripts that handle dtrace output parse and query dtrace output full of backtraces - it's stuff that only someone practiced in the art will use.
0:19:01
jasom
something like: "'( $(for item in "$@"; do printf '"%s\"' "$(escape "$item")"; done) )"
0:26:05
jasom
drmeister: IMO the for loop version will be better than a length prefix anyways even if you don't add in the escaping.
0:48:38
aeth
I think I can just take all of the methods and functions I use for freeing and similar things and just make them methods on a generic CLEANUP
0:49:32
aeth
(This code interfaces with foreign libraries so the GC can't be relied on here. Or, more accurately, it's way more complicated to rely on the GC than to just have a bunch of WITH-FOOs built on top of UNWIND-PROTECT calling CLEANUP)
1:34:27
gendl
I know you can intersperse regular Lisp forms like dolist, then drop back into lhtml with (htm ...)
1:35:16
no-defun-allowed
[here](https://gitlab.com/Theemacsshibe/cl-pixelcanvas/blob/master/bot/pages.lisp#L23)
1:37:56
no-defun-allowed
can slime do emacs-style symbol shortening? for example, sa-l-a-d becomes save-lisp-and-die
1:41:04
gendl
within the body of the with-h-o-t-s, I want to call another macro which itself returns valid lhtml.
1:41:39
trn
beach: I have a couple of questions for you about the old Ford network that I'm hoping you can answer in regards to 3270 apps on Multics at Ford .
1:45:07
trn
beach: Specifically, did 3270 users login a 3270-related project that defined a restricted process_overseer_?
1:45:38
trn
beach: Or did they login to a standard project via the answering service as usual users?
1:45:46
gendl
like you said, I just had to wrap (htm ...) around the lhtml which my macro was emitting.
1:46:35
gendl
doing it like that, I can include calls to macros at will within my with-html-output-to-string and similar.
2:38:09
AeroNotix
http://man7.org/linux/man-pages/man2/timer_create.2.html is there a library out there that exposes this?
2:41:24
AeroNotix
I was looking in the sb-* docs. I thought timer related things would be under sb-posix/sb-unix
3:01:17
trn
beach: No problem, thanks anyway. We're trying to see if some behaviour we are seeing is something we are doing wrong, need to fix, or the way it actually was. :)
5:41:12
johnjay
" Due to its many novel and valuable ideas, Multics had a significant impact on computer science despite its faults"
5:42:07
beach
And now, most computer users are brainwashed to think that Unix-like systems are actually good.
5:42:17
johnjay
wiki goes right into the fact ther was no distinction between memory and main storage
5:45:42
beach
It didn't start a new process for each command, so the stack was intact when there was a problem. So it was closer to using a Common Lisp system in that respect.
5:46:14
johnjay
Ken Thompson, in a transcribed 2007 interview with Peter Seibel[23] refers to Multics as "…overdesigned and overbuilt and over everything. It was close to unusable. They [Massachusetts Institute of Technology] still claim it’s a monstrous success, but it just clearly wasn't."
5:46:18
beach
Anyway, the fact that Multics had unified memory is why it bothers me when people have me justify that decision in CLOSOS as if it had never been done before.
5:48:37
johnjay
beach: i'm impressed about the reliability parts, apparently you could remove cpus, disks, anything and the system kept running
5:48:49
no-defun-allowed
gotta get a kangaroo to kill the insurance inspector if he comes near me barbie now
5:49:27
beach
johnjay: Yes, it was designed partly for the US military, so there were tough specifications.
5:50:06
johnjay
right. someone in another channel just complained about firefox taking up all the system memory. in fact i have the command 'taskkill /f /im firefox.exe' ready to go always on this pc.
5:50:30
johnjay
since i guess you said there's not a new stack per process it doesn't have that problem?
5:50:30
beach
I have said this before, but the Common Lisp condition system was inspired by that of Multics PL/I.
5:51:39
johnjay
it's hard to conceptualize some of this because i'm so used to the typical stack/process/pc setup
5:52:54
no-defun-allowed
it'd all leak cause of --holes in the rusty bucket-- i mean reference counting
5:53:01
johnjay
is it something you can actually study in an emulator or is it mostly the conceptual aspect of it?
5:55:01
beach
Sure, there was a guy here not too long ago who announced a web site running an emulator.
6:00:28
jackdaniel
there is also MicroEmacs, but if we limit software to lisp-only systems, then it doesn't count either ;-)
6:40:35
johnjay
but someone, aeth i think, said to build a lisp on top of linux you'd need 5 or 6 things
6:43:10
jackdaniel
beach: I guess that means to use linux as a kernel for userspace which would be fully implemented in Lisp
6:47:35
jackdaniel
there is a kernel space and a user space, that referes to a virtual memory segregation on today operating systems
6:49:12
beach
And that sound more like implementing a Unix system (except the kernel) in Lisp than "build a lisp on top of linux".
6:50:40
jackdaniel
following wikipedia: "The term userland (or user space) refers to all code that runs outside the operating system's kernel." that's the meaning I had in mind
6:51:43
jackdaniel
and regarding implementing that: you may have a single process on the system which would be a lisp process, then you have a single address space for all applications in that image
6:52:13
jackdaniel
that way linux kernel serves a purpose of being a host. I don't think it is necessarily unix-like
6:53:25
aeth
My personal approach would be fairly Unix-like because I'd be aiming at various compatibility things that aren't strictly necessary, like a Unix shell.
6:55:23
jackdaniel
I was employed at some point of time as an embedded system's engineer, so I'm fed up with linux kernel internals ,p
7:10:48
jackdaniel
johnjay: yes, from the linux kernel internals perspective. I still use it of course
7:11:43
no-defun-allowed
here's a stupid research idea: how much effort is put into making a computer unix-like?
7:12:05
no-defun-allowed
for example, there's a hell of a lot of microcode that interprets x86 nowadays
7:13:51
jackdaniel
ober: I didn't work with fat which is well implemented afaik. mostly drm (direct rendering mechanism) and writing custom drivers. it is well written, but it is a frustrating work: i.e you have to restart device to reboot the kernel and check your changes. debugging is hard too (though jtags help)
7:14:29
LdBeth
EvilTofu: A lower level machine code generator and optimizer for CL, may or may not be llvm
7:14:36
jackdaniel
johnjay: it is based on 2.6.x I think. it is good, you'll get a grasp of the abstractions which exist there, but there is much more to learn from the code (like with any non-trivial source code)
7:15:12
johnjay
i was thinking of writing some drivers for reactos, and i wondered how much studying linux driver model would help for that
7:16:08
jackdaniel
reverse-engineering custom protocol is way harder. but this is offtopic on this channel. sorry for bringing this up
7:35:15
jackdaniel
EvilTofu: opengenera is a full operating system with a development environment etc etc, it is not a CL implementation (however it has CL implementation in it)