freenode/#lisp - IRC Chatlog
Search
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
12:29:28
phoe
all Turing-complete languages can do everything all other Turing-complete languages can do
12:30:07
phoe
so you can implement Lisp in Brainfuck and Brainfuck in C and C in Pascal and Pascal on a hypothetical bounded Turing machine and a hypothetical bounded Turing machine in Lisp
12:30:40
johnnymacs
It is true that with a turing machine you'd get a machine that can solve any math problem. However there are guarantees that you will not get. For example being turing complete gives you no guarantees as to how fast the computation will get done. Or as to how easy it will be to express the computation.
12:31:01
phoe
and this is not a Common Lisp problem because Common Lisp is a Turing-complete language.
12:31:06
johnnymacs
Being turing complete also gives no guarantees as to what features the machine will come preinstalled with.
12:32:17
phoe
no, it is a query about hyper-Turing-completeness, and is about computability more than Lisp itself.
12:32:40
johnnymacs
My point is the reason I don't go ask this in #javascript is that javascript is already out of the race
12:32:58
jackdaniel
I understand nothing from all this - either it is very close to nonsense or I'm too primitive to comprehend
12:33:06
jdz
The Common Lisp that is implemented in a browser in JavaScript is no longer a Common Lisp?
12:33:33
johnnymacs
There are features to a computer besides the limit of the computations it can do
12:34:51
phoe
But you can implement a Turing-complete language in any other Turing-complete language.
12:34:57
Josh_2
The quote goes something like this "every significantly complex programming project will have at some point implemented a lisp"
12:34:58
jdz
johnnymacs: so there you have it -- lisp can implement reversible computing, as you just said.
12:36:17
johnnymacs
To be purely reversible all of your hardware and software from the bottom of your stack to the top of the stack has to be reversible
12:36:30
Shinmera
13:26:55 Shinmera | Can we just say Lisp isn't suitable and move on to more fruitful topics
12:36:56
johnnymacs
There are machines in existence which are reversible in the hardware. They are called quantum computers
12:37:56
phoe
It is concerned about hypertheoretical Lisp dialects tha nobody created yet and almost no one has computers to run it on anyway.
12:38:05
jackdaniel
#lispcafe for reversible computing! ;-) but seriously, it fits nowhere near #lisp channel
12:39:44
Shinmera
Unfortunately the universe is mostly deterministic, so we'd just relive the last 10 minutes again over and over.
12:40:54
jackdaniel
I don't get the "mostly" part, it either is or isn't (and my belief is that it is not deterministic)
12:40:56
phoe
Shinmera: if the universe is reversible, then we can relive the last 10 minutes forever and still be unaware of it repeating
12:41:51
Shinmera
jackdaniel: Quantum mechanics says it isn't, but the fluctuations smoothen out with scale, so it is deterministic if you don't zoom in too much.
12:43:02
jackdaniel
Shinmera: taking into account chaos theory, even small changes may influence a big picture
12:49:49
paule32
the problem i see: how to iterate dynamical - e.g. Menu1 has 3 items, Menu2 has 4 ..
15:26:29
jmercouris
Hey everyone, I just made another release of my browser https://www.reddit.com/r/lisp/comments/7dlnif/next_browser_ver_004_with_binary/
15:26:55
jmercouris
This one includes a lot of updates from feedback that I got from the community here about how to improve my code. There's still a long way to go, don't get me wrong, but it's slowly getting better and more mature
15:27:17
jmercouris
I'm looking for anyone who would like to help work on a GTK release with me, or just leave a star on github, thank you for your time
15:33:03
jmercouris
It used to be cross-platform via QT, but I've sought better performance, so I've gone native + CCL
15:33:36
jmercouris
Josh_2: Yes, and without going to deep into it, it is not suitable for my purposes
15:34:22
jmercouris
Most of the GUI work I'm doing is just basic rendering of a Web canvas, the majority of the logic is in managing those canvas' and the associated datastructures associated with a web-page
17:18:18
Josh_2
Am I right in assuming that Quicksort isn't so great when you have lots of repeating values you have to sort?
17:20:01
pjb
well, I don't know exactly in that case, but if the vector is almost sorted, quicksort is not necessarily the fastest in practice. Having a lot of repeating values would render the vector almost sorted, so…
17:53:54
pjb
Josh_2: if you have a (small) bounded number of different elements, then you can easily sort the vector in O(n)!
18:04:52
johnnymaster
So basically i am trying to implement a function that takes a function and a nested list and applies the function to the the list (like reduce)
18:05:15
johnnymaster
So if i have the list '((1)) 2 3) and the function '+ i should get 6 as my answer
18:05:30
johnnymaster
(defun reduce-tree (fn tree &optional init-val) (cond ((null tree) init-val) ((atom tree) (funcall fn init-val tree)) (t (reduce-tree fn (cdr tree) (reduce-tree fn (car tree) init-val)))))
18:06:01
johnnymaster
Can you help me shorten the last line (t (......) using reduce and a lambda call
18:11:51
pjb
Using flatten and thus implementing a modular solution would be good to ensure you get a correct function, but it would use more temporary space (and more O(1) time), so it may be rejected for production. Of course, if you need to avoid the use of space, you need to be working on trees that fill half or more of the memory!
18:12:44
johnnymaster
(defun reduce-tree (fn tree &optional init-val) (cond ((null tree) init-val) ((atom tree) (funcall fn init-val tree)) (t (reduce #'(lambda (x) (reduce-tree......))))))
18:13:55
pjb
johnnymaster: well, you have to answer the question of what kind of tree you're dealing with here. cf. http://groups.google.com/group/comp.lang.lisp/msg/0c66e597e08be90d
18:17:14
pjb
johnnymaster: what you would put in that lambda, is what you should put for the whole function! ;-) cf: (t (......) using reduce and a lambda call
18:17:20
pjb
*** Josh_2 (~user@cpc88041-dund14-2-0-cust452.16-4.cable.virginm.net) has quit: Ping timeout: 260 seconds
18:17:22
pjb
<pjb> Using flatten and thus implementing a modular solution would be good to ensure you get a correct function, but it would use more temporary space (and more O(1) time), so it may be rejected for production. Of course, if you need to avoid the use of space, you need to be working on trees that fill half or more of the memory!
18:17:31
pjb
<johnnymaster> (defun reduce-tree (fn tree &optional init-val) (cond ((null tree) init-val) ((atom tree) (funcall fn init-val tree)) (t (reduce #'(lambda (x) (reduce-tree......))))))
18:17:41
pjb
<pjb> johnnymaster: well, you have to answer the question of what kind of tree you're dealing with here. cf. http://groups.google.com/group/comp.lang.lisp/msg/0c66e597e08be90d
18:17:47
pjb
#lisp johnnymaster: what you would put in that lambda, is what you should put for the whole function! ;-) cf. http://sprunge.us/QUQL
18:17:57
pjb
johnnymaster: what you would put in that lambda, is what you should put for the whole function! ;-) cf. http://sprunge.us/QUQL
18:21:34
pjb
There are several questions: where is the init-val used? once for the whole tree? Once for each subtree?
18:22:00
pjb
And there's the question of what defines a tree. eg. What should happen for ((1 . 2) (3 . 4)) ?
18:23:13
pjb
johnnymaster: So write down a specification, then you can write test cases, and then you can implement it.
18:34:58
shka
johnnymaster: (defun reduce-tree (fn tree) (reduce fn tree :key (lambda (x) (if (atom x) x (reduce fn x)))))
18:36:25
shka
johnnymaster: (defun reduce-tree (fn tree) (reduce fn tree :key (lambda (x) (if (atom x) x (reduce-tree fn x)))))
18:37:19
Bike
How annoying would it be if loading fasls didn't install inline definitions for the compiler?
18:40:53
pjb
johnnymaster: in general, it's better to use &key rather than &optional, because you soon will want to add optional arguments, and then &key is more practical, since you can pass them in any order.
18:41:18
pjb
johnnymaster: for example, you could want to add a key argument to extract the value to reduce from each node.
18:42:04
pjb
(reduce-tree #'+ '("abc" "ab" ("abc" "def")) :key #'length :initial-value (length "prefix")) --> 17
18:47:14
shka
johnnymaster: numerous other sequence functions accept similar arguments, it is beneficial to stick to this set
18:48:11
pjb
What's interesting when you do that, is to compare an school case implementation, to an actual implementation with a lot of special cases and options.
19:20:16
trn
Others too... I finally hacked up from ttyd a proper Web terminal for the Multics emulation. So, you can login with "e Guest", to get a proper terminal, "stty -ttp vt102_132c_50l" and then "wdc invoke" for a proper 132x50 terminal. Enjoy Emacs 12.9 and MacLISP, etc. Now no mosh/ssh/telnet needed :)
19:24:17
trn
No permanent storage for guest users, but, you can have temp space in the process dir ( cwd [pd] )