jackdaniel changed the topic of #commonlisp to: Common Lisp, the #1=(programmable . #1#) programming language | Wiki: <https://www.cliki.net> | IRC Logs: <https://irclog.tymoon.eu/libera/%23commonlisp> | Cookbook: <https://lispcookbook.github.io/cl-cookbook> | Pastebin: <https://plaster.tymoon.eu/>
dipper_ has quit [Remote host closed the connection]
dipper_ has joined #commonlisp
flip214 has quit [Read error: Connection reset by peer]
dra_ has joined #commonlisp
dra_ has quit [Client Quit]
dra has quit [Ping timeout: 256 seconds]
flip214 has joined #commonlisp
nij- has joined #commonlisp
dipper_ has quit [Remote host closed the connection]
dipper_ has joined #commonlisp
attila_lendvai has quit [Ping timeout: 256 seconds]
chrcav has quit [Ping timeout: 268 seconds]
Oddity has quit [Ping timeout: 268 seconds]
chrcav has joined #commonlisp
aartaka has quit [Ping timeout: 256 seconds]
aartaka has joined #commonlisp
notzmv has quit [Ping timeout: 260 seconds]
epony has quit [Read error: Connection reset by peer]
causal has joined #commonlisp
seok has quit [Read error: Connection reset by peer]
epony has joined #commonlisp
danieli has quit [Quit: Ping timeout (120 seconds)]
danieli has joined #commonlisp
bollu has quit [Remote host closed the connection]
bollu has joined #commonlisp
aartaka has quit [Ping timeout: 256 seconds]
Josh_2 has quit [Remote host closed the connection]
dipper_ has quit [Remote host closed the connection]
dipper_ has joined #commonlisp
thuna` has quit [Quit: out]
NotThatRPG_away has quit [Ping timeout: 260 seconds]
tyson2 has quit [Read error: Connection reset by peer]
terrorjack has quit [Quit: The Lounge - https://thelounge.chat]
terrorjack has joined #commonlisp
nij- has quit [Ping timeout: 252 seconds]
waleee has quit [Ping timeout: 260 seconds]
<beach> phoe: Assembly? Really?
azimut has quit [Remote host closed the connection]
azimut has joined #commonlisp
<hayley> FASLs do contain machine code, by my reading.
<beach> Yes, but assembly is not machine code. It is a source format for an assembler.
<hayley> src/code/load.lisp, look for (define-fop 17 :not-host (fop-load-code ((:operands header n-code-bytes n-fixup-elts))) ...)
<hayley> Right, the answer to "Assembly?" would be "No".
<beach> That's what I thought. But I don't follow SBCL evolution, hence the question.
azimut has quit [Remote host closed the connection]
azimut has joined #commonlisp
Lord_of_Life has quit [Ping timeout: 260 seconds]
Lord_of_Life has joined #commonlisp
<beach> Speaking of which, I seem to remember that there are a lot of restrictions on the environment into which a FASL is loaded, compared to the one in which it was compiled, that it seems it has to be loaded almost immediately after being compiled. And if so, the advantage of creating a FASL file seems not that great.
<beach> Plus, there are restrictions on the file compiler, such as some objects not being possible to serialize.
<beach> But I can't remember the relevant section in the standard that talks about such restrictions.
rgherdt has joined #commonlisp
dtman34 has quit [Ping timeout: 256 seconds]
dipper_ has quit [Remote host closed the connection]
dipper_ has joined #commonlisp
igemnace has joined #commonlisp
mingus has joined #commonlisp
pjb has quit [Ping timeout: 256 seconds]
<jackdaniel> circular references require fiddling with make+load-form and make-init-form - in some cases it is not possible to serialize properly invocations to these functions
<jackdaniel> regarding restrictions, I think that it is mostly about referenced objects - most notably packages
dipper_ has quit [Remote host closed the connection]
dipper_ has joined #commonlisp
azimut has quit [Quit: ZNC - https://znc.in]
azimut has joined #commonlisp
_cymew_ has joined #commonlisp
pjb has joined #commonlisp
Brucio-61 has quit [Ping timeout: 260 seconds]
scymtym has quit [Ping timeout: 260 seconds]
enzuru has quit [Quit: ZNC 1.8.2 - https://znc.in]
<phoe> beach: welp, yes, that is what I meant
<beach> jackdaniel: Do you remember the relevant passage in the standard?
Brucio-61 has joined #commonlisp
enzuru has joined #commonlisp
Brucio-61 has quit [Read error: Connection reset by peer]
Brucio-61 has joined #commonlisp
Cymew has joined #commonlisp
<loke[m]> I have been trying to use postmodern-dao. I'm not a huge fan. I'm considering writing my own dao metaclass. Send help.
shka has joined #commonlisp
* contrapunctus exiles loke[m] to Baikonur (bknr.store)
<loke[m]> contrapunctus: thanks. I will check it out.
dipper_ has quit [Remote host closed the connection]
<lieven> what does dao stand for?
dipper_ has joined #commonlisp
<beach> minion: What does dao stand for?
<minion> Dolichocephaly Anthracitism Overflood
<hayley> "Database access object"
<lieven> ah thanks
<hayley> Prior to software engineering classes I would have answered "decentralised autonomous organisation". The former has...something to do with retrieving rows as objects from a relational database. Now I forgot.
<jackdaniel> beach: make-load-form page of the standard; all "externalizable" objects may be referenced, but creation forms can't contain circles - to handle them initialization forms were introduced
<hayley> In the Spring framework for Java, you have a "model", "service", "repository" and our instructor would call one of the latter two of those the "DAO" and I can't bloody remember which, because no one else on the planet does.
<beach> jackdaniel: I was referring to the restrictions that I seem to remember about what's in the environments.
<jackdaniel> ah, no; I don't remember the section, that's more from memory how fasls work in ecl
<beach> Ah, OK.
<phoe> beach: this?
<phoe> clhs 3.2.4.4
<specbot> Additional Constraints on Externalizable Objects: http://www.lispworks.com/reference/HyperSpec/Body/03_bdd.htm
junkrunner has quit [Ping timeout: 260 seconds]
<beach> Yeah, maybe so. Especially the part about symbols. Thanks!
seletz has joined #commonlisp
mingus1 has joined #commonlisp
<jackdaniel> I wouldn't say that these restrictions are severe enough to say that "fasl must be loaded almost immediety after being compiled [...]"
mingus has quit [Ping timeout: 256 seconds]
mingus1 is now known as mingus
<beach> I may have exaggerated my memory of those restrictions.
<jackdaniel> on the other hand this restriction is one of major factors regarding the speed of loading fasls - all symbols and packages must be resolved during the load time
<beach> Does loading code (source or FASL) represent a performance issue in general?
<jackdaniel> yes, for example loading asdf.fas on ecl takes a few seconds (compared to 50ms without it) - a lot of it is about creating symbols if I remember correctly, but also creating classes etc
<jackdaniel> so it may affect the startup time
<jackdaniel> that said it is much faster thn compiling the code anew
<jackdaniel> s/thn/than/
<jackdaniel> (save-lisp-and-die greatly mitigates this kind of issues, a feature ecl doesn't have sadly)
<beach> I wasn't referring to just the difference in performance between the two. I was referring to the role that loading code represents to either the user of a program or a project. And yes, I was assuming that the image would be saved in a final application.
<beach> jackdaniel: Also I am confused. Are you saying loading asdf.fas (which I assume is a FASL file) takes a few seconds? But then what does 50ms refer to?
<jackdaniel> usually people require asdf at startup; I was referring to startup: without asdf - up to 50ms, with asdf - a few seconds; so I was referring the startup time
<beach> I see.
<jackdaniel> regarding how useful it is to have precompiled fasl - startup of an environment for developing a program that has precompiled dependencies than loading and compiling everything from scratch; admittedly if someone never restarts the lisp process then it is only a minor nuisance
<beach> Right.
cosimone has joined #commonlisp
scymtym has joined #commonlisp
Mrtn[m] has quit [Read error: Software caused connection abort]
Mrtn[m] has joined #commonlisp
<scymtym> ::notify junkrunner i was away from the computer for a day and a bit. i don't use discord, so it's probably best to leave a message with the bots as phoe suggested
<Colleen> scymtym: Got it. I'll let junkrunner know as soon as possible.
pve has joined #commonlisp
<scymtym> jackdaniel: does the time for "startup with asdf" include asdf initialization? at least with my setup, asdf initialization dwarfs everything else, including loading asdf, because the initialization traverses a directory hierarchy
<jackdaniel> scymtym: I don't know, it might be that this is the case
<scymtym> jackdaniel: i see, thanks
<jackdaniel> if that is so, then sorry for misleading statements (re fasl + asdf)
<loke[m]> contrapunctus: wait a minute. bknr.datastore doesn't map to postgres.
<contrapunctus> loke[m]: yup...it wasn't a serious recommendation ^_^'
ilmu[m] has quit [Read error: Software caused connection abort]
ilmu[m] has joined #commonlisp
<beach> There was an interesting article in a recent CACM about the mismatch between a modern programming language and relational databases. The authors preferred to create their own persistence library for Java than to interface with a database.
MajorBiscuit has joined #commonlisp
resttime has quit [Read error: Software caused connection abort]
dipper_ has quit [Remote host closed the connection]
dipper_ has joined #commonlisp
resttime has joined #commonlisp
loke has quit [Read error: Software caused connection abort]
loke has joined #commonlisp
rgherdt_ has joined #commonlisp
rgherdt has quit [Ping timeout: 260 seconds]
random-nick has joined #commonlisp
dipper_ has quit [Remote host closed the connection]
dipper_ has joined #commonlisp
<AadVersteden[m]> loke: I did the same :-)
<AadVersteden[m]> The readme is best viewed by source, perhaps formatting on GitHub has changed or perhaps I didn't know at the time.
<contrapunctus> AadVersteden[m]: I'm on it - making a PR to fix up your README
lisp123 has joined #commonlisp
dipper_ has quit [Remote host closed the connection]
dipper_ has joined #commonlisp
<contrapunctus> AadVersteden[m]: PR created. I usually like to specify the language of source code blocks so they can be syntax highlighted, but I couldn't find a way to do that in Textile. Also, I'm new to both Fridge and Textile, so hopefully any errors I made are still outweighed by the benefits. ^^'
<AadVersteden[m]> contrapunctus: That's super kind of you :D Not sure it's the best code but it is more approachable this way.
jmdaemon has quit [Ping timeout: 256 seconds]
easye has joined #commonlisp
lisp123 has quit [Ping timeout: 260 seconds]
easye has quit [Remote host closed the connection]
ahc has quit [Quit: Client closed]
jeosol has quit [Quit: Client closed]
tyson2 has joined #commonlisp
Inline has joined #commonlisp
shka has quit [Quit: Konversation terminated!]
thuna` has joined #commonlisp
shka has joined #commonlisp
rogersm has joined #commonlisp
jeosol has joined #commonlisp
thuna` has quit [Ping timeout: 248 seconds]
<phoe> huh, cliki is down
<phoe> who should be bothered about it?
<pjb> phoe: IIRC in #common-lisp.net
<phoe> pjb: yes, thanks
Bike has joined #commonlisp
nij- has joined #commonlisp
<pve> Hi, if read-char reaches eof and returns an eof value (i.e. eof-error-p is nil), am I allowed to call unread-char with the last character read from the stream?
nij- has quit [Client Quit]
nij- has joined #commonlisp
thuna` has joined #commonlisp
Inline has quit [Remote host closed the connection]
<beach> Reading the dictionary entry on READ-CHAR, I don't find anything that says you wouldn't be allowed to do that.
<pve> unread-char says "Invoking peek-char or read-char commits all previous characters". Does that mean I'm not allowed?
<beach> I don't know what committing a character means.
lucerne has joined #commonlisp
<pve> ok.. it seems to works on sbcl
nij- has left #commonlisp [#commonlisp]
<phoe> beach: yes, this is unclear
<beach> Hmm, that phrase looks strange...
<beach> "The consequences of invoking unread-char on any character preceding that which is returned by peek-char ... are unspecified"
<phoe> I understand it as "if you read char A, then you can call (UNREAD-CHAR A) iff you have not called READ-CHAR or PEEK-CHAR on the same stream"
<beach> Oh, I gess that's what is meant by "committing".
<beach> *guess
<beach> Yeah.
<phoe> so if READ-CHAR returns some character A, and then you call READ-CHAR again, you can no longer (UNREAD-CHAR A)
<phoe> no matter what the second READ-CHAR returns
<phoe> or how it returns
<pve> even if it's at eof?
<beach> That's correct. But it also says that if you READ-CHAR an A and then call PEEK-CHAR which returns B, then you can't unread A.
<phoe> I guess so, yeah
<phoe> beach: yes
<phoe> pve: it doesn't seem like the return value matters, what matters is the fact that you call READ-CHAR *at all*
<phoe> (or PEEK-CHAR)
<beach> I tend to agree. So it is not allowed.
<beach> That was a good question! :) I learned something from it.
<phoe> me too
<pve> ok, my thinking was that the "position" in the stream doesn't advance if we reach eof, so the character might still be eligible for unread-char..
<pve> beach: cool!
<pve> but apparently not
<beach> Yeah. :(
<pve> is there a way to easily test how the various implementations behave on this?
<beach> Wouldn't you just write a function that does this, say on a string stream?
<phoe> pve: a partial answer is https://plaster.tymoon.eu/view/3533#3533
<pve> or maybe it doesn't matter, since it's not allowed
<phoe> but the trouble is is that different stream types can have different implementations
<beach> Hmm, right.
<pve> I meant that I only have sbcl installed atm
<phoe> so a string stream could work differently than a network stream or a file stream or terminal stream or some Gray stream or what not
<beach> pve: It does matter, because it would be a case for WSCL.
<pve> beach: oh
<phoe> CLISP signals an error on my above example
<phoe> sbcl, ccl, abcl, ecl, all pass the assertions
<pve> phoe: thank you for checking
<beach> Technically, they can do what they want because it says "Exceptional Situations: None."
<phoe> clasp, lw, acl all pass the assertions too
<phoe> so only CLISP signals an error
<phoe> that's for an input-string-stream, that is
easye has joined #commonlisp
* ski . o O ( can you call `unread-char' with a different character ? )
<beach> No.
<phoe> ski: unspecified behavior
<beach> Really? "unspecified"?
<beach> OK, my bad then.
<phoe> lemme re-check
<jackdaniel> for some streams unreading the character is like decrementing a pointer; while on other streams it is storing the last character in a variable
<beach> "must be the last character..."
<phoe> oh wait, it's actually undefined
<jackdaniel> so results may differ depending on the stream
<beach> I don't remember what "must be" means.
<phoe> I mixed things up with the last paragraph of CLHS UNREAD-CHAR's Description
<phoe> ...if it must be some concrete char then why do we even need to specify it
* phoe ponders API design
Cymew has quit [Ping timeout: 268 seconds]
<beach> I think "undefined".
<phoe> yes
<Bike> i checked C for comparison, and it looks like ungetc doesn't require that the ungot character was the last read, and also it explicitly clears eof
jeosol has quit [Quit: Client closed]
jeosol has joined #commonlisp
Inline has joined #commonlisp
rogersm has quit [Quit: Leaving...]
nij- has joined #commonlisp
<nij-> How to I force redefining #'apply?
<beach> Er, what?
<nij-> s/to/do
<beach> That would not be conforming behavior to do that.
<nij-> Yeah, I'd just like to try something.
<Bike> but you can't.
<nij-> For example, after hacking #'apply, can I make (3 (list 1 2)) evaluates to ((1 2) (1 2) (1 2)).
<Bike> that wouldn't go through apply to begin with.
<Bike> the evaluation rules are not extensible in this way.
<nij-> Oh.. you mean if SBCL is truly conforming, then SBCL won't let the end user do it.
<Bike> no, i mean that it has undefined consequences, and no implementation does things in the way you apparently expect them to work
<nij-> oh...
<Bike> going through a call to apply on every single form would be expensive
<Bike> you may be interested in racket, where you can change %app or something
<nij-> In racket, %app is called in each form evaluation?!
<Bike> something like that' haven't used it.
<Bike> and of course you can define a macro copy such that (copy 3 (list 1 2)) => ((1 2) (1 2) (1 2))
<nij-> Yeah, I can even hack the reader for a shorter expression.
<beach> nij-: Where did you get the idea that a Common Lisp evaluator always calls apply?
<nij-> But (3 (list 1 2)) is the shortest.
<nij-> beach I didn't. So that's why I'd like to try.
<beach> It sounds like taken from the pedagogical definition early lisps.
<nij-> I'm exploring the possiblity of how hackable CL as a lang is.
azimut has quit [Ping timeout: 255 seconds]
<beach> The language itself is not "hackable". You are not allowed to redefine any standard operator.
<nij-> I see.
<pjb> pve: you could use (setf stream (make-concatenated-stream (make-string-input-stream "WHAT YOU WANT TO 'UNREAD'") stream)) to 'unread' more than 1 character.
<nij-> And not only that, Bike said even if #'apply is changed, I won't get what I want either.
<ecraven> nij-: well, this is trivial, just write your own eval function that does whatever you want
<ecraven> it won't be *fast*, but it'll do whatever you want
<Bike> the standard does not mandate that all form evaluations go through apply. doing so without some further rules would make it pretty impossible for compilers to optimize anything.
<shunter> That said, you have the option to shadow other operators with your own within your own package nij-
<Bike> there are systems like racket that do whatever, and there are toy lisps like maru that do let you do this.
<nij-> ecraven Do you mean #'eval is called every time? And if I hack it, the evaluator logic changes?
<Bike> no
<ecraven> no, *you* just call eval
<Bike> ecraven is talking about implementing your own function, which you would then use.
<ecraven> (my-eval '(3 (list 1 2)))
<nij-> oh ok..
<nij-> Ok got it.
<ecraven> you can also (rather simply) write my-repl, which lets you then have a repl with your variant
<ecraven> of course, again, it won't be *fast* :P
<nij-> yes I get it now.
<pjb> nij-: you can use reader macros eg. [3 (list 1 2)] -> ((1 2) (1 2) (1 2))
<nij-> So racket %app is pretty cool.
<nij-> I wonder how they have that without making racket slow.
<nij-> pjb yep!
<Bike> i would check whether it is in fact not slow.
<beach> nij-: The fact that Common Lisp is not hackable is a feature. If it were, as Bike pointed out, it would be very hard to write optimizing compilers, and then everyone would complain that Lisp is slow.
<nij-> ,(lol-with-tears)
<ecraven> beach: hehe, that way lie Scheme (and many others)
<beach> Exactly!
<nij-> beach makes sense!
<nij-> Scheme? what about it?
<ecraven> some Schemes support what you want. many Schemes support redefining all kinds of things that CL forbids. and many (almost all?) Schemes are much slower than CL (for many reasons, but this is one of them)
<Bike> i think there are probably ways the language could be made more extensible without sacrificing performance, or at least not much performance. but it would require more thought than letting people redefine apply.
<nij-> making a whole lotta sense
<nij-> thanks folks!
<beach> More thought, and probably more work too.
<ecraven> from my playing around with lisp machines (mostly the cadr via usim), that *did* let you redefine deeply system-internal functions, and that can be rather dangerous
<pjb> nij-: more generally, you can write a reader macro to replace entirely the lisp reader (parser), and implement your own syntax. So (3 (1 3)) could mean what you want.
<phoe> yeah, the fact that only symbols and lambda forms are valid functional operators is kind of a place where the syntax could in theory be extended without sacrificing performance
<ecraven> pjb: that's a good point, a reader-macro alone would be sufficient, if it just expanded every (:foo a b c) to (my-ref :foo a b c)
<nij-> pjb I can't think of a consistent way to do that.
<phoe> the language could just delegate to some programmable slow path instead of signalling an error
<jackdaniel> generally an approach where you have some static base + programmable part seems to be much saner than skipping the former
<nij-> ecraven how about '(:foo a b c)?
<ecraven> what about it?
<nij-> It will be expand into '(my-ref :foo a b c)
<phoe> nij: (defun :foo ...) is permissible in most implementations though
<ecraven> yes, and that can then be a normal function doing whatever you want
<nij-> cause if it is quoted, I don't want it to be expanded that way.
<phoe> if you properly configure lispworks then even it will accept it
<pjb> nij-: but more often, you want to mix lisp and your own syntax. see for example, objective-cl: https://groups.google.com/g/comp.lang.lisp/c/AkU0JCnGGAA https://gitlab.com/com-informatimago/com-informatimago/-/blob/master/objcl/documentation.pdf
<nij-> phoe how about (defmethod :foo)?
<ecraven> phoe: but hard to generalise, if it's meant to work like clojure, for accessing "slots" of objects.. you'd need to define *all* possible keywords
<phoe> nij-: this is equivalent to (defgeneric :foo ...) which is permissible
<ecraven> pjb: hehe, I thought "what an abomination", but looking at it, it isn't so bad
<phoe> ecraven: no no, I mean, if you had (:foo ...) expand into (my-ref :foo ...) then you would exclude the possibility of (defun :foo ...)
<ecraven> phoe: ah, correct. I didn't think about that even being possible
<nij-> It's ok, I think the easist way is to hack the reader macro, but I may have to type one or two more characters.
<phoe> yes, my RC file has some functions and macros defined on keyword names
<pjb> ecraven: yes, using different parentheses make it mix well.
<nij-> Like #H(:foo ht)
<ecraven> nij-: how is that better than (r :foo ht)?
<phoe> yeah, it's time for 「defun foo 「x y」「+ x y」」
<nij-> That's also fine.
<nij-> LOL
<nij-> ,(lol-with-tears)
<nij-> phoe you made everyone in Starbucks staring at me
<nij-> ok i gotta run for a minute. Thanks folks! brb
nij- has left #commonlisp [Using Circe, the loveliest of all IRC clients]
<phoe> ...that's suspiciously specific
dipper_ has quit [Remote host closed the connection]
<thuna`> Wait.. what does (defun :foo ...) do?
<phoe> it defines a function named FOO
<thuna`> In which package?
<phoe> which package is :FOO in?
<phoe> ;; hint: (symbol-package :foo)
<beach> As I recall, Fare tried to define functions with names like that for ASDF or UIOP, citing that it was practical that they would always be available. But he had to back down when there were loud protests.
<phoe> keywords are a rare global resource and defining stuff on them should be reserved for end users
<beach> Exactly!
<jackdaniel> I think that such proposal is very much like Fare
thuna` has quit [Ping timeout: 268 seconds]
thuna` has joined #commonlisp
thuna` has quit [Remote host closed the connection]
thuna` has joined #commonlisp
<thuna`> I got disconnected.
<thuna`> What was the last message I sent?
<jackdaniel> some not very complimentary remark of mine
<thuna`> phoe: Right, the answer is keyword. But I had figured they worked similarly to nil and t
<thuna`> Apparently not
<phoe> the thing is that T and NIL are from the CL package and by 11.1.2.1.2 you cannot define stuff on them
<phoe> keywords have no such restriction
<thuna`> I wonder why
<phoe> because that is what the specification says™
<beach> Heh.
Lucretia has quit [Remote host closed the connection]
seletz has quit [Ping timeout: 260 seconds]
<jeosol> good morning all!
<beach> Hello jeosol.
yottabyte has quit [Quit: Connection closed for inactivity]
<jeosol> beach: I am doing well, over here. Not bad. Following the world cup games a bit.
<jeosol> beach: how are things on your end
<beach> Slow, but making steady progress. The latest progress by scymtym prompted me to work on Second Climacs a bit, so that his work could be layered on top of Second Climacs.
<beach> Let me see if I can find a video with his latest progress...
<beach> So what you are seeing is very detailed and very accurate analysis of Common Lisp code at typing speed.
MajorBiscuit has quit [Ping timeout: 268 seconds]
<beach> I guess either nobody understood it, or everyone fainted from being so impressed.
thuna` has quit [Remote host closed the connection]
<splittist> we're all applauding, you just can't hear it
<beach> That explains it.
<pl> Anyone used CORBA in FLOSS implementations recently~ish?
<pl> Have a project where I might want to implement a RPC message bus and CORBA would be reasonable option
<jeosol> beach: is that you coding in that linked video. What is the editor is that?
<beach> No, that is scymtym.
rainthree has joined #commonlisp
<jeosol> beach: is it evaluating the code as type, or I am not understanding things correctly
<beach> The editor is just DREI, so it is not the final deal. The demo is more about the upper layers.
<jeosol> beach: I see
<beach> jeosol: It is not evaluating it. But it does some analyses based on the s-expression syntax.
<beach> But the idea is to plug in even more sophisticated analyses later.
<jeosol> beach: analyses is a better word - makes more sense
NotThatRPG has joined #commonlisp
<beach> It won't ever generate executable code, but there could be some compilation-like passes added for even better analyses.
<beach> In addition to the syntax analysis, scymtym also has a model of the global environment and the package system, so that some top-level forms can be "evaluated" for incremental effects on this global environment model.
<jeosol> I seem to recall seeing some editor discussion last week about the state of editors. I only used SLIME+EMACS but did look at Sly, but then went back to my old slime+emacs setup
NotThatRPG_ has joined #commonlisp
<NotThatRPG_> I wonder if someone can clarify SBCL's interpretation of FUNCTION types. According to a compilation note, it's interpreting my (declaim (ftype (function (t t) fixnum) choice-node-player)) as (FUNCTION (T T) (VALUES FIXNUM &REST T)) Where does the &rest t come from?
<Bike> clhs the
<Bike> says you can put in extra values no problem
<Bike> sbcl uses &rest t to indicate that
NotThatRPG has quit [Ping timeout: 256 seconds]
<Bike> if you mean that it returns exactly one value, instead of fixnum you can use (values fixnum &optional) or, my preference, (values fixnum &rest nil) which i think sbcl will interpret the same way
<rainthree> https://stackoverflow.com/questions/9743056/common-lisp-exporting-symbols-from-packages "Of course, one could reach the conclusion, that macros like defstruct lack a feature. Namely, a switch which enables automatic exporting of the accessors etc. they create." (or better: a switch for each accessor :export t or nil) . Is it so ? I know serapeum.export has this, but the drawback is that the code becomes "foreign" to everyone used to the standard
<rainthree> way of exporting in the defpackage. The drawback of exporting in the defpackage is that things get go out of sync , it brings extra maintenance burden . I think the best is to use defpackage and to reduce the burden, let the editor help you: "C-c x to export the symbol at point, or even the class and all its accessors with slime-export-class" . Now the only issue is that I'm dealing with cffi:defcstruct and slime doesn't have a function to
<rainthree> automatically export the accessors for it. Should I code one myself or you guys have a better solution?
<phoe> rainthree: do your own one, I have no idea if cl-annot or cl-annot-revisit has anything for automatic export of defstruct
<phoe> might be worth checking though
<rainthree> https://github.com/LispCookbook/cl-cookbook/issues/269 it has , but I think it can only export all of them, you cannot individually select which accessor you want to export, and that's not good
_cymew_ has quit [Ping timeout: 256 seconds]
<NotThatRPG_> Thanks, Bike ! A quick type declaration follow up: am I right in reading the spec as prohibiting declaration of the return type of a generic function? The doc page for `defgeneric` says that there can't be function declarations *inside* the form, but I could read it either way about external declarations.
rogersm has joined #commonlisp
Fare has joined #commonlisp
<resttime> If there are any CFFI maintainers lurking, created a PR for a small change meant to be first step in tackling an old bug with libffi and passing a foreign-structure-by-value (FSBV) to a foreign function with variadic args : https://github.com/cffi/cffi/pull/347
<random-nick> is there any linux syscall ffi library for CL?
<Bike> NotThatRPG_: you can declare the return type of a generic function, the same way as you do with other functions - declaim
<Bike> NotThatRPG_: the declarations within the defgeneric only pertain to the discriminating function, which is why only optimize is allowed
lagash has quit [Remote host closed the connection]
<NotThatRPG_> Bike: I was trying to do that, but according to SBCL "Generic function SHOP3::CHOICE-NODE-PLAYER clobbers an earlier FTYPE proclamation (FUNCTION (T T) (VALUES FIXNUM &REST T)) for the same name with (FUNCTION (T T) *)"
Brucio-61 has quit [Ping timeout: 260 seconds]
<Bike> did you have any earlier proclamation?
Brucio-61 has joined #commonlisp
<Bike> ah, i see the warning
<beach> random-nick: No, but there are plans for such a thing: http://metamodular.com/POSIX-API/
<Bike> it's just a style warning, i think you can ignore it. annoying, though
<Bike> might want to ask the sbcl people about that
<NotThatRPG_> Bike: But it seems to imply that the return value declaration is being ignored. For now I'm just putting #-sbcl in front of it.
<Bike> i think it just means it's removing an older declaration with no return type.
<Bike> ah, nope, it does actually clobber it
<Bike> you can see what the declaration on the name is with describe. and it does look clobbered if you put the declaim before the defgeneric. how vexing
<_death> I too had this issue.. I believe it's a bug, and not aware of workaround/solution
<Bike> if i put the declaim after the defgeneric it seemingly sticks
jeosol has quit [Quit: Client closed]
lagash has joined #commonlisp
<_death> (well, aside from the "have type declarations in call sites" workaround)
<random-nick> beach: hmm, I guess what I'm looking for would be something like the low-level interface, but I guess I'm interested in some linux-specific system calls
<beach> I understand. I think everything that exists is implementation specific.
<random-nick> regarding the no FFI requirement, wouldn't that cause problems for some newer system calls which use C structs?
<beach> I would have to define Common Lisp structure or standard classes instead.
<pjb> syscalls are different. Of course, they need their own foreign interface.
<pjb> But it can be hidden inside the implementation.
<random-nick> beach: even for the low-level interface?
<rainthree> phoe: I think this is the most convenient solution: https://stackoverflow.com/a/70235441/19589272 show-all-fboundp-symbols-of-package then copy paste or use some editor shortcut such as ctrl+right click on the symbol to add it to the :export list in the defpackage form
<beach> random-nick: Some implementations might choose to use FFI.
<beach> random-nick: A C struct is just a sequence of bytes in memory. It is just a matter of figuring out the layout.
<beach> Anyway, my (admittedly small) family just announced that dinner is ready, so I'll be off for today.
<pjb> But syscalls are just a few hundred functions. The equivalent of the API from libc would be implemented in pure lisp.
<pl> random-nick: you need only to port the binary layout into some form of serialisation/deserialisation component that can be pure Lisp
* pl recalls the joke from Genera sources about implementing considerable chunk of PL/I compiler to do something like that, for mapping data structures into binary records on disk
<random-nick> pl: it still has to reside in what is usually called "foreign memory" since CL object don't have any guarantees about how they're laid out in memory afaik
<random-nick> CL objects, even
<pl> You can have that as implementation specific interface between standard and implementation detail
jeosol has joined #commonlisp
<pl> Similarly, the closest thing to knowing exact layout in standard C is that things in array are laid out in certain way
<pl> (and even then it's not guaranteed it will reflect the layout and ops necessary to access them in actual memory, just that it will match other standard C code behaviour)
Catie has joined #commonlisp
cage has joined #commonlisp
Bike has quit [Ping timeout: 248 seconds]
ec has quit [Remote host closed the connection]
dtman34 has joined #commonlisp
karlosz has joined #commonlisp
dtman34 has quit [Ping timeout: 260 seconds]
tyson2 has quit [Remote host closed the connection]
frgo has quit []
_cymew_ has joined #commonlisp
ec has joined #commonlisp
ec has quit [Remote host closed the connection]
ec has joined #commonlisp
morganw has joined #commonlisp
mariari has quit [Read error: Connection reset by peer]
emacs-dwim has quit [Ping timeout: 268 seconds]
Bike has joined #commonlisp
akoana has joined #commonlisp
MajorBiscuit has joined #commonlisp
snits_ has quit [Ping timeout: 240 seconds]
snits has joined #commonlisp
mathrick has quit [Ping timeout: 260 seconds]
mariari has joined #commonlisp
ec has quit [Remote host closed the connection]
ec has joined #commonlisp
rainthree has quit [Remote host closed the connection]
rainthree has joined #commonlisp
rainthree has quit [Read error: Connection reset by peer]
thuna` has joined #commonlisp
lucerne has quit [Read error: Connection reset by peer]
waleee has joined #commonlisp
_cymew_ has quit [Quit: Konversation terminated!]
gin has quit [Quit: ZNC 1.7.2+deb3 - https://znc.in]
gin has joined #commonlisp
son0p has joined #commonlisp
junkrunner has joined #commonlisp
lisp123 has joined #commonlisp
jmdaemon has joined #commonlisp
nij- has joined #commonlisp
cage has quit [Quit: rcirc on GNU Emacs 27.1]
MajorBiscuit has quit [Quit: WeeChat 3.6]
Brucio-61 has quit [Ping timeout: 260 seconds]
emacs-dwim has joined #commonlisp
scymtym has quit [Ping timeout: 252 seconds]
robin has quit [Quit: Leaving]
lisp123 has quit [Ping timeout: 260 seconds]
Bung has joined #commonlisp
lisp123 has joined #commonlisp
<Nilby> random-nick: A number of things exist, but they are all partial or incomplete, as far as I know. If you want to share what system calls you're interested in, perhaps there's a smaller library that does what you're looking for?
Bung has quit [Quit: Leaving]
Brucio-61 has joined #commonlisp
matt` has joined #commonlisp
tyson2 has joined #commonlisp
YaN3k has joined #commonlisp
igemnace has quit [Remote host closed the connection]
YaN3k has quit [Remote host closed the connection]
shka has quit [Ping timeout: 268 seconds]
lisp123 has quit [Remote host closed the connection]
lisp123 has joined #commonlisp
matt` has quit [Remote host closed the connection]
lisp123 has quit [Read error: Connection reset by peer]
lisp123 has joined #commonlisp
mathrick has joined #commonlisp
thuna` has quit [Remote host closed the connection]
lisp123 has quit [Read error: Connection reset by peer]
Bike has quit [Quit: Lost terminal]
tasty has quit [Quit: rebooting for kernel updates]
<random-nick> I was asking about it in general, but I guess the most interesting one is probably epoll
<random-nick> but I recall seeing some wrapper for epoll specifically
thuna` has joined #commonlisp
tasty has joined #commonlisp
tasty has quit [Changing host]
tasty has joined #commonlisp
<random-nick> also, getting access to futex and related APIs might be useful, but I don't know how the different implementations handle getting blocked in foreign code
lucerne has joined #commonlisp
NotThatRPG_ has quit [Ping timeout: 260 seconds]
jeosol has quit [Ping timeout: 260 seconds]
lucerne has quit [Read error: Connection reset by peer]
lucerne has joined #commonlisp
tyson2 has quit [Remote host closed the connection]
<phoe> cliki is back, thanks everyone
<Fare> where is it? cliki.net ?
<phoe> yes
ec has quit [Remote host closed the connection]
ec has joined #commonlisp
nij- has quit [Ping timeout: 240 seconds]
lucerne has quit [Read error: Connection reset by peer]
Madsy has quit [Quit: Leaving]
tevo has quit [Read error: Connection reset by peer]
tevo has joined #commonlisp
pve has quit [Quit: leaving]
tyson2 has joined #commonlisp
NotThatRPG has joined #commonlisp
NotThatRPG has quit [Client Quit]
NotThatRPG has joined #commonlisp
euandreh has quit [Remote host closed the connection]
euandreh has joined #commonlisp
<pl> random-nick: on linux (and windows), the really nice stuff would be to implement io_uring
rgherdt_ has quit [Remote host closed the connection]
euandreh has quit [Client Quit]
euandreh has joined #commonlisp
cosimone` has joined #commonlisp
Bike has joined #commonlisp
Bike is now known as Bike
cosimone has quit [Ping timeout: 260 seconds]
nij- has joined #commonlisp
cosimone` has quit [Ping timeout: 260 seconds]
attila_lendvai has joined #commonlisp