freenode/#lisp - IRC Chatlog
Search
11:04:58
Shinmera
Does anyone have a collection of implementation-dependent tests to determine whether a symbol denotes a type? I know how to test for conditions, structures, and standard-objects, but not types otherwise.
11:50:47
Bike
that's difficult. implementations can vary which types are also classes, and how they do type macroexpansion, and so on
12:00:13
Shinmera
I need it in order to determine whether a type-definition should be emitted in my documentation system.
12:00:35
Shinmera
Bike: Right. I don't even need to type expand though, just to know whether a symbol names a type at all.
12:01:44
Bike
it sounds like you only need to know about user deftypes, in which case typexpand would do it
12:01:53
beach
It sounds like it would be a very useful library to have. And it would include TYPE-EXPAND.
12:02:34
Bike
https://github.com/Bike/introspect-environment/blob/master/ccl.lisp#L82 all internal symbols and shit too
12:03:53
Shinmera
pierpa: subtypep is a much more complex operation than simply testing whether a type exists.
12:09:28
Bike
it doesn't mention any errors, it just says the arguments are type specifiers, which means using non type specifiers is UB, rather than defined to be an error
14:26:57
k-stz
puchacz: if you check out the sbcl source, the exit-code is just a slot in a "process defstruct", which is nil on initilazation. The code also looks easy to understand at first glance
18:11:30
Fare
for compressing logs, I use xz -9 in a subprocess, which also reduces the GC pressure.
18:15:49
puchacz
how is it supposed to work anyway? if I put it in dot file in cl-user, will it apply to everything?
18:17:22
Fare
puchacz: the way it works is you put (declaim (optimize (speed 3))) in every file where you want that setting.
18:17:58
Fare
OR you use an around-compile handler in ASDF to (proclaim '(optimize (speed 3))) around the compilation of your files.
18:26:12
|3b|
ACTION would first try just deleting .fasl cache, declaim speed or whatever, and load the system and see if it actually gets noticeably faster before doing complicated things to make it permanent
18:27:04
puchacz
|3b| fasl deleted, but where to put (declaim (optimize (speed 3)) if it is supposed to be in every file?
18:29:27
puchacz
sounds like I want (eval-when (:execute :compile-toplevel :load-toplevel) (proclaim '(optimize (speed 3))))
18:32:11
puchacz
so if I (declaim (optimize (speed 3))) in .lispworks in cl-user package, will it just work globally "unless shadowed" somewhere?
18:33:19
pjb
If you're crazy, you mean do: (declaim (optimize (speed 3) (space 3) (debug 0) (safety 0)))
18:33:45
puchacz
pjb: I want to see how fast lispworks can go. by default 32 bit linux lispworks is much slower than 64 bit linux sbcl.
18:35:12
pjb
It is, but for code, smaller code means fewer memory accesses, and therefore more speed.
18:36:45
pjb
smaller code = simplier code = bigger data. If you optimize for smaller data you may need to use bigger code…
18:37:27
|3b|
ACTION notes that salza2 (used by zip) already has some OPTIMIZE SPEED declarations, so global setting might not help it much
18:46:30
puchacz
doing a lot of HTML processing. maybe I "broke" lispworks by replacing standard functions by unicode functions
18:51:27
puchacz
in one HTML the difference is massive. in the other - not so much. so my unicode "fix" has definitely something to do with it
19:03:53
puchacz
I just need to drill down to individual steps I guess. unzipping, parsing html, processing, serializing.....
19:09:56
malice
Common Lisp is Lisp-2, meaning that it has two namespaces; values and functions rest in different namespaces
19:10:23
malice
in Common Lisp, if you store function as a value of a symbol, you need to use funcall
19:22:40
Fare
I suppose you could produce sbcl output for android, though the interface would be in a separate java binary
19:24:34
pjb
asarch: (defun get-coords (x y) (list x y)) or (defun get-coords (f x) "Calls f with x as argument." (funcall f x))
19:26:53
Fare
there is sbcl for arm, etc. So you could run it on android. It's just that you then need some RPC to the java or javascript interface
19:28:13
aeth
These game jams tend to produce standalone binaries. Most of the CL entries use SBCL afaik. https://github.com/lispgames/lispgames.github.io/wiki/Lisp-Game-Jams
19:29:48
puchacz
Fare: did you notice that lispworks without "patching" like I did does not use unicode across standard string and character functions?
19:51:47
puchacz
also, pjb - why is it "Crazy" to switch safety to 0? is it possible that (+ 5 nil) will return a value for example?
20:01:08
aeth
puchacz: In SBCL, setting safety to 0 removes type checks and bounds checks. Other implementations might behave similarly, or might ignore a safety 0 and always enforce safety.
20:01:43
puchacz
aeth: so accessing index of vector out of bounds will not signal anything, just return a value? or store a value?
20:02:52
puchacz
(that's for bound checks) and for type checks, it will get an area in memory, say it is "integer" and like in C - no matter what there was, I will get an integer
20:04:16
puchacz
it is implementation dependant anyway, so I take your word for sbcl, and I may check with lispworks support what they mean by 0 or 1
20:05:44
puchacz
sbcl will crash on any uncaught signal/error whatever if you disable debugger, which is what I do for server
20:06:22
puchacz
and this is what we want, no? something unexpected, restart sbcl, rather than hang on [1] to use value [2] to abort etc.
20:07:34
aeth
If you're going to make assumptions that work some places but not others #+foo is probably a good idea
20:07:35
puchacz
pierpa_ tks, I may check but so far I estabilished that even with speed 3 my program is way too slow, so I need to dig into details....