freenode/#lisp - IRC Chatlog
Search
8:59:49
no-defun-allowed
Are there any benchmarks on how using type tagged pointers instead of consing up fixnums in the heap perform in (some kind of Lisp)?
9:00:10
no-defun-allowed
I know the former is much, much better, but I'm trying to estimate by how much.
9:03:15
Shinmera
Tagging and untagging is practically free on the CPU, whereas the rest requires constant memory access. So the benchmark is, well, your memory bandwidth and cache.
9:04:36
no-defun-allowed
I have a bytecode Lisp interpreter in CL and I'm looking at another bytecode interpreter in C, and wondering how mine is 10x faster on the only "benchmark" they have provided.
9:08:02
no-defun-allowed
My guess is that my environment model (a list of vectors) is faster than theirs (a hash table of some kind, I am not very good at reading C), and that they use heap-allocated numbers, whereas I snarf SBCL's fixnums.
9:10:00
no-defun-allowed
The former has a 3x or so speed increase, and I'm about to test the latter.
9:20:13
jonatack
seok: i'm not sure how lispy this is, but one advantage to me of breaking a long function into shorter ones is that you can unit test them.
9:25:56
beach
Cleavir can only be used to implement a Common Lisp compiler, and SICL is not in a state to be used by a general audience.
9:29:05
thijso
So I'm wondering... those of you using emacs as your editor, do you just use it's default indenting for CL code? Or are there packages (or settings) that make it better?
9:30:40
no-defun-allowed
Using the slime-indentation contrib for SLIME guarantees you don't get odd looks when you show your code to #lisp.
9:32:02
no-defun-allowed
The default Emacs indentation is okay, but slime-indentation makes it work much better. I think LOOP is the best example of the differences between them.
11:40:07
thijso
So if I have a part of my lisp code light up in red in emacs, it means there's something wrong, right? Apart from (error "whatever") where 'error' is red, I mean?
11:43:39
no-defun-allowed
If you write (foo (bar baz <Newline> quux) bloop), Emacs will highlight bloop red because it's in a silly spot.
12:02:12
thijso
Uhm. But what is wrong with (loop named something<newline>do<newline>(function-called) .. ? 'function-called' is marked red here, which I find a little strange. Is it the 'do'?
12:03:06
White_Flame
if your function name starts with "assert" it also changes red like "error" does
12:03:44
thijso
It looks like something else is going on. Is the function name "check-schedule" something special? It lights up anywhere I put it in my code...
12:05:22
thijso
Is there somewhere I can change those assumptions? I'm fine with 'assert' and 'error', but 'check-' not so much
12:07:05
thijso
Of course, I'm running a clfswm window manager on sbcl on funtoo, so that might explain some things...
14:52:46
beach
That's stupid. Here in Europe, the machine switches to the official language of the country where the card was issued.
14:53:18
beach
Well, maybe not ATMs. I don't know that. But when you pay in a store with a card for instance.
14:53:44
Bike
the US doesn't have an official language and we have many people who would prefer languages other than english. melting pot and all.
14:54:17
Bike
of course it's pretty annoying when the ATM says it will remember your preference and then asks you the exact same question next time
16:32:22
flip214
well, depending on the card format any user could use unused space for their own files...
16:38:05
p_l
when you put the card in, the ATM will query it for list of applications, then select from it the few that it supports (for example, Mastercard or Visa), then talk to that specific application
17:00:36
fiddlerwoaroof
https://github.com/slime/slime/blob/master/contrib/slime-fontifying-fu.el#L9-L13
18:29:23
jeosol
Does cl-mop:deep-copy of an object creates a complete new copy even for slots that are class objects?
18:30:11
jeosol
I am trying to create a new fresh object and modify one of the slot objects. Or what is a better way to do this.
18:31:31
jeosol
I have used cl-mop:deep-copy, I changed the inner slot object and when printed, they have the same value, so I am not doing something right
18:36:35
Bike
it looks like it copies values of class slots, but that just means changing the value of the class slot, which is after all shared
18:38:09
jeosol
Bike: I apologize for the lack of clarity. I mean have another object that is a slot in the outer one.
18:42:59
Bike
i mean, deep-copy calls copy-tree, but that won't copy the elements in the tree, just the conses
18:50:33
jeosol
I see. I was able to get it fixed by still performing a separate copy of the slots. I have used this approach (two step copy) in the past to get the objects to be different and not sure if there is a better way.
18:53:38
jeosol
I am trying to do sensitivity analyses by changing some slots (2 or more) in the parent object and can do by a function and submit in parallel
18:54:11
jeosol
Once I change the objects, I use it to create a deck for another black box function (external physics simulator)
18:55:19
jeosol
each one writes a different input deck when evaluated. I could do it sequentially on the same object, but trying to get the results faster by doing parallel calls.
20:05:15
thijso
Ah, ok. Yeah, then you're out of luck. Only way I see is to copy into a newly created hashtable with the correct test, but that is probably quite expensive...
20:10:43
aeth
I think the general expectation is to work with symbols/keywords if possible, where string= hash tables would mostly be for keys for things based on user input... so, yes, it's inconvenient, but not as commonly needed as it is in many other languages
20:11:47
aeth
Depending on what you'd need, you could make a make-hash-table* that defaults to string= (or equal or whatever), or a copy-hash-table... but alexandria has the latter.
20:12:06
pjb
seok17: (defun change-hash-table-test (old new-test) (let ((new (make-hash-table :test new-test :size (hash-table-count old)))) (maphash (lambda (k v) (setf (gethash k new) v)) old) new))
20:12:52
aeth
It looks like alexandria:copy-hash-table takes a keyword argument called test where if it's defined it will change what the test is (and if it isn't, it keeps the old test). So you could turn default hash-tables into #'equal hash tables that will also work on strings
20:14:10
aeth
You could also test for EQUAL or STRING= or EQUALP or STRING-EQUAL being used in the HASH-TABLE-TEST first to save a copy.
20:14:21
pjb
(let ((old (make-hash-table))) (setf (gethash "foo" old) 42 (gethash (copy-seq "foo") old) 1) (hash-table-keys (change-hash-table-test old 'equal))) #| --> ("foo") |#