freenode/#lisp - IRC Chatlog
Search
19:52:05
White_Flame
if you disassemble CONSP checks, it hcecks to see that the pointer's low 4 bits has the value 7
19:52:46
White_Flame
I believe the allocation granularity is 16 bytes (two 64-bit words), so the bottom 4 bits can be used for tagging
19:53:28
White_Flame
so if you know it's a cons pointer, the car is at [ptr-7] and cdr is at [ptr+1], since the pointer already contains an offset of 7 for the tag
19:56:35
pve
White_Flame: thank you, so would a fixnum sit directly in the car? (i'm not super familiar with this stuff)
19:57:05
White_Flame
yes, fixnums have a low 4 bits of xxx0, and all other types use xxx1. So the fixnums can use 63 bits of the 64-bit word
19:57:32
White_Flame
and are shifted left 1 bit, so plain adds/subtracts/etc can work directly without masking off a tag
19:59:17
White_Flame
fixnums, characters, and single-floats all reside literally in a word without indirecting
19:59:44
White_Flame
double-floats have to be boxed, as they require the full 64 bits of a word, and obviously multi-word elements are always pointed to as well
20:01:24
pve
ok great, this brings me to my second question: when I do (defclass kons (car cdr)) and allocate a long chain of them with fixnums (< 100000) in the car, i get something very close to 48 bytes per kons instance
20:01:57
White_Flame
well, the allocation reporting is probably rounding up to whatever block size it uses
20:02:29
White_Flame
but for an object instance, that'd be 6 words per, which probably isn't that bad?
20:02:50
White_Flame
obviously 2 words for the data, but 4 words of overhead does smell a little high. I think structs only have 1 word of overhead
20:03:29
Bike
a standard object is probably going to indirect its slots in a vector, plus there's a link back to the class somehow, and possibly more header
20:04:25
White_Flame
pve: I do default to structs, and only move to defclass if I really need it, to keep things lightweight
20:05:30
Bike
so four words of overhead could be the object header, pointer to the class, pointer to the slots vector, vector header
20:32:41
aeth
galex-713: If you *really* want to hate the modern web and Gitlab in particular, try using Gitlab's snippits (pastebin-esque) system. I used it for > 1.5 years after lisp paste shut down, but it's now entirely unusable for about 4 months because the dumb text input is gone
20:33:09
aeth
Now, it has a "smart" editor that reindents anything that you paste into it, and has no knowledge of Lisp, thus ruining any code you paste into it.
20:36:26
aeth
I think I'll just make a git repository next time I need pastebin-like functionality, and maybe I'd link to the /raw/ which doesn't appear to require JS
22:19:57
dim
if you're after a self-hosted web git thingy I've been told nice things about https://gitea.io/en-us/
22:42:00
z3t0
how is lisp land these days! I've been out of touch for a few weeks playing with freebsd
22:45:06
dra
z3t0: I doubt you have missed much. A new book was announced: https://www.apress.com/gp/book/9781484261330
23:32:04
sm2n
aeth, sourcehut is quite nice because it avoids modern web practices like the plague but this is offtopic
0:15:40
_death
I took a first step towards that not long ago.. porting the pertinent bits from gogs and creating a hunchentoot dispatcher to support git-clone
0:17:01
_death
but gogs seems to work ok with javascript off, so I'm not pressed to take further steps
3:56:56
contrapunctus
(Oh god. I can't believe it took me this long to realize the Strandh/beach pun 🤦)
4:16:03
contrapunctus
beach: been designing a markup language - https://github.com/contrapunctus-1/TheatreScript ...thinking of making a fork of 3bmd to parse it. (Or maybe it can be extended instead of forking...)
6:02:18
nirved
phoe: missing mezzano here https://github.com/phoe/trivial-custom-debugger/blob/master/trivial-custom-debugger.lisp#L41
7:00:17
VincentVega
Hey guys! Got a question on types. Is there any danger in class slots initform being nil when I specify some non-compatible type e.g. double-float? Structs fail to compile w/ smth like that, but the class def is just fine.
7:01:44
beach
VincentVega: You should probably use the type (or null double-float) for cases like that.
7:08:01
VincentVega
flip214: well, the struct definition compiles, but making an instance produces an error
7:09:19
beach
It must be the case that the type is checked in a struct but not in a standard object.
7:10:25
flip214
VincentVega: yeah, you need to provide all missing values on your make-<struct> call
7:10:39
VincentVega
because the struct has to calculate it's own size, right? btw are there any good resources/articles on typing?