p_l changed the topic of #lisp to: Common Lisp, the #1=(programmable . #1#) programming language | <https://irclog.tymoon.eu/freenode/%23lisp> <https://irclog.whitequark.org/lisp> <http://ccl.clozure.com/irc-logs/lisp/> | ASDF 3.3.4
FreeBirdLjj has joined #lisp
heisig has quit [Quit: Leaving]
dxtr has quit [Ping timeout: 256 seconds]
FreeBirdLjj has quit [Ping timeout: 246 seconds]
catchme has quit [Excess Flood]
catchme has joined #lisp
jprajzne has quit [Quit: jprajzne]
jprajzne has joined #lisp
jprajzne has quit [Client Quit]
jprajzne has joined #lisp
Josh_2 has quit [Ping timeout: 240 seconds]
MerlinTheWizard has quit [Ping timeout: 260 seconds]
orivej_ has joined #lisp
orivej has quit [Ping timeout: 272 seconds]
lucasb has quit [Quit: Connection closed for inactivity]
stereosphere has joined #lisp
Lord_of_Life_ has joined #lisp
Lord_of_Life has quit [Ping timeout: 260 seconds]
Lord_of_Life_ is now known as Lord_of_Life
pjb has quit [Ping timeout: 272 seconds]
FreeBirdLjj has joined #lisp
orivej has joined #lisp
orivej_ has quit [Ping timeout: 272 seconds]
FreeBirdLjj has quit [Ping timeout: 272 seconds]
MerlinTheWizard has joined #lisp
msk has quit [Remote host closed the connection]
msk has joined #lisp
pjb has joined #lisp
bhartrihari has left #lisp ["Disconnected: Replaced by new connection"]
bhartrihari has joined #lisp
MerlinTheWizard has quit [Ping timeout: 260 seconds]
bitmapper has quit [Ping timeout: 256 seconds]
marusich has quit [Quit: Leaving]
orivej has quit [Ping timeout: 256 seconds]
bhartrihari has left #lisp ["Disconnected: closed"]
shifty has joined #lisp
shifty has quit [Ping timeout: 258 seconds]
shifty has joined #lisp
dale_ has joined #lisp
dale has quit [Disconnected by services]
dale_ is now known as dale
dale_ has joined #lisp
dale has quit [Disconnected by services]
dale_ is now known as dale
v3ga has quit [Ping timeout: 260 seconds]
<White_Flame> drmeister: kebab-style vs snake_case vs camelCase vs probably other animal & food related ones
akoana has left #lisp ["Leaving"]
gxt__ has quit [Remote host closed the connection]
EvW has quit [Ping timeout: 244 seconds]
toorevitimirp has joined #lisp
gxt__ has joined #lisp
lalilulelo has joined #lisp
lalilulelo has quit [Max SendQ exceeded]
<pjb> drmeister: I object to this name for lisp style.
arpunk has quit [Remote host closed the connection]
Oladon has joined #lisp
msk has quit [Read error: Connection reset by peer]
msk has joined #lisp
ag` has joined #lisp
ag` has left #lisp [#lisp]
ag` has joined #lisp
<ag`> Hi. Total noob here. Can someone help me to get (format) right. I need something like this (format nil "first item ~second ~first" "1st" "2nd")
<ag`> Basically I need to get nth item either from a given list or the arguments
<Bike> i'm not sure i understand. could you give an example of a format call with arguments and what you'd like to see output. without the format string, of course, if you don't know how to write it
<ag`> Let's say I have a list ("1st" "2nd" "3d",,, etc) I want a string (using (format)) that interpolates arbitrary nth element, something like this: "second item is 2nd first is 1st" ... etc
<ag`> If I say I need a string that iterates through the elements, that's straightforward, but I need to "pick" nth element from the list
Aurora_v_kosmose has quit [Quit: Пока, мир.]
<Bike> okay, but what would the call look like? (format nil string-goes-here '("1st" "2nd" "3rd") 2 1)?
<Bike> well, format doesn't really do counting anyway, at least not in any way that would work for what i think you're thinking of
<ag`> I don't really care the call may look like (format nil string-goes-here "1st" "2nd" "3d") or (format nil string-goes-here '("1st" "2nd" "3d"))
<Bike> and in that case it would print "first item is 1st second item is 2nd third item is 3d"?
<Bike> How does the "picking" enter there?
<ag`> That's what I meean. If I ask to grab elements in order i.e.: through iterating the list - that's straightforward.
<ag`> but the string may go like this "fist ~1, second ~2, and first again ~1"
<Bike> oh. oh oh. if i understand you correctly,
<Bike> clhs ~*
<Bike> should do it
<ag`> damn... format is sooooo confusing
<ag`> I just started playing with CL, and I LOVE it but having to deal with (format) magic makes me feel stupid.
<Bike> well, it's another language.
ech has quit [Ping timeout: 265 seconds]
<ag`> can you show me an example where something like ~n* is used? I don't get this shit like at all
<Bike> (format nil "first is ~a, second is ~a, first again is ~0@*~a" "harpsichord" "VASIMR") => "first is harpsichord, second is VASIMR, first again is harpsichord"
<beach> Good morning everyone!
<ag`> @Bike holy shit... this is pure magic... so I understand that ~0@* goes to the first argument, but why do you need ~a right after it?
<ag`> ah... I see it now... it's basically like a "pointer".. it just moves it into the position
<Bike> right, it doesn't print an argument itself.
<ag`> OMG
<ag`> cool.. awesome. Thanks!
<Bike> no problem
ag` has quit [Quit: ERC (IRC client for Emacs 28.0.50)]
hvxgr has quit [Quit: Lost terminal]
_whitelogger has joined #lisp
_whitelogger has joined #lisp
farooqkz__ has joined #lisp
MerlinTheWizard has joined #lisp
farooqkz__ has quit [Ping timeout: 264 seconds]
MerlinTheWizard has quit [Remote host closed the connection]
pjb has quit [Ping timeout: 272 seconds]
_paul0 has joined #lisp
paul0 has quit [Ping timeout: 272 seconds]
catchme has quit [Quit: Connection closed for inactivity]
azimut has quit [Remote host closed the connection]
azimut has joined #lisp
pjb has joined #lisp
Bike has quit [Quit: leaving]
gko has joined #lisp
<stylewarning> Nice harpsichord
dddddd has quit [Ping timeout: 272 seconds]
lerax has joined #lisp
jesse1010 has quit [Ping timeout: 258 seconds]
Bourne has joined #lisp
bhartrihari has joined #lisp
bhartrihari has left #lisp ["Disconnected: Replaced by new connection"]
bhartrihari has joined #lisp
FreeBirdLjj has joined #lisp
bhartrihari has left #lisp ["Disconnected: Replaced by new connection"]
bhartrihari has joined #lisp
SGASAU has quit [Remote host closed the connection]
bhartrihari has left #lisp ["Disconnected: Replaced by new connection"]
SGASAU has joined #lisp
bhartrihari has joined #lisp
v3ga has joined #lisp
froggey has quit [Ping timeout: 256 seconds]
toorevitimirp has quit [Ping timeout: 260 seconds]
froggey has joined #lisp
<v3ga> so for anyone with strong common lisp and clojure experience what do you like about common lisps repl opposed to clojure?
toorevitimirp has joined #lisp
<v3ga> I ask because I mostly deal with clojure but I do like the books that deal with common lisp but I don't feel i've experienced enough to say what it is that feel different about the development process
mibr has joined #lisp
<beach> v3ga: The channel ##lisp is probably better for comparisons like that. This channel is dedicated to Common Lisp.
<beach> v3ga: But feel free to ask specific questions about Common Lisp if you want.
_whitelogger has joined #lisp
<beach> Also, as I understand it, Clojure is a functional programming language, but Common Lisp is a multi-paradigm language with a strong object-oriented paradigm possible. So I am guessing that the comparison is going to be more than just about the REPL.
andrei-n has joined #lisp
toorevitimirp has quit [Remote host closed the connection]
<no-defun-allowed> The more developed condition system in Common Lisp allows one to handle some errors in a Common Lisp REPL in a nicer way than with some other language implementations' REPLs.
toorevitimirp has joined #lisp
stereosphere has quit [Quit: KVIrc 4.2.0 Equilibrium http://www.kvirc.net/]
<no-defun-allowed> One small example is that if I made a mistake in a file in an ASDF system, the debugger would present me with some restarts, including trying to recompile the file. I could then fix my mistake and invoke that restart.
Jeanne-Kamikaze has quit [Quit: Leaving]
<no-defun-allowed> The object system also has a protocol for updating instances for redefined classes, so "hot reloading" a program is much less difficult.
<v3ga> beach: ahh well then also i'd like to ask which is preferable for working through how to design programs. racket or would i be safe with guile?
Aurora_v_kosmose has joined #lisp
<beach> v3ga: Again, this channel is for Common Lisp.
<v3ga> no-defun-allowed: hmm thats what I felt I was getting closer to. Again I only toyed with it for a short period but it felt like it would be a great debugging tool.
<beach> v3ga: Common Lisp with its object system is a great tool for designing modular and extensible code.
<beach> v3ga: In fact, in many situations it turns out that auxiliary methods are necessary in order to avoid breaking an API while still allowing for significant updates to the implementation.
<v3ga> beach: i'm slow. those both are Scheme. lol sorry. i'm reading a few books at once but i've been forcing examples to clojure though now i've decided to get my feet wet again
<beach> v3ga: So unless your other language choices have generic functions with auxiliary methods, I think Common Lisp is the best choice.
<beach> v3ga: Yes, I know that Guile and Racket are both Scheme based.
<v3ga> well yeah for any projects I'd go CL from what i've seen. this is more so down time. Funny enough I had a cynical answer to someone asking what language they should use for task. After they mentioned that it was for learning purposes I asked them why not both. I suppose that answer fits my questions as well
farooqkz__ has joined #lisp
<beach> When I give talks to industry, I strongly advice against languages that do not have an independent standard. Common Lisp is one of the few languages that that do that. If a language does not have an independent standard, it can change at the whim of the person or organization that controls it, and your investment may be destroyed.
<beach> With Common Lisp, you also have several different, often very good, implementations available to you. You can then choose the implementation that corresponds to your needs, and if one implementation ceases to be maintained, you can choose a different one with very few problems.
<v3ga> beach: yeah, makes sense. I have sbcl at the moment installed. i suppose another annoyance but saving grace is you roll a lot of things togehther yourself.
<beach> Furthermore, while an independent frozen standard would be a disaster to traditional languages, this is not the case for Common Lisp, since the language itself is extensible through its macro mechanism.
<beach> v3ga: Like what?
<beach> v3ga: There are many libraries available for Common Lisp these days.
<v3ga> well as you said via macros...or your own dsl. it seems to be the same for most lisps where a library may no longer be updated but that seems to be beause it just works or you've molded your own toold over a period. i have no working experince there, that just seemed to be the case.
pjb has quit [Ping timeout: 272 seconds]
<beach> I mentioned the macro system because some people object that the standard is old. But that doesn't matter as much for Common Lisp as it does for other languages, since we do not have to wait for a new standard in order to get additional functionality.
<beach> But there are several good libraries (available in Quicklisp) that work for many of the popular Common Lisp implementations.
<beach> There is a lot less need to roll your own these days, depending on what you want to do of coruse.
<beach> course
<solrize> no-defun-allowed, v3ga hot reloading is one of erlang's marquee features but after a while i decided it was more trouble than it was worth, and i actually talked with joe armstrong (RIP) about it and he felt the same way. it's better to just launch the new version of the program separately and then transfer the active network connections etc from the old to the new. that's not trivial but it's how phone switches have traditionally worked for ages
Blukunfando has quit [Remote host closed the connection]
<solrize> SICL will be able to have sandboxed applications if i understand it right, so that might be a good setup for hot reloading that way
guicho has joined #lisp
<no-defun-allowed> I see. So far, I have had relatively few issues with updating at a function or class level.
shifty has quit [Ping timeout: 260 seconds]
pve has joined #lisp
pjb has joined #lisp
mangul has joined #lisp
<v3ga> solrize: yeah i'm familiar with it =P I read a bit on erlang when I played with scala years ago and actors.
farooqkz__ has quit [Ping timeout: 260 seconds]
Oladon has quit [Quit: Leaving.]
gaqwas has joined #lisp
hineios6 has joined #lisp
liberliver1 has joined #lisp
marusich has joined #lisp
hineios has quit [Ping timeout: 256 seconds]
hineios6 is now known as hineios
cosimone has joined #lisp
liberliver has quit [Ping timeout: 272 seconds]
liberliver1 is now known as liberliver
rgherdt has joined #lisp
FreeBirdLjj has quit [Remote host closed the connection]
FreeBirdLjj has joined #lisp
ldb has joined #lisp
ljavorsk has joined #lisp
<ldb> goot eveing
<no-defun-allowed> Hello ldb
<ldb> today i read about extensible effect handler
<ldb> which seems to be very close to condition system
<ldb> no-defun-allowed: hello
FreeBirdLjj has quit [Ping timeout: 260 seconds]
madnificent has joined #lisp
SGASAU has quit [Remote host closed the connection]
SGASAU has joined #lisp
<phoe> ldb: where is this from?
<ldb> it is called "extensible" because like condition system, unhandled effects are passed to upper level handlers.
niklasl has quit [Remote host closed the connection]
<no-defun-allowed> I thought the condition system does check "upper level handlers".
<beach> We need to do something about this ambiguous stack-direction terminology.
<beach> I can't imagine a stack of (say) plates growing "downward".
<no-defun-allowed> True.
<v3ga> hmm
<beach> We have to use two different words.
<no-defun-allowed> How about "I thought the condition system does check handlers that were bound earlier"?
mangul has quit [Ping timeout: 256 seconds]
<beach> Now, that I understand.
<solrize> that eff looks interesting
<solrize> dunno if i'd compare it to lisp conditions though
<no-defun-allowed> For example, (signal 'b ...) in (handler-bind ((b something)) (handler-bind ((a something-else)) (signal 'b ...)) would have an applicable handler from the outermost HANDLER-BIND form.
FreeBirdLjj has joined #lisp
ldb has quit [Ping timeout: 246 seconds]
ldb has joined #lisp
FreeBirdLjj has quit [Ping timeout: 244 seconds]
<phoe> no-defun-allowed: if I understand algebraic effects correctly, they *are* condition handlers, just wrapped in enough mathematics to make them implementable in Haskell and other strictly statically typed strictly functional languages.
<no-defun-allowed> Alright.
<phoe> Like, algebraic effects are to condition handlers what the IO monad is to #'write and #'read.
<phoe> ldb: thanks for the links, I'll write about them. How should I credit you in my book?
<ldb> phoe: Qifan Wang
<phoe> ldb: thanks.
gaqwas has joined #lisp
gaqwas has quit [Changing host]
DGASAU has quit [Read error: Connection reset by peer]
DGASAU has joined #lisp
cosimone has quit [Remote host closed the connection]
cosimone has joined #lisp
SGASAU has quit [Remote host closed the connection]
<ldb> ok, apple has break my shell somehow.
SGASAU has joined #lisp
FreeBirdLjj has joined #lisp
gravicappa has joined #lisp
FreeBirdLjj has quit [Ping timeout: 260 seconds]
bhartrihari has left #lisp ["Disconnected: Replaced by new connection"]
bhartrihari has joined #lisp
sdumi has quit [Ping timeout: 240 seconds]
ldb has quit [Ping timeout: 260 seconds]
ldb has joined #lisp
cosimone has quit [Remote host closed the connection]
sdumi has joined #lisp
cosimone has joined #lisp
shifty has joined #lisp
ljavorsk has quit [Ping timeout: 246 seconds]
oldtopman has joined #lisp
wxie has joined #lisp
anticrisis has quit [Read error: Connection reset by peer]
heisig has joined #lisp
oxum has joined #lisp
nicktick has joined #lisp
orivej has joined #lisp
<White_Flame> is it possible to compile new functions that can share the bindings in closures that are already compiled?
<White_Flame> eg (let ((count 0)) (defun next () (incf count))), then add more defuns that can access COUNT as directly as NEXT can
<White_Flame> after the fact
<beach> I don't see how that would be possible.
<phoe> not via any standard means
<White_Flame> closures are just that much more optimal, vs accessing dynamic bindings, that it would be nice for optimization to somehow wrangle that
<phoe> you'd need to extract locatives for that binding and then use these
<ldb> White_Flame: the most close thing I can think of is first class pointer
<ldb> or so called locatives
<phoe> and there's no locatives in CL other than via reader/writer closures
<White_Flame> right, but that wouldn't be direct access in terms of compiled cost to access them in the same way as the original defun
<White_Flame> well yeah, I use cons cells for poor man's locatives, as they tend to be the least overhead
<White_Flame> but then one has to pass them around etc, they aren't just ever-present on the function pointer like closure bindings are
<axion> You can imitate something similar with symbol macros. See "pandoric" macros from Let Over Lambda.
dale has quit [Quit: My computer has gone to sleep]
<ldb> acesss bindings in compiled closure breaks the abstraction that programming languages provide
<White_Flame> well, it wouldn't ideally be accessing from the outside, but rather putting a new function inside
<White_Flame> (which is unexpressable in pretty much every language, I'd guess)
orivej has quit [Quit: No Ping reply in 180 seconds.]
<White_Flame> I guess langs that have an eval that can see & close over the caller's lexical environment might be able to pull that off, but that is not lisp
<White_Flame> at least not CL
orivej has joined #lisp
pjb has quit [Ping timeout: 260 seconds]
<ldb> in many languages other than lisp, defining a global function inside a let binding is impossible
rixard has quit []
frgo has quit [Remote host closed the connection]
orivej_ has joined #lisp
frgo has joined #lisp
<aeth> I guess you could add a locative, but then that adds a layer of indirection and would remove a lot of the efficiency of the clsoure.
<aeth> The easiest way would probably be to use a symbol-macrolet instead of a let... does a top-level symbol-macrolet create a closure like let?
orivej has quit [Ping timeout: 272 seconds]
<aeth> But then you're not really restricting access except by convention... One of the good things about a lexical closure in CL is that it's one of the few ways to truly restrict access.
gareppa has joined #lisp
<aeth> Cons cells (or similar) are actually pretty clever because then you could have a %foo accessor and use this as the basis to copy the locative, which doesn't have to exist globally except as part of that accessor.
ldb has quit [Ping timeout: 264 seconds]
<White_Flame> well, what I'm seeing now (and smacking myself on the forehead abotu) is that the stuff I'm closing over really is mutating arrays & structures, so sharing the actual binding itself actually doesn't matter.
<aeth> White_Flame: Off the top of my head, you could do a LET containing conses (or 0D arrays or 1-elt vectors or 1-element structs, etc.) over a SYMBOL-MACROLET (to make them look like variables to the user functions, since this will probably be wrapped in a macro except for the &body) over DEFUNs/etc.
<White_Flame> since the binding doesn't change; it just points to a shared mutable composite
<White_Flame> and so multiple closures just simply share the same final reference, not binding
<aeth> White_Flame: This can be macro-generated including with an "inheritance" system done by calling a function that copies all of the LET bindings into new bindings (so the inherited setup would actually be LET over MULTIPLE-VALUE-BIND over SYMBOL-MACROLET over DEFUNs/etc.)
FreeBirdLjj has joined #lisp
<aeth> White_Flame: e.g. (define-global-closure give-it-a-name-for-the-inheritance-function (bindings-go-here) (inherit-from-parents-or-this-can-be-nil) ...) ; where "..." would be the DEFUNs/etc. and in those DEFUNs you would pretend that the bindings are variables instead of a CAR/AREF/etc. accessor because of symbol-macrolet.
<aeth> e.g. (define-global-closure foo ((bar 42) (baz 53) (quux 64)) () (defun foobar (x) (incf bar x))) (define-global-closure barfoo ((qwerty 75)) (foo) (defun decbar (x) (decf bar x)))
<aeth> With the caveat that this will be less efficient because of the indirection, both directly because of the indirection and because the compiler isn't smart enough to know that bar is going to remain a number.
ldb has joined #lisp
<aeth> White_Flame: and, yeah, if it's just arrays/lists/etc. anyway you don't need to do this, but this solution's perfectly general.
johntalent has joined #lisp
random-nick has joined #lisp
ldb has quit [Ping timeout: 264 seconds]
orivej_ has quit [Ping timeout: 256 seconds]
orivej has joined #lisp
dddddd has joined #lisp
FreeBirdLjj has quit [Remote host closed the connection]
sdumi has quit [Ping timeout: 272 seconds]
sdumi has joined #lisp
wxie1 has joined #lisp
wxie has quit [Remote host closed the connection]
wxie1 is now known as wxie
ldb has joined #lisp
pjb` has joined #lisp
orivej has quit [Ping timeout: 260 seconds]
orivej_ has joined #lisp
ldb has quit [Ping timeout: 258 seconds]
cosimone has quit [Quit: Quit.]
rixard has joined #lisp
bhartrihari has left #lisp ["Disconnected: closed"]
karlosz has quit [Quit: karlosz]
karlosz has joined #lisp
bhartrihari has joined #lisp
bhartrihari has left #lisp ["Disconnected: Replaced by new connection"]
bhartrihari has joined #lisp
ralt has quit [Quit: Connection closed for inactivity]
bhartrihari has left #lisp ["Disconnected: Replaced by new connection"]
ldb has joined #lisp
gareppa has quit [Quit: Leaving]
hvxgr has joined #lisp
tankman has joined #lisp
tankman has quit [Client Quit]
sdumi has quit [Ping timeout: 272 seconds]
ldb has quit [Ping timeout: 260 seconds]
sdumi has joined #lisp
pjb` has quit [Ping timeout: 260 seconds]
orivej_ has quit [Quit: No Ping reply in 180 seconds.]
orivej has joined #lisp
karlosz has quit [Quit: karlosz]
ldb has joined #lisp
ldb has quit [Ping timeout: 240 seconds]
orivej has quit [Quit: No Ping reply in 180 seconds.]
orivej has joined #lisp
ralt has joined #lisp
<ralt> White_Flame: not sure why you're not using a class instead
ldb has joined #lisp
<phoe> Somewhat-Lisp-related question. What would be a good example program where using dynamic bindings can greatly simplify code?
<phoe> Or show something that is otherwise hard to achieve without dynamic bindings?
<madnificent> phoe: Lik special variables?
<madnificent> s/lik/like/
<phoe> madnificent: yes
<madnificent> Extending unexpected things has been major for me with mu-cl-resources.
<madnificent> Such cases are possible, but super hard to do when you're not allowed to pass things through deep down.
ldb has quit [Ping timeout: 256 seconds]
<phoe> I don't want to depend on external libraries here; I want to write an example program where I demonstrate the things that dynamic bindings allow that would otherwise be hard.
<phoe> Which means that I need to figure out what that program would need to be, in the first place.
<madnificent> Say, for example, that somewhere deep down in the call stack you want some behaviour to be different, it gets super hard to pass that information through to the lower layers without having to re-architect the code.
<_death> RANDOM
<madnificent> A specific case we have this way is caching. I'll lay down what the issue there was, then we check if that works for you?
<phoe> _death: uhhhh?
<phoe> madnificent: OK
<_death> imagine if you had to explicitly pass down the random-state
<phoe> oooh, that is correct
<madnificent> mu-cl-resources gives you a jsonapi.org compliant response for data that is in a triplestore. It uses bindings for that. We want to cache the response and clear the cache when something relevant is updated. Hence, the system creates a "cache key" for each resource it needs to construct a response. Because there are various code-paths creating parts of the response, there are various code-paths creating cache-keys.
<madnificent> cache-keys is not trivial without special variables.
<madnificent> We have a similar case where we did something like that in Elixir and it was a lot less fun :)
<phoe> I see
<madnificent> Cases where you are not linearly executing code become hard. You end up passing arguments to functions which don't have too much to do with the function at all. You can do it, but it's harder to read and more error-prone.
<madnificent> The random state is a nice example of that too.
<_death> this use-case is mentioned in SICP in relation to global state.. basically special variables are useful for context.. they also provide a stack-like, thread-local behavior (shadowing bindings)
<_death> they make it easy to implement REPL-friendly operators
ldb has joined #lisp
ldb has quit [Client Quit]
bhartrihari has joined #lisp
orivej has quit [Ping timeout: 256 seconds]
wxie has quit [Ping timeout: 260 seconds]
orivej_ has joined #lisp
Aurora_v_kosmose has quit [Remote host closed the connection]
Aurora_v_kosmose has joined #lisp
FreeBirdLjj has joined #lisp
wxie has joined #lisp
FreeBirdLjj has quit [Remote host closed the connection]
Bike has joined #lisp
<madnificent> phoe: We probably have more cases like this which are used in the wild.
hvxgr_ has joined #lisp
<_death> (defmacro with-replayability (&body forms) `(let ((*random-state* (make-random-state *random-state*))) ,@forms))
sdumi has quit [Ping timeout: 246 seconds]
<pve> hi, does something like this exist?
<pve> i.e. a function that establishes a restart
<Bike> you want the restart to invoke another restart?
<Bike> you should be able to use restart-bind, though
orivej_ has quit [Quit: No Ping reply in 180 seconds.]
<pve> just wondering if there is a function equivalent to, say, with-simple-restart
sdumi has joined #lisp
orivej has joined #lisp
<pve> the conditions dictionary in the hyperspec tells me that there might not be, but I just wanted to check
<phoe> pve: no
<phoe> you can implement it though
<phoe> (defun call-with-simple-restart (... thunk) (with-simple-restart (...) (funcall thunk)))
<pve> hmm will that really work..
<pve> i must test this
<phoe> pve: yes, it will
Lycurgus has joined #lisp
<phoe> ...oh wait a second, it's non-trivial
<phoe> clhs with-simple-restart
<phoe> the name is not evaluated
<phoe> that is a problem
<phoe> same with restart cases, same with restart bindings...
<phoe> thanks! I'll add this to my book
<pve> yes, that was exactle my problem
stentroad_ has quit [Ping timeout: 272 seconds]
<pve> exactly
<phoe> that is not an issue if you have the compiler handy, since you can (funcall (compile nil `(lambda () (with-simple-restart (,name ,string) (funcall ,thunk)))))
<phoe> but that's invoking the compiler
<phoe> which might quirk quite a few brows
<phoe> damn! I never noticed that issue until now
<phoe> I guess no one really specifies handler/restart details at runtime, even though it seems like a decent addition...
* phoe adds this to the bag of ideas for the Hypothetical Future Revision
<Bike> what do you mean?
<phoe> (call-with-handler #'foo 'my-condition (lambda (c) (print 42)))
<phoe> (call-with-restart #'foo 'my-restart (lambda () (print 42)) :interactive-function ... :report-function ... :test-function ...)
<phoe> where #'FOO is our thunk that we want to call
<Bike> the only part of those you can't do is evaluating the name and type specifier.
<phoe> correct
<Bike> which i guess is something, though it's hard to imagine actually wanting to do that
<phoe> pve: what is your use case?
Lord_of_Life_ has joined #lisp
<pve> I'm working on my "symbolic smalltalk" and would like to add restarts to it, preferably using only functions
<phoe> then you'll need to use the workaround I proposed up there
<pve> but it's no big deal if it can't be done, just need to expand to the macros
<phoe> hold on, let me write it...
<pve> but that means restricting the selectors in question and making them "special"
Lord_of_Life has quit [Ping timeout: 264 seconds]
Lord_of_Life_ is now known as Lord_of_Life
<pve> naturally I would like to have as few special selectors as possible
orivej has quit [Read error: Connection reset by peer]
orivej has joined #lisp
TwoNotes has joined #lisp
wxie has quit [Ping timeout: 256 seconds]
<pve> nice
<phoe> oh wait a second
<phoe> I screwed up a thing...
sdumi has quit [Ping timeout: 246 seconds]
<phoe> there, fixed now
<Bike> clisp has some kind of handler-case or handler-bind instruction in its bytecode, so i wonder if type specifiers can be dynamically specified or not
<phoe> obviously they do not need to be
<phoe> the specification does not mandate that anywhere.
<phoe> that's why I must use the compiler
sdumi has joined #lisp
<Bike> well, i wonder. i'm curious what clisp does. every other implementation i'm familiar with does the dynamic variable thing in which case it's fine (though you can probably optimize constant type specifiers better)
<phoe> I mean, even if clisp does that, it has to get the type specifier and restart name from somewhere
<phoe> so, at least in theory, they could be provided dynamically, too - which means via a functional interface
orivej has quit [Read error: Connection reset by peer]
orivej_ has joined #lisp
Snaffu has joined #lisp
<pve> while I'm here, can I ask you, will this come back and bite me in the behind later, or do I need to rethink it?
<pve> I do this because it's a little inconvenient that conditions can't be defined using defclass
FreeBirdLjj has joined #lisp
<pve> so I would prefer if "conditions" could be defined using the normal subclass method
<Bike> phoe: i mean like, if there was only handler-case and not handler-bind, you could have the type specifiers not to be accessible to signal. might be doable with handler-bind too.
<Bike> pve: might be slower, but since you have your own language here it doesn't seem like there'd be a problem
<phoe> pve: seems OK to me.
<phoe> Bike: correct; we can implement handler-case via handler-bind though, so we are lucky
<pve> ok great!
<phoe> pve: the return-from in line 34 is superfluous
<pve> thanks for your input, bike, phoe
<phoe> required in handler-case, not required in handler-bind
<pve> oh right
<pve> will remove
<Bike> like for example if you compiled a type check into the function with the handler, and unwound to that frame with handler-bind, and then rewound if there was a restart
<Bike> with that implementation there wouldn't be any way to do a type specifier dynamically short of the compile
<phoe> correct
<phoe> an implementation is allowed to leverage the fact the condition types are not suppliable at runtime
<phoe> and optimize the hell out of such code by e.g. turning a runtime TYPEP with a Lisp type specifier into a compiled, more efficient one
wxie has joined #lisp
<phoe> a functional interface with variable condition type would make it hard to optimize that.
ech has joined #lisp
orivej_ has quit [Read error: Connection reset by peer]
orivej has joined #lisp
<TwoNotes> If I use Quicklisp to load both :SHA1 and :DEXADOR I get this: "BASE64" is a package name, so it cannot be a nickname for "CL-BASE64".
Lycurgus has quit [Remote host closed the connection]
<phoe> TwoNotes: sounds like an ugly package name conflict between different base64 libraries.
<beach> Both those names are badly chosen actually.
<TwoNotes> groan
<TwoNotes> I am looking at the code for dexador and I do not see that it actually defines BASE64. It does however 'depend-on' a bunch of other things, including cl-base64
<phoe> that's where the nickname comes from
<phoe> please complain at the authors of the relevant systems to unclobber the package namespace and/or the authors of sha1 that the package is unloadable with dexador and/or the authors of dexador that the package is unl... nah, don't complain at dexador, I sadly don't expect the author to change anything
<_death> I believe someone already complained
<TwoNotes> SHA1 defines a function "sha1-base64", which returns a base64-encoded hash. That is the one function I use form it.
<TwoNotes> Maybe I just clone SHA1 and fix it myself locally
EvW has joined #lisp
<TwoNotes> In the first link, the author says he doesn't feel like changing it because he likes his own base64 implementation so much
<_death> or use ironclad.. its sha1 implementation is more performant
<phoe> it's different than the PR that _death linked since it provides a real-life breakage case (which you provided to us!)
<phoe> _death: and also *huge*
rme has quit [Read error: Connection reset by peer]
<phoe> needing to pull all of ironclad just to use its sha1 implementation is why the sha1 system actually came into life
orivej has quit [Ping timeout: 258 seconds]
<TwoNotes> All I need is a hash function that returns a string. It doesn't *have* to be sha1
jmercouris has quit [Read error: Connection reset by peer]
<_death> well, usually you need more than sha1..
<TwoNotes> I am using it to make small Merkle Trees
orivej has joined #lisp
gendl has quit [Read error: Connection reset by peer]
mpontillo has quit [Ping timeout: 272 seconds]
rme has joined #lisp
<_death> what's surprising is that ironclad doesn't include base64 ;)
<_death> though it mentions it might need to do that in the TODO
<phoe> _death: it's good that base64, cl-base64, qbase64, and s-base64 do
<phoe> there's a pbase64 missing though, where p stands for "phoe"...
<phoe> brb
<_death> phoe: plus a bunch of inline implementations written in 10 mins throughout the years
<phoe> _death: oh no!
<TwoNotes> I can call cl-base64 myself. I just need the hashing. Ironclad looks interesting to play with itself, but I don't need all that for this particular project.
<phoe> we need to extract these into separate ASDF systems and upload them to quicklisp
<phoe> TwoNotes: you can pull in the sha1 code and either gut out the base64 parts or tweak them to use cl-base64
<phoe> ;; if you don't need base64 encoding, I suggest the former
<TwoNotes> I could start with SHA1, strip out the base64 stuff, and call cl-base64 instead.
mpontillo has joined #lisp
<_death> there should be a choose-system system that baffles you with choices for test/base64/utility/portability libraries
<phoe> sure - or just throw out all base64 and cl-base64 stuff altogether if you don't ever want to use that encoding.
<TwoNotes> It does not HAVE to be base64. I use it as a key into an LMDB database.
<phoe> _death: ...
<TwoNotes> LMDB doesn't care
<_death> and a pick-system too
<phoe> trivial-base64
terrorjack has quit [Ping timeout: 260 seconds]
stentroad has joined #lisp
rme has quit [Ping timeout: 264 seconds]
<_death> maybe asdf has a user hook for "do this after that system loads".. or is it too simple minded
<phoe> _death: I guess that defining methods counts...
<phoe> I think you could defmethod on asdf:operate
stentroad has quit [Ping timeout: 260 seconds]
<phoe> (defmethod asdf:operate :after ((operation 'load-op) (component (eql (asdf:find-system :base64)))) ...) ?
<_death> what if there are two hooks
<phoe> then you're in trouble
<phoe> I don't know such a hooking mechanism in ASDF.
jmercouris has joined #lisp
rme has joined #lisp
<_death> phoe: it may be too convenient :)
* phoe adds that to the idea bin named "Future Rants About ASDF - Public Use"
orivej has quit [Ping timeout: 272 seconds]
orivej_ has joined #lisp
<_death> package name clashes suggest that the lisp ecosystem is growing.. aren't you happy? :)
terrorjack has joined #lisp
<phoe> package name clashes suggest that the current way the Lisp ecosystem is cultivated has issues
liberliver has quit [Ping timeout: 265 seconds]
<_death> btw, one wonders why a sha1 library should depend on a base64 library..
<phoe> "what if you wanted to have a sha1 digest that is base64-encoded"
<phoe> obviously you need to depend on base64
<phoe> "what if you wanted to have a sha1 digest that is engraved onto a metal ring"
<_death> create a sha1+base64 library
<phoe> obviously you need to depend on a library that interfaces with CNC milling machines
gendl has joined #lisp
<phoe> that's why base64 should depend on one as well
<phoe> and when the CNC milling machine library depends on a base64, then you can safely depend on cl-base64 to avoid having a circular dependency
<phoe> there! problem solved
<_death> I've been using a dirty trick to work around circular dependencies lately
<phoe> what is it?
<_death> (defpackage :foo (:use :cl) (:export :some-symbol-defined-in-bar)) (defpackage :bar (:use :cl :foo) (:export :some-symbol-defined-in-bar)) ...
<phoe> that looks like uiop:define-package :reexport, am I right?
<_death> so now the symbol is interned in package foo, but the definition (say, a function definition) is made in bar
orivej_ has quit [Quit: No Ping reply in 180 seconds.]
oxum has quit [Remote host closed the connection]
<_death> no, it's not about re-exporting
mibr has quit [Quit: mibr]
oxum has joined #lisp
orivej has joined #lisp
<_death> the original code made no use of packages (had in-package :cl-user)
<phoe> ouch
<_death> do you understand what I did?
<phoe> yes
<phoe> you separated it into packages in a way that still makes it work
ralt has quit [Quit: Connection closed for inactivity]
<_death> yes.. I could define a single package that both foo and bar modules share
<phoe> where the latter packages use and reexport all symbols exported by the former packages, therefore allowing definitions to work on the same symbols
<phoe> nice
X-Scale` has joined #lisp
<_death> but package-inferred-systems style fit this code base better
X-Scale has quit [Ping timeout: 272 seconds]
X-Scale` is now known as X-Scale
oxum has quit [Ping timeout: 265 seconds]
orivej has quit [Ping timeout: 246 seconds]
orivej has joined #lisp
orivej has quit [Quit: No Ping reply in 180 seconds.]
sz0 has joined #lisp
orivej has joined #lisp
bhartrihari has left #lisp ["Disconnected: closed"]
bhartrihari has joined #lisp
gravicappa has quit [Ping timeout: 272 seconds]
gravicappa has joined #lisp
oxum has joined #lisp
<TwoNotes> Package names are *supposed* to be long, like internet names. But nobody likes to type all that each time so they have nicknames too. Trouble is, the nicknames are part of the defpackage and then you can have conflicts if two developers pick the same nicknames. Better to let the end-user pick the nicknames, as in done in Python
aeth has quit [Read error: Connection reset by peer]
FreeBirdLjj has quit [Remote host closed the connection]
<beach> Or use package-local nicknames which are now available nearly everywhere.
aeth has joined #lisp
<_death> or :import-from with the long name
wxie has quit [Ping timeout: 260 seconds]
stentroad has joined #lisp
<phoe> TwoNotes: package-local nicknames are a form of python's import
<phoe> or rather, Python import ... as
stentroad has quit [Client Quit]
oxum has quit [Remote host closed the connection]
<TwoNotes> It is the ".. as .." construct I was htinking of
quazimod1 has quit [Ping timeout: 260 seconds]
<phoe> package-local nicknames then
<phoe> they work everywhere except CLISP
<luis> phoe: what do you mean everywhere?
<beach> In every significant Common Lisp implementation.
<phoe> luis: SBCL, CCL, ECL, Clasp, ABCL, ACL, LW 7.2
<phoe> (note: LW 7.2 is not released yet)
<phoe> so, right - except CLISP and LW (yet)
<luis> phoe: that's impressive. Cool!
orivej has quit [Ping timeout: 256 seconds]
orivej has joined #lisp
<phoe> luis: I'm looking for someone brave enough to dig into the C code of the CLISP reader and implement PLNs there
<phoe> and someone even more brave who will convince Bruno that it is time for a new CLISP release after ten years
<beach> As I recall, it's not a reader thing.
<beach> Isn't it FIND-PACKAGE that is modified?
<phoe> beach: correct, I didn't express myself clearly; it's FIND-PACKAGE and FIND-SYMBOL and DEFPACKAGE other related operators
<phoe> it's not the reader per se, the reader just calls FIND-PACKAGE and FIND-SYMBOL
quazimodo has joined #lisp
orivej has quit [Quit: No Ping reply in 180 seconds.]
arpunk has joined #lisp
orivej has joined #lisp
Snaffu has quit [Quit: leaving]
<luis> phoe: if only it were C code :)
<phoe> luis: what do you mean?
<luis> Last time I checked it seemed very macro-heavy... that doesn't look as bad as I remembered
toorevitimirp has quit [Quit: Konversation terminated!]
<phoe> yes, but still C
bitmapper has joined #lisp
EvW has quit [Ping timeout: 260 seconds]
orivej_ has joined #lisp
orivej has quit [Read error: Connection reset by peer]
oxum has joined #lisp
dddddd has quit [Ping timeout: 240 seconds]
oxum has quit [Ping timeout: 246 seconds]
guicho has quit [Remote host closed the connection]
orivej_ has quit [Quit: No Ping reply in 180 seconds.]
orivej has joined #lisp
lucasb has joined #lisp
madnific` has joined #lisp
madnificent has quit [Ping timeout: 260 seconds]
gko has quit [Ping timeout: 258 seconds]
Oladon has joined #lisp
Necktwi has quit [Ping timeout: 272 seconds]
Necktwi has joined #lisp
jesse1010 has joined #lisp
Bit_MCP has joined #lisp
sdumi has quit [Ping timeout: 256 seconds]
nicktick has quit [Ping timeout: 272 seconds]
<TwoNotes> I call a function that returns multiple values But I don't need all the values. I use declare ignore, but it still complains. https://privatebin.net/?99c568896ea30811#9We1DrL9YbeEv8iuhuatJE7JRrsHXW844spqzKFd98NB
<_death> the declaration form should be placed where the bindings are introduced (in your case, outside the let form)
sdumi has joined #lisp
ralt has joined #lisp
<beach> TwoNotes: When you expose your code for others to read, it is important that you make sure it follows elementary conventions about indentation and spacing.
Bourne has quit [Remote host closed the connection]
<beach> TwoNotes: A closing parenthesis should never be preceded by whitespace, in particular not by a newline.
<beach> TwoNotes: And the list of variables introduced by your MULTIPLE-VALUE-BIND is not indented correctly.
<beach> TwoNotes: What programming environment do you use?
kpoeck has joined #lisp
<beach> TwoNotes: You should use three or four semicolons for comments outside a top-level form.
<beach> TwoNotes: The arguments starting at HOUR to your format are not indented correctly.
<phoe> there, reindented and fixed
<beach> TwoNotes: And there is no point in having a LET with no bindings introduced. In this case, since the declaration should go outside the LET, you can remove it. If you do need a declaration but no bindings, use LOCALLY.
orivej has quit [Ping timeout: 258 seconds]
orivej_ has joined #lisp
<_death> may also consider using *x* for special variables rather than +x+ (some think it makes sense for constants, but...)
<TwoNotes> I was under the mistaken impression that multiple-value-bind only allowed one form. So I removed the let and now it works.
<_death> also, you may want to use vectors instead of lists
<phoe> clhs multiple-value-bind
<TwoNotes> This is SBCL. It complains if I change the +x+ for *x* in violation of "convention"
<_death> complains how?
<TwoNotes> I did try using defconstant, but it annoyingly complains every time I recompile
<phoe> TwoNotes: correct, DEFCONSTANT with lists is very annoying
<_death> defconstant is indeed the wrong operator to use
<phoe> you could try alexandria:define-constant with #'equal predicate
<_death> defparameter/defvar should use *x*
<beach> TwoNotes: Did you understand the style remarks that were given to you?
<TwoNotes> I see lots of examples with + though
<TwoNotes> Yes, I did, thank you. I use emacs in lisp mode
<beach> I suggest you use SLIME.
<_death> TwoNotes: because it's not a standard convention, there are multiple "sub-conventions"
<beach> It has better indentation capabilities for Common Lisp.
<TwoNotes> Does SLIME work with asdf .asd files?
<phoe> TwoNotes: yes
<phoe> very yes
<TwoNotes> ah ok
<phoe> (asdf:load-system :foo) in the REPL and you're good to go
orivej_ has quit [Quit: No Ping reply in 180 seconds.]
orivej has joined #lisp
rumbler31 has quit [Remote host closed the connection]
<TwoNotes> Do I leave the ;;;; -*- Mode: Lisp at the start of each file?
<_death> there's no need if you have a proper file extension like .lisp
orivej has quit [Quit: No Ping reply in 180 seconds.]
sdumi has quit [Read error: Connection reset by peer]
<TwoNotes> Is there a "pretty-print my region" command in SLIME that will fix up my indentations?
orivej has joined #lisp
ghard has joined #lisp
sdumi has joined #lisp
<_death> C-x h C-M-q
<_death> nice, Lisp's concept of decoded time supports job security
<_death> if you pass encode-universal-time a year between 0 and 99 it shifts the prospect from employment from current day to the end of the century
msk has quit [Ping timeout: 246 seconds]
pjb has joined #lisp
orivej has quit [Quit: No Ping reply in 180 seconds.]
<_death> ah, it's a bit more elaborate.. has to be within fifty years
<pjb> phoe: you can trivially make locatives with closures!
orivej has joined #lisp
<pjb> White_Flame: remember closures are equivalent to objects. What you want to do is done with classes and methods!
<phoe> pjb: I've mentioned it.
<pjb> White_Flame: your example must be written: (defclass anonymous-1 () ((count :initform 0))) (defmethod next ((s anonymous-1)) (incf (slot-value s 'count))) #| AND THEN: |# (defmethod previous ((s anonymous-1)) (decf (slot-value s 'count)))
<phoe> pjb: your example is equivalent in semantics but not equivalent in performance, and this is what I think White_Flame was concerned about; closures have less overhead than classes and methods.
<pjb> phoe: totally wrong!
Jeanne-Kamikaze has joined #lisp
<pjb> phoe: this is precisely because this is totally wrong, that the equivalence was discovered!
<phoe> pjb: I don't understand, which *exactly* part is wrong? that the two are equivalent in semantics, that the two are not equivalent in performance, that this is what I think White_Flame wac concerned about, or that closures have less overhead than classes and methods?
<phoe> Since you used "totally", I assume you mean all four of them.
oxum has joined #lisp
<TwoNotes> So the correct way to balance parens to to pile all the close-parens at the end of the last line?
<phoe> TwoNotes: correct
<TwoNotes> ok. The Style Guide does not directly address this point, but all of its example do.
<phoe> a line with only whitespace and closing parens is a line that should be folded into the above one
<phoe> I think the luv-slides do
<TwoNotes> I was reading https://lisp-lang.org/style-guide/
orivej has quit [Ping timeout: 256 seconds]
luckless has joined #lisp
azimut has quit [Ping timeout: 272 seconds]
orivej has joined #lisp
<TwoNotes> I'm a big beleiver in coding style, so I will go over all these, thanks. Over the *cough* decades I have had to read other people's badly written code in that other-language-who-shall-not-be-named-that -is-about-coffee
<TwoNotes> It is amazing how much "professionally" written code contains zero comments.
madnific` has quit [Ping timeout: 260 seconds]
<pjb> phoe: "Then came a crucial discovery. Once we got the interpreter working correctly and had played with it for a while, writing small actors programs, we were astonished to discover that the program fragments in apply that implemented function application and actor invocation were identical! Further inspection of other parts of the interpreter, such as the code for creating functions and actors, confirmed this insight: the fact th
<pjb> functions were intended to return values and actors were not made no difference anywhere in their implementation."
X-Scale has quit [Ping timeout: 264 seconds]
<pjb> TwoNotes: https://groups.google.com/forum/#!msg/comp.lang.lisp/oGmha6PbAD4/kmpG51wjJ6gJ
SGASAU has quit [Remote host closed the connection]
X-Scale` has joined #lisp
<pjb> TwoNotes: basically: comments of type "pseudo-code" must be compiled into code. comments of type "specification" are of type "pseudo-code" too!
<pjb> TwoNotes: you just need a compiler for the specifications! :-)
SGASAU has joined #lisp
X-Scale` is now known as X-Scale
<TwoNotes> We must not neglect this classic: paper "Artificial Intelligence Meets Natural Stupidity" http://www.cs.yorku.ca/~jarek/courses/ai/F11/naturalstupidity.pdf
<pjb> TwoNotes: what's amazing, is that actually most code is considered to be basically throwable. The situation where you have code that last long, and be maintained over generations of programmers is rather rare.
<TwoNotes> My primary audience for the code I write is a future me.
ljavorsk has joined #lisp
cosimone has joined #lisp
stereosphere has joined #lisp
ljavorsk has quit [Ping timeout: 258 seconds]
orivej has quit [Quit: No Ping reply in 180 seconds.]
<MichaelRaskin> pjb: forget generations, I am OK with reclaiming mere ten years
orivej has joined #lisp
EvW1 has joined #lisp
<p_l> heh
<pjb> Indeed. Remember that every 5 years, the number of programmers doubles. Which means that at all times, half the programmers have less than 5 years of experience. Which explains why there are new fads all the time, new silver bullet programming languages, etc.
<p_l> meanwhile I'm in a project where Python was chosen because the code will have to run for 20 years under probably random maintainers
<pjb> but also, code written doubles every 5 years, so (more than) half of the code written is less than 5 years odl.
<p_l> pjb: It compounds with technological advances into "great generational knowledge death", as I call it
<pjb> p_l: bad choice. python 2.7 is dead. In the meantime, CL is still going…
<p_l> pjb: Python 3 fortunately
<p_l> the thing is, availability of CL programmers is lower
<phoe> jackdaniel: I remember that you mentioned some sort of server that has asynchronous and synchronous components; the async parts were realized by calling handlers
<phoe> is it published anywhere?
<pjb> p_l: will be dead soon… :-) for python 4 or viper or grass-snake?
<p_l> pjb: the question was "do we want support calls for next 20 years or do we want ability to throw someone else under the bus"
<TwoNotes> LISP and FORTRAN are the two oldest languages still in use. But does anyone really still use FORTRAN?
<pjb> p_l: this is wrong. Everywhere I've worked, programmers knew lisp (or scheme). They've been taught it in university.
<p_l> that said, the experience with this project is convincing others to learn Lisp
DGASAU has quit [Ping timeout: 256 seconds]
<pjb> p_l: only since it's not a hiring bullet-point, they don't talk about it.
<TwoNotes> Some places consider LISP their secret sauce
<p_l> pjb: the only university that still had serious lisp course closed it exactly when I wanted to go there so I'd have been in the first year without list
<p_l> *lisp
<p_l> (only university that was within "range" let's say)
<phoe> TwoNotes: fortran is still used in academia and physics computations; tons of battle-tested scientific code is written in Fortran and there's no need or money to rewrite it in elsething
<TwoNotes> Places like CERN
<p_l> I'd have way higher chances depending on Haskell, because then I can always put up adverts in Scotland
<p_l> TwoNotes: not only
<p_l> actually CERN is heavily in C++, iirc
<p_l> though I think they have mixed up code
<p_l> TwoNotes: however if you need to run MPI calculations on arrays it tends to be much easier to just grab fortran 90 with OpenMP and hack
<MichaelRaskin> pjb: meh, remind me when pypy2 stops working
random-nick has quit [Ping timeout: 256 seconds]
orivej_ has joined #lisp
orivej has quit [Ping timeout: 272 seconds]
<p_l> anyway, next such project will be mix of C and Lisp :V
<MichaelRaskin> Nice
<TwoNotes> Last time I hung out with high-energy physics people was at uni 50 years ago. Not a lot of options then.
<p_l> MichaelRaskin: the C is only there because we would need a kernel module for a realtime bit
bhartrihari has left #lisp ["Disconnected: Replaced by new connection"]
bhartrihari has joined #lisp
<p_l> unless I end up getting rt gc for a lisp on top of a *proper* RTOS (something that implements OSEK/AUTOSAR or ARINC-653 or similar)
<TwoNotes> Stop-the-world GC is a bad idea. I like the way Erlang does it.
<p_l> Stop the world is good for certain kinds of work
<p_l> what I'd be happy with is something that worked on the metronome pattern
DGASAU has joined #lisp
jw4 has quit [Read error: Connection reset by peer]
rogersm has joined #lisp
rippa has joined #lisp
jw4 has joined #lisp
<beach> TwoNotes: It is not surprising that professionally written code is bad. Remember that a "professional" (by definition) is a person who does something for money, whereas an "amateur" (again by definition) is a person who does something out of love.
random-nick has joined #lisp
oxum has quit [Remote host closed the connection]
orivej_ has quit [Ping timeout: 265 seconds]
orivej has joined #lisp
bhartrihari has left #lisp ["Disconnected: Replaced by new connection"]
bhartrihari has joined #lisp
<jackdaniel> phoe: no, but I've described how that could be implemented
<phoe> jackdaniel: OK, I see - I'll think about that
cosimone has quit [Ping timeout: 260 seconds]
<TwoNotes> Can a sub-class override a slot :type from the superclass?
oxum has joined #lisp
<phoe> TwoNotes: it can, but the provided type must be a subtype of the original
cosimone has joined #lisp
<Bike> it can't override it, they're combined
<phoe> otherwise LSP does not hold
<phoe> Bike used better words than me
rogersm has quit [Ping timeout: 240 seconds]
<Bike> specifically, if C2 is a subclass of C1, and they both declare a slot with the same name, with types T2 and T1 respectively, the type of the effective slot of C2 is equivalent to (and T1 T2)
oxum has quit [Ping timeout: 240 seconds]
<TwoNotes> What if the superclass does not mention :type at all, can the subclasses *add* a :type?
<Bike> if a slot doesn't have a :type mentioned the type is implicitly T
<phoe> yes
rogersm has joined #lisp
rogersm has quit [Client Quit]
<Bike> so, yeah go for it
rogersm has joined #lisp
<Xach> temper your expectations for how useful it will be beyond documentation for the human reader
Josh_2 has joined #lisp
<Bike> mhm
<phoe> I mean, SBCL now typechecks stuff based on :TYPE
<Bike> though i have some ideas for how packed data in standard objects might usefully be supported in sicl and clasp. we'll see how that goes
<phoe> CCL did it for a long time™
<TwoNotes> It is a b-tree structure, which can be in memoery or on disk. The concept of a 'left' and 'right' downward pointer is common to both. But in memory those slots contain references to other nodes, while on disk they contain strings where are DB keys. I was thinking of possible optimizations the compiler might do
<Xach> none
<rogersm> Hi guys, what is the prefered library for PEG parsing?
<Bike> yeah, it's none on any implementation i'm aware of that actually exists
<Bike> the problem is that CLOS supports redefinition heavily so the compiler generally can't rely on any information like that
<phoe> rogersm: esrap-peg IIRC
<rogersm> thanks!
<phoe> MichaelRaskin is the one to bother for providing support for that
<phoe> see our conversation at https://irclog.tymoon.eu/freenode/%23lisp?around=1589647933#1589647933 for some pointers
<phoe> I was using that library recently
<rogersm> phoe: any tricky things I need to know?
<phoe> rogersm: I don't know, I'm just a neophyte of that lib
<MichaelRaskin> Well, all the magic optimisations are in Esrap proper
<MichaelRaskin> Esrap-PEG is just a translation of language-independent PEG syntax as described in the Ford's work to Esrap rules
<MichaelRaskin> PEG does have some interesting tricky corner cases (unfortunately)
<MichaelRaskin> Some things are easier to define in BNF, some in PEG.
gravicappa has quit [Ping timeout: 260 seconds]
* Xach blames easye for the failure report bloodbath today
orivej has quit [Quit: No Ping reply in 180 seconds.]
liberliver has joined #lisp
orivej has joined #lisp
<phoe> what did easye do
liberliver has quit [Ping timeout: 246 seconds]
liberliver has joined #lisp
bhartrihari has left #lisp ["Disconnected: closed"]
bhartrihari has joined #lisp
dxtr has joined #lisp
dxtr has quit [Client Quit]
FreeBirdLjj has joined #lisp
bhartrihari has left #lisp ["Disconnected: closed"]
bhartrihari has joined #lisp
v3ga has quit [Ping timeout: 260 seconds]
<Xach> phoe: unbalanced parens
FreeBirdLjj has quit [Ping timeout: 260 seconds]
oxum has joined #lisp
<phoe> ooh
<phoe> how unfortunate
* phoe gets the chainsaw
EvW1 has quit [Ping timeout: 260 seconds]
oxum has quit [Ping timeout: 264 seconds]
bhartrihari has left #lisp ["Disconnected: Replaced by new connection"]
bhartrihari has joined #lisp
bhartrihari has left #lisp ["Disconnected: closed"]
bhartrihari has joined #lisp
<flip214> phoe: better get some ballistic parens in reserve, they might be needed
<phoe> flip214: I got only opening ones though
orivej has quit [Ping timeout: 260 seconds]
<flip214> phoe: turn them around, then they match the other end too
<phoe> flip214: woah
<ralt> Next you're gonna say d and b have a similar fate? Don't go down that road.
<flip214> ralt: I'd have said d and p, but who counts individual bits among friends?!
orivej has joined #lisp
<flip214> it's interesting which axis of rotation is assumed at first by different people, isn't it?
<ralt> Certainly
<ralt> I mean
<ralt> I don't know if I'd qualify it as "interesting"
<flip214> there's the story of spatial direction of time among different cultures... ask me at next years ELS if you'd like to hear it
<ralt> I probably won't be there, but that one does sound fun to hear over a beer
random-nick has quit [Ping timeout: 256 seconds]
shifty has quit [Ping timeout: 256 seconds]
rogersm has quit [Quit: Leaving...]
<flip214> ralt: short, simple version at https://paste.debian.net/hidden/9abb962e/
lonjil has quit [Quit: Quit.]
<ralt> flip214: uh
pjb has quit [Ping timeout: 265 seconds]
<_death> metaphors we live by
<flip214> ralt: is that an approving "uh"? can't tell from here
<flip214> I quite like such stories... they provide nice anecdata for sapir-whorf, which I consider proven (for myself)
bhartrihari has left #lisp ["Disconnected: closed"]
<ralt> flip214: an intrigued one
bhartrihari has joined #lisp
<_death> flip214: do you know it?
hugo1 has joined #lisp
hugo1 has quit [Client Quit]
dddddd has joined #lisp
lonjil has joined #lisp
lonjil has quit [Client Quit]
random-nick has joined #lisp
orivej has quit [Read error: Connection reset by peer]
orivej has joined #lisp
karlosz has joined #lisp
pjb has joined #lisp
bhartrihari has left #lisp ["Disconnected: closed"]
bhartrihari has joined #lisp
rogersm has joined #lisp
lonjil has joined #lisp
lonjil has quit [Client Quit]
lonjil has joined #lisp
orivej has quit [Quit: No Ping reply in 180 seconds.]
orivej has joined #lisp
dxtr has joined #lisp
<Josh_2> stylewarning: I think I now have the templates compiling into functions, finally got something working
lonjil has quit [Quit: Quit.]
lonjil has joined #lisp
rogersm has quit []
orivej has quit [Quit: No Ping reply in 180 seconds.]
orivej_ has joined #lisp
<TwoNotes> I'm pretty sure the Sapir Shorf hypothesis has been debunked
<TwoNotes> Whorf
<_death> surely not the weak form
rogersm has joined #lisp
rogersm has quit [Remote host closed the connection]
rogersm has joined #lisp
rogersm has quit [Remote host closed the connection]
<Bike> i mean it's a hypothesis about human cognition relating to national groups formulated in 1930s America, be appropriately skeptical
<phoe> Online Lisp Meeting #2 has just been announced (by me) - https://www.reddit.com/r/lisp/comments/gpwfyf/
<_death> if C doesn't have an oddp predicate, is it any wonder that a & 1 is the idiomatic way to test for it?
bhartrihari has left #lisp ["Disconnected: closed"]
bhartrihari has joined #lisp
orivej_ has quit [Ping timeout: 272 seconds]
orivej has joined #lisp
<ralt> I could fall into that trap
Krystof has quit [Remote host closed the connection]
vibs29 has joined #lisp
rogersm has joined #lisp
jeosol has quit [Remote host closed the connection]
dxtr has quit [Quit: Reconnecting]
dxtr has joined #lisp
rogersm has quit [Ping timeout: 256 seconds]
Krystof has joined #lisp
oxum has joined #lisp
heisig has quit [Quit: Leaving]
<pjb> _death: a&1 is not idiomatic, it IS the C oddp predicate.
<_death> pjb: well, there's also a%2 ;)
<_death> PG gave the example of BASIC and recursion
<p_l> _death: regarding recursion and BASIC... it hits you hard when you end up working on a platform that does *not* support recursion. or reentrancy
<_death> good thing you know about stacks :)
orivej has quit [Ping timeout: 272 seconds]
orivej has joined #lisp
<p_l> can't fix it because we're not allowed to program the cpu directly
<p_l> and as insane as I am, writing a lisp in IEC ST is a bit beyond me
SGASAU has quit [Remote host closed the connection]
<_death> you could write lisp to write it for you
<pjb> p_l: you can always implement your own stack, modulo we're not using turing machines!!! (much less universal turing machines).
SGASAU has joined #lisp
<p_l> _death: the problems are limitations of the execution environment even if you somehow get a lisp through
<phoe> us lambda calculus fanboys don't need no ugly stacks
<pjb> p_l: LISP was implemented on a machine that didn't support recursion or reentrancy (no stack).
<emacsomancer> what prefix is sbcl's make-timer under?
bitmapper has quit [Read error: Connection reset by peer]
<pjb> p_l: that said, I agree that LISP wasn't implemented using libraries from github!
<p_l> pjb: if we could program the CPU directly, we wouldn't have an issue
<_death> emacsomancer: check out the APROPOS operator
<pjb> p_l: there's always a turtle under.
<pjb> just ask Intel!
<p_l> pjb: sometimes the turtle has already been cooked
<emacsomancer> it works when I just sbcl --load it, but not with ql
<p_l> pjb: instead my solution for any future project involving similar environment is Lisp running on hardened PC, possibly with a C kernel module to handle realtime network
<pjb> When we'll have quantum processors, the fun!
<TwoNotes> emacsomancer, sb-ext. See Chapter 14
<emacsomancer> thanks _death, TwoNotes
<p_l> pjb: generally PLCs disappointed me a lot over last few months ;)
<pjb> actually, my point is that without those numerous layer, directly to the CPU, we could eventualy reach the physical layer. Then things become funny. Early computers had some of that fun…
<pjb> it doesn't have to be quantum physics, it can be anything the computer is implemented on.
bitmappe_ has joined #lisp
johntalent has quit [Quit: leaving]
<pjb> We should really use legos to implement a lambda calculus on braids of wool…
karayan has quit [Remote host closed the connection]
<_death> p_l: by ST do you mean https://en.wikipedia.org/wiki/Structured_text ?
<p_l> yes
<_death> ok
karayan has joined #lisp
<White_Flame> pjb/phoe: yeah, I was purely looking at disassembly-based optimization options, and how to use the tightest shared access to data (closures) in an extensible way
bitmappe_ is now known as bitmapper
<White_Flame> accessing a slot of a closure is a simple indexing of the function pointer that was entered
<White_Flame> (in SBCL, speed 3, etc)
<p_l> White_Flame: beware, speed 3 allows editing function constants :D
<White_Flame> well yeah, speed 3, safety 0, debug 0, etc
<p_l> yep
<White_Flame> with a switch to flip it to fully safe for debugging purposes
<p_l> I wondered at that time how far I was from simply overwriting the entrypoint
oxum has quit [Ping timeout: 265 seconds]
oxum has joined #lisp
corpix has joined #lisp
oxum has quit [Ping timeout: 240 seconds]
parentheses has joined #lisp
<parentheses> Hello
<parentheses> are hash tables really important to common lisp, or can i just skip them over on pcl and then come back?
zulu-inuoe has quit [Read error: Connection reset by peer]
<TwoNotes> Depends what you are doing. I use them all the time.
jeosol has joined #lisp
<parentheses> what do you use lisp for?
<Josh_2> if I have a function that either returns t or signals a condition should I still use -p or not?
<seok> Hi guys
<Josh_2> seok: hi
<seok> Hi Josh!
<seok> How do I print and flush output to make stuff like progress bars?
<TwoNotes> parentheses Speech recognition, natural language parsing, database access
<Josh_2> parentheses: they aren't that important but certainly worth knowing. They are pretty simple ¯\_(ツ)_/¯
<parentheses> thats neat!
<TwoNotes> seok (finish-output)
<Josh_2> seok: (finish-output) (force-output) ?
<seok> hm, is there one I can do with strings?
<seok> Do I have to make streams first?
<Josh_2> Well when you "print" those strings are being written to a stream
<TwoNotes> seok if outputing to the temrinal, just use T for the stream
<parentheses> when i finish my lisp study and after making some simple software i might try to develop a roguelike, are they important for roguelikes? tho i will explore everything i can do with lisp and find what i like mre
<Josh_2> parentheses: It's worth just reading about hashtables because there isn't much to them
<TwoNotes> Hash tables are the primary "associative memory" of Lisp. Just make sure you set the :test properly
<Josh_2> (make-hash-table) (setf (gethash ..)) (maphash ..) etc
<parentheses> im just having problems with multiple-value-bind
<seok> Hm, doesn't work like a progressbar on sbcl
<seok> http://clhs.lisp.se/Body/f_finish.htm seems to be implementation dependent?
<TwoNotes> seok, that loop runs so fast you probably would not notice
<seok> just test code
<seok> I have another loop I want to know progress of
<seok> I am expecting 10 only, but I am getting 0 1 2 3 ....
<TwoNotes> If you want to overwrite text on the screen, you need to throw in some escape sequences
<Josh_2> seok: (loop :for i :from 0 :to 10 :do (format t "~A" i)) this just prints 012345678910 on one line
<seok> yeah I want to flush outputs from previous loop
<TwoNotes> You have to reposition the temrinal cursor. Read up on the $[m;nH escape sequnce
<Josh_2> (loop :for i :from 0 :to 1000 :do (format t "|")(force-output t))
<Josh_2> that writes | each iteration
<ralt> TwoNotes: what would be a more googleable name?
<TwoNotes> To emit an escape you need to use (code-char 17) and the ~C format control
<TwoNotes> oops, (code-char 27)
gaqwas has quit [Ping timeout: 256 seconds]
<TwoNotes> When testing, throw a (sleep 1) into the loop so it slows down
<seok> Ah
nwoob has joined #lisp
<seok> this looks good
<seok> Thank you
<nwoob> does cl still has advantage over modern languages?
<seok> nwoob if you ask that here...
<TwoNotes> lol
dale has joined #lisp
<TwoNotes> No, we just prefer chisleing our code on stone tablets for the fun of it
<seok> nwoob I'm a CL noob, but I cannot use any other language. It feels really bad
<TwoNotes> But it is the most productive language I have ever used, and I have used a LOT of them
<seok> I've moved from python
<seok> I only use other languages when big API's force me to use them
<nwoob> TwoNotes: could you give examples where you find cl having advantage over the set of languages that you have used
<TwoNotes> Lisp's elegance appeals to me. Then there is this: https://xkcd.com/224/
<TwoNotes> Data is code is data is code
<seok> Which language are you from nwoob?
<TwoNotes> It takes me few lines of code to do most things. And it has an extensive library
<seok> TwoNotes I don't think library availability is an advantage of CL
<nwoob> seok: mostly js
<seok> if you want big community and lots of library probs should head to other big languages should you not?
<ralt> seok: I think TwoNotes meant the standard library.
<TwoNotes> When all else fails, there is FFI
<TwoNotes> And quicklisp
<seok> What kind of library does he mean?
<nwoob> it takes few lines of code to do things in JS too and it has very vast library
<TwoNotes> Does JS even have lexical scoping? I cant remember
<nwoob> yes
<seok> JS as in node?
<nwoob> seok: as in vanilla JS
<seok> JS is not a programming language though
<nwoob> but yes node too I have enough exp
<nwoob> seok: and from where did you learn that
<seok> its a scripting language is it not? and node is the programming version
<ralt> seok: that's just being pedantic :)
<seok> xD
<seok> Idk, I think the difference matters
oxum has joined #lisp
<seok> It depends on what you want to get out from programming
<ralt> and no, it's not a scripting language, that term is not even defined. If you want to be pedantic, at least be correct. The language is ECMAScript. The implementations are: nodejs. v8, etc.
<ralt> well, not even that
<seok> If you want a job.. stay away from lisp?
<ralt> v8 is node's runtime as well
<Josh_2> CL's incredible metaprogramming abilities is certainly an advantage over basically all other languages
<Josh_2> while remaining extremely performant
<nwoob> seok: these type of arguments scripting vs programming attracts shallow arguments
<TwoNotes> You are not going to be writing raw databases and web servers in JS
<ralt> you are...
<seok> ralt I see
kpoeck has left #lisp [#lisp]
<seok> nwoob what are you looking for in a language?
<Josh_2> CL also has much nicer syntax that most other languages, much more consistent, creates elegant code :P
<ralt> I mean, if y'all want to bash on js, go for it, but at least present good arguments. Josh_2 is the only one who had a good one so far.
<nwoob> looking to widen my knowledge, looking to learn other paradigms
<seok> ralt wikipedia says ECMAScripts are scripting langauges tho https://en.wikipedia.org/wiki/ECMAScript
TwoNotes has quit [Quit: Leaving]
<ralt> seok: given cl-launch, is Common Lisp a scripting language?
<Josh_2> Oh right, well I don't think you are gonna find any "new" paradigms in CL, but you will find support for many, and then you can jimmy them together
<seok> and it says scripting languages are programming languages
<ralt> "scripting language" is just an ill-defined term those days
<seok> I guess
<Josh_2> And if you have no experience with homoiconicity then I think Lisp is a better choice that Julia
<Josh_2> than Julia*
oxum has quit [Ping timeout: 260 seconds]
<seok> lisp is a general purpose language
<ralt> nwoob: I would recommend Common Lisp because it has all the features of all the other languages since the 80's, plus many more (condition system, CLOS, first-class functions, macros, etc etc). Some of those have been implemented in JS. (Did you know that JS was originally inspired by lisp?)
<Josh_2> haha yes "inspired" It's also apparently a "scheme" XD
pve has quit [Quit: leaving]
<ralt> JS is a mix between java (the C-like syntax), Scheme (e.g. first-class functions, which was one of the few algol-family languages to have it back then), and Self (the whole prototype stuff)
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
frgo has quit [Remote host closed the connection]
Yardanico has quit [Quit: https://quassel-irc.org - Chat comfortably. Anywhere.]
frgo has joined #lisp
Yardanico has joined #lisp
SAL9000 has quit [Ping timeout: 246 seconds]
whiteline has quit [Ping timeout: 272 seconds]
<aeth> CL has uniform syntax, which means that language extensions don't look any different from language built-ins. So e.g. (:html (:head #| header stuff goes here |#) (:body (:p "Hello, world!"))) can exist in a macro and it can generate an HTML string at compile time.
<aeth> And you can usually mix in a variable inside that macro like (:body (:p "Hello, " name)) and it will just turn everything surrounding the variable(s) into a constant string
parentheses has quit [Quit: WeeChat 2.7]
<nwoob> cool!!!
<aeth> But trivial macros exist, too. e.g. Someone was complaining about CL not having a simple for loop, but that's just (defmacro for (&rest forms) `(loop for ,@forms)) ; e.g. (for i in (list 1 2 3) do (print i))
<nwoob> aeth: and I believe one cannot do that in any other language. right?
aeth_ has joined #lisp
<nwoob> extending the langauge like you showed with for loop example
<MichaelRaskin> Complicated question
<MichaelRaskin> Lisp family languages mostly support that
nicktick has joined #lisp
whiteline has joined #lisp
<MichaelRaskin> Julia requires prefixing macros with @ (and standard library includes quite a few macros)
SAL9000 has joined #lisp
aeth has quit [Disconnected by services]
aeth_ is now known as aeth
<MichaelRaskin> Simple constructs can sometimes be shoehorned into Ruby's block support to look as if they were native
<MichaelRaskin> There is Metalua…
<MichaelRaskin> etc.
<aeth> Most languages want to restrict the power of the programmer, sometimes for performance or sometimes for simplicity. It's often seen as a problem that macros are indistinguishable from functions, although in practice the various conventions make them easy to spot.
<aeth> Metaprogramming is generally possible but it's usually (1) hard and (2) distinguishable from something built into the language
andrei-n has quit [Quit: Leaving]
rogersm has joined #lisp
oxum has joined #lisp
rogersm has quit [Ping timeout: 256 seconds]
nwoob has quit [Ping timeout: 272 seconds]
corpix has quit [Ping timeout: 240 seconds]
corpix has joined #lisp
lucasb has quit [Quit: Connection closed for inactivity]
random-nick has quit [Ping timeout: 258 seconds]
oxum has quit [Ping timeout: 256 seconds]
orivej has quit [Ping timeout: 256 seconds]
orivej_ has joined #lisp
nicktick has quit [Ping timeout: 272 seconds]
cosimone has quit [Quit: Quit.]
msk has joined #lisp
<ralt> is there some tutorial about using cffi groveler/wrapper?
<fe[nl]ix> no
orivej_ has quit [Quit: No Ping reply in 180 seconds.]
orivej has joined #lisp
pjb has quit [Ping timeout: 272 seconds]
<ralt> would it be an accepted contribution to the manual?
quazimod1 has joined #lisp
<fe[nl]ix> sure
<ralt> great. I need to write one for myself.
quazimodo has quit [Ping timeout: 265 seconds]
<ralt> essentially, the groveller is to write lisp code that goes through C and generates Lisp (the typical use case is being able to grab constants in C macros), whilst the wrapper is to write Lisp code that ends up generated to C and linked as a shared library? What is the typical use case for wrappers? Did I get those correct?
rgherdt has quit [Ping timeout: 260 seconds]
<fe[nl]ix> wrappers are needed when you need to expose C entities that are not available as ELF symbols: either macros that execute code or built-in operators
<ralt> macros executing code makes sense, what are built-in operators?
<ralt> also; ELF symbols is linux-only, right? what would be a common terminology with windows? or is there not, and we should just use "ABI"?
<fe[nl]ix> things not exposed thorugh the ABI
<fe[nl]ix> GCC has lots of built-in operators: start at https://gcc.gnu.org/onlinedocs/gcc/Return-Address.html
anticrisis has joined #lisp
orivej has quit [Ping timeout: 265 seconds]
orivej has joined #lisp
<ralt> ah, those sort of things
<ralt> thanks!
stereosphere has quit [Quit: KVIrc 4.2.0 Equilibrium http://www.kvirc.net/]
pjb has joined #lisp
orivej has quit [Ping timeout: 240 seconds]
orivej has joined #lisp
Aurora_v_kosmose has quit [Ping timeout: 240 seconds]
cantstanya has quit [Ping timeout: 240 seconds]
jfrancis has joined #lisp
vibs29 has left #lisp ["Leaving"]
cantstanya has joined #lisp
Aurora_v_kosmose has joined #lisp