freenode/#lisp - IRC Chatlog
Search
0:31:18
dmiles
it woiuld ve a ton of work on the part of an implementor to actually prevent the user for doing most of that
0:47:52
pjb
Do you support (tagbody (mapcar (lambda (x) (if (zerop x) (go :end)) x) '(1 2 0 3 4)) :end) #| --> nil |#
0:48:29
pjb
Similarly (block :foo (mapcar (lambda (x) (if (zerop x) (return-from :foo 42)) x) '(1 2 0 3 4))) #| --> 42 |#
0:50:10
pjb
(tagbody (unwind-protect (mapcar (lambda (x) (if (zerop x) (go :end)) x) '(1 2 0 3 4)) (print 'foo)) :end) #| foo --> nil |# (block :foo (unwind-protect (mapcar (lambda (x) (if (zerop x) (return-from :foo 42)) x) '(1 2 0 3 4)) (print 'foo))) #| foo --> 42 |#
0:53:02
dmiles
but it is really easy for me (i feel compelled constantly) to write non backtracking code
0:54:21
dmiles
just be it allows one to do non standard things that are normally hard in prolog (since its always ready to unwind
0:57:22
dmiles
just because swi-prolog allows me to do non standard things that are normally hard, if not impossible, in other prologs .. i just have to keep reminding myself throw/1 can be called
1:17:39
dmiles
mentally it is hard form to picture that when i call a predicate from another predicate how that constitutes backing out.. it *looks* like its diving in deeper
1:18:59
dmiles
yet the grandparent frame is already collected by the time you enter the grandchild frame
1:33:55
dmiles
the wierdness is that the second example @ http://clhs.lisp.se/Body/s_tagbod.htm works because the "(go out)" is calling a whole separated compiled subroutine that only contains "(prin1 n)"
1:38:37
aeth
pjb: Thanks for the help, I think I'm going to go with this: (loop for x on '(1 2 3 4 . 5) by (lambda (x) (let ((next (cdr x))) (if (not (listp next)) `(&rest ,next) next))) collect (car x))
1:39:30
aeth
This turns a Scheme-style dotted lambda list into the CL equivalent, i.e. (x y z . foo) => (x y z &rest foo) as long as the special case of not a list at all is dealt with first.
1:41:33
aeth
(I use (not (listp next)) instead of (atom next) because nil is an atom and that'll blow up the list into an infinite loop)
1:43:41
stacksmith
G'day... Can someone tell me what happened to uiop:launch-program? What is a good way to run another program (asynchronously) and get its stdin and stdout?
3:16:32
rumbler31
if you're trying to use ccl, I think ccl bundles an old version of asdf, so you might have to load a recent version to get it?
4:10:09
resttime
Sup, I've been writing small bits of Common Lisp to test a C++ daemon I'm writing that's going to be on a satellite which got me imagining lisp in space so I'm curious if it's possible to protect against random bitflips in space due to radiation with whatever is available.
4:11:50
resttime
Like could a random bitflip screw up a type and cause devastating errors throughout the whole lisp image or make the garbage collector delete the wrong memory?
4:13:04
resttime
An example to kind of protect against this in C is to represent a flag for example is reprsentating ON/OFF with a UINT16 instead of a single bit
4:14:15
resttime
But anyways, I don't know anything about this for lisp, like is it enough to use T and Nil?
4:15:39
Bike
you'd have to specifically think about it. i mean, like you could do the popcnt booleans in lisp as well
4:16:44
resttime
Errr but again this is going into implentation territory I dunno about so I'm here to ask :)
4:17:33
antonv
hi, who knows, what cl-tbree version is better / newer: https://sourceforge.net/projects/cl-btree/ or https://github.com/danlentz/cl-btree ?
4:18:14
pjb
resttime: you can write your own implementation, or patch an existing implementation, to add redundancy in the internal representations.
4:18:55
resttime
pjb: Supposedly yeah, but still protection is pretty important that stuff is still implemented like that. Example being multiple copies of data of polling data (there's been discussion about something like partitioning to store multiple copise of samefile on disk etc on satellite)
4:20:27
resttime
I wonder if there's some source of the lisp that ran on other space hardware and/or technical specifications of them somewhere
4:20:29
pjb
For example, there have been lisp implementations where there were no (obvious) type tag. Instead, data of a given type was stored all in the same memory page. So the type depended on the address. Then you would have to protect bits in pointers!
4:22:23
pjb
resttime: but seriously, it shouldn't be too hard to patch an implementation to do that.
4:26:36
Zhivago
I like the dylan approach which had the type tags point at the objects, allowing the tags to be elided where static inference was sufficient.
4:40:07
resttime
This seems like the right place to snoop around in lol: https://github.com/sbcl/sbcl/blob/master/src/compiler/generic/early-objdef.lisp
4:53:21
resttime
I probably need to rethink the premise :/ there's really only so much redundancy that can be added on before getting pedantic.
4:54:57
resttime
There's some C code which does do the whole bitflip protection thing so I'll ask those guys why they decided why they put it there
5:01:49
resttime
harovali1: You can check out roswell if you'd like, it's an implementation manager+more if the archlinux support isn't good enough
6:16:22
turkja
trying to get linedit installed on a debian box... what heck is going on, any idea? I get errors like this: "Just performed compiling #<MADEIRA-PORT "linedit" "ports" "ccl"> but failed to mark it done"
6:26:53
turkja
Just performed compiling #<MADEIRA-PORT "linedit" "ports" "ccl"> but failed to mark it done.
7:18:50
beach
greyavenger: It is easy to choose the wrong tools, so if you need help, you should say so.
7:44:19
Shinmera
stacksmith: uiop:launch-program works fine enough for async processes. I recently switched simple-inferiors to use it instead of external-program.
9:08:19
Shinmera
Can't use lisp if you want to let people install a lisp without a lisp already on the system.
9:21:56
resttime
Is the static-vectors library for sharing lisp simple arrays to C functions without copying it to C memory?
9:26:29
resttime
Thanks, I'm looking into the source for SBCL and it seemed different from another way which seemed to be done by 'pinning' the object against the garbage collector and then passing a pointer to it or something
9:27:13
Shinmera
Well, pinning isn't necessarily enough. The memory representation for the elements must match that of C oo
9:30:52
resttime
Hmmm, would you happen to know if SBCL is an implementation which cleans up these static vectors with the GC? (something mentioned in the readme, although it advises to not rely on it)
11:31:32
turkja
so it looks like ASDF 3.3.1 doesn't like what is in the linedit.asd: (:madeira-port "ccl" :when :ccl)
12:16:09
johnnymacs
In the sense that one programs on a purely reversible computer so that that processor won't consume any energy
12:17:20
phoe
do you want to run your computer without a battery and not plugged into a power socket?
12:18:37
Shinmera
Reversible computing as I understand it means that the state can always be rolled back or "reversed in time" in some fashion. Energy has nothing to do with that.
12:20:14
phoe
Following wikipedia, if reversible computing is an art of bypassing Landauer's principle, then it is not a matter of language but a matter of computer architecture
12:20:36
phoe
contemporary computers use irreversible computation and are therefore subject to Landauer's principle
12:21:05
phoe
and I bet that whatever language you use to program quantum computers, you can write yourself a Lisp there as well.
12:21:06
Shinmera
Anyhoo, turing equivalence says that if quantum computers are turing machines, then you can run lisp on them if you want :shrug:
12:24:04
phoe
and unless you have a reversible computer, all languages are equally unusable for reversible computing
12:26:09
phoe
it's the machine underneath that operates, the language only instructs it how to do it
12:28:09
johnnymacs
With the addition and the subtraction I can find out what the initial two terms were
12:28:57
johnnymacs
My research involves finding programming languages that can do anything that is possible for a language to do