freenode/lisp - IRC Chatlog
Search
16:56:40
Josh_2
I'm sat here thinking I wonder if there is a destructuring-plist, turns out you can just destructure a plist using &key ...
17:01:40
Bike
http://ix.io/3cvy here is how i would do a roots of lisp thing. makes the difference between a special operator and built in function clearer. would be more involved to make it self hosting, though
17:46:22
pjb
pyc: note how concatenate-string is faster when you have more than between 50000 and 100000 strings to concatenate. (may also depend on the length of the strings).
17:47:29
pjb
pyc: but when you have about 1000 strings, apply-concat is faster (in ccl, and given that call-arguments-limit #| --> 65536 |# );
17:51:46
copec
speaking of destructuring plists, a snip from the project I'm working on Josh_2 https://unaen.org/pb/1ym
17:55:32
Josh_2
well from what I just learned you can use (destructuring-bind (&key <your keys> &allow-other-keys) <your plist> <body>) to destructure a plist
19:09:51
pjb
About SBCL 2.1.3, I wonder why I get "Control stack exhausted during signal emulation: PC: 52077ee2" crashes, when call-arguments-limit is 4611686018427387903 ?
20:02:59
copec
anything more then one line I dump in a file in another buffer and ctrl-c-c each form anyways
20:06:33
copec
Even though for most of my programming I use sbcl, I wish clisp would have been the python
20:47:50
copec
#osdev is pretty popular, there should be a #lispdev, where people hang out who have reached the phase of trying to bootstrap their own lisp
21:34:42
dieggsy
FWIW this seems to work ok https://stackoverflow.com/questions/25809493/how-can-i-get-syntax-highlighting-for-common-lisp-in-slimes-repl#26050762
21:34:56
dieggsy
i changed it to lisp-font-lock-keywords instead of keywords-2... not really sure...
21:37:07
opcode
if i specify a literal as #o00 is that the null byte \00? coming from the C-family and finding lisp's type system very unintuitive
21:38:28
moon-child
opcode: in cl, characters and numbers have different types. So #o00 is another way to get the number 0
21:38:51
moon-child
if you want to make a character from a number, use code-char. e.g. (code-char 0) ←→ #\nul
21:39:21
opcode
i'm fiddling around with ironclad, and I want to make an initialization vector for AES that's just 0x00's. Is #\nul what I want?
21:41:16
opcode
but it's not clear to me from reading the hyperspec what exactly is equivalent to what
21:43:22
opcode
k. i find the docs very dense, but perhaps that's just because I have no formal CS training :/
21:45:14
Xach
opcode: i think ironclad is probably most useful if you already know generally how the algorithms are set up and used and you just need a reference for use
21:50:23
moon-child
standards documents are frequently like that. You have to learn to read standardese ;)
22:06:56
pjb
opcode: (make-array 4 :initial-contents '(#\null 0 nil "nope")) #| --> #(#\Null 0 nil "nope") |# ;-)
22:15:14
Xach
i find the hyperspec to be a fantastic reference, but it helps that i've spent a long time getting used to how it presents info.
22:36:47
copec
It is fantastic after you get it :-P If I don't understanding something, it's like it falls on deaf ears until I already understand it
23:34:27
White_Flame
I made a (defmacro fast-body (&body body) ...) which just wraps the body in a locally declare optimize
23:36:49
White_Flame
If you have multiple versions for different architectures, there will probably be #+ based compilation or file inclusion somewhere to select between them
23:37:27
White_Flame
so only 1 version is probably in existence? the other thing affecting it would be optimization declarations
2:10:37
pjb
ebrasca: integers have infinite length in Common Lisp. How do yo fetch a bit at ∞ to put it at 0?
2:11:49
no-defun-allowed
Something like https://en.wikipedia.org/wiki/Cyclic_redundancy_check#CRC-32_algorithm no?
2:12:59
ebrasca
I am now in this part http://www.sunshine2k.de/articles/coding/crc/understanding_crc.html#ch71
2:13:21
no-defun-allowed
I don't think you will do any bit-wise CRC for a filesystem, only on bytes.
2:15:42
White_Flame
but still, unless there's some weird superoptimizer style trick to bit order reversal, you'll probably still have to loop
2:16:34
no-defun-allowed
ebrasca: Any real implementation of CRC for a filesystem would use a byte-wise loop, not bitwise, and there is no reversal there.
2:17:08
White_Flame
ah, here's a reasonable method in log2 time: https://stackoverflow.com/questions/2602823/in-c-c-whats-the-simplest-way-to-reverse-the-order-of-bits-in-a-byte/2602885#2602885
2:17:10
dieggsy
way back in the day (lol just a few years ago) i had found some way to have a running SBCL process and write scripts that would like connect to it, does anyone know what i'm referring to ?
2:17:34
dieggsy
i don't think i was manually connecting to a swank server, though that may have been what the tool was doing
2:18:42
pjb
ebrasca: https://www.oreilly.com/library/view/hackers-delight/0201914654/0201914654_ch07lev1sec1.html
2:22:24
White_Flame
hmm, with 4 bytes to look up and re-merge, that pairwise reversal's 5 steps for reversing a 32-bit word might be shorter/faster
2:23:10
White_Flame
but yeah, feel free to try the various options in pjb's links for the really weird and potentailly shorter solutions
2:29:38
moon-child
http://graphics.stanford.edu/~seander/bithacks.html#BitReverseObvious has a few methods
2:29:59
pjb
Now, when you have specific operations that can be thus optimized (don't forget the logand etc to ensure 32-bit operations are performed on the intermediaries), such algorithms are ok. But if you had some generic bit manipulations to perform, of various kinds, one way to do it in lisp would be to convert the integer into a bit-vector.
2:30:26
pjb
Then you can manipulate the bit-vector with any array or sequence operator. replace, reverse, aref, find, etc.
2:31:22
pjb
Of course, it would be nice if there was an implementation operation to do that perhaps in a more efficient way than looping on logbitp…
4:03:36
beach
Not a "vs" opinion, but I think both are sub-optimal and we should work to get something better.
4:15:06
moon-child
is there a general solution to that (that doesn't require special knowledge of the 'let' form)? You would have to macroexpand 'let' with a partial body (or, more charitably, a body with a hole in it) in order to infer that 'multiple-value-bla' were bound at the point of the cursor. All that without knowing the end of the body
4:15:54
beach
So, we should analyze the buffer that way. Why should we settle for a lousy approximation?
4:16:58
moon-child
I'm not saying we should settle, I'm genuinely curious how you would solve that problem
4:18:51
moon-child
(I suppose one solution would be to have the editor automatically insert closing parentheses, but I find such 'features' jarring)