Xach 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>
Qwnavery has joined #commonlisp
<Qwnavery> Hi so I'm trying to figure out lambda functions in CL and I'm just doing so with a basic base, doubler, tripler function
jeosol has joined #commonlisp
<Josh_2> Whats your Q?
<Qwnavery> ?
<Josh_2> Idk, just seemed like you had a question coming
<Qwnavery> yeah
<Josh_2> :)
<Qwnavery> so I've got (defun base (x) (lambda (a) (* x a)) and (defun doubler (x) (base 2) x))
srhm has quit [Quit: Konversation terminated!]
<Josh_2> (defun doubler (x) (funcall (base 2) x)) something like that
srhm has joined #commonlisp
<Qwnavery> and I'm not sure where I'm going wrong. when I try to call just ((base 2) 2) -> 4 for example it doesn't work.
<Josh_2> Yeh
<lotuseater> ohai Qwnavery :)
<Qwnavery> hihi lotuseater
<Josh_2> You need to use funcall
<Qwnavery> does funcall convert a function pointer produced by lambda into a usable function?
<lotuseater> doing (lambda ...) returns a function, you don't have to do #'(lambda ...)
<Qwnavery> herm I see.
<Qwnavery> thankyou Josh_2
<Qwnavery> thankyou lotuseater
hendursaga has quit [Ping timeout: 244 seconds]
<sm2n> it's actually kind of weird
<sm2n> (lambda ...) is a macro that expands to #'(lambda ...)
<lotuseater> try (funcall #'sqrt 2)
<lotuseater> sm2n: yes it is ^^
<Josh_2> Try (funcall 'sqrt 2) ;)
<lotuseater> but weird doesn't mean something's not useful
<Qwnavery> any difference between #'() and '()?
<sm2n> and so the point to realize is that #'x is a reader macro for (function x), which is a special form
<lotuseater> Qwnavery: yes
aeth has quit [Ping timeout: 248 seconds]
<lotuseater> funcall looks up the symbol-function for the provided symbol with only '
<Josh_2> funcall will do a lookup if you just pass a symbol
<Josh_2> very useful if you plan on changing the definition of things
<Qwnavery> what about #'?
<lotuseater> #' is a readmacro that turns #'foo into (function foo) like 'foo makes (quote foo)
<Qwnavery> oh
<Qwnavery> so they are inverse
<sm2n> I don't know what you mean by "inverse"
<Qwnavery> one converts to a symbol, the other converts to a funtion?
<lotuseater> ehm yes not very inverse
<Josh_2> no
<Josh_2> 'sqrt = (quote sqrt)
aeth has joined #commonlisp
<Josh_2> #'sqrt = (function sqrt)
<Qwnavery> erm I've never seen (function x) before?
<Josh_2> Type it into your repl
<Qwnavery> I know (quote x)
<lotuseater> ah I think he thinks the "#" gets applied to 'foo, but that are independent things
<Josh_2> Type (function sqrt) into repl and #'sqrt
hendursaga has joined #commonlisp
<Qwnavery> erm ok? not sure the usecases for that
<lotuseater> Josh_2: so if I use COMPILE to redefine a definition it's better to just pass the symbol?
<lotuseater> Qwnavery: preventing you from writing (quote ...) and (function ...) every time
<Josh_2> Thats what I do lotuseater
<Qwnavery> lotuseater: the use of (function ...)
ec has quit [Quit: ec]
<lotuseater> writing '(A B C) is the same as (list 'A 'B 'C) so you just have to write ONE quote
<lotuseater> Qwnavery: it's when writing macros where the name is not known in before
<lotuseater> and of course FUNCTION is one of the 25 special operators like eg LET
<Qwnavery> erm..
<lotuseater> *blub*
<Qwnavery> why does lisp have to be such a pain in the a$$ to learn
<Josh_2> This stuff doesn't matter that much when all you are trying to do is called an anonymous function :P
<Josh_2> (funcall (lambda (x) (print x)) "hello world")
<lotuseater> it isn't, but you asked a question that's not good to be answered at an entry level
<Qwnavery> I get lambda calculus, I was just worried about the syntax
<Qwnavery> I gotta go
<Qwnavery> thanks
Qwnavery has quit [Quit: WeeChat 3.2]
makomo has quit [Ping timeout: 248 seconds]
<lotuseater> I remember, was a bit confusing for me at the beginning getting the difference between FUNCALL and APPLY.
<Josh_2> I just ignored apply until I found the use case, now I use it all the time
<lotuseater> :)
derelict has joined #commonlisp
happy-dude has joined #commonlisp
nirnam has quit [Remote host closed the connection]
dlowe has quit [Remote host closed the connection]
copec has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
igemnace has quit [Quit: WeeChat 3.2]
dsk has quit [Ping timeout: 272 seconds]
Qwnavery has joined #commonlisp
srhm has quit [Quit: Konversation terminated!]
srhm has joined #commonlisp
loke[m] has joined #commonlisp
lisp123 has joined #commonlisp
lisp123 has quit [Ping timeout: 245 seconds]
srhm has quit [Read error: Connection reset by peer]
srhm has joined #commonlisp
mfiano has joined #commonlisp
taiju has quit [Ping timeout: 268 seconds]
Qwnavery has quit [Quit: WeeChat 3.2]
alphapapa[m] has joined #commonlisp
lottaquestions has joined #commonlisp
dieggsy has joined #commonlisp
frgo has quit [Ping timeout: 245 seconds]
lotuseater has quit [Quit: ERC (IRC client for Emacs 27.2)]
frgo has joined #commonlisp
srhm has quit [Quit: Konversation terminated!]
srhm has joined #commonlisp
icepic1984[m] has joined #commonlisp
lottaquestions has quit [Quit: Konversation terminated!]
karlosz has joined #commonlisp
taiju has joined #commonlisp
srhm has quit [Quit: Konversation terminated!]
srhm has joined #commonlisp
katco has joined #commonlisp
waleee has quit [Ping timeout: 252 seconds]
akater[m] has joined #commonlisp
luis` has joined #commonlisp
hayley has joined #commonlisp
hayley has quit [Changing host]
hayley has joined #commonlisp
JooTvora[m] has joined #commonlisp
etimmons has joined #commonlisp
z3t0 has quit [Read error: Connection reset by peer]
z3t0 has joined #commonlisp
Gnuxie has joined #commonlisp
Mrtn[m] has joined #commonlisp
notzmv has quit [Ping timeout: 248 seconds]
nij- has joined #commonlisp
<nij-> Hello, in one of the example, it asks me to run `(click "[name=btnK]")` once it opens the page www.google.com and types in something. However, an error was fired. I guess it's because that google has updated its page, so the selector "btnK" no longer works. My question is, how do I get the selector name independently by inspecting the web page? https://github.com/TatriX/cl-selenium-webdriver
prxq has joined #commonlisp
<hayley> I got the class gNO89b, which would be (click ".gNO89b") or something. Loosely speaking, right click on the button, click "inspect element", then the right node will be highlighted in the inspector.
<nij-> Weird! I tried again and it works. And indeed, in the inspection it does name itself "btnK"
<nij-> So that's the trick! Thanks :) lemme play with it a bit.
doyougnu has quit [Remote host closed the connection]
prxq_ has quit [Ping timeout: 272 seconds]
<beach> Good morning everyone!
<nij-> Good morning beach :)
Bike has quit [Quit: Lost terminal]
lisp123 has joined #commonlisp
lisp123 has quit [Ping timeout: 258 seconds]
Fare has joined #commonlisp
karlosz has quit [Quit: karlosz]
dsk has joined #commonlisp
<nij-> hayley: Hmm.. I played around with it. It worked for google, reddit, but it didn't work for chase bank: https://secure05b.chase.com/web/auth/dashboard
<hayley> Looks like you want #signin-button for the button, rather than the label. But what are you doing automating a bank UI?
<nij-> I failed to click on the user input text field. Have tried "class" "id" ..
<nij-> I want to hack the bank and get rich.
<nij-> Just kidding.
<nij-> I want to get my personal info automatically.
srhm has quit [Quit: Konversation terminated!]
* hayley hopes the FBI has a stable IRC connection.
srhm has joined #commonlisp
* nij- thinks JS is so complicated.
* nij- is just kidding. FBI! FBI! I was just kidding :)
igemnace has joined #commonlisp
phantomics has quit [Read error: Connection reset by peer]
phantomics has joined #commonlisp
srhm has quit [Read error: Connection reset by peer]
srhm has joined #commonlisp
<nij-> I have no idea.. maybe I should learn the language of selenium?
Inline_ is now known as Inline
amb007 has joined #commonlisp
amb007 has quit [Read error: Connection reset by peer]
amb007 has joined #commonlisp
kulernil is now known as kuler
Inline has quit [Quit: Leaving]
srhm has quit [Quit: Konversation terminated!]
srhm has joined #commonlisp
srhm has quit [Quit: Konversation terminated!]
srhm has joined #commonlisp
nij- has quit [Ping timeout: 272 seconds]
taiju has quit [Ping timeout: 272 seconds]
pranavats has left #commonlisp [Disconnected: Received SIGTERM]
pranavats has joined #commonlisp
lisp123 has joined #commonlisp
pranavats has left #commonlisp [Disconnected: Received SIGTERM]
lisp123 has quit [Ping timeout: 268 seconds]
pranavats has joined #commonlisp
taiju has joined #commonlisp
taiju has quit [Ping timeout: 258 seconds]
lisp123 has joined #commonlisp
pranavats has left #commonlisp [Disconnected: Received SIGTERM]
taiju has joined #commonlisp
pranavats has joined #commonlisp
taiju has quit [Ping timeout: 248 seconds]
pranavats has left #commonlisp [Disconnected: Received SIGTERM]
pranavats has joined #commonlisp
<lisp123> If I am writing a class for Object, should I call it Object or Objects & should I call the file object.lisp or objects.lisp?
<lisp123> I think singular, but checking
pranavats has left #commonlisp [Disconnected: Received SIGTERM]
<lisp123> Sorry, to clarify - I believe it should be (defclass object ...) and the file should be objects.lisp
<hayley> The class name should be singular, and generally I tend to make file names singular nouns too.
pranavats has joined #commonlisp
shka has joined #commonlisp
<lisp123> hayley: thanks
<hayley> ...or verbs. It depends on what way you think presenting your code is best.
<lisp123> hayley: do you have an example of using verbs?
<hayley> In my regular expression compiler I chose to define all the classes in one file, and then write a file per function, so that each file would roughly match up with a function defined in the papers.
taiju has joined #commonlisp
<lisp123> hayley: Thanks, that makes sense
pranavats has left #commonlisp [Disconnected: Received SIGTERM]
<hayley> https://github.com/telekons/one-more-re-nightmare/tree/local-hash-cons/Code/Compiler though, come to think of it, the names are almost all nouns.
<lisp123> I am generally moving that way too, doing nearly alawys nouns except where a verb reads much more
Lord_of_Life_ has joined #commonlisp
pranavats has joined #commonlisp
Lord_of_Life has quit [Ping timeout: 256 seconds]
Lord_of_Life_ is now known as Lord_of_Life
pve has joined #commonlisp
Cymew has joined #commonlisp
pranavats has left #commonlisp [Disconnected: Received SIGTERM]
pranavats has joined #commonlisp
Fare has quit [Ping timeout: 258 seconds]
rain3 has joined #commonlisp
srhm has quit [Read error: Connection reset by peer]
srhm has joined #commonlisp
hafat has quit [Ping timeout: 256 seconds]
srhm has quit [Quit: Konversation terminated!]
Qwnavery has joined #commonlisp
srhm has joined #commonlisp
kulernil has joined #commonlisp
kuler has quit [Remote host closed the connection]
<beach> scymtym_: Around?
amb007 has quit [Ping timeout: 258 seconds]
retropikel has joined #commonlisp
amb007 has joined #commonlisp
lisp-newbie has joined #commonlisp
amb007 has quit [Read error: Connection reset by peer]
amb007 has joined #commonlisp
hafat has joined #commonlisp
<mfiano> I've been using a little reader trick I learned a while ago I thought I'd share.
amb007 has quit [Read error: Connection reset by peer]
amb007 has joined #commonlisp
d4ryus has quit [Quit: WeeChat 3.2]
<mfiano> Sometimes I will globally SETF the value of *read-base* in my REPL to do some calculations. To get restore the default efficiently, one can do (setf *read-base* 10.) since a decimal point after an integer is not treated as a float, but a base-10 integer.
<mfiano> May or may not have been known to you, enjoy regardless :)
amb007 has quit [Read error: Connection reset by peer]
<pjb> Yes, in 10. . is called the _decimal_ point which means, the base-ten point ;-) This is not the floating-point point!
amb007 has joined #commonlisp
<pjb> In 10.0 . would be the floating-point point…
amb007 has quit [Read error: Connection reset by peer]
amb007 has joined #commonlisp
<pjb> or in .10 !!!
<mfiano> Confusingly only in base 10
<mfiano> It is called a radix point in other bases
<flip214> #xa is an integer and means 10(decimal) either way
<mfiano> Sure
<mfiano> I just find it intuitive to be able to specify the read base you want _in_ the read base you want
makomo has joined #commonlisp
gaqwas has joined #commonlisp
<beach> I am considering asking for help to make progress on Second Climacs (provided scymtym has no objections). Specifically I would like to replace the SICL reader used by Second Climacs by Eclector. The reader is used to parse buffer contents when Common Lisp code is being edited.
<beach> I am willing to pay a modest amount of money for this to happen.
<mfiano> That seems to require some particular domain knowledge. Who do you have in mind?
<beach> I am thinking that a relative newbie might be the best.
<mfiano> That is not I
<edgar-rft> mfiano: 10. is a fixnum, so the point is a fixpoint :-)
<beach> mfiano: If you are interested and available, that is fine too.
<beach> mfiano: I was just assuming most experienced people are busy.
<beach> I would be delighted to be wrong.
<mfiano> beach: I would, I really would, but I fear it is out of my domain of expertise and I would be wasting time and money acquainting myself with it before work could even progress.
<mfiano> I kindly decline
<beach> mfiano: That would not be a problem for me.
lisp-newbie has quit [Quit: This computer has gone to sleep]
<beach> I am willing to spend some money for someone to acquire the knowledge of the domain.
lisp-newbie has joined #commonlisp
lisp-newbie has quit [Remote host closed the connection]
lisp-newbie has joined #commonlisp
lisp-newbie has quit [Remote host closed the connection]
d4ryus has joined #commonlisp
lisp-newbie has joined #commonlisp
lisp-newbie has quit [Remote host closed the connection]
<mfiano> Ask me again if you are unable to find anyone willing. I just don't want to disappoint.
<beach> mfiano: I am willing to take that risk.
cage has joined #commonlisp
lisp-newbie has joined #commonlisp
<beach> mfiano: And someone like you would require a lot less time investment on my part, so that's fine too.
lisp-newbie has quit [Read error: Connection reset by peer]
lisp-newbie has joined #commonlisp
<mfiano> I would be fine with it then if you are
<beach> Excellent!
hendursa1 has joined #commonlisp
hendursaga has quit [Ping timeout: 244 seconds]
lisp-newbie has quit [Ping timeout: 252 seconds]
<pl> beach: only slightly related question as I don't have time to hit the paper right now - did Second Climacs have any optimization for long lines?
<beach> It uses Cluffer which has a gap buffer for each line, but since that's a protocol question, it is easy to supply a different implementation of the protocol.
cage has quit [Remote host closed the connection]
<beach> I mean, Cluffer has a protocol for editing a single line, and you can supply your own implementation.
cage has joined #commonlisp
<beach> The STANDARD-LINE implementation uses a gap buffer.
<pl> mhm
<pl> it's just that recently I talked with someone regarding very long lines in emacs and other editors, and I wondered how 2nd climacs would deal with it
<beach> Sure. It can't be worse than Emacs (unless Emacs has changed), since Emacs uses a single gap buffer for the entire buffer (or used to at least).
<pl> still uses
<beach> The worst case for a gap buffer is if you go to the beginning, edit, go to the end, edit, etc.
<beach> But that worst case is already taken care of by something like Flexichain.
<beach> But normally, editing is done with some spatial locality, and then a gap buffer is great.
<beach> For the sequence of lines, Cluffer uses a splay tree by default.
<beach> Again, a different implementation can be substituted.
<beach> Splay trees also take advantage of spatial locality.
lisp-newbie has joined #commonlisp
svillemot has joined #commonlisp
amb007 has quit [Ping timeout: 248 seconds]
amb007 has joined #commonlisp
srhm has quit [Quit: Konversation terminated!]
srhm has joined #commonlisp
<Qwnavery> beach: someone mention a relative newbie?
amb007 has quit [Read error: Connection reset by peer]
amb007 has joined #commonlisp
<beach> Qwnavery: Yes, I did. The particular project I had in mind is taken for now, but I am willing to discuss other projects.
<Qwnavery> beach: what do you need done?
<Qwnavery> or do yo have a list of projects on a site with TODOs?
<beach> Qwnavery: The general idea is that I need help to make progress on several projects, but there are very few people who are both qualified and available.
<Qwnavery> well, I'm looking for projects to study (reading others code) and perhaps contribute too.
<Qwnavery> s/too/to/
<beach> Qwnavery: So my thinking is that, if there is a "relative newbie" who would like to invest in something like that, I could be that person's "mentor".
<Qwnavery> beach: no.
<Qwnavery> I'm not after a mentor.
<beach> That's fine too.
hafat has quit [Quit: Leaving]
<beach> So let me start by giving you a list of suggested projects...
<Qwnavery> I have projects in mind i.e. a clone of Total Commander (midnight commander is doodoo) but I would like to have some other projects to work on.
<Qwnavery> I've read esr's blog on hackerdom. I'm not here to waste your time.
<Qwnavery> By Lisp Operating system I hope you refer to the components to interact with it, not the management of programs and low-level operations the language should handle :)
amb007 has quit [Read error: Connection reset by peer]
<beach> Qwnavery: Why do you hope that?
amb007 has joined #commonlisp
<Qwnavery> Because the language should be the operating system.
<Qwnavery> ie lisp machines.
<beach> I don't make a sharp distinction between the two.
trriplex has joined #commonlisp
trriplex has quit [Client Quit]
lisp123 has quit [Remote host closed the connection]
lisp123 has joined #commonlisp
<Qwnavery> grammar checking library - any progress on it?
<beach> I think phoe started with the dictionary, but nothing beyond that I think.
<Qwnavery> ok.
<mfiano> Of course you need a game of solitaire for any OS :)
<beach> Qwnavery: A "relative newbie" who doesn't want a mentor sounds strange to me. I think it would be best, then, that you work on independent projects, rather than that you contribute to existing ones.
<Qwnavery> beach: I know python, that's about it.
<beach> Qwnavery: What I mean is that, without a mentor, you are unlikely to pick up on conventions, whether general or specific to a particular project.
<beach> So the code you produce may not be very idiomatic.
<Qwnavery> fair.
<kakuhen> beach is right -- i'm helping someone with a game in CL for fun and they pretty much teach me everything I now know about common lisp conventions etc
<kakuhen> sometimes i would unnecessarily pollute a namespace without even realizing it, and he would point it out to me so i could fix it
<kakuhen> little things like that build up over time
lisp123 has quit [Ping timeout: 268 seconds]
gaqwas has quit [Ping timeout: 268 seconds]
<beach> kakuhen: Right. And I don't know Qwnavery very well (yet), but we get a significant number of newbies here who explicitly reject any idea of adhering to conventions.
<Qwnavery> Isn't it just write functional, try sticking tail recursion in for speed, keep side-effects to a minimum, use ASDF, write portable code?
<kakuhen> if only it were just that ;^^
<jackdaniel> half of it sounds like scheme
<mfiano> beach: 404 for "this document": http://metamodular.com/Common-Lisp/graph-layout-library.html
<jackdaniel> not like common lisp ,)
<hayley> Not necessarily, don't count on it, depends, yes, yes.
<beach> Qwnavery: For one thing, none of the code I write (or want) is written in a functional style.
<Qwnavery> beach: OOP?
<beach> mfiano: I'll look into it.
lisp123 has joined #commonlisp
<beach> Qwnavery: CLOS-style.
<beach> hayley: Nice summary! :)
<kakuhen> Qwnavery: CLOS feels very different than OOP in languages like Python and C++ imo; you'll just have to ask people around here how they do things in CLOS so you can see it
<kakuhen> if you want to see the tip of the iceberg of what CLOS can do, check out the dynamic-mixins library
<mfiano> beach: URL is case sensitive. Just change the "D" in "Documentation" to "d"
<beach> kakuhen: Hence my suggestion about being a mentor, and that was rejected.
<beach> mfiano: Thank you.
<hayley> I remember that cl-decentralise1 was (probably) my first independent CL project, and I remember it used to be subtly unidiomatic in ways.
<Qwnavery> ok. I just don't want to be a nuisance
<beach> mfiano: Right now I am doing way too many things simultaneously, and I also need lunch and more sleep than I got last night, so it won't be immediate.
<Qwnavery> beach: well, I mean no offence, I'm of the idea that most do not wish to be a mentor to newbs.
<beach> mfiano: Remind me if I forget, please.
<mfiano> Sure
<lisp-newbie> Hi guys, I've been reading PCL and I'm trying to do a simple macro based on what I read on chapters 3, 7 and so far in 8, and I keep getting a unbound variable error. Can you please take a look: https://pastebin.com/xYC6VuMR
kevingal has joined #commonlisp
<hayley> For example, rather than using a generic function, I had slots in each server instance contain functions to perform database actions (write object, read object, get iterator for all object names, etc). That was corrected eventually, but only after someone on #lisp pulled me up on it.
<lisp-newbie> In the top I wrote the goal of what the macro should create
<beach> Qwnavery: Well, since there are very few people who are both available and qualified, that's the solution I came up with. I am a teacher, so I can do that kind of stuff.
<rain3> beach: please accept me as your disciple
<rain3> I want to learn and contribute
<beach> rain3: That can definitely be discussed. What kind of project would you like to work on?
<hayley> Well, I think you are calling a different function, as the macroexpansion mentions |user-GET|, which is notably not the same as USER-GET.
<lisp-newbie> The pastebin has the goal of the macro, the short macro, the macroexpand, and the error... https://pastebin.com/xYC6VuMR
<lisp-newbie> hayley because of the caps?
<rain3> beach: clim related would be fine, since I have started learning CLIM . I'd like to work on pretty much any project that is useful
<lisp-newbie> hayley I don't know how the || got in there, but it seems that's what I'm calling because the error references model-class
<lisp-newbie> let me check
<hayley> Sort of.
<Qwnavery> beach: I don't want to waste your time.
<beach> rain3: Perfect. Let me check something with hayley...
<beach> hayley: Did you ever get around to doing a GUI for the accounting system?
<hayley> While you can write symbols in any casae, the reader will upcase the names.
<lisp-newbie> hayley doing (|user-GET| 4) I get Evaluation aborted for #<SB-KERNEL:CASE-FAILURE expected-type: (OR SYMBOL STANDARD-CLASS) datum: (CLASS-OF *JOHN*)>
<beach> ... a CLIM GUI I mean.
<rain3> "accounting system" is the kind of project I would really like to work on
<beach> rain3: Perfect.
<kakuhen> rain3: depending on what you mean with "accounting system," i may be interested in helping with such a project
<beach> rain3: Do you know about double bookkeeping?
<hayley> No, only a web UI. But the whole project stinks of "someone set an arbitrary deadline and timeline on me" in a way, so I think it deserves a rewrite.
<rain3> beach: I have only heard the term but I will read about it to grasp what it means
<beach> hayley: OK.
<beach> rain3: It is essential, but also very simple.
<hayley> ...in the case that you would ask to use Clomptroller for the backend. Oh, and "someone asked me to write an algorithm, so I wrote a lousy compression algorithm" too :)
<beach> rain3: I desperately need a long-ish lunch break, but let's discuss this later or in the near future.
<beach> kakuhen: Two people working on such a thing would not be wrong.
<hayley> lisp-newbie: So, when making symbols in a program you wrote, you do not have the reader to upcase symbol names. Thus you either have to use an all-upcase string, or upcase the name before creating a symbol using SYMBOLICATE.
nij- has joined #commonlisp
<rain3> beach: enjoy the break , and I will hope we'll get to it as soon as possible
<beach> Thanks.
<hayley> The other problem, which you just found, is that you have quoted (CLASS-OF *JOHN*) and thus FIND-DAO is passed that list as (I assume) a class specifier. Just remove the quote before ,model-class
<lisp-newbie> hayley ah ok, will try it with that now, thanks
<nij-> Hello :) What's a good rpc scheme between lisp and shell?
<nij-> (POSIX shell)
<nij-> I've been thinking about this for a while. Doesn't have too much idea, as shell is mostly text..
lisp-newbie has quit [Quit: This computer has gone to sleep]
<hayley> What kind of objects do you need to pass between them? Generally, I don't think you can easily pass anything more than strings and integers.
lisp-newbie has joined #commonlisp
lisp-newbie has quit [Remote host closed the connection]
<nij-> All lisp readably printable objects <- lets start with this.
lisp-newbie has joined #commonlisp
lisp-newbie has quit [Read error: Connection reset by peer]
<nij-> I would need to write a lispy parser in shell that can deal with them primatively..
lisp-newbie has joined #commonlisp
<hayley> I'm afraid to ask how you manipulate a fair few Lisp types in a shell language.
<nij-> I'm afraid too @@
lisp-newbie has quit [Remote host closed the connection]
lisp-newbie has joined #commonlisp
lisp-newbie has quit [Remote host closed the connection]
srhm has quit [Quit: Konversation terminated!]
srhm has joined #commonlisp
<nij-> Ok I think I should narrow down to lists of symbols or lists of symbols..
amb007 has quit [Ping timeout: 268 seconds]
amb007 has joined #commonlisp
<Qwnavery> whyyy (ql:quickload "mcclim") (mcclim:define-application-frame myapp () (...) => "package mcclim not found.
<Qwnavery> after it loads.
<jackdaniel> Qwnavery: package and system are two different things
<jackdaniel> try clim:define-application-frame
<Qwnavery> and the manual says to use (inpackage :common-lisp-user) which doesn't work either.
<hayley> The package you want is CLIM, but the system is McCLIM.
<Qwnavery> works, not in slime though because of the whole process threads thing
<jackdaniel> (find-application-frame 'myapp) will be default fire off a separate thread
<jackdaniel> by*
<hayley> What process threads thing? I think I've never used CLIM from outside SLIME, funnily enough.
<Qwnavery> it did mention in the docs that won't happen in slime though
<Qwnavery> for mcclim's implementation at least
<jackdaniel> what won't happen in slime?
<Qwnavery> the thread for the window being created
lisp123_ has joined #commonlisp
<jackdaniel> if you call run-application-frame in the slime repl, then the prompt will wait until it finishes running, is that what you mean?
<Qwnavery> herm I swear I read somewhere in the McClim docs that because of the event loop thread replacing the execution thread it won't run in slime because it doesn't make a new thread
<jackdaniel> run-frame-top-level that is :)
<jackdaniel> the only thing to remember is that run-frame-top-level blocks until you close the frame, so you either need to start it from a new thread, or use find-application-frame (which does it for you)
lisp123 has quit [Ping timeout: 245 seconds]
<Qwnavery> oh it werks in slime
<Qwnavery> I see
<Qwnavery> jackdaniel: makes sense
<mfiano> There is a way to trick SLIME into thinking it isn't blocked, and update the prompt and allow time sharing to evaluate things in the same thread
<mfiano> I'm not sure if McCLIM makes use of that feature though
<Qwnavery> It mentions it in the docs, it might.
<jackdaniel> there are no provisions in McCLIM to make slime happy
<Qwnavery> jackdaniel: worth using clim2 instead?
<jackdaniel> because McCLIM doesn't have provisions to help slime?
<jackdaniel> neither of them have afaik
<Qwnavery> yeah?
<Qwnavery> oh
<Qwnavery> x_x
<jackdaniel> slime is just emacs integration
<jackdaniel> there aren't any problems with using clim2 or McCLIM in slime
<jackdaniel> s/in/from/
kakuhen has quit [Quit: Leaving...]
luis3 has joined #commonlisp
<Qwnavery> I might go, thanks though.
<jackdaniel> sure
Qwnavery has quit [Quit: WeeChat 3.2]
<jackdaniel> oh, luis3 joined; what I've meant is that slime is *the* emacs integration of course ;)
luis has quit [Ping timeout: 258 seconds]
luis3 is now known as luis
karlosz has joined #commonlisp
srhm has quit [Quit: Konversation terminated!]
srhm has joined #commonlisp
lad has quit [Ping timeout: 256 seconds]
srhm has quit [Ping timeout: 248 seconds]
<luis> jackdaniel: :D
dlowe has joined #commonlisp
scymtym_ has quit [Remote host closed the connection]
scymtym has joined #commonlisp
frgo has quit [Remote host closed the connection]
frgo has joined #commonlisp
taiju has quit [Ping timeout: 272 seconds]
<scymtym> beach: i am now
<nij-> What's a good rpc scheme between lisp and c?
<nij-> To talk to C from lisp we have cffi.
<nij-> How about the other way around? I hope to have a running lisp server that a C client can talk to.
<jackdaniel> nij-: cffi has also an interface to define callbacks that may be passed as pointers to C
<nij-> jackdaniel: Does that also work if I want to write a little client in C that starts up any time, search for a lisp server, and talk to it?
<jackdaniel> no, it is not remote, but you've mentioned that talking to c from lisp via cffi is acceptable
<jackdaniel> a few years back I've adapted a common lisp backend for thrift (which is a full blown rpc)
<jackdaniel> mind, that the original author was someone else, I've just cleaned it up for inclusion mainline
taiju has joined #commonlisp
<nij-> Yeah.. it's doable to c from lisp. But another way around (remotely)?
<jackdaniel> from lisp to c via cffi is not remote. as noted above, for rpc you may use thrift
<shka> how to implement useful pretty printer?
<shka> i need some guidelines
<jackdaniel> (for the record -- the original author of the backend was James Anderson)
elf_fortrez has joined #commonlisp
random-nick has joined #commonlisp
karlosz has quit [Quit: karlosz]
<jackdaniel> shka: while I haven't read it myself I've been recommended this in the past: https://dspace.mit.edu/bitstream/handle/1721.1/6503/AIM-1102.pdf?sequence=2
<shka> jackdaniel: thanks!
<shka> oh wow, 40 pages
<shka> i guess this should cover a lot
<nij-> hmmm lemme take a look at thrift
<jackdaniel> (and, for the information completness, this adaptation was sponsored by rigetti computing)
<nij-> Anyone has had experience with cl-selenium-webdriver?
<nij-> thrift? you mean
<jackdaniel> yes
<nij-> Thanks rigetti computing :)
<rain3> I've tried cl-selenium-webdriver once and it worked
<rain3> s/cl-selenium-webdriver/cl-selenium/
<rain3> "I like this macro example from http://common-lisp.net/cgi-bin/viewcvs.cgi/cl-selenium/?root=cl-selenium It's a Common Lisp binding to Selenium (a web browser test framework), but instead of mapping every method, it reads Selenium's own API definition XML document at compile time and generates the mapping code using CL macros. You can see the generated API here: common-lisp.net/project/cl-selenium/api/selenium-package/index.htm
<rain3> l This is essentially driving macros with external data, which happens to be an XML document in this case, but could have been as complex is reading from a database or network. This is the power of having the entire Lisp environment available to you at compile time."
amb007 has quit [Read error: Connection reset by peer]
amb007 has joined #commonlisp
<nij-> rain3: Oh seems that they are different things. Worth trying though.. did you figure out how to automatically login to a bank account using that?
<nij-> jackdaniel: IIUC to talk to lisp from C i should follow this tutorial - https://thrift.apache.org/tutorial/c_glib.html ?
<nij-> Not pretty sure what glib is and if it's necessary.
<rain3> nij-: if the bank sends an sms check at login, I don't know yet how to easily send that code from the phone to the computer . phone<->computer interaction through some network protocol is needed
<jackdaniel> I don't remember, try installing thrift and experiment with it. basically it is an rpc where you have a server and various clients
<jackdaniel> I would follow the tutorial I've linked above, because it is aimed at cl (and then I'd try to connect from C client)
<nij-> Cool! Will give it a try. The only problem is that I only know lisp, and a little bit of python. But ill try :)
<pl> is there some usable thrift implementation for lisp?
<nij-> jackdaniel: iiuc the tutorial you posted above requires the client to call another lisp in order to talk to tahe lisp client.
<jackdaniel> pl: depends on your definition of usability, but as stated above - there is one merged upstream
<pl> ho hum
<nij-> rain3: Thank god they haven't done that to me yet.
<pl> reminds me I need to go through grpc for CL again
<jackdaniel> nij-: since it is rpc it doesn't matter what is either side. start server in lisp - first try client in lisp, and then try client in, say, python
amb007 has quit [Ping timeout: 268 seconds]
amb007 has joined #commonlisp
<nij-> jackdaniel: I see.
<nij-> Btw, is it possible to launch subthreads (of a thread)? In the sense that if the main thread is killed, all of its subthreads are killed as well.
<hayley> Generally killing threads is a Bad Idea, so hopefully you don't kill the main thread, and so you'll never kill any other threads.
<shka> agreed
<shka> killing threads is not exactly what you want
<hayley> (Ergo, bordeaux-threads gives you this functionality out of the box :)
<nij-> s/main thread/mother thread/g
<hayley> On the other hand, the "opposite" of having a thread finish only when threads it creates are finished is common. Sometimes the pattern is called "parbegin", sometimes fork-join, sometimes "structured concurrency", but the general idea holds.
<hayley> I am sure someone implemented "supervisor trees" in Common Lisp, but I am not going to give you any information on that because it is still difficult to write anything where threads can arbitrarily be killed.
<shka> especially since unwind protects won't run in sbcl
<shka> which managed to screw me up recently
<hayley> Hah, if you look up "supervisor tree common lisp" on Google, it comes up with a Clozure-only actor library. If you look up '"supervisor tree" common lisp' with quotes, it comes up with the library I need to finish one day (which does not _kill_ things, rather ask them to stop politely).
<hayley> shka: Yes, destroying a thread causes it to phase out of reality rather than shut down nicely.
<shka> yeah
<pl> so, SBCL just straight out murders the thread with OS APIs?
<shka> dunno how, but no unwind-protect cleanup
* pl ponders if there might be some option to use GC safepoints to trigger condition
<shka> which was a problem because that's where i was closing my files
<rain3> so, is it possible and recommended to launch subthreads (of a thread)? In the sense that if the main thread is politely stopped, all of its subthreads are politely stopped as well
<hayley> I think that is generally how DESTROY-THREAD works.
<hayley> pl: First, you have to have safepoints. Most, perhaps except for ABCL because the JVM uses safepoints, do not. But you can interrupt threads with a function that signals some error, causing unwinding.
<hayley> Though you still have to think about what you don't want to be interrupted in.
<pl> hayley: there's still whatever mechanism the GC uses to suspend the mutators
<pl> hayley: so use that when extending an implementation
<hayley> I believe those also fall under using OS primitives to freeze threads.
<hayley> (See bt:destroy-thread: "Terminates the thread THREAD, which is an object as returned by MAKE-THREAD. This should be used with caution: it is implementation-defined whether the thread runs cleanup forms or releases its locks first.")
<pl> the biggest issue I see is that semantics of "stop thread" condition are iffy
selwyn has joined #commonlisp
selwyn has quit [Remote host closed the connection]
selwyn has joined #commonlisp
<hayley> Yeah, picking critical sections would also be a pain though. Generally I would assume that someone doesn't want to be interrupted while holding a lock; they want to get from state A to B cleanly, and politely destroying oneself in the middle would lead to something strange.
<pl> doing it full erlang style would probably bulldoze locks anyways, but then one should be aware of what it means to go full erlang style ;)
<hayley> And then if one uses finer-grained locking, there may still be the expectation that we eventually finish the second critical section after the first, which also isn't nice.
<hayley> pl: I am aware of it, but I am foolishly trying to find a middle-ground with all my fine-grained locking code. If you squint hard enough, any ol mutable structure is equivalent to an actor.....
elf_fortrez has quit [Quit: Client closed]
<hayley> pl: That said, the plan for SICL is to use GC safepoints to handle other interrupts.
cosimone has joined #commonlisp
dlowe has quit [Remote host closed the connection]
<hayley> In the case of locks, I think some languages rather make it an error to try to grab a lock that some thread "died" while holding, which is another option.
<scymtym> not recommending this as a safe practice, but SBCL generally does run cleanups when destroying threads. try (let ((thread (bt:make-thread (lambda () (unwind-protect (sleep 100) (princ "cleaning up" *trace-output*)))))) (sleep 1) (bt:destroy-thread thread)). this is, of course, super racy. for example, without the (sleep 1) the thread may be destroyed before the unwind protection gets established
<hayley> I see.
tyson2 has joined #commonlisp
Alfr has quit [Ping timeout: 252 seconds]
Alfr has joined #commonlisp
<scymtym> i think this behavior is essential for interactive development since otherwise interrupting a thread, which has gone off the rails, using the SLIME debugger and choosing the ABORT restart would leave locks locked and possible corrupt the image or application state in other ways
<hayley> So destroying a thread is implemented by interruption?
<scymtym> for SBCL, messing up the world lock is game over, for example
<hayley> I guess it would hit UNWIND-PROTECT and thus unlock locks, but there is still the problem that you can leave critical resources halfway between states.
<scymtym> i think conceptually (destroy-thread th) == (interrupt-thread th (lambda () (invoke-restart '%abort-thread)))
<hayley> Oh, nice.
<scymtym> but, it is still not safe since the interrupt is asynchronous
<scymtym> so (let ((f (open …))) (unwind-protect … (close f))) could be interrupted between OPEN and UNWIND-PROTECT
<hayley> Yes, that's true.
<scymtym> this can be improved, but for example (let ((f nil)) (unwind-protect (progn (setf f (open …)) …) (when f (close f)))) is still unsafe since the interrupt can occur after returning from OPEN but before assigning to F
<jackdaniel> (without-interrupts (let ((open …)) (unwind-protect (with-interrupts-enabled …) (close f))
<scymtym> so only WITHOUT-INTERRUPTS … what jackdaniel said
<jackdaniel> ah, blunder, (f (open …))
<hayley> I guess I need to invent a portable WITHOUT-INTERRUPTS which doesn't interfere with any other usage of it, but that is doable as I control the unwinding convention.
<jackdaniel> what do you mean by a "portable" without-interrupts?
<hayley> Last I checked, it is not in Bordeaux threads or the like.
<jackdaniel> ah, as in "portability layer"
<hayley> But, again, I just use a handler for a condition type only I signal, so I could bind a new handler which defers unwinding until finishing some critical section.
amb007 has quit [Read error: Connection reset by peer]
hendursa1 has quit [Quit: hendursa1]
hendursaga has joined #commonlisp
amb007 has joined #commonlisp
amb007 has quit [Read error: Connection reset by peer]
<hayley> Indeed.
amb007 has joined #commonlisp
<rain3> beach: what's the goal with the accounting app ? I have played with https://github.com/robert-strandh/compta and I am reading Finance for Non-Financial Managers
amb007 has quit [Read error: Connection reset by peer]
amb007 has joined #commonlisp
<nij-> Oooh we have a ledger in CL?!
* hayley hesitates to ask what is meant by "ledger".
waleee has joined #commonlisp
<jackdaniel> probably an "account book" alluding to compta
<hayley> Whew!
<hayley> Yes, but without Unix-induced wheels in the head.
<rain3> https://www.reddit.com/r/Common_Lisp/comments/7lb8s7/clledger_double_accounting_system/ "BTW, I do my accounting in Lisp also. I studied double-entry accounting and found it idiotic."
Inline has joined #commonlisp
<beach> Double-entry bookkeeping is legally required for companies in most of the world.
<hayley> I think that the "zero sum accounting" is trivially convertible to double-entry bookkeeping and vice versa, but it is too late for me to think of how exactly.
<beach> I do not know what the former is. Sorry.
<jackdaniel> antoszka wrote a tool to issue invoices in common lisp, I've used it for some time
<hayley> It is presented in the linked comment, and I suspect the author came up with the name.
<hayley> Rather, one of the comments on the linked page.
<rain3> jackdaniel: this one ? https://github.com/antoszka/fv
<nij-> CL-Ledger official: "CL-Ledger is a Common Lisp port of the Ledger double-entry accounting system."
<jackdaniel> rain3: yes
<nij-> Does this mean that someone wrote this from scratch? Or it's just a binder to ledger?
<hayley> Or rather, this comment states that it is also double entry bookkeeping in spirit: "How you describe your system is exactly how I was taught double-entry accounting in school, and AFAIK, the way its still taught here in Norway. The other way you described is just syntactic sugar for those used to that way of thinking (for those new to double-entry accounting it just leaves a bitter aftertaste in my experience), otherwise they are identical."
<rain3> jackdaniel: cool thanks for sharing
<beach> The main tricky part with such an application is not the "business logic" which is almost trivial. Mainly, it is the GUI, and McCLIM is perfect for such an appliation.
<beach> Let me go check CL-Ledger. It may very well be that it could be the "business logic" part of the final system.
<hayley> I think it is a port, but there is a submodule for the original C code for some reason, and the code looks kind of odd but not necessarily bad.
<nij-> What is a "port"?
<hayley> Rather, a Common Lisp rewrite of the original C code.
<hayley> A "port" is some code which was modified in a way to run on another platform. Admittedly that definition does not make sense when you rewrite all the code to "port" to another language...
<nij-> Ok, so it's not just a binder. Cool.
<hayley> Right.
<nij-> I remember ledger being quite good and well documented. Not sure about cl-ledger.
<nij-> While it helped, it still painful to get all the data together.
tfeb has joined #commonlisp
<beach> Regular expressions to parse files? Not acceptable for the system I am thinking of.
tfeb has quit [Client Quit]
tfeb has joined #commonlisp
<hayley> I don't see the appeal of human-readable file formats necessarily, as attributing any actual meaning to the data tends to require a program.
<nij-> why not? hayley
<hayley> As I understand it, the ledger is stored as some list of transactions.
<tfeb> In the presence of humans I think human-readable (and thus human-editable if need be) is occasionally useful. Of course we could just eliminate the humans
<nij-> I still don't know why you see no point @@..
<nij-> It's also very easy to output, edit.. etc.
<hayley> To compute the balance of accounts, we need to do some parsing and accumulation. Thus we find we would need a program pretty quickly.
<jackdaniel> human readable file formats are better if the format is meant to be interchangable between different programs -- programs tend to be written by people, and people are bad with unreadable formats. still, binary formats are OK if they do not assume some certain structure of the program handling them
<beach> In CL-Ledger, an account seems to have data stored in it. I think that makes the system unnecessarily complicated.
lisp123_ has quit [Remote host closed the connection]
<tfeb> The question is how brittle you want to make it. Without the program, do you want the files to be useless, or just less useful?
<jackdaniel> (and, even better, if you stipulate only one client, then you may use the program abstractions -i.e serialize clim output records as a format for graphics)
<beach> Account balance can be computed from the list of transactions. So the only real data structure required is a list of transactions.
<beach> Such a list will be humanly (somewhat) readable if you just use PRINT and READ.
<beach> ... which is what I want.
<hayley> Hah, we are having the same discussions as two years ago.
<hayley> *as we had two years ago.
<beach> Not surprised!
<beach> The data structure of CL-Ledger seems to be backwards.
<beach> An account contains entries, and an entry contains a list of transactions.
<beach> I want a transaction to contain two lists of accounts, debit and credit.
<beach> rain3: It looks like it is better to start over.
<aeth> The problem with binary formats is that you have complete and total control so you are tempted to optimize it and frequently revise it as long as you have a versioning scheme. Plus, the only authoritative documentation is the source code of the program that uses it. Human readable constrains what you do.
<hayley> nij-: Maybe I am too imaginative, but it couldn't be easier than not having to render and parse the data.
<beach> aeth: I think what READ and PRINT can handle is the way to go.
<hayley> Hm, I haven't optimized the one binary format I wrote, and I am pretty sure the BNF grammar still is correct.
<nij-> hayley: If the format is in sexprs, would you be happier?
<scymtym> regardless of the representation, be it human-readable plain text or some binary format, specifying the syntax /and/ semantics is the only way to get interoperability
<hayley> It's a bit easier, sure, but ideally I would have the transaction log in persistent memory.
<hayley> What I mean is that, with a mere text editor, you are limited in what you can reasonably do with a textual transaction log, and "human readable" is pretty vague (e.g. COBOL and SQL on the worse end).
<beach> rain3: Are you still interested?
<nij-> hayley: But can't you just read the sexprs into memory?
<rain3> beach: I am back, let me read
<aeth> scymtym: yes, but if it's human readable, it will probably look the same over time, while if it's binary, and it has versioning, then everything after the version number can be radically different as you bikeshed the most optimal way to do it
<tfeb> Well, some of us have written quite hairy systems to process machine-generate SGML using 'a mere text editor' Certainly helped me do so that it was human-readable.
<hayley> nij-: Yes, but you have to come up with a relation between the S-expressions and object graph in memory. Though beach instead uses the printer and reader to serialize the object graph directly.
<jackdaniel> beach suggestion is still a human readable format
<jackdaniel> kind of, without headers and such :)
<scymtym> aeth: i get that human readability lowers the initial barrier. but look at markdown. now people can't agree how to parse and interpret it exactly
<nij-> hayley: In any case, at the end of the session, if you want to store the data, what would you do?
<jackdaniel> all grand "ends" end with save-lisp-and-die :)
<rain3> beach: Yes I am interested
<tfeb> scymtym: that's because markdown is inadequately specified, not because it is human readable
Fare has joined #commonlisp
<aeth> That's only because Markdown is underspecified for its role (even CommonMark doesn't specify tables or colors yet) and, crucially, it became too popular before it became specified.
<beach> rain3: Excellent!
<aeth> You can easily become too successful too quickly
<hayley> When I had to serialize a more interesting object graph, have fast incremental updates, and have durability, I mostly just lost my mind trying to do it with files. Next I guess I will repeat that with a relational database.
<aeth> When you're both underspecified and popular, there are now 5+ ways to do a common task and standardization becomes way harder.
<jackdaniel> markdown is an excellent example of human-readability value - it has succeeded because it was friendly for the human reader; it could be better specified though :)
<aeth> almost
<hayley> nij-: I'd leave the transaction log in the persistent memory, and come back to it tomorrow.
<beach> rain3: It is almost 3pm here and I haven't gotten anything done yet today on my own projects, so I need to do that for a while. What forum do you prefer for the discussion? Maybe #clim is the best since the main thing will be the GUI?
<aeth> markdown has a few straze design flaws, like _foo_ being the same as *foo* (and having no way to do underlining!)
<scymtym> tfeb: i thought that's what i said initially
<rain3> beach: Okay, #clim will do
<beach> Great!
<aeth> s/straze/strange/
kevingal has quit [Remote host closed the connection]
<nij-> hayley: Oh I misunderstand what you mean by persisten memory.
<nij-> What's that?
<tfeb> scymtym: my point is that hr and unambiguousity are entirely orthogonal
<scymtym> tfeb: i agree and i think that's what i said. but i have to go now
<tfeb> ok
pranavats has left #commonlisp [#commonlisp]
<tfeb> sorry if I misunderstood
<hayley> nij-: Loosely speaking, you just save everything in memory. (It can be made fast, don't worry about that.) The nice thing is that you only need one policy for how to update state.
<scymtym> tfeb: no worries
<hayley> Compare that to serialization, where you have one set of operations in memory, another for objects on disk, and perhaps another with version control. (If we needed versioning, we could use a transactional memory scheme too.)
<nij-> What is the lisp session ends?
<nij-> What if *
<hayley> Persistence is achieved by saving the state to disk.
<nij-> All states? including functions and closures?!
<hayley> Yes.
tfeb has quit [Quit: died]
tfb has joined #commonlisp
selwyn has quit [Read error: Connection reset by peer]
tyson2 has quit [Ping timeout: 268 seconds]
pranavats has joined #commonlisp
<nij-> hayley: There must be a library that handles this right?
<nij-> That sounds nice. At most, if someone wants a human readable format, I can write a printer and a parser on top of that.
<nij-> But the core is indeed what you described.
dsk has quit [Ping timeout: 252 seconds]
srhm has joined #commonlisp
pjb has quit [Ping timeout: 258 seconds]
Bike has joined #commonlisp
cosimone` has joined #commonlisp
tyson2 has joined #commonlisp
nij- has quit [Quit: #archlinux]
cosimone has quit [Ping timeout: 252 seconds]
tyson2 has quit [Remote host closed the connection]
tyson2 has joined #commonlisp
pjb has joined #commonlisp
Mandus has quit [Quit: WeeChat 3.0.1]
pjb is now known as Guest659
Guest659 has quit [Remote host closed the connection]
pjb has joined #commonlisp
Mandus has joined #commonlisp
fizbin has joined #commonlisp
pranavats has left #commonlisp [#commonlisp]
fizbin has quit [Ping timeout: 252 seconds]
cosimone` has quit [Ping timeout: 268 seconds]
lisp123 has joined #commonlisp
lisp123_ has joined #commonlisp
lisp123 has quit [Ping timeout: 248 seconds]
lotuseater has joined #commonlisp
michal has joined #commonlisp
<michal> Heya, I have a question
<Bike> shoot
<michal> Where should I write my defgeneric forms - within packages.lisp? And also does anyone recommend a way to organising code when using ASDF?
<Bike> usually the package definition file has only package definitions
<Bike> you might have a dedicated generic-functions.lisp, or you could put generic function definitions in whichever file defiens their behavior
<michal> Thanks, I will do that
tyson2 has quit [Quit: ERC (IRC client for Emacs 27.2)]
<lisp123_> Does anybody keep in touch with the Lispers of the 80s and 90s
<lisp123_> I wonder what they are up to these days
<mfiano> Many of us here fit that description.
<lisp123_> mfiano: Nice :)
<lisp123_> mfiano: Any good stories?
<beach> mfiano: Heh!
<mfiano> I am not one of them. Only less than 20 years for me
<mfiano> (I am an early 80's child)
<lotuseater> mfiano: "only" ^^ I wish that would go for me too.
hendursaga has quit [Ping timeout: 244 seconds]
hendursaga has joined #commonlisp
<mfiano> Hmm. Arity overloading is one thing I continually wish CL had, but monomorphized instead of dispatched at runtime.
<lisp123_> mfiano: funnily enough, I was just looking into that
<lotuseater> mfiano: I once wrote me a macro to experiment with that like Erlang has it. So you can define functions with the the same name but different (fixed) arity, no &KEY, &OPTIONAL, &REST. so (defun foo (x y z) ...) gets exported and callable by FOO/3
<lotuseater> but of course recommended calling by just FOO
<mfiano> specialization-store has it, and supports key/optional/rest, but like other CLtL2 dependent libraries, it is subject to breakage once in a while. I don't think such a thing will be robust with implementation support.
derelict has quit [Ping timeout: 268 seconds]
<mfiano> That's what I'm after, something implementation-specific that could be made into an extension like PLN, rather than half-baked libraries that when they break, it's hard to blame the implementation, the CLtL2 portability layer, or the library itself
robin_ has joined #commonlisp
<mfiano> But I do a lot of wishful thinking :)
<mfiano> I meant I don't think an attempt will be robust _without_ implementation support above.
robin has quit [Ping timeout: 252 seconds]
<mfiano> With a proper lambda list parser, which beach might have modularized come to think of it, a naive version that doesn't depend on environment introspection could be written easily.
<mfiano> I wouldn't mind even an adhoc solution for a few projects of mine.
robin has joined #commonlisp
robin_ has quit [Ping timeout: 258 seconds]
<Bike> having it monomorphized seems like it would entail some subtle but far reaching semantic changes
robin has quit [Remote host closed the connection]
robin has joined #commonlisp
<mfiano> Perhaps. I haven't thought too deeply into it. Just one feature I like from Clojure, but not enough to actually use it :)
derelict has joined #commonlisp
fengshaun has quit [Quit: bibi!]
fengshaun has joined #commonlisp
robin has quit [Remote host closed the connection]
robin has joined #commonlisp
Lycurgus has joined #commonlisp
robin has quit [Remote host closed the connection]
robin has joined #commonlisp
karlosz has joined #commonlisp
Cymew has quit [Ping timeout: 268 seconds]
santiagopim has quit [Remote host closed the connection]
Skyfire has quit [Ping timeout: 256 seconds]
Skyfire has joined #commonlisp
Skyfire has quit [Ping timeout: 272 seconds]
tfb has quit [Quit: died]
taiju has quit [Ping timeout: 248 seconds]
selwyn has joined #commonlisp
amb007 has quit [Ping timeout: 268 seconds]
amb007 has joined #commonlisp
Fare has quit [Ping timeout: 272 seconds]
Fare has joined #commonlisp
tfeb has joined #commonlisp
Cymew has joined #commonlisp
pranavats has joined #commonlisp
robin has quit [Ping timeout: 258 seconds]
robin_ has joined #commonlisp
Cymew has quit [Ping timeout: 268 seconds]
<pve> Does "monomorphized" means that the method is chosen at compile time?
<pve> *mean
<Bike> that is how i was interpreting it
<mfiano> Pretty much.
<Lycurgus> unless it refers to monomorphism
<mfiano> It's what Rust does for example, and what contributes to incredible compilation times
derelict has quit [Ping timeout: 248 seconds]
<mfiano> But yes, it seems such a thing would not meld well with dynamism/interactivity.
derelict has joined #commonlisp
lad has joined #commonlisp
<pve> then the types of each argument would need to be declared/known at compile-time? or would that part be run-time?
<Bike> mfiano was talking about arity rather than types
<pve> yes, I meant the arity is chosen at compile time
<Bike> so it would be pretty obvious from non-apply calls which to use
<pve> oh, so no type-based dispatch at all?
<pve> ok, I get it now.. thanks
tfeb has quit [Ping timeout: 248 seconds]
robin_ has quit [Remote host closed the connection]
robin_ has joined #commonlisp
robin_ has quit [Remote host closed the connection]
CrashTestDummy2 has joined #commonlisp
karlosz has quit [Quit: karlosz]
CrashTestDummy3 has quit [Ping timeout: 248 seconds]
Inline has quit [Quit: Leaving]
amb007 has quit [Read error: Connection reset by peer]
amb007 has joined #commonlisp
esb has joined #commonlisp
gaqwas has joined #commonlisp
retropikel has quit [Quit: Leaving]
retropikzel has joined #commonlisp
fizbin has joined #commonlisp
jeosol has quit [Quit: Ping timeout (120 seconds)]
Inline has joined #commonlisp
Lycurgus has quit [Quit: Exeunt]
fizbin has quit [Ping timeout: 258 seconds]
<White_Flame> mfiano: it could be interactive, if the notion of recompiling was part of the CL image model. I don't think the two are incompatible, but since there's no interface to such a mechanism, nobody builds in that style
<White_Flame> to be more clear, recompiling already-compiled functions based on new assumptions
<mfiano> Sure
CrashTestDummy has joined #commonlisp
<White_Flame> either that, or a manual "bake" command which takes the current dynamic code and bakes in all the currently known assumption, preventing further dynamicism, unless unbaked
<White_Flame> (dynamism?)
CrashTestDummy2 has quit [Ping timeout: 248 seconds]
lisp123_ has quit [Remote host closed the connection]
yitzi has joined #commonlisp
Skyfire has joined #commonlisp
tfeb has joined #commonlisp
michal has quit [Ping timeout: 268 seconds]
rain3 has quit [Ping timeout: 252 seconds]
Devon has joined #commonlisp
CrashTestDummy2 has joined #commonlisp
CrashTestDummy has quit [Ping timeout: 248 seconds]
rain3 has joined #commonlisp
tyson2 has joined #commonlisp
tfeb has quit [Remote host closed the connection]
lisp123 has joined #commonlisp
michal has joined #commonlisp
michal has left #commonlisp [#commonlisp]
nij- has joined #commonlisp
<nij-> hayley: do you recommend mito or elephant for persistent memory?
Steeve has joined #commonlisp
Devon has quit [Ping timeout: 248 seconds]
<lisp123> nij: try bknr
jeosol has joined #commonlisp
CrashTestDummy3 has joined #commonlisp
CrashTestDummy2 has quit [Ping timeout: 268 seconds]
<dieggsy> Does SBCL have an equivalent of Allegro's interactive-stream-p, which forces output for certain functions if a stream is marked interactive? it's described here: https://franz.com/support/documentation/9.0/doc/streams.htm#force-finish-output-2
<dieggsy> basically this helps me have sly handle output more similarly to slime and i'm wondering if other implementations have an equivalent setting
<nij-> lisp123: what does satellite mean? how does this approach differ with that of mito (db based)? should I worry about memory overflow?
taiju has joined #commonlisp
<lisp123> nij-: Ignore the term satellite, its just a buzzword. BKNR serialises your lisp data objects to file and then reloads them the memory on startup. So basically you will have all your data in memory always
<lisp123> And it only requires a very little modification to do so
CrashTestDummy2 has joined #commonlisp
<lisp123> Unless your data is too large, it should be fine for your uses - how much data do you need to keep in memory?
<lisp123> Mito / Elephant as I understand are traditional databases, so are much slower than BKNR and also BKNR is very nice in easy it is to use (once you get the hang of it) :)
<nij-> Oh ok! I dunno yet. What is "too large"?
<lisp123> Gigabytes is fine
<nij-> How about 1 million of lines of plain text? One line 100 characters?
<lisp123> Shouldn't be an issue
<nij-> :O
<lisp123> And its all in memory, so super fast
<nij-> I have been dealing things the wrong way..
<Josh_2> Something about BKNR makes me very uneasy when using it
<Josh_2> idk why
<lisp123> Think of it as working in memory and just saving the results to file to give you persistence and then loading back on startup
<nij-> Josh_2: plz.. elaborate xD
<Josh_2> Idk
CrashTestDummy3 has quit [Ping timeout: 248 seconds]
<nij-> Common its manual has cute pics. I was almost determined to learn it.
<mfiano> Hi all. Question:
<Josh_2> I was using it for a while, but swapped to postgres
<nij-> Alert! mfiano has a question. :)
<lisp123> Josh_2: Are you scared of losing your data?
<lisp123> I export to XML for that reason
<lisp123> (which BKNR has)
<mfiano> CLtL2 says: "Nearly all functions that operate on the contents of a vector will operate only on the active elements. An important exception is aref...". I cannot find anything in CLHS about this. Why do I ask? Well loop :across may be unspecified on arrays with fill pointers.
<lisp123> So its 100% safe :)
<Josh_2> Yes something like that lisp123
<nij-> lisp123 nothing is 100% safe :)
<nij-> So what does a LISP satellite mean?
<Josh_2> Have to say I trust Postgres more
<lisp123> nij-: Disappointment may be :)
<Inline> ohh
<Inline> a satellite in orbit ?
<nij-> i dunno.
<Inline> or in the mental realm ?
<lisp123> Josh_2: That's fine too, do you use Postmodern? Good thing about database solutions is that you can remove the lisp part (!) and reuse elsewhere a bit easier (although BKNR has XML export so I don't think its an issue tbh)
<jmercouris> A satellite is like another node on a network
<lisp123> nij-: Let me quote the manual, one sec
<jmercouris> don't worry about it, it is in fact a buzzword
<Josh_2> Yes I use pomo
<nij-> lisp123: I'm reading the manual.
<nij-> And got stuck by that term.
<jmercouris> I use pomito, for tomato sauce
<Josh_2> One of the reasons I swapped to Postgres was because I thought about the possibility that I would need to scale my project, pomo makes that pretty easy
<jmercouris> You will never need to expand beyond BKNR I guarantee it
<lisp123> nij-: "BKNR is a software launch platform for LISP satellites. You could replace “launch platform” with framework and “satellites” with “applications”, but that would be too many buzzwords."
<jmercouris> you could serve MILLIONS of requests per minute easily
<lisp123> jmercouris: Are you using BKNR :) ?
<nij-> lisp123: exactly where I stopped reading and asked
<jmercouris> lisp123: No, I've played with
prxq_ has joined #commonlisp
prxq_ has quit [Client Quit]
<jmercouris> I am personally using CL P R E V A L E N C E
<nij-> mfiano: sorry for the text wall..
<jmercouris> and M I T O
<lisp123> nij-: Sounds good doesn't it, imagine going into space with a rocket from Baikanur ;)
<nij-> what makes cl-prevalence so spaced out :O ?
<Inline> duh
<jmercouris> A E S T H E T I C S
<nij-> i like that. lemme take a look.
<Josh_2> All bknr needs is to be able to interconnect with multiple instances and you have a competitor to allegrocache, however thats not a trivial task
<Inline> i'd rather ask the grey for a lift!
<Inline> lol
<nij-> jmercouris: Can it save functions and closures?
<jmercouris> nij-: no...?
<nij-> :(
<jmercouris> but YOU CAN!
<lisp123> Josh_2: Indeed, that's a very difficult task :)
<nij-> lisp123: can bknr save functions and closures?
<jmercouris> look (format *some-file-stream '(defun my-function ())) ->
<lisp123> Then it would be called SpaceX not BKNR ;)
<Bike> serializing compiled functions is not something you're going to be able to do in standard lisp, and probably not in portable lisp either
<Josh_2> You can save functions and closures with fasl files
CrashTestDummy3 has joined #commonlisp
<jmercouris> Bike: hence the define-command macro
<jmercouris> which allows for this
<lisp123> nij-: Not at the moment, but you could write it for us :)
<jmercouris> if you want inspiration, look in the Nyxt source code, where we tackle this exact problem
<Josh_2> Elephant looks cool as well, shame its unmaintained lisp123 I have looked through the source and cant say I had any idea at all what was going on
<jmercouris> also what Bike said, good luck saving compiled functions
<jmercouris> I believe beach said something about it existing for commercial Lisps or something
<nij-> Then I'm curious what hayley meant..
<lisp123> Josh_2: Elephant or BKNR? From my understanding, Postmodern is pretty much perfect for db solutions (if one is willing to go with PSQL)
<jmercouris> s/existing/not existing
<Bike> so you save the source form. i see
<jmercouris> nij-: don't worry about it
<jmercouris> Bike: I N D E E D
<mariari> oh no
<mariari> wrong channel, sorry
<nij-> mariari: good job. we're friendly so you're ok:)
<nij-> so apparently hayley suggested there are black magics that help persistentize functions and closures https://irclog.tymoon.eu/libera/%23commonlisp?around=1628863135#1628863135
CrashTestDummy2 has quit [Ping timeout: 248 seconds]
<Bike> nij-: hayley seems to be referring to something more like dumping an image
<nij-> which lib does hayley use?
<nij-> oh
<Bike> but i am not sure of the details
<edgar-rft> mfiano: the HyperSpec AREF page says that AREF ignores fill-pointers, but I still have found nothing in the LOOP chapter what that means for : ACROSS -> http://www.lispworks.com/documentation/HyperSpec/Body/f_aref.htm
<nij-> I've been lisping too much lately.
<nij-> Wife isn't happy.
* nij- slightly pushes hmslef to #lispcafe
<nij-> Bike: Yeah.. I should ask hayley again.
<Bike> that would probably be the most informative course of action
<lisp123> nij-: I have been trying to get my gf into lisp, at least she's been telling all her IT friends that they should program in lisp if they want to be successful :S It's a start
<Bike> i would think that loop-as-across respects the fill pointer, but i don't see any explicit language either way
<nij-> lisp123: lol yeah I need to cook up some tricks to get people in
<nij-> at least they need to try
<nij-> I always failed..
<nij-> It's great to start with emacs. But that alone scares many people alway.
zos has joined #commonlisp
<contrapunctus> nij-: how's the Lisp support in other IDEs?
<mfiano> edgar-rft: Right, that was the bit in CLtL2 about aref being an exception. I don't see anywhere where it specifies what loop uses
<mfiano> Bike: Ah I missed what you had said. Yeah, I think this is undefined.
<nij-> contrapunctus: come over here at #lispcafe
<edgar-rft> mfiano: CLHS 6.1.2.1.5 "The for-as-across subclause" says "Iteration stops when there are no more elements in the supplied array that can be referenced" but AREF ignores fill-pointers, so elements after the fill-pointer *can* be referenced. I don't think that's what's meant but the explanation indeed is somewhat ambiguous.
<Bike> i would say it should read "active elements"
<Bike> might be something to toss into wscl actually
<jmercouris> or elements before the fill pointer
<Bike> that is what "active" means.
<jmercouris> is that a defined term?
<mfiano> Bike: Yes that would be a good addition.
<Bike> yeah it's in the glossary
<jmercouris> I see, OK
<Bike> it's pretty obscure though
<Bike> i only know it because i was trying to figure out if this loop thing was defined
<jmercouris> then perhaps it is not a good idea to use this term
<jmercouris> or to use it, and then immediately define it
<Bike> there'd be like, a link to the glossary.
<jmercouris> right
Steeve has quit [Quit: end]
<Bike> since otherwise yeah you read that and go what the heck does that mean.
<edgar-rft> I often think the glossary only exists because the committee folks permanently lost track of what they were talking about :-)
<Inline> lol
<edgar-rft> don't laugh too loud, the ANSI Spec is a pretty much complex thing, andif I had been member of the committee the glossary would probably be bigger than the internet
<Inline> right
<Bike> i figure that's why glossaries exist in general
<edgar-rft> if I had been member of the committee the glossary would need its own internet :-)
hafat has joined #commonlisp
nij- has quit [Quit: Using Circe, the loveliest of all IRC clients]
<jcowan> If I had been a member of the committee, the glossary would be stored in its own universe: gets you another 10^79 bits to play with.
<jcowan> "Every word she says is a lie, including 'and' and 'the'."
attila_lendvai has joined #commonlisp
CrashTestDummy2 has joined #commonlisp
CrashTestDummy3 has quit [Ping timeout: 256 seconds]
<Alfr> jcowan, might be impractical if that universe should become inaccessible from the one where the spec is in use.
<jcowan> So keep a copy in this universe. :-)
amb007 has quit [Ping timeout: 252 seconds]
amb007 has joined #commonlisp
<Alfr> Do we have enough spare state?
dsk has joined #commonlisp
yitzi has quit [Quit: Leaving]
amb007 has quit [Read error: Connection reset by peer]
amb007 has joined #commonlisp
cosimone has joined #commonlisp
krjst has quit [Ping timeout: 250 seconds]
jeosol has quit [Ping timeout: 248 seconds]
Vultyre has quit [Ping timeout: 256 seconds]
energizer has quit [Ping timeout: 272 seconds]
krjst has joined #commonlisp
cage has quit [Quit: rcirc on GNU Emacs 27.1]
Vultyre_ has joined #commonlisp
Vultyre_ is now known as Vultyre
lisp123 has quit [Remote host closed the connection]
lisp123 has joined #commonlisp
jeosol has joined #commonlisp
energizer has joined #commonlisp
amb007 has quit [Ping timeout: 258 seconds]
amb007 has joined #commonlisp
lisp123 has quit [Ping timeout: 248 seconds]
makomo_ has joined #commonlisp
makomo_ has quit [Client Quit]
makomo_ has joined #commonlisp
makomo has quit [Ping timeout: 245 seconds]
makomo_ has quit [Client Quit]
makomo has joined #commonlisp
<edgar-rft> my glossary would have it's own glossary...
Lord_Nightmare has quit [Quit: ZNC - http://znc.in]
Lord_Nightmare has joined #commonlisp
selwyn has quit [Read error: Connection reset by peer]
santiagopim has joined #commonlisp
attila_lendvai has quit [Ping timeout: 245 seconds]
lisp123 has joined #commonlisp
lisp123 has quit [Read error: Connection reset by peer]
shka has quit [Ping timeout: 268 seconds]
sander has quit [Ping timeout: 248 seconds]
lisp123 has joined #commonlisp
santiagopim has quit [Ping timeout: 268 seconds]
pve has quit [Quit: leaving]
lisp123 has quit [Read error: Connection reset by peer]
zos has quit [Ping timeout: 248 seconds]
zos has joined #commonlisp
pegaso has joined #commonlisp
frgo has quit [Read error: Connection reset by peer]
frgo has joined #commonlisp
santiagopim has joined #commonlisp
gaqwas has quit [Ping timeout: 258 seconds]
gaqwas has joined #commonlisp
pegaso has quit [Quit: Leaving]
cosimone has quit [Ping timeout: 252 seconds]
Qwnavery has joined #commonlisp
amb007 has quit [Ping timeout: 248 seconds]
makomo has quit [Ping timeout: 258 seconds]
mister_m` has joined #commonlisp
Noisytoot_ has joined #commonlisp
mister_m has quit [Remote host closed the connection]
Noisytoot has quit [Remote host closed the connection]
<mfiano> Is there a convenient way to debug print-object not invoking the debugger when it errors?
<mfiano> <<error printing object>> in the object printed rep is not very convenient :/
<hayley> nij-: 🆑🅾🆘
<lotuseater> hayley: :D
akoana has joined #commonlisp
Noisytoot_ is now known as Noisytoot
kakuhen has joined #commonlisp
karlosz has joined #commonlisp
karlosz has quit [Client Quit]
seanw has joined #commonlisp
Qwnavery_ has joined #commonlisp
Qwnavery_ has quit [Client Quit]
Qwnavery has quit [Ping timeout: 258 seconds]
Qwnavery has joined #commonlisp