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/> | News: ELS'22 this Monday (2022-03-21), see https://european-lisp-symposium.org
PoisonedPigeons has joined #commonlisp
varjag has joined #commonlisp
MajorBiscuit has quit [Ping timeout: 244 seconds]
varjag has quit [Ping timeout: 240 seconds]
frgo has joined #commonlisp
frgo has quit [Read error: Connection reset by peer]
masinter has quit [Ping timeout: 272 seconds]
varjag has joined #commonlisp
varjag has quit [Ping timeout: 240 seconds]
varjag has joined #commonlisp
varjag has quit [Ping timeout: 244 seconds]
zachel has quit [Ping timeout: 260 seconds]
zachel has joined #commonlisp
mon_aaraj has quit [Ping timeout: 268 seconds]
mon_aaraj has joined #commonlisp
varjag has joined #commonlisp
mon_aaraj has quit [Ping timeout: 276 seconds]
PoisonedPigeons has left #commonlisp [#commonlisp]
mon_aaraj has joined #commonlisp
varjag has quit [Ping timeout: 276 seconds]
lucyy has quit [Ping timeout: 268 seconds]
lucyy has joined #commonlisp
hashfunc11db has joined #commonlisp
lucyy has quit [Ping timeout: 268 seconds]
lucyy has joined #commonlisp
<hashfunc11db> dbotton: what's the best way to access the BODY via a slime repl? i'm very confused about this. for example the function (DEFUN ON-NEW-BUILDER (BODY) ... ) takes BODY as an argument, but i'm finding it super difficult to even get access to it in my Slime repl because of the connection stuff(?). i'd like to manipulate/test-out BODY so that i can understand more of what's going on under the hood
lucyy has quit [Ping timeout: 268 seconds]
<dbotton> So if just want a window to play with you can change in clog-user and run (clog-repl)
<hashfunc11db> right, but i'd like to manipulate the builder page itself
<dbotton> however if something in your code base you will need to make some variable available to the repl to access your window etc
<dbotton> so say the builder page
<dbotton> you would pass whatever object to a global variable you want to access
<dbotton> if you are talking about something you designed
<dbotton> So as show on the reddit video I published
<dbotton> you hit the text button to compile the panel, that places in whatever package the panel is assigned to, by default clog-user, and there is a function now there create-name-of-panel, so you can run (clog-repl) then (create-name-of-panel *body*)
<dbotton> Hope that helps you, if not consider opening a tick on https://github.com/rabbibotton/clog
<dbotton> or discussion
<hashfunc11db> i think you might be misunderstanding me
<hashfunc11db> i'm trying to make a change to the actualy clog-builder software itself
<hashfunc11db> in the function ON-ATTACH-BUILDER-PAGE there this piece of code: (BOX (CREATE-PANEL-BOX-LAYOUT BODY :LEFT-WIDTH 0 :RIGHT-WIDTH 0 :TOP-HEIGHT 0 :BOTTOM-HEIGHT 0))
<hashfunc11db> CREATE-PANEL-BOX-LAYOUT takes BODY as an argument
<hashfunc11db> after clog-builder is up and running how can i access this BODY argument that was passed around?
<hashfunc11db> like is there something like this (using psuedo-code as an example)? (GET-BODY :connection-id 123)
<hashfunc11db> or (GET-BODY :connection-id (GET-LAST-OPENED-CONNECTION))
<dbotton> that is what I described you would have to pass out the body from with in the code, we can use clog-user:*body* since already define, some place in the code so say on-new-builder - you could add (setf clog-user:*body* body)
<dbotton> then in the repl could play with *body*
<dbotton> It would not be terribly difficult to add such a function based on connection-id, if really want add a ticket for it, I'll get it in today or tomorrow
<dbotton> but I think just assigning what you want to a global more flexible and realistic in use
<hashfunc11db> ok thanks
yauhsien has joined #commonlisp
hashfunc11db has quit [Ping timeout: 260 seconds]
yauhsien has quit [Ping timeout: 240 seconds]
notzmv has joined #commonlisp
Krystof has quit [Ping timeout: 276 seconds]
azimut has joined #commonlisp
varjag has joined #commonlisp
lottaquestions has quit [Remote host closed the connection]
varjag has quit [Ping timeout: 255 seconds]
karlosz_ has joined #commonlisp
karlosz__ has joined #commonlisp
karlosz_ has quit [Ping timeout: 268 seconds]
karlosz__ has quit [Ping timeout: 268 seconds]
karlosz_ has joined #commonlisp
karlosz_ has quit [Ping timeout: 240 seconds]
azimut has quit [Ping timeout: 268 seconds]
azimut has joined #commonlisp
gxt_ has quit [Ping timeout: 268 seconds]
gxt_ has joined #commonlisp
waleee has quit [Ping timeout: 255 seconds]
karlosz_ has joined #commonlisp
yauhsien has joined #commonlisp
yauhsien has quit [Ping timeout: 260 seconds]
<jmes> I need to decide which function to call with which args based on some predicates. The simplest way is to have a cond clause for each function call. But in my case there is always overlap in the args so it's ugly to have that repetition.
<jmes> e.g. (fn1 a d) or (fn2 a b d) or (fn3 a b c d)
<jmes> also I might have the case where fn3 and fn4 share the same args
<jmes> I want to improve on this without losing performance as I'm going to be making this decision in a loop
Volt_ has quit [Quit: ]
<jmes> I figured this is something really obvious to a real lisper (not me)
<beach> If the argument forms are all variables, you can't do much better.
<beach> If all the arguments are the same, you could do (funcall (cond ...) a b c d) but you may lose some performance that way.
<beach> If some arguments are compound forms, but all those compound forms should always be evaluated, you can turn them into variables using LET.
<beach> If some arguments are compound forms and should be evaluated only in some of the cases, then there is not much you can do I think.
<jmes> beach: thanks for the insight. I did have one approach where I was building parts of the arg list using cons in a progn in the cond, then NCONCing them when calling the chosen function. I think it's the same time complexity based on some measurments, but just as it sounds, it's not really any less ugly.
hineios6 has joined #commonlisp
<beach> Such a strategy will almost certainly worsen the performance.
hineios has quit [Ping timeout: 264 seconds]
hineios6 is now known as hineios
<jmes> It did, but only by a constant amount
<beach> I was referring to "I want to improve on this without losing performance".
<jmes> Yeah, that's why I didn't like that route
<jmes> Anyway, thanks again. I'll stick with the simple cond for now :)
<beach> Sure. Good luck!
yauhsien has joined #commonlisp
contrapunctus has quit [Ping timeout: 268 seconds]
contrapunctus has joined #commonlisp
masinter has joined #commonlisp
yauhsien has quit [Ping timeout: 268 seconds]
causal has quit [Quit: WeeChat 3.5]
igemnace has joined #commonlisp
varjag has joined #commonlisp
varjag has quit [Ping timeout: 268 seconds]
<qhong> Is there a way to do syntax-rule/Wright-Cartwright-Shinn style ellipsis pattern matching in CL (without reinventing a whole new pattern matching macro?)
<qhong> (match '((1 2) (3 4) (5 6)) (((a b) ...) (values a b))) => (1 3 5) (2 4 6)
<hayley> You could perhaps add it to a pattern matching library like Trivia, but I'm not sure how one would compile an ellipsis pattern.
<qhong> It need recursion/loop which does not exist in Trivia's combinator language and I don't see a way to add it...
<qhong> It's definitely compilable though. You just need to compile patterns to DATA->ENVIRONMENT then it's pretty obvious how to express ellipsis (see the original Macro By Example paper).
<hayley> Right. I don't think ellipsis appears in ML-style matching, which is what all the fancy algorithms are written for.
<hexology> in this (admittedly somehwat silly) package https://gitlab.common-lisp.net/frideau/lambda-reader/-/blob/master/lambda-reader.lisp , what's the advantage of using a reader macro instead of a just `(defmacro λ (formals &body body) `(lambda ,formals ,@body))` ?
<hayley> There is an example showing you can use a λ form as a function name in the first element of a list, much like you can use a LAMBDA form.
<beach> But then they are not forms are they? :)
shka has joined #commonlisp
<qhong> hayley: Hmm, I think I can actually hack ellipsis into Trivia. I can expand (pat ...) into MAPCARing `(lambda (x) (trivia:match x (,pat (list ,(free-vars pat))))) over current input, then a sequence of trivia:guard1 (according to (free-vars pat)) to bind the results back into the outer trivia:match
<qhong> what a hack
<Nilby> srfi 204 looks nice. now i'm wishing for a CL port
<beach> hexology: The first element of a compound form is itself not a form, i.e., it is not evaluated like everything else. So you can't put a macro call as the first element of a compound form.
<beach> ... which is what hayley likely tried to communicate.
<hexology> ah, so my version wouldn't work with ((λ () 1)) but the reader macro would?
<beach> Right.
<hexology> thanks
<beach> Sure.
<Nilby> But do humans actually use lambda in the first position? It only seems useful in macro expansions.
<Nilby> I guess if you want to use λ everywhere, you have to allow for macros to use it in front.
<hexology> i've done it before in the repl, maybe not in "real" code
alvaro121 has joined #commonlisp
alvaro121_ has quit [Ping timeout: 244 seconds]
even4void has left #commonlisp [#commonlisp]
masinter has quit [Ping timeout: 272 seconds]
even4void[m] has joined #commonlisp
mon_aaraj has quit [Ping timeout: 255 seconds]
mon_aaraj has joined #commonlisp
frgo has joined #commonlisp
cage has joined #commonlisp
azimut has quit [Write error: Connection reset by peer]
gxt_ has quit [Write error: Connection reset by peer]
anticomputer has quit [Remote host closed the connection]
anticomputer has joined #commonlisp
azimut has joined #commonlisp
gxt_ has joined #commonlisp
pve has joined #commonlisp
mon_aaraj has quit [Ping timeout: 272 seconds]
gxt_ has quit [Remote host closed the connection]
gxt_ has joined #commonlisp
Posterdati has joined #commonlisp
azimut has quit [Remote host closed the connection]
azimut has joined #commonlisp
anticomputer has quit [Quit: quit]
anticomputer has joined #commonlisp
Inline has quit [Quit: Leaving]
frgo has quit [Ping timeout: 276 seconds]
Inline has joined #commonlisp
jmdaemon has quit [Ping timeout: 264 seconds]
azimut has quit [Remote host closed the connection]
azimut has joined #commonlisp
akoana has quit [Quit: leaving]
glaucon has joined #commonlisp
dBc has joined #commonlisp
Everything has joined #commonlisp
Dynom_ has joined #commonlisp
Dynom_ is now known as Guest9867
lisp123 has joined #commonlisp
azimut has quit [Ping timeout: 268 seconds]
azimut has joined #commonlisp
notzmv has quit [Ping timeout: 240 seconds]
<lisp123> any good libraries for symbolic algebra and basic manipulations (e.g. cancel common terms, factorise common terms)
Oddity has quit [Ping timeout: 240 seconds]
zachel has quit [Ping timeout: 272 seconds]
zachel has joined #commonlisp
modula has joined #commonlisp
defaultxr has quit [Ping timeout: 272 seconds]
frgo has joined #commonlisp
modula is now known as defaultxr
<qhong> lisp123: my own practice: if I need something more complicated like polynomial factorizations, I load MAXIMA as a library and call if from Lisp; if I really just need some basic simplification, I have a set of home-grown routines for each function symbols (+ - * / min max …) and basically recursively dispatch and call the routine on your input term
<qhong> just getting some simplification is not that hard. BTW I always use MAXIMA as a CL library and never used its frontend — I think it’s the way it should be used!
nij- has joined #commonlisp
<nij-> Is there any project that uses common lisp to hack ANKI?
lisp123 has quit [Remote host closed the connection]
lisp123 has joined #commonlisp
<lisp123> qhong: Thanks. That's some food for thought! Using maxima as a back-end could supercharge what I'm doing
zachel_ has joined #commonlisp
zachel has quit [Ping timeout: 240 seconds]
aartaka has quit [Ping timeout: 268 seconds]
aartaka has joined #commonlisp
lisp123 has quit [Remote host closed the connection]
Inline has quit [Remote host closed the connection]
Inline has joined #commonlisp
notzmv has joined #commonlisp
glaucon has quit [Quit: Leaving.]
* |3b| likes alexandria's idea of numerical stability: (a:lerp 0.1 717d0 717d0) -> 716.9999839738011d0 :/
<_death> what if you use 1.0d0 instead of 1.0 in the definition
<_death> (or 0.1d0 in your call form)
* |3b| also doesn't appreciate it using 1.0 for no reason. if i give it integers, give back a rational, and if i use mixed rationals and doubles, don't mix in some singles
<|3b|> and if i use singles, give back singles
mon_aaraj has joined #commonlisp
<|3b|> 0.1d0 returns 717.0000000000001d0 which is slightly less wrong
szkl has quit [Quit: Connection closed for inactivity]
<_death> the complexity of lerp is FP-hard ;)
lisp123 has joined #commonlisp
<|3b|> yeah :/
pjb has quit [Ping timeout: 276 seconds]
lisp123 has quit [Remote host closed the connection]
glaucon has joined #commonlisp
azimut has quit [Quit: ZNC - https://znc.in]
azimut has joined #commonlisp
azimut has quit [Quit: ZNC - https://znc.in]
zachel_ has quit [Ping timeout: 268 seconds]
azimut has joined #commonlisp
zachel has joined #commonlisp
prokhor_ has quit [Read error: Connection reset by peer]
prokhor_ has joined #commonlisp
azimut has quit [Client Quit]
attila_lendvai has joined #commonlisp
frgo has quit [Remote host closed the connection]
frgo has joined #commonlisp
azimut has joined #commonlisp
son0p has quit [Ping timeout: 264 seconds]
prokhor has joined #commonlisp
knusbaum has quit [Quit: ZNC 1.8.2 - https://znc.in]
knusbaum has joined #commonlisp
prokhor__ has quit [Ping timeout: 240 seconds]
prokhor_ has quit [Ping timeout: 276 seconds]
prokhor has quit [Ping timeout: 276 seconds]
dBc has quit [Quit: leaving]
anticomputer_ has joined #commonlisp
anticomputer has quit [Quit: quit]
gxt_ has quit [Ping timeout: 268 seconds]
gxt_ has joined #commonlisp
causal has joined #commonlisp
ebrasca has joined #commonlisp
mon_aaraj has quit [Ping timeout: 272 seconds]
<pve> Hi, there is apparently something I'm not getting about how defsetf works. I'm trying to make my own "getf", but it doesn't work. Here's what I have:
<pve> oh the defmethod should be defun - fixed
<pve> so I would like A in the let expression to get updated with the new list
mon_aaraj has joined #commonlisp
<pve> now I'm not looking for the correct solution (at least not now :) just a nudge in the right direction so I can figure it out on my own
<Nilby> pve: I'm pretty sure with prop and set-prop you can just use the simple form of defsetf
<pve> Nilby: but update-fn should return the new value, no?
<pve> so I think the head of the list will be lost
<Nilby> the "short form" does that for you
<pve> hm, it says update-fn can be a macro.. is that the secret?
<pve> oh
<Mrtn[m]> pve: Shhh ... 😇
<mfiano> |3b|: That property only holds when (minusp (* a b)) for that algorithm.
yauhsien has joined #commonlisp
<mfiano> If you want that to produce 717d0, you can opt for the "unstable" method, but then you might not ever reach point b when t=1
nij- has left #commonlisp [Using Circe, the loveliest of all IRC clients]
<|3b|> mfiano: i just added a special case for lerp between the same value in my code
<mfiano> In retrospect, I wish I never made that change to alexandria
<mfiano> I prefer the other method :)
<|3b|> pve: looks like short form of defsetf with a macro for update-fn might be only way to do what you want with defsetf
<|3b|> long form is specified to gensym the LIST argument, so modifying it won't affect the outer binding, and similarly a function in short form can't modify it
glaucon has quit [Quit: Leaving.]
glaucon has joined #commonlisp
<Nilby> (defsetf prop set-prop) is the easy way, but (defsetf prop (list property) (new-value) `(setf (getf ,list ,property) ,new-value)) also works. The the you have to modify is new-value, but you could do it the extra long way and make set-prop a macro
<pve> |3b|: yup, if I change set-prop to a macro it works as expected. I guess I thought the long form was strictly more general than the short form
<pve> thanks all
<|3b|> pve: define-setf-expander is probably the strictly more general one :)
<pve> Nilby: ah, so my mistake was making the new binding..
<|3b|> short and long-form of defsetf are more general in different ways
<Nilby> pve: yes
<|3b|> Nilby: are you sure that works?
<|3b|> (setf (prop a :f) 2) expands to (LET* ((#:LIST A) (#:NEW1 2)) (SETF (GETF #:LIST :F) #:NEW1)), so the (setf getf) can't affect the original A
<|3b|> (on sbcl, but spec says it should behave that way)
yauhsien has quit [Ping timeout: 268 seconds]
<|3b|> though it also says the temporaries are optimized out where possible, so maybe sbcl is wrong
anticomputer_ has quit [Ping timeout: 268 seconds]
<Nilby> it works because (setf (getf list …) …) really modifies the list
<|3b|> (setf (getf #:list )) modifies the binding #:list, but doing so doesn't modify the binding A, even if the value of A is stored in #:LIST
<|3b|> (setf getf) only modifes the contents of the list instead of the binding when the list already contains the property indicator
waleee has joined #commonlisp
anticomputer has joined #commonlisp
<Nilby> heh, i guess you're right, it only works because it's a plist
<|3b|> so the question is whether the spec requires DEFSETF to optimize out #:list in that case
pjb has joined #commonlisp
<|3b|> "During the evaluation of the forms, the variables in the lambda-list and the store-variables are bound to names of temporary variables..." but "defsetf arranges for the temporary variables to be optimized out of the final result in cases where that is possible."
<Nilby> so if it wasn't a plist you'd have to (defsetf prop (list property) (new-value) `(setf ,new-value (setf (getf ,list ,property) ,new-value)))
<|3b|> you are required to return the value assigned, so can't change new-value
<|3b|> and it isn't because it is a plist, it is because it can modify a value in place if the key already exists, but if it doesn't it has to add it to the front which requires changing the binding
<|3b|> (it could theoretically add it in the middle, but you still lose if passed NIL which has no middle)
<Nilby> this makes a great trick question
<|3b|> this is one of those places where it matters that lists don't actually exist :/
<pve> Nilby: sadly, I would not have passed the defsetf exam :)
<pve> maybe now I'm a bit wiser
<|3b|> similarly if you wanted to implement something like (setf logbitp), it would need to modify bindings and have the same problem
lucyy has joined #commonlisp
<|3b|> since numbers also don't actually exist
mon_aaraj has quit [Ping timeout: 240 seconds]
mon_aaraj has joined #commonlisp
<|3b|> and for the record, (setf logbitp) also doesn't exist in the spec, only as an implementation extension in some implementations, so don't use it in portable code.
* |3b| used "like" there because conforming code can't define it, only define something like it
ebrasca has quit [Ping timeout: 268 seconds]
lucyy has quit [Remote host closed the connection]
prokhor has joined #commonlisp
son0p has joined #commonlisp
yauhsien has joined #commonlisp
Guest88 has joined #commonlisp
azimut has quit [Ping timeout: 268 seconds]
<cosimone> hello, does anyone know about an existing cl library to generate boxplots? i already use vgplot for regular plots, and i know that gnuplot supports boxplots, but sadly vgplot doesn't (yet) have dedicated functions for them
<beach> What is a boxplot?
<cosimone> a statistical plot of this form https://en.wikipedia.org/wiki/Box_plot
<beach> Ah, OK. Thanks!
yauhsien has quit [Ping timeout: 276 seconds]
tyson2 has joined #commonlisp
ebrasca has joined #commonlisp
orestarod has joined #commonlisp
tyson2 has quit [Remote host closed the connection]
<|3b|> mfiano: (+ (* v b) (- a (* a v))) maybe?
<mfiano> For what?
<|3b|> for more stable lerp
Everything has quit [Quit: leaving]
<mfiano> Well the two widely known methods are more stable in different ways. It's a tradeoff. I'm not sure where that math sits
<|3b|> yeah, it's probably wrong for some 3rd situation :p
tyson2 has joined #commonlisp
frgo has quit [Read error: Connection reset by peer]
vassenn has joined #commonlisp
masinter has joined #commonlisp
orestarod has quit [Quit: Leaving]
igemnace has quit [Quit: WeeChat 3.6]
igemnace has joined #commonlisp
igemnace has quit [Remote host closed the connection]
yauhsien has joined #commonlisp
igemnace has joined #commonlisp
yauhsien has quit [Ping timeout: 240 seconds]
Lord_of_Life has quit [Ping timeout: 276 seconds]
Lord_of_Life has joined #commonlisp
Oddity has joined #commonlisp
masinter has quit [Ping timeout: 272 seconds]
jmdaemon has joined #commonlisp
frgo has joined #commonlisp
attila_lendvai has quit [Ping timeout: 244 seconds]
Josh_2 has joined #commonlisp
<Josh_2> Hi :sunglasses:
tyson2 has quit [Ping timeout: 255 seconds]
vassenn has quit [Quit: Good bye!]
tyson2 has joined #commonlisp
notzmv has quit [Ping timeout: 240 seconds]
orestarod has joined #commonlisp
perrierjouet has quit [Quit: WeeChat 3.6]
perrierjouet has joined #commonlisp
yauhsien has joined #commonlisp
cage has quit [Quit: rcirc on GNU Emacs 27.1]
masinter has joined #commonlisp
Guest88 has quit [Quit: Client closed]
yauhsien has quit [Ping timeout: 264 seconds]
knusbaum has quit [Quit: ZNC 1.8.2 - https://znc.in]
knusbaum has joined #commonlisp
frgo has quit [Remote host closed the connection]
nij- has joined #commonlisp
<nij-> Are there any project that lets us to call a JS engine from CL? Something like py4cl (but py->js).
<nij-> I'm not asking for a transpiler, but rather I want the CL runtime and the JS runtime (browser?) to interact with each other.
<pjb> nij-: if the CL runtime can run on the server, then the usual tools, like WebSockets, or AJAX, etc.
<nij-> ?
<nij-> (Oh also, I'm not asking for embedding CL in JS.)
frgo has joined #commonlisp
frgo has quit [Read error: Connection reset by peer]
mon_aaraj has quit [Read error: Connection reset by peer]
Inline has quit [Quit: Leaving]
Inline has joined #commonlisp
<Josh_2> There is cl-webkit
<Josh_2> But I guess thats for executing js
<Josh_2> There is jscl
igemnace has quit [Remote host closed the connection]
<nij-> jscl is a compiler, not a caller
<nij-> cl-webkit doesn't call js from cl either)
frgo has joined #commonlisp
karlosz has quit [Ping timeout: 252 seconds]
karlosz_ is now known as karlosz
frgo has quit [Read error: Connection reset by peer]
Guest9867 has quit [Quit: WeeChat 3.5]
aartaka has quit [Ping timeout: 268 seconds]
<contrapunctus> nij-: what's the purpose?
thuna` has quit [Remote host closed the connection]
frgo has joined #commonlisp
thuna` has joined #commonlisp
frgo has quit [Read error: Connection reset by peer]
notzmv has joined #commonlisp
masinter has quit [Ping timeout: 240 seconds]
<nij-> contrapunctus To develop webs in my favorite lang and implementation (SBCL).
<contrapunctus> nij-: ah...CLOG perhaps?
<nij-> contrapunctus But I'd like to hack website that's made and running in my browser already.
<dbotton> nij you can hack existing sites with CLOG - you just add boot.js and have full access CLOG style to the page
<nij-> dbotton !!
<nij-> Add boot.js to where? Is there a tutorial on this. That's super cool!
<dbotton> one sec is one of the standard ones'\
<nij-> Wooow, I'm so excited now <3
<contrapunctus> nij-: there's also Reblocks (fork of Weblocks), which IIUC has the same aims and architecture as CLOG - https://40ants.com/reblocks/
<dbotton> nij 11
<dbotton> <contrapunctus> no totally different architecture
<nij-> 11?
<dbotton> and even goals different
<dbotton> tutorial 11
<dbotton> - 11-tutorial.lisp - Attaching to existing HTML
<dbotton> (clog:run-tutorial 11)
<dbotton> redblocks is a nice web framework
<dbotton> but in the traditional sense
<dbotton> html / page based
<dbotton> CLOG is screen / gui app based
<nij-> <3 dbotton I will take a look. Thank you very much <3
<dbotton> nij if you look at the source of any .clog file you produce with builder there is a working example of attaching to html - you design the builder page and html is output as a single block when you show a panel, then the generated code attaches to the existing html
frgo has joined #commonlisp
<dbotton> the basic idea for an existing html page, is that you use attach-as-child and pass it the html-id and now you can set events, manipulate the element etc
frgo has quit [Read error: Connection reset by peer]
<dbotton> boot.js just establishes the websocket connection that makes all that possible
<dbotton> enjoy!
<nij-> what's a websocket connection? same thing when I use localhost to talk to slynk?
<dbotton> nij, went back to your previous lines of conversation, CLOG is exacgly what you are talking about
<nij-> I think so. Heard of great words about it several times. And today is when it really hit me. Thanks :)
<dbotton> CLOG works but using websockets (well for "webpages' it also uses html so can be googled)
<dbotton> you serve a page that has boot.js - blank or with pre-existing html
<dbotton> then your Lisp code can dynamically do anything to the page
<dbotton> add html, manipulate it, execute JS etc
<dbotton> CLOG also provides a gtk like Api
<nij-> They are not using HTTP nor linux pipe. I never heard of that. Will google :)
anticomputer has quit [Ping timeout: 268 seconds]
<dbotton> so you don't have to know or use html or js
shka has quit [Ping timeout: 244 seconds]
<dbotton> It uses http partly
<dbotton> but html5 provides a way to establish a live connection to a server called websockets
anticomputer has joined #commonlisp
gxt_ has quit [Ping timeout: 268 seconds]
<nij-> I see
<dbotton> give it a try and run through the tutorials and demos
<dbotton> you will enjoy, is a very different experience in web programming vs web authoring
<nij-> Indeed, I'm in that tutorial <3
<nij-> I wonder why nyxt doesn't use clog :(
<nij-> It uses parenscript instead, which is a very limited sub-lisp..
<nij-> dbotton That also means I can setup a keybinding in my fav browser, which injects boot.js.. and I can hack whatever webpage on the fly...... in common lisp...... I'm dead.
frgo has joined #commonlisp
<dbotton> Hmm not so fast
gxt_ has joined #commonlisp
<dbotton> Security restrictions will not allow websockets from different domain
<dbotton> Maybe be possible it if you own the browser
<dbotton> Nyxt is much older than CLOG
<dbotton> But in theory it could work
<dbotton> nij-: clog is more for authoring and manipulating your own content
<dbotton> But if get it working let me know :)
glaucon has quit [Read error: Connection reset by peer]
masinter has joined #commonlisp
<nij-> "Security restrictions will not allow websockets from different domain" what do you mean by this? Who is the one that disallows?
[deleted] has joined #commonlisp
<pjb> nij-: the websocket server.
livoreno has quit [Ping timeout: 240 seconds]
<Bike> that's just same-origin policy, right
<pjb> nij-: with the help of the browser who will snitch you to the server.
<pjb> Bike: yes.
ebrasca has quit [Ping timeout: 260 seconds]
<nij-> And, usually, it's the browser who owns the websocket server? And that's why if my browser is hackable enough, there's a chance of workaronud?
frgo has quit [Read error: Connection reset by peer]
<dbotton> yes same-origin policy
akoana has joined #commonlisp
jmdaemon has quit [Quit: ZNC 1.8.2 - https://znc.in]
jmdaemon has joined #commonlisp
jealousmonk has joined #commonlisp
orestarod has quit [Ping timeout: 260 seconds]
Inline has quit [Remote host closed the connection]
masinter_ has joined #commonlisp
Inline has joined #commonlisp
masinter has quit [Ping timeout: 268 seconds]
<nij-> dbotton WOOOW I went through all the tutorials! It's truly amazing <3 Thanks for making my day!
<nij-> Two questions! (1) After I run (open-browser), the repl doesn't return until I close the browser. How then can I change the lisp code on the fly, and see it changes in the browser? (Or is that impossible?)
<dbotton> never saw that behavior
<dbotton> what platform?
<nij-> (2) Suppose I've written a website with CLOG, with an expensive lisp backend, and I want to compile the lisp code.. how would I ship my website as a whole? Do my users need to have a lisp installed in their computer?
<dbotton> if that is case though don't run open browser, instead just point your browser to the server http://127.0.0.1:8080
<nij-> It did open the browser, and I can interact with the browser. The reason I asked (1) is that CL is great in interactive development. So I wonder if I can interact with the browser from the repl too.
<dbotton> this would create a stand alone application - (ql:quickload :clog/tools) (sb-ext:save-lisp-and-die #P"./builder" :toplevel (lambda () (clog-tools:clog-builder)(loop (sleep 10))) :executable t :compression t)
<dbotton> you would still need to provide (if you use) your www directory with any resources you need to provide
<dbotton> (you would do that in sbcl at the command line)
<dbotton> Similar exists for ecl
<nij-> Gotcha for (2)! Thanks :)
<dbotton> So no you don't have to deliver your source, and they don't have to install sbcl or ecl
<nij-> For (1) still, suppose I want to change the def of #'on-new-window on the fly in the lisp repl, and see the browser updates on the fly too. Is it possible?
<nij-> (2) But it also means when the user loaded the page, it's going to download a binary that's >40MB :D :D!
<dbotton> so 1 - use instead 'on-new-window not #' so this way it looks up each browser refresh
<nij-> hmm.. ok
<dbotton> also if the place you update is the on-new-window handler you need to refresh your browser, however other parts of the system, you would just need to recompile and say click again
<dbotton> or see the changes in place etc
<dbotton> as for binary size, I think on my mac it is 8 meg with laters sbcl
<dbotton> latest
<dbotton> and there are techniques to get tighter smaller binaries, if speed less of an issue, ecl creates much smaller binaries
<dbotton> the common lisp cook book (on line) has help for that
gxt_ has quit [Remote host closed the connection]
anticomputer has quit [Remote host closed the connection]
pve has quit [Quit: leaving]
anticomputer has joined #commonlisp
gxt_ has joined #commonlisp
<dbotton> not sure understand 2 part you wrote, going to download - normally no user would download your lips code on browsing your content
paul0 has joined #commonlisp
Inline has quit [Quit: Leaving]
elderK has joined #commonlisp
EsoAlgo has joined #commonlisp
<nij-> Got it. :)
causal has quit [Quit: WeeChat 3.5]
thuna` has quit [Remote host closed the connection]
robin has quit [Ping timeout: 244 seconds]