freenode/#lisp - IRC Chatlog
Search
11:29:22
contrapunctus
White_Flame: named let is Scheme's syntactic sugar for recursive functions - (let foo ((a 0) (b 1)) ... (foo 1 2) ...) (the next time, a and b will be bound to 1 and 2)
11:32:14
jackdaniel
galex-713: print this https://web.archive.org/web/20180811021738/http://cvberry.com/downloads/ansi_cl_standard_draft_nice.pdf
11:35:09
ldb
galex-713: there's a nice PDF version of CLtL2, under https://github.com/daly/axiom/blob/master/zips/clm.pdf
11:36:36
galex-713
ldb: I’ve the sources from steele’s website, as for CLtL2, I just can’t get the index to compile correctly
11:37:15
jackdaniel
I think that while cltl2 is nicely written, learning from it will do you no good, because it is a *different* language than Common Lisp
11:38:16
jackdaniel
it worked for me, cvberry.com website went blank some time ago, that's why I've linked the archive copy
11:38:50
easye
jackdaniel: RE: cltl2: slightly disagree, the style (Steele!) is excellent, and can help with some points. One does has to check the CLHS for exact differences, of course.
11:39:06
galex-713
ldb: I also have a compiled version with hyperlinks, but it’s more cool to have sources, to reprint and correct it if one day I feel it is needed
11:39:30
dra
galex-713: https://franz.com/support/documentation/cl-ansi-standard-draft-w-sidebar.pdf
11:41:09
galex-713
jackdaniel: I read the diff you gave, to me it looks small or superficial, I disagree, I hoped bigger change (like the series, CLOS or condition system added as annexes in second edition of CLtL… though I know CLOS description is not complete and doesn’t describe MOP, I didn’t find where to get anything about that, and thought I could complete with ANSI Common Lisp from Graham
11:42:04
jackdaniel
easye: it is a nice reading, but learning about cltl2 to understand common lisp is not a sound idea in my eyes, precisely because of these small differences
11:45:12
galex-713
I wished there were a fusion of CLtL2 and that draft, in some format such as texinfo, that could convert to both a readable TeX book and to an html hyperspec
11:46:43
galex-713
jackdaniel: I started with elisp, learnt scheme by reading r5rs, some r4,6,7rs and srfi, and wanted my knowledge to be exhaustive, I was especially excited about type declarations, but this doesn’t seem to have changed
11:48:30
galex-713
jackdaniel: dra: also, was cl only standardised by ANSI? wasn’t it also by ISO, IEEE, or something alike, outside of US?
11:49:37
ldb
galex-713: Anatomy of Lisp teaches the LISP family of languages via the formal semantics
11:51:01
jackdaniel
islisp has iso standard, eulisp was being standardized in Europe (but only drafts are available, it was never finished)
11:52:48
galex-713
anyway, I think if any foreign org should have done that, they should have just dubbed the ansi one
11:56:22
galex-713
jackdaniel: buy from ANSI? that’s possible? I’m in Europe and only european also. And why terrible? why a waste? what’s dpans3?
11:57:49
jackdaniel
ansi sells documents with standards, but they charge (afair) $20 per copy, which is an ugly scan of a printed document
11:58:40
galex-713
contrapunctus: indeed labels in the best bet to build named let on it, but beware without syntactic sugar, you will have to write program body before init vars, like with map
11:58:40
jackdaniel
if you want to compile latex yourself, dpans3 sources are available i.e in this repository: https://gitlab.com/vancan1ty/clstandard_build.git
11:59:11
galex-713
ldb: oooh, so it’s not about lisp, it’s about computer science, but uses lisp is it?
12:00:33
ldb
galex-713: noo, it's all about lisp, how to implement lisp, the meaning of the primitives. it is just not about a specific kinds of lisp
12:01:04
galex-713
ldb: does it also speaks about history? like lisp 1, 1.5, maclisp and maybe interlisp?
12:02:35
ldb
galex-713: it is using essential the same notation from McCarthy, but also talked about lexical scoping.
12:11:15
jackdaniel
galex-713: let me help you: https://duckduckgo.com/?t=canonical&q=dpans+lisp&ia=web
12:26:42
galex-713
(I feel also like other people are also just better than me, they adapted to the noise, and I don’t, it drains my energy out)
12:27:29
galex-713
well for instance I searched “dpans3” on google and first 5 results didn’t tell me anything about what I wanted
12:28:04
galex-713
and I have a randomly-strong adhd (but trying some medicine now, maybe it helps, who knows)
12:28:30
galex-713
I also happened to find interesting programs on github, apparently proprietary, yet useful
12:28:50
phoe
I usually add more keywords to searches, I guess that "dpans3 lisp" works somewhat better
12:31:07
galex-713
I usually add the least, as long as it’s unambiguous (then go back if it’s apparently not), so I don’t get unrelated answers that could be unrelated (or even not containing) the keywords that really interested me
12:32:18
galex-713
phoe: antoszka doesn’t include a readme and I don’t know which of these dozens of file research for the meaning of what “dp” stands for
12:32:38
ldb
intead, you should looking in books' reference/bibliography section for relatex information
12:34:27
jackdaniel
the first rule of steering through noise is to not generate it ;) discussing ddg vs google is not this channel topic
12:34:55
galex-713
also a horrible thing is then google makes so relevant bubble about people you ask for help, that you can’t get help from them because “google it it’s obvious”, and if trying ddg or other, you don’t get the answer…
12:35:53
galex-713
jackdaniel: you are right, thank you (through irrelevance can be sometimes relevant, especially as some people are sometimes more relevant than other, especially here ;) so each channel ought to have a -offtopic counterpart)
12:36:43
jackdaniel
this channel has one, it is called #lispcafe -- a preemtive answer: some people are not on #lispcafe because they are _not_ interested in offtopic
12:38:00
galex-713
jackdaniel: “[14:22:08] <dra> 20 years ago it was way easier to find useful information on the net.” was brought here by someone not on the offtopic channel, and I found that interesting, I think I should have answered privately then maybe, thank you anyway
12:40:47
jackdaniel
there you go sunshine, I'm afk for a while (to avoid complaints for changing the topic)
12:48:46
galex-713
So let me resume: beside being older, hence more used, with special variables, being a lisp-2 (actually lisp-n, afaiu), not having continuation but having goto+return, and empty list/falsity equivalence, one of scheme or cl could be implemented in terms of the other?
12:49:24
galex-713
like having a small kernel implementing all these, and configurabilility about what to do about booleans and namespaces
12:50:08
galex-713
are there also pecularities to typing? or is just cl superior to scheme in this respect (which restricts itself to a few standard disjoint datatypes)?
12:50:27
phoe
kinda sorta - I think the most painful thing is the ability to express continuations in CL and (I guess?) implementing on Scheme-side the possibility of doing external non-local returns in CL
12:56:10
beach
galex-713: Both languages are Turning complete, so you can always implement one in terms of the other. The only question is what technique you then use, and how painful it is.
13:44:32
galex-713
beach: some features are more low level than others. I’m pretty sure we can implement gotos in terms of lambda, but it looks extremely wrong to me, and I would never want to do that
13:45:07
beach
So then the question is what you want, and that is a very tough question to answer, because there are so many different options.
13:45:15
galex-713
so, let me try that: except continuations, all of scheme is expressible in terms of cl
13:46:08
galex-713
beach: I’d like to take any implementation and make it pyramidally built upon a small lower level kernel
13:47:17
galex-713
I think it’d need to be a lisp-n (in a configurable way: let n be any number, possibly as much as the number of types), have both continuations and gotos, configurable scope, and configurable conditionals
13:48:00
jdz
galex-713: Even Scheme people don't think full-blown continuations are a good idea — they don't mix with dynamic (special) variables very well.
13:48:56
galex-713
phoe: I’d like to help a friend do something useful and amusing to more people from his thesis work
13:50:05
phoe
the former is a general Lisp discussion channel, where the latter (here) is strictly CL-related
13:52:03
galex-713
but anyway my base question was on cl, and scheme, and I asked on both channels, and got non-overlapping relevant answers
14:03:55
beach
galex-713: As it turns out, that technique of implementing a language (i.e., growing it from something lower level) is not necessarily a good idea, as you would see if you followed my presentations for the online Lisp meeting.
14:17:36
phoe
my thought/experience/conclusion on which topic in particular? I'm just a Lisp hacker/programmer
14:22:19
phoe
all talks that I've streamed so far as a part of the OLM initiative are on this channel
14:24:17
minion
galex-713: SICL: SICL is a (perhaps futile) attempt to re-implement Common Lisp from scratch, hopefully using improved programming and bootstrapping techniques. See https://github.com/robert-strandh/SICL
14:25:25
phoe
basically, SICL is an attempt to write a CL implementation 1) in a fully modular way, 2) in portable Common Lisp without parts in any foreign languages
14:25:49
phoe
1) makes its modules usable and useful in other implementations and just in general as libraries
14:26:53
phoe
2) is the craziest idea ever since it means that you can write all of CL in CL without any kind of intermediate core written in C or what else and without issues of "we can't use defclass because we don't have defclass yet"
14:29:12
galex-713
beach: thank you, I read several pages on that then :) so the new thing is you use the whole high level common lisp to implement it right? or some new features too?
14:29:43
jackdaniel
the idea is not crazy, C is bootstrapped using "full" C; it is just not very common among existing common lisp implementations
14:30:25
phoe
jackdaniel: ebrasca: I meant what jackdaniel mentioned - it's not what existing implementations do. Mezzano and SICL are unique in the matter
14:30:35
galex-713
jackdaniel: it is not very common among high-level languages implementations, I only know C, C++, rust, haskell and OCaml who do that
14:30:57
phoe
galex-713: the SBCL compiler is written in CL, the C core is usually used for interfacing with the OS and for garbage collection
14:31:59
galex-713
modules which could dynamically load libc themselves, and/or base themselves on some kernel API, isn’t it?
14:32:53
beach
galex-713: Not so much, no. Most of the code is tied to SBCL itself. And the SBCL compiler is written in a subset of Common Lisp that does not include CLOS.
14:33:34
galex-713
I’ve seen that in guile too, lisp implementors keep implementing it in non-portable way, this is sad :c
14:33:53
galex-713
and it’s bad, because the more important is something, the more readable it should be
14:34:41
phoe
there's SB-INT and SB-C and SB-IMPL and SB-VM and SB-GRAY and SB-WHATEVER splattered all over SBCL source code: compiler, reader, FORMAT, LOOP, everything
14:35:00
beach
galex-713: CLOS is part of the Common Lisp standard. So it all has to be implemented in a conforming Common Lisp implementation.
14:36:07
galex-713
jackdaniel: REALLY??? even the VM? but how is it natively compiled? I thought there was only gcj which did that, and it was abandoned…
14:36:29
jackdaniel
there are multiple compilers (the standard java compiler is written in java), but this is offtopic
14:36:53
beach
galex-713: In other words, there is no "order" between modules. It is not the case that one module is written in a subset defined by modules that have been created previously.
14:36:59
galex-713
I dislike OOP, but your talk should be interesting, but it lacks subtitles and spoken english drains my energy if it’s not with a friend :c
14:38:15
beach
I am sorry to hear that you dislike object-oriented programming. That dislike is probably due to your not having been exposed to CLOS.
14:39:46
galex-713
it would have changed my way to see english, if a native french speaker had a so good accent that it made me tired
14:39:47
phoe
(defclass frenchman-for-all-practical-purposes () ()) (defclass frenchman (frenchman-for-all-practical-purposes) ())
14:42:09
beach
galex-713: So to summarize, "growing" a language implementation is not such a great idea, because it requires the person implementing and maintaining a module to know precisely what subset of the language is allowed.
14:43:44
galex-713
personally I like reductionism (“growing a language” out of low-level) because it helps learning the whole system working going down, and also because it means you don’t have to know everything to read anything
14:47:56
galex-713
or is it about using it and doing fun or unheard or not-known-enough stuff with it?
14:48:35
phoe
it's about constructing it from scratch two times in a row in different ways, and then discussing its uses and traits and quirks and fun purposes
14:49:41
ldb
actually most programming languages are suspicious to all kinds of exception handling like things
14:52:02
galex-713
phoe: no no, you don’t understand, in my case it’s an issue, I don’t write anything T-T
15:01:13
MetaYan
dra: continued from #sbcl - I just happened to have read the errata a couple of days ago, so the form rang a bell. Not familiar with the details yet.
15:07:01
dra
MetaYan: Yeah. I just noticed that SBCL spits out a few warnings and COMPILE-FILE sets FAILURE-P. Loading the FASL works and even the continuations work. But by now I'm convinced that Weitz must have DEFVAR'd the symbol before (setq foo 13). See 12m54s at https://www.youtube.com/watch?v=EyhL1DNrSME.
15:10:39
_death
dra: it's an old habit to setq like that.. the standards committee decided to not define the consequences of doing it, and some implementations (e.g., sbcl) decided to be strict and signal a warning
15:25:55
galex-713
phoe: I guess your book and what’s in it won’t be under a free licence…? :/ do you know how much it will cost btw?
15:26:53
phoe
also, nope, I expect coin to flow through them to me if you get the book in a legitimate way
15:29:33
phoe
beach: I still don't know, I'll know when it comes out of production and we have a chance to implement our last fixes there
15:30:10
phoe
I... honestly don't know, because I don't know what kind of page size and font they'll use
15:38:24
phoe
galex-713: yes, CLtL2 (AFAIK) doesn't teach how the condition system works internally or how one can construct it from scratch
15:42:19
galex-713
phoe: just that? so I could read that in another implementation and it would be “just” more difficult and likely uglier (since I guess it’s must be beautiful to be published)?
15:43:29
phoe
same way you can "just" read the Portable Common Loops sources in SBCL and it would be "just" more difficult and likely uglier than reading AMOP
15:45:56
galex-713
does Sonya’s book describe MOP too? what do you think of it if you have read it at least skimming?
15:46:38
phoe
MOP is a means of implementing and programming CLOS; I don't think Sony--- thanks xristos
15:47:21
xristos
the sonya book is nice but i'm not sure i'd spend the money for it if i had another chance (i bought both)
15:47:34
phoe
I can't say if my book is worth buying because that'll be up for the reviewers to decide
15:48:15
galex-713
phoe: for now it looks promising :) you you implemented conditions twice and are proud enough to put that on paper, that inspires trust
15:48:41
phoe
galex-713: I didn't really do that from scratch once, I based the implementation on an earlier one
15:49:38
galex-713
if you found something beautiful and even a little improved it and explained it, it’s cool
15:50:23
phoe
obviously not, that implementation was from 1990s and didn't even compile cleanly anymore
15:50:51
phoe
it seems that PCL is built atop MOP, at least judging from https://www.cs.cmu.edu/afs/cs/project/ai-repository/ai/lang/lisp/oop/clos/pcl/ code
15:52:13
galex-713
but I knew a bit of smalltalk, and it seemed stupid and beautiful at the same time, I liked it somewhat
15:52:37
galex-713
I had a course on it, never did anything because the implementation taught was proprietary
15:53:07
phoe
#lispcafe would say that Pharo is a good modern free smalltalk implementation, but that's already #lispcafe material
15:54:19
dra
galex-713: I found phoe's comments very thorough and insightful in the book announcement thread on Hacker News: https://news.ycombinator.com/item?id=23843525
15:57:52
phoe
;; so this kinda teaches me that the traveling salesman problem is not a problem when you're the salesman and you travel to HN to show your wares
16:05:13
galex-713
phoe: if you think to also convince other languages, why not titling it “Condition System”? it’s shorter and common lisper may already recognize what it is, wouldn’t they?
16:08:20
rpg
SLIME question: how does one start up slime with environment variables for the lisp process? the definition of SLIME-START has an ENV argument, but AFAICT there's no way to pass that argument to SLIME-START -- SLIME doesn't accept an ENV option. It seems like SLIME-LISP-OPTIONS should allow this, but afaict it only lets you add command line arguments to the command that invokes the inferior lisp.
16:09:35
rpg
Franz's ELI (emacs lisp environment) has the variable fi:subprocess-env-vars -- is there anything like that for SLIME?
16:27:40
galex-713
phoe: still reading about your book on HN and… do you think it will be possible to order it without non-free javascript? I don’t know well apress, nor where it will arrive
16:28:05
galex-713
oh also if you order the dead-tree version, do you get the ebook as well? or would you need to pay twice'
16:35:01
galex-713
phoe: also, when you say “programmable debugguer”, is that standard and integrated in the condition system? or standardized after CLtL2?
16:42:36
galex-713
something that made me sad reading CLtL is that struct don’t support multiple inheritence
16:43:20
rpg
galex-713: That would mess with the ability to efficiently access structs by memory offsets.
16:44:01
phoe
galex-713: I know that apress and/or amazon have it, I don't know about their JS-free versions
16:44:36
galex-713
because I have apress books, and everything I got I got through ebay, because I couldn’t get it elsewhere
16:44:41
phoe
the CL debugger itself is actually not defined in the standard itself, it's left for the implementations to define
16:45:08
phoe
so you can either tweak the implementations' provided debuggers, or - as we do in the book - define your own debugger somewhat easily and program it
16:47:26
phoe
and BREAK is a pretty trivial thing, it's a LET over WITH-SIMPLE-RESTART over INVOKE-DEBUGGER
16:47:49
galex-713
Also something opposite: same question about “supertyping” of struct and class… considering that offset thing, especially of classes: wasn’t there ever something like “define a super class of all these class, such as it contains the intersection of their common member and the intersection of their appliable methods apply to it”? or was there never a need to do that because of the possibility to redefine classes on the fly? (I guess
16:49:15
galex-713
with defclass you can only (re)define a class according its definition and the superclasses you give
16:49:40
galex-713
what I mean is like you define a new class, which would be the intersection of several classes so that it automatically is the superclass of all these a posteriori
16:50:28
phoe
but then you'd also need to take care to only mutate the classes that you are allowed to mutate
16:53:37
jackdaniel
I don't understand what it means, that it is "automatically a superclass of all these a posteriori"
16:53:48
galex-713
rpg: what if structures are aligned and that turns up to just be a structures of structures (so there is overhead, but not as much), while letting the API be the same?
16:55:05
rpg
galex-713: I suppose, but I believe that the intent was to give structs the efficiency that objects lacked...
16:55:28
galex-713
Bike: because they can overlap, but that is an issue with union, not intersection
16:56:08
jackdaniel
check out stealth-mixin library which allows adding a superclass to a "victim class"
16:57:28
phoe
Lisp type unions/intersections are symmetrical but Lisp class unions/intersections are ordered and therefore asymmetrical
16:57:29
Bike
say you have classes A and B and C. you do this automatic definition thing to get AB s.t. A <: AB, B <: AB, and BC s.t. B <: BC, C <: BC. Then you define a generic function with methods on AB and BC and call it with a B.
16:59:44
galex-713
Bike: you do that by the topological order in which you specify the subclass in the automatic superclas definition
17:01:08
Bike
The class-precedence-list, the linear list of superclasses, is a property of the class, not of its superclasses.
17:01:43
galex-713
I’m unsure, I feel like on a subset it’s feasible, I’m unsure how it would behave on special cases
17:01:55
galex-713
but that would be an important decision whenever trying to implement a such thing
17:02:13
Bike
the need for this linear list is what makes this more complciated than unions and intersections.
17:02:24
Bike
for that we have the type system where you can easily specify intersection and union types.
17:03:23
Bike
there are also some things with slots that would be non obvious. For example if one class has a slot that's an instance slot and the other has a slot with the same name that's a class slot.
17:04:00
galex-713
phoe: concatenation of matching subset of ordered list of superclass, would it work?
17:04:34
galex-713
so (defsuperclass my-superclass (my-class my-other-class)) would have no applicable method
17:05:35
jackdaniel
galex-713: I think that you need to get at least some grasp of clos before making hasty suggestions
17:05:54
phoe
"concatenation of matching subset of ordered list of superclass" is a bit over my head
17:06:04
phoe
could you give me an example with MY-CLASS and MY-OTHER-CLASS that I mentioned up above?
17:06:15
galex-713
but given (defclass first (a b c d e f)) and (defclass second (a b d c e f)), (defsuperclass my-superclass (first second)) would have as ordered superclass list (a b e f)
17:06:50
phoe
galex-713: so, basically, MY-CLASS and MY-SUPERCLASS would have what exactly as its ordered superclass list?
17:06:52
galex-713
jackdaniel: you are very likely right, I’m speculating, trying to mindplay with thing, I shouldn’t do that maybe…
17:07:25
Bike
i mean, it's fine. mop is designed to let you do weird things with clos, and is itself unfinished.
17:08:09
jackdaniel
you could, but I personally would not engage all channel participants with speculation without trying to understand what I want first
17:09:04
galex-713
but my-class would have (a b c d e f my-superclass) and my-other-class would have (f e d c b a my-superclass)
17:10:27
galex-713
I’m grateful to you to have made me understand why, despite my inexperience about clos
17:10:42
phoe
gee, how many things get complicated when you introduce a simple linear order on a set
17:11:20
galex-713
oh, do you know if there is a such thing such as data, or even compound data inlining within struct?
17:11:51
galex-713
so that to reduce the amount of pointer to dereference to access an element of a data structure of a member of a struct?
17:12:32
phoe
AFAIK yes but it's not going to be as efficient as in C by default in order to preserve object identity.
17:13:36
galex-713
like eq could never work but maybe eqv would work as equal (without going deeper than the most shallow level)
17:17:05
phoe
and because small integers and characters are allowed to be stored inside pointers but also may not be stored there, it means that EQ may not work well on those
17:18:13
galex-713
but is there a way to declare something so that you declare a member of a struct as, say, a cons, so that eq won’t work anymore on it, though eql would, but it would only compare its car and cdr, not going deeper (contrarily to equal)
17:21:20
phoe
there's a concept of places in Common Lisp that works sorta similarly to what you describe
17:22:18
galex-713
initially I thought there was a trinary separation between variable, place and value, and that each involved a pointer
17:22:28
phoe
but no, I don't think that you can tell Lisp to do things like that without breaking object identity in some way; for simple tagged structures like conses it might work, but for more complex objects that require having headers in memory that's going to break
17:22:54
galex-713
rpg: yes but I guess it won’t be inlined, especially as I don’t see a way of indicating the “fixed size” of a list, and it looks a dumb thing to do
17:24:44
phoe
I mean, you could cheat by explicitly allocating foreign memory, but that's only going to give you foreign types + overhead for converting between Lisp and foreign worlds
17:28:01
phoe
it's an abstract thing, and sometimes a lexical thing, and a second-class citizen in CL
17:29:09
phoe
(that's a basic Lisp question and #clschool is designed exactly for that sorta questions)
17:29:37
galex-713
I’m not interested in cl because I got how it is defined so how it can work, or not work
17:29:53
phoe
other examples of places include CARs and CDRs of conses, AREFs of arrays, ELTs of sequences, GETHASHes of hash tables with given keys, SYMBOL-FUNCTIONs of functions, etc..
17:30:54
galex-713
no your vision of it is perfectly correct so I don’t understand why you made a connection I would have made before and wouldn’t anymore now I got how it work
17:32:33
galex-713
sorry, indeed, you are right, I’m too quick to type return while I think, instead of afterthought, thank you for the notice
17:33:41
galex-713
okay my idea is definitely complex to implement, but doable, and not definable according current standards
17:39:51
galex-713
are there or were there cl implementations that optimized so much so as to stop storing the size of arrays?
17:40:26
galex-713
for instance if som eprogram never asks for it, and because it keeps it in some data elsewhere and doesn’t need one per array
17:40:29
phoe
that would have to be nonstandard because ARRAY-DIMENSIONS must return a meaningful value
17:40:58
Bike
well, it would be fine if array-dimensions etc aren't called. however it would be hard to impossible to maintain this across function boundaries
17:41:46
galex-713
unless the function is really unsafe, but that particular unsafety ought to be declared as such and no such standard declaration exist
17:42:20
Bike
i mean, for some cases maybe, like if you have a constant array and access it only in one function
17:43:25
galex-713
I thought like imagine I have a datatype which is a list of arrays whose length change in a predictible manner
17:44:01
galex-713
for instance (a b c d) where a is #(nil), b is #(nil nil), c is #(nil nil nil), d is #(nil nil nil nil), etc. if you grow the list
17:44:38
galex-713
since you can predict it, in some portion of program that access a such object, you would never call array-dimensions, nor length, etc.
17:45:07
galex-713
Bike: indeed it is, but it is one of the possibilities that makes C lower level than lisp in the sense that it can do some things that lisp couldn’t
17:46:16
phoe
link them to https://pvk.ca/Blog/2014/03/15/sbcl-the-ultimate-assembly-code-breadboard/
17:46:30
Bike
i mean, you're right, lisp does not let you specify memory layouts even to the limited extent C does.
17:47:28
phoe
when it comes to allocating memory then you can go full FFI way and allocate and access it yourself
17:49:21
galex-713
Bike: I know someone else who defined a language that allows to *specify* that kind of low-level memory nitpicking in a turing complete way, his language/software is called Poke
19:31:37
aeth
galex-713: I mention a few of the differences between Common Lisp and Scheme here: https://gitlab.com/mbabich/airship-scheme/-/blob/master/CONTRIBUTING.md
19:33:17
aeth
I leave out some of them (like Common Lisp macros preferring TAGBODY and Scheme macros prefering tail recursion... also Schemers prefering hygienic macros... well, maybe I should add something for that) that are irrelevant for the project of implementing Scheme in Common Lisp.
19:34:37
aeth
I put it all in CONTRIBUTING.md because it's quite possibly the only project where knowing the differences between Scheme and Common Lisp is relevant and almost a prerequisite for contributing. :-)
19:46:47
pve
Hi, I wonder if someone could shed some light on how conses are (generally) represented in memory. I'm looking at the output from (room) on SBCL, and dividing the number of bytes (used by conses) with the number of cons objects gives me 16 bytes.
19:47:51
pve
so does that mean a cons in this case is simply 8 bytes for the car and 8 bytes for the cdr?
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