Xach changed the topic of #commonlisp to: Common Lisp, the #1=(programmable . #1#) programming language | Wiki: <https://www.cliki.net> | IRC Logs: <https://irclog.tymoon.eu/libera/%23commonlisp> | Cookbook: <https://lispcookbook.github.io/cl-cookbook>
random-nick has quit [Ping timeout: 265 seconds]
igemnace has joined #commonlisp
tyson2 has joined #commonlisp
zacts has joined #commonlisp
zacts17 has joined #commonlisp
yitzi has joined #commonlisp
zacts has quit [Ping timeout: 246 seconds]
edgar-rft has joined #commonlisp
sjl has joined #commonlisp
pillton has quit [Quit: ERC (IRC client for Emacs 27.2)]
zacts17 is now known as zacts
<Josh_2> I keep getting a very annoying bug when making HTTP requests using Dex I get an error complaining about writing to closed SSL, https://plaster.tymoon.eu/view/2564#2564 however if I try the request once again it works just fine, five minutes later it will signal that error again..
notzmv has joined #commonlisp
<Josh_2> I am making requests to a hunchentoot server
<Josh_2> I might just swap over to drakma
mister_m has quit [Ping timeout: 265 seconds]
<etimmons> Josh_2: Try with `:use-connection-pool nil`. Dexador's connection pool support is broken and unsafe in general.
<Josh_2> I'll give it a shot
<Josh_2> Without the pooling is dex actually any faster than Drakma?
<Josh_2> (not that it really matters)
<etimmons> No idea. It's also worth noting it's possible to do connection pooling in Drakma, it's just not built in.
<Josh_2> Interesting
<etimmons> I tend to only use Dexador on Windows since its story for https on Windows is better
taiju has quit [Remote host closed the connection]
<Josh_2> Yes that seems to have fixed it etimmons tyvm. I will try it again tomorrow
taiju has joined #commonlisp
<Josh_2> I should probably swap to drakma, weitz ware seems to be better than fukamachi ware
yitzi has quit [Quit: Leaving]
<etimmons> More maintainable and readable at least (IMO)
<etimmons> I wish I had the time to integrate winhttp into drakma, then I wouldn't have to worry about dex at all
mister_m has joined #commonlisp
<Josh_2> I really love hunchentoot, just wish it was a bit faster...
<Josh_2> Maybe with some call site optimization on SICL it will speed right up
<etimmons> We can hope!
<moon-child> the sicl meme precedes it. I kinda wonder how that happened--it's not like it has a large marketing budget
waleee has quit [Ping timeout: 245 seconds]
waleee has joined #commonlisp
pillton has joined #commonlisp
tyson2 has quit [Remote host closed the connection]
CrashTestDummy2 has joined #commonlisp
CrashTestDummy has quit [Ping timeout: 258 seconds]
derelict has joined #commonlisp
derelict_ has joined #commonlisp
derelict has quit [Ping timeout: 276 seconds]
jeosol has quit [Ping timeout: 258 seconds]
prxq_ has joined #commonlisp
prxq has quit [Ping timeout: 265 seconds]
recordgroovy has joined #commonlisp
derelict has joined #commonlisp
CrashTestDummy3 has joined #commonlisp
derelict_ has quit [Ping timeout: 258 seconds]
CrashTestDummy2 has quit [Ping timeout: 240 seconds]
<beach> Good morning everyone!
<recordgroovy> Oh yeah, timezones
<beach> Or UGT.
<Josh_2> Mornin' beach
<raeda> Morning, everyone
<beach> Hello raeda.
<beach> moon-child: I think it's the published papers. They have been peer reviewed, so there must be some substance there.
<pillton> I have a design question which relates to a chronology I have observed many times. An application originally invoked a function f(x). Over time, the function changed to f2(x) = h(x;p) where p is a parameter provided by the user of the application. My question is, how would you structure the application given that f(x) and f2(x) or potentially f3(x) are useful implementations? Would you 1) add a slot to the application state which stores
<pillton>
<pillton> a closure which closes over the parameter p or 2) implement f(x) using a dynamic variable *VAR* which invokes the generic function (EXTENDABLE-F X *VAR*) or 3) just change f(x) to h(x;p) and provide a default value for p or 4) something else?
<beach> pillton: I think the right answer depends a lot on the details. But I can tell you that, for SICL, we have developed a style that is close to number 2, but not for the reason you give. We have a first argument CLIENT that the library does not specialize to, and client code can write methods with specific clients.
<beach> pillton: Check out Eclector as a good example.
<beach> This style allows us to provide lots of useful default functionality in the library, while still allowing complete customization for clients who need it.
waleee has quit [Ping timeout: 255 seconds]
<beach> This style also allows the same library to play different roles in a single Common Lisp image.
<pillton> beach: Cheers. I'll take a look.
<moon-child> beach: solid academic work does not a positive public image make
<moon-child> at least not alone
<beach> I guess that's true. But I didn't generalize what Josh_2 said to be a "positive public image".
<moon-child> I feel that there is a general perception of sicl as somewhat of a holy grail in lisp implentation, and that this perception has more than a little to do with performance
<moon-child> how many times is it now people have asked whether sicl is ready yet, or when it will be ready? :P
Inline has quit [Remote host closed the connection]
Inline has joined #commonlisp
<beach> Oh, that would be unfortunate if so.
hafat has quit [Ping timeout: 240 seconds]
ad-absurdum has joined #commonlisp
<beach> It is true that we have come up with techniques that are likely faster than the analogous technique used in current Common Lisp implementations (like generic dispatch, path replication, call-site optimization), but my main goal is for SICL to provide excellent debugging support.
recordgroovy has quit [Ping timeout: 258 seconds]
derelict_ has joined #commonlisp
recordgroovy has joined #commonlisp
<beach> In fact, until I came up with the call-site optimization technique, I was convinced that SICL would never be able to compete with the best existing Common Lisp implementations in terms of performance.
derelict has quit [Ping timeout: 255 seconds]
<beach> Another issue is that, although we are getting closer to generating a native executable for SICL, there is a lot of work left to implement all the optimizations we want, and that is going to take time.
<phantomics> One key to performance will be allowing the generation of ASM code like SBCL does, I think I asked you about that before
<beach> That's an easy one. And it is taken care of. But that alone won't imply good performance.
<phantomics> People have complained about the stagnation of CL, but the define-vop in SBCL is a major point of distinction that makes much higher performance possible, it could lead to a division of CL between SBCL and non-SBCL
<beach> I don't see that. The Cleavir compiler framework is quite easy to customize, but it doesn't have a define-vop.
<phantomics> What's the approach to generating ASM in that case?
<beach> Well, first of all, we don't generate "ASM". We generate a graph of standard objects representing "instructions" that are closer and closer to native with different passes. And each pass is defined by a bunch of generic functions that can be customized, so that new "instructions" can be provided.
Melantha has quit [Quit: WeeChat 3.2]
Melantha has joined #commonlisp
<kakuhen> Is there a function like FIND-CLASS that does not signal error if class is not found? I know that you can write (find-class 'name nil), but it does not feel "idiomatic" to me.
<beach> I haven't studied SBCL internals much, but I suspect define-vop is just an implementation echnique.
<beach> technique
<beach> kakuhen: That's the idiom.
<kakuhen> i guess it's fine if you're aware of the optional arguments accepted by find-class
<kakuhen> I'll keep using it then
<beach> Why would a Common Lisp programmer not be aware of that optional argument?
<beach> kakuhen: It is a slippery slope to start writing code for people who might now only part of the language.
<kakuhen> I guess, yeah
<beach> s/now/know/
<beach> phantomics: SBCL is great, of course, but there are some issues with it as well. For one thing, the garbage collector is not that great. And the technique used for generic dispatch was designed at a time when memory access and register operations were roughly equally fast. For call-site optimization, SBCL addresses a number of special cases, but in general, I don't see any attempt to get good performance out of keyword arguments an
<beach> such.
<phantomics> beach: I see, I'm sure there's room for improvement. It seems like SBCL is ahead of other impls in the area of generating custom ASM, which you need for SIMD. That's why things like the sb-simd project are SBCL-only, and why if I add SIMD support to April it may only be available in SBCL. It would be great to see more support for use cases like this
<phantomics> Also, all CL impls have some shortcomings related to array handling: for instance, you can't have a vector of 8 64-bit ints and create another reference to it as a vector of 64 8-bit ints like you can in C, this would help in some situations
<beach> Most such "shortcomings" are not about the implementation(s), but about language semantics. This particular case might be possible, though.
<kakuhen> a little birdie told me sbcl is getting a new garbage collector and it's apparently going to be great
<|3b|> i suspect sb-simd being sbcl only is more about # of users than anything else (and ecl has had a simd extension for a while i think)
Bike has quit [Quit: sleep]
<|3b|> (and also that "sbcl is fast" so the users that care about performance enough to write simd code are using sbcl)
<kakuhen> in general sbcl seems to be very good for number crunching
<kakuhen> there's pretty much only three reasons i use ccl: objective-c bridge, more "efficient" gc, and starts up faster on my computer; it seems inferior to sbcl as far as number crunching and saving heap images goes
<kakuhen> so for instance, on sbcl you can save a heap image and compress it down quite a bit, with minimal impact on performance; ccl has nothing like this
derelict_ has quit [Ping timeout: 255 seconds]
<|3b|> the nibbles library helps with a lot of the situations where you want to read a chunk of memory as various types, though not transparently and you have to start from a vector of 8-bit ints
srhm has quit [Quit: Konversation terminated!]
<|3b|> (and most of the cases where i care about that sort of thing, transparent "8x64-bit <-> 64x8-bit" isn't what i would want anyway, since i usually care about "Nx8-bit <-> some arbitrary layout of mixed types")
<|3b|> i think ccl has "LAP" for defining things in asm, and according to the docs that supports altivec on ppc, so you could make a portable simd lib that supported that if you happened to still have some PPC somewhere :p
Inline has quit [Quit: Leaving]
<kakuhen> i was planning to build a small blackbird workstation, but the power9 chips are on backorder
<kakuhen> the power architecture is forwards compatible, based on what little i was able to find online
<kakuhen> that is to say ppc970 assembly should mostly "just work" with power9
peterhil has joined #commonlisp
igemnace has quit [Ping timeout: 245 seconds]
hayley has joined #commonlisp
gaqwas has joined #commonlisp
<hayley> I did a naughty thing and read the logs. Some thoughts on performance things:
<beach> kakuhen: That's great news about the SBCL garbage collector. Do you know any details about it?
<hayley> |3b|: Right, there's a Lisp assembler in Clozure. Though I don't know if the assembler knows any SIMD instructions on PowerPC or x86-64. (It does, however know about the instructions to do an atomic increment rather than a CAS loop, but that is something else.)
mister_m has quit [Remote host closed the connection]
<hayley> beach: SBCL is going to support use of the Memory Pool System. The Boston Lisp Meeting I attended was about it, and I believe I provided a link for the slides...
<beach> I see.
<beach> I guess I missed that part.
<hayley> I forgot exactly how DEFINE-VOP works, but it ends up generating another kind of instruction, which eventually is replaced by a user-defined sequence of instructions. This would not be awfully difficult to do in Cleavir.
<beach> Don't we already do something similar with primop/AST/HIR/MIR/LIR methods?
<hayley> We could create a HIR instruction class which eventually is replaced with a sequence of LIR instructions that the user provided -- well, yes, that's pretty close.
<hayley> But generally I hope that DEFINE-VOP is the last resort for doing SIMD work; rather the compiler should vectorise where possible, and then a programmer could use "intrinsic" functions like in C or SB-SIMD if the compiler cannot vectorise for them.
<beach> Makes sense.
<hayley> Such functions are probably more important in Common Lisp, as they can perform type and bounds checks and are generally safe. Although VOPs do require precise type definitions, it is not hard to generate completely broken and unsafe code.
<hayley> Of course, in an APL compiler like the one phantomics is writing, there are relatively few tight loops that need assembly to be written for them. But otherwise measuring the performance of anything with explicit SIMD instructions tends to be more of a challenge of who memorised the fastest instructions.
<kakuhen> Is there a function like REMHASH but for association lists?
<hayley> Can't think of one, but (remove key alist :test #'car) would work.
<kakuhen> aah I think I found my mistake now
<kakuhen> I was using remove and comparing the car of each cons cell; but this kept giving me an error that the alist was not the type SEQUENCE
<kakuhen> ok thanks so much; this solved my issue... not using #'car in particular, but I put in a small lambda that did exactly what I wanted. thanks
pve has joined #commonlisp
ad_absurdum has joined #commonlisp
ad-absurdum has quit [Ping timeout: 256 seconds]
domovod has joined #commonlisp
igemnace has joined #commonlisp
Lord_of_Life_ has joined #commonlisp
Lord_of_Life has quit [Ping timeout: 258 seconds]
Lord_of_Life_ is now known as Lord_of_Life
totoro has quit [Ping timeout: 272 seconds]
totoro has joined #commonlisp
<kakuhen> debugging macros is harddd
<kakuhen> so I was adding custom conditions and signalling errors, and offering restarts for these errors
<kakuhen> in some random cases, the restarts simply wouldn't appear, and then the restarts would provide errors
<kakuhen> after enough macroexpand's I figured out my mistakes and it finally works
<kakuhen> writing ,'foo accidentally when i meant ',foo really threw me off
<hayley> It could help to do the work of the macro in a function, and then have the macro expand to something like (call-with-foo (lambda () body ...)), provided that there is enough code that doesn't need to be generated every time.
selwyn has joined #commonlisp
<beach> Speaking of SIMD, one thing I would like in SICL some day is a set of excellent FFT functions, and those would very likely use SIMD.
gaqwas has quit [Ping timeout: 256 seconds]
shka has joined #commonlisp
zacts has quit [Ping timeout: 246 seconds]
<hayley> I have an implementation of the Cooley-Tukey algorithm written in Petalisp, and Petalisp will likely be an early user of SB-SIMD.
<beach> But that's a very basic algorithm, right?
<hayley> Yes, I don't think Petalisp can optimize that out :)
<beach> I would like to experiment with things like √n radix.
<beach> That's optimal with respect to arithmetic operations as I recall, but hard to manage because of the space.
amb007 has quit [Ping timeout: 265 seconds]
amb007 has joined #commonlisp
dsk has quit [Ping timeout: 250 seconds]
ad_absurdum has quit [Quit: Leaving]
lad has quit [Remote host closed the connection]
lad has joined #commonlisp
asarch has joined #commonlisp
<asarch> If I have: '(:tacos 10 :beer 12 :pizza 8 … :tacos 7), how could I get the second :taco value?
<beach> Use POSITION to find the position of the first one. Then use FIND with a :START position beyond that.
<mfiano> That requires repeating traversing the intersection. Instead, just walk it until you find it "again". A good job for LOOP
<beach> Sure, that works too.
<beach> Or you can use MEMBER to find the first one, and then MEMBER on the CDDR of the value the first MEMBER returned.
<mfiano> I like that one, and it will work if you ever want to find the second NIL key
<beach> As in (member :tacos (cddr (member :tacos '(:tacos....))))
pranavats has left #commonlisp [Error from remote client]
pranavats has joined #commonlisp
<|3b|> there is also GET-PROPERTIES that returns the tail of the list starting at the found property as 3rd value, and could be used similarly to member if there is a risk of the key also being a value
Th30n has joined #commonlisp
<beach> Good point.
* |3b| would probably just LOOP though
<asarch> Let's say: (defparameter *lista* '(:tacos 1 :pizza 3 :beer 4 :tacos 4 :ramen 4))
<asarch> (find :tacos *lista* :start (position :tacos *lista*)) → :TACOS
pillton has quit [Quit: ERC (IRC client for Emacs 27.2)]
<hayley> Sorry to ask, is this representative of any real data you are playing with? Would it be easier to structure the data we are searching some other way?
<pjb> asarch: find and member are bad, if you have something that is structured like a plist.
<pjb> asarch: (member :tacos '(:beer 12 :prefered-meal :tacos :tacos 3)) #| --> (:tacos :tacos 3) |#
<pjb> asarch: if you have a plist, use loop on by cddr
<|3b|> for example start from (loop for (k v) on plist by #'cddr when (eql k key) collect v) to get all the values for a key, if the task isn't always "get the value for the second instance of the key"
hendursaga has quit [Ping timeout: 244 seconds]
<pjb> asarch: but indeed, the point of a-lists and p-lists, is to shadow the following keys, so it may be preferable to structure your data differently if this is a normal thing you need to do.
<hayley> Say, are we dealing with separate collections of foodstuff, which might be represented as '((:tacos 1 :pizza 3 :beer 4) (:tacos 4 :ramen 4))?
<pjb> or: (let ((plist '(:ramen 2))) (push 3 (getf plist :tacos)) (push 4 (getf plist :tacos)) plist) #| --> (:tacos (4 3) :ramen 2) |#
<hayley> Perhaps I shouldn't ask, but it seems like a weird thing to do to retrieve the second value, as pjb said.
<asarch> Yeah: '((:tacos 1 :pizza 3 :beer 4 :tacos 4 :ramen 4) (:tacos 1 :pizza 3 :beer 4 :tacos 4 :ramen 4) (:tacos 1 :pizza 3 :beer 4 :tacos 4 :ramen 4) …)
<asarch> And I need the second :tacos from each list
<hayley> But why do :tacos appear twice in each list?
<asarch> From a query
<hayley> What kind of a query is that?
<asarch> From a PostgreSQL resulting query
* |3b| would probably add a "clean up the data into an easier to use form" step between "query" and "use", or else fix the sql to generate what you want :)
<hayley> Okay, still, how do you get two columns with the same name?
<asarch> SELECT * FROM foo, bar WHERE foo.baz = bar.id ORDER BY foo.id;
<asarch> There are foo.tacos and bar.tacos
<asarch> And each tacos means something different
<asarch> However, when I parse the query, I get it as list in that form: (:tacos 1 :pizza 3 :beer 4 :tacos 4 :ramen 4)
<asarch> (This is a very simplified form of the resulting query)
<hayley> Well, I'm not sure if I'd count on the order the columns appear to start with. Guess there is a defined order, but foo.tacos coming first in the list and bar.tacos coming later is too subtle.
<hayley> (Though it is also weird for the database library to strip off the foo. and bar. off the column names in my opinion. And does your database care if you use a product then a WHERE constraint rather than JOIN?)
<hayley> Again, sorry for the hard questions, but having to use such a list just sounds like a bad idea to start with.
cjb has quit [Quit: rcirc on GNU Emacs 28.0.50]
<asarch> Oh :-(
<pve> asarch: you should probably use result-type :lists instead of :plists, and examine the second return value to figure out what is where
<pve> or rewrite the query so you get ... bar.tacos as tacos2 ...
<hayley> I mean, the database would not let you make columns with duplicate names. So it is weird that the database library ends up producing duplicate names.
<pve> they're from different tables
<pve> the plist result type isn't really suitable for joins
<asarch> Or, can you convert a plist into an array? If yes, how?
<pjb> you can use "AS" to rename columns in the output to ensure you get unique names.
<pve> asarch: are you using postmodern?
<pjb> SELECT foo.tacos as footacos bar.tacos as bartacos foo.pizza foo.beer bar.ramen FROM foo, bar WHERE foo.baz = bar.id ORDER BY foo.id;
<pjb> + the commas of course.
<asarch> CL-DBI
<pve> oh
<pve> does it always return plists? there's no way to change that?
<pve> even "select *, bar.tacos as tacos2 ... " will work if you're lazy
<asarch> Or even parse its output as a JSON object
<asarch> No, it won't work. The second :tacos will overwrite the first one
<pve> asarch: but you're calling it "tacos2"
<hayley> Still, doesn't the database name your columns foo.tacos, bar.tacos, foo.baz, foo.id, etc?
<hayley> I pulled up sqlite3 and apparently not. Go figure.
tfb has joined #commonlisp
<asarch> Well, it seems that I will have to do two separate queries and then join each result in a new plist
<hayley> sigh
<pve> asarch: doesn't using "AS" work?
amb007 has quit [Read error: Connection reset by peer]
amb007 has joined #commonlisp
igemnace has quit [Remote host closed the connection]
MichaelRaskin has quit [Ping timeout: 245 seconds]
lotuseater has joined #commonlisp
igemnace has joined #commonlisp
<asarch> Yeah, it works: '(:tacos 1 :pizza 3 :beer 4 :tacos 4 :ramen 4 :taquitos 1 :tacotes 4)
<asarch> :taquitos as the first :tacos and :tacotes as the second one
<lotuseater> nice asarch
<asarch> Now I understand why Lispers hate SQL language
<hayley> No, it's not really because of that.
pranavats has left #commonlisp [Error from remote client]
<asarch> Oh
<moon-child> doesn't everybody hate sql?
<hayley> https://plover.com/~mjd/misc/hbaker-archive/letters/CACM-RelationalDatabases.html provides some reasons, which I would summarise as that 1. the relational theory didn't come first and 2. joins are messier than pointers at times.
<hayley> Personally, I prefer that good programs are based around protocols of functions, whereas SQL has no such concept and is only concerned with storing homogenous rows. This is called the "object-relational impedance mismatch". Some people use it to claim object-oriented programming is bad, but I use it to claim that relational databases are bad.
<pjb> sql has a sound mathematical foundation.
<pjb> haskell has a sound mathematical foundation.
<pjb> lisp has not. lambda was just a keyword, when he introduced it, JMC didn't understand lambda-calculus.
<hayley> That doesn't change that doing things in SQL or Haskell can get very hairy if you're not doing "the right things".
<pjb> draw your conclusions.
* moon-child leaps into the domain-specificity corner, because no one is there
<moon-child> ooh, pjb what do you mean by 'sound'?
<hayley> Well, sure, but I never seem to be in that domain.
<moon-child> s/ooh//j
<moon-child> g, god, I can't type today
<hayley> I wonder if https://counterexamples.org/ has any bugs in Haskell. Some Haskell examples, sure, but I can't remember if there are bugs.
pranavats has joined #commonlisp
<pjb> moon-child: sql a une base mathématique solide. haskell a une base mathématique solide.
<pjb> The point is that because you're have a good mathematical model doesn't mean that you have a practical system. The universe is still messy.
<tfb> pjb: and if you try and program in a version of lambda calculus which *does* make sense mathematically, but leave out all the stuff you actually need, you rapidly find out how little the good mathematical underpinnings actually help you
amb007 has quit [Ping timeout: 258 seconds]
amb007 has joined #commonlisp
<moon-child> pjb: that doesn't explain anything. What does it _mean_ to have a solid mathematical base? I can model lisp, c, sql, haskell... in a mathematical fashion. So what distinction are you trying to draw?
Th30n has quit [Quit: WeeChat 3.2]
* hayley assumes no one wants a HIR abstract machine.
lad has quit [Ping timeout: 258 seconds]
<hayley> s/no one/no one else/
tfeb has joined #commonlisp
tfb has quit [Ping timeout: 250 seconds]
lisp123 has joined #commonlisp
<lotuseater> nice maybe I can get a Lisp job in Bremen
<lotuseater> pjb: but you can seriously rely on stuff it provides (when done correctly)
<tfeb> moon-child: it should mean among other things there is a consistent model which would le you predict the behaviour of a program (modulo halting problem etc)
<hayley> Is a mathematical specification any better than any other specification in this regard?
<tfeb> which I would be extraordinarily surprised if could exist for CL
* tfeb realises now he missed some of this due to disconnecting, sorry
tfeb is now known as tfb
asarch has quit [Quit: Leaving]
<hayley> https://plover.com/~mjd/misc/hbaker-archive/MetaCircular.html "we believe that a carefully fashioned system of metacircular definitions can achieve most of the precision of denotational semantics."
<kakuhen> suppose I have a restart-case that skips executing some pure function entirely, but I do not want to abort evaluation; does it matter if I make this restart return t or nil?
<kakuhen> basically, I have a macro that can add a key to an alist, but I want to avoid duplicate keys in the alist, so I signal a duplicate-key condition when someone attempts to insert a key that already exists
<hayley> From memory, the RESTART-CASE evaluates to whatever the last form in the restart clause is. So it should return something that makes sense for the operation.
<kakuhen> there are two restarts I have: one just deletes the key and its values entirely, and another one just "does nothing" and it's intended for when the user wants to cancel redefining the key
<kakuhen> oh and to clarify, the former restart deletes the already existing key and then inserts what would've been a duplicate key
<hayley> Right. So the latter might return the original alist.
<kakuhen> oh wow I never thought of that, thanks
amb007 has quit [Ping timeout: 252 seconds]
amb007 has joined #commonlisp
<kakuhen> if i want to return t, it's probably more meaningful to return the original alist anyway
<hayley> Well, if you have a pure function, then you are going to return the modified alist, right?
<pl> I wonder if someone documented any sort of issue/wish list for drakma api
tfb has quit [Quit: died]
terrorjack has quit [Remote host closed the connection]
terrorjack has joined #commonlisp
tyson2 has joined #commonlisp
scymtym has joined #commonlisp
kakuhen has quit [Quit: Leaving...]
<lisp123> If i want to learn to write more efficient search & loop algorithms in Lisp, am I better off learning SICP or an algorithm book (e.g. the design and analysis of computer programs - which was recommended here and I'm starting to read)
<lisp123> Both require reasonable investments of time
<lisp123> I assume an algorithm book is better, but perhaps SICP will make me better and is more applicable to Lisp?
frgo has quit [Remote host closed the connection]
frgo has joined #commonlisp
igemnace has quit [Quit: WeeChat 3.2]
random-nick has joined #commonlisp
scymtym has quit [Ping timeout: 255 seconds]
yitzi has joined #commonlisp
<lisp123> OK - chapter 1 of 'The Design and Analysis of Computer Algorithms' was pretty dry and felt too out of the way, but chapter 2 is looking _good_ and very useful. So I will do this book first and not SICP
<pjb> moon-child: Well, basically what it means is that the "sound mathematical models" are simplistic, while the real-life mathematical models are too complex to handle efficiently or cost-effectively. Yes, indeed, you could formalize complex systems. But it's difficult, and once you've integrated into the mathemacal model all the complexities, you're not any more advanced (you have to switch to physics, biology, or "computer science").
<hayley> I'd say I just drew up a state machine for what I considered to be a subtle module, but it is fairly simple on paper.
<pjb> lisp123: I'd say an algorithm book.
<lisp123> pjb: thanks :)
domovod has quit [Ping timeout: 240 seconds]
<etimmons> Xach: when is the next QL release? It looks like we're going to release ASDF/UIOP v3.3.6 to prevent that error you found from happening in most circumstances
<pl> lisp123: SICP is more of how to compute
<pl> for writing efficient algorithm, in lisp or otherwise, an algorithm book and detailed specs for implementation and language (CLHS/WSCL) are the go to
IPmonger has joined #commonlisp
IPmonger has quit [Remote host closed the connection]
<lisp123> pl: thanks for that
tfeb has joined #commonlisp
lisp123 has left #commonlisp [ERC (IRC client for Emacs 26.3)]
nirved has joined #commonlisp
tfeb has quit [Quit: died]
hendursaga has joined #commonlisp
amb007 has quit [Ping timeout: 256 seconds]
amb007 has joined #commonlisp
<Xach> etimmons: this week
pranavats has left #commonlisp [Error from remote client]
Bike has joined #commonlisp
selwyn has quit [Read error: Connection reset by peer]
pranavats has joined #commonlisp
recordgroovy has quit [Ping timeout: 265 seconds]
recordgroovy has joined #commonlisp
raeda has quit [Remote host closed the connection]
raeda has joined #commonlisp
nij- has joined #commonlisp
Inline has joined #commonlisp
amb007 has quit [Ping timeout: 258 seconds]
amb007 has joined #commonlisp
domovod has joined #commonlisp
<Josh_2> 'ello
<nij-> Hello :) Morning there
nirved has quit [Quit: Leaving]
jeosol has joined #commonlisp
zacts has joined #commonlisp
<lotuseater> hi nij-
<nij-> :)
waleee has joined #commonlisp
IPmonger has joined #commonlisp
IPmonger has quit [Remote host closed the connection]
<jcowan> This Lisper doesn't hate SQL because it's relational, but because it is not relational enough, being full of gaps, unorthogonal, and plagued with things that look relational but make no sense.
zacts has quit [Ping timeout: 246 seconds]
selwyn has joined #commonlisp
ullbeking has joined #commonlisp
zacts has joined #commonlisp
_whitelogger has joined #commonlisp
admich has joined #commonlisp
<aeth> SQL is kind of like Lisp actually
<aeth> SQL is relational... with a bunch of compromises for real-world performance and usability
<aeth> Lisp is functional programming with similar compromises, to the point where many don't even call it FP anymore
<aeth> (and then Common Lisp in particular takes Lisp into a fully multiparadigm design)
admich has quit [Ping timeout: 258 seconds]
mister_m has joined #commonlisp
<jcowan> Yes? What's so efficient about the result of SELECT SUM(price) where product_name = "nonexistent"?
<jcowan> What would you naturally expect the sum of zero rows to be?
<jackdaniel> I may be naive, but if I buy 0 goods I expect to pay 0 coins
<jackdaniel> alternatively NULL as no payment occurs
* jackdaniel gives in to wondering whether the cave empty of dragons is the same the cave empty of knights
<jcowan> NULL is SQL-correct, but I think clearly 0 is right.
<jcowan> Admittedly you probably need to take further steps before sending an invoice to the customer demanding a payment of $0.00.
akoana has joined #commonlisp
<jcowan> That's a small thng, but there are a *lot* of small things that add up.
<raeda> Taking further steps is still a tall order for most places. I got a bill for $0 a few days ago :p
attila_lendvai has joined #commonlisp
cage has joined #commonlisp
<lotuseater> raeda: the only amount which is the same in all currencies :D
<lotuseater> did anyone of you once worked (as job) with AutoLISP? any recommendations?
hafat has joined #commonlisp
peterhil has quit [Ping timeout: 252 seconds]
hafat has quit [Quit: Leaving]
<jcowan> I'd actually rather have a recurring bill for $0 than wonder if the bill got lost in the (e)mail.
* pl regularly has a bill where the amount I'd negative and gets lower every month
<pl> s/I'd/is/
prxq_ is now known as prxq
hafat has joined #commonlisp
<pjb> pl: so they send you more and more money?
yitzi has quit [Quit: Leaving]
<lotuseater> maybe they got injected with SEND MORE MONEY
srhm has joined #commonlisp
zacts has quit [Quit: zacts]
tyson2 has quit [Quit: ERC (IRC client for Emacs 27.2)]
tfeb has joined #commonlisp
peterhil has joined #commonlisp
mister_m has quit [Remote host closed the connection]
mister_m has joined #commonlisp
tfeb has quit [Quit: died]
<nij-> Any updates on an issue brought up roughly 3 months ago, on liberating CLHS?
<jackdaniel> a rebellion commenced, the war has been wrought upon the lisp community
<jackdaniel> right now the eastern front is stuck, however we make some small progress on the center, under the proud banner "clhs liberation front"
* jackdaniel gives flyers left and right
<lotuseater> I like peace in the Land of Lisp.
<jackdaniel> nij-: clhs won't be "liberated"; its clearly stated by the copyright holder; scymtym started a repository for wscl here: https://github.com/s-expressionists/wscl and new clarifications happen from time to time
<jackdaniel> it is based on the final specification draft (not clhs)
tyson2 has joined #commonlisp
<nij-> I like the github account "s-expressionists", btw.
<nij-> jackdaniel: By liberating clhs I mean to work on DPANS (https://github.com/xach/dpans) and create "another" CLHS.
<jackdaniel> clhs is a proper noun, isn't it?
<Josh_2> nij-: I think there have been many attempts to create a new hyperspec, or a complimentary one at least
<nij-> Oh wow, seems like some movement has been 'ROLLING! https://github.com/s-expressionists/dpans
<nij-> Does scymtym hang out in #commonlisp? (https://github.com/scymtym)
<jackdaniel> yes
lad has joined #commonlisp
<jackdaniel> mind that other wscl contributors (like beach and Bike) are present too
peterhil has quit [Ping timeout: 252 seconds]
peterhil has joined #commonlisp
<phantomics> Hi, a question: is there a way to find out if a symbol is lexically bound? For example: (let ((abc 1)) (lex-boundp 'abc)) => T
<phantomics> Is there something that can do the job of lex-boundp?
<Bike> No. I mean, whether it's bound should be obvious from the source code. What are you trying to do? Something in a macro?
<jackdaniel> phantomics: lexical variables may be optimized away by the compiler, so there is not even a guarantee that they will be stored (unportably) in the environment
<phantomics> Yes, a macro that creates functions that can be used to set a variable value outside of a given scope, this is for output from the April compiler so there are constraints that I wouldn't normally have
<jackdaniel> the usual way to do that is to give names to the macro yourself
<jackdaniel> i.e (let ((a 3)) (my-macro (a :extrap t) woosh))
<jackdaniel> (but during macroexpansion time lexical variables should be accessible in the env)
<jackdaniel> another way to approach that would be incorporating a code walker
<phantomics> Ok, I'll see about that
<phantomics> The code walker is a last resort solution due to the added complexity
<jackdaniel> yes, and code walkers easily break (because of impementation-specific special forms)
<phantomics> In APL you have the ability to either create a local alias of an external variable to a function (changeable without side-effects) or to write a side-effecting statement that changes a variable external to a function, I'm figuring out how to support both of these cases
<jackdaniel> phantomics: i.e try this: (defmacro foobar (&body body &environment env) (print env))
<jackdaniel> (defun xxx (my-fancy-variable) (foobar))
<jackdaniel> you will probably see some elaborate implementation-specific structure
<phantomics> Interesting
<jackdaniel> standard-wise environment is an opaque token passed between macros
<jackdaniel> (unfortunately:)
<phantomics> Right, can't count on any specific structure being present in there
Alfr has joined #commonlisp
peterhil has quit [Ping timeout: 256 seconds]
domovod has quit [Quit: WeeChat 3.2]
tfeb has joined #commonlisp
gaqwas has joined #commonlisp
pve has quit [Quit: leaving]
pve has joined #commonlisp
attila_lendvai has quit [Read error: Connection reset by peer]
attila_lendvai has joined #commonlisp
tfeb has quit [Quit: died]
zacts has joined #commonlisp
zacts has quit [Quit: zacts]
pve has quit [Ping timeout: 258 seconds]
<nij-> (FYI: quickdocs is back https://quickdocs.org/)
yitzi has joined #commonlisp
tyson2 has quit [Quit: ERC (IRC client for Emacs 27.2)]
dsk has joined #commonlisp
cage has quit [Quit: rcirc on GNU Emacs 27.1]
nij- has quit [Quit: Using Circe, the loveliest of all IRC clients]
dilated_dinosaur has quit [Remote host closed the connection]
dilated_dinosaur has joined #commonlisp
kpoeck has joined #commonlisp
MichaelRaskin has joined #commonlisp
shka has quit [Ping timeout: 256 seconds]
zos has joined #commonlisp
danieli2 has joined #commonlisp
danieli has quit [Killed (NickServ (GHOST command used by danieli2))]
danieli2 is now known as danieli
azimut has quit [Ping timeout: 244 seconds]
azimut_ has joined #commonlisp
amk has quit [Remote host closed the connection]
<recordgroovy> feels good to get a pr merged c:
amk has joined #commonlisp
Josh_2 has quit [Ping timeout: 255 seconds]
amk has quit [Ping timeout: 255 seconds]
amk has joined #commonlisp
<recordgroovy> > :mailto #.(concatenate 'string "someone" "@" "example" "." "com")
<recordgroovy> To go against email scrapers on the GitHub... I see no reason why this *can't* be done, right?
tfeb has joined #commonlisp
<_death> you can just stuff some backslashes
<_death> interestingly, the glossary entry for "single escape" says "(In the standard readtable, slash is the only single escape.)".. but it's not slash, but backslash (2.1.4.6 has it right)
<recordgroovy> I'm targeting it to be readable by humans and asdf, but not by generic scrapers.
<recordgroovy> Enough backslashes would make it readable by asdf, but probably not humans without good effort
<_death> "\a\b\c\@\e\x\a\m\p\l\e\.\c\o\m"
<recordgroovy> I stand corrected
<recordgroovy> Lisp's backslash is always "take next char literally", that's it?
<_death> clhs 2.1.4.6
<recordgroovy> Okay, that's good to know, thanks
* tfeb is now planning a tool which will convert code with string literals into code which uses load-time-value in ... interesting ways
amk has quit [Ping timeout: 252 seconds]
yitzi has quit [Quit: Leaving]
taiju has quit [Ping timeout: 240 seconds]
tfeb has quit [Quit: died]
<moon-child> _death: sounds like a good target for a wscl issue
<Bike> i think that's on the cliki corrections page already
Alfr has quit [Quit: Leaving]
CrashTestDummy2 has joined #commonlisp
amk has joined #commonlisp
CrashTestDummy3 has quit [Ping timeout: 258 seconds]
zacts has joined #commonlisp
<lotuseater> I asked myself, when I can do all sorts of symbol names between pipes #\|, how is this done by the reader, cause (get-macro-character #\|) => (values nil nil). also with #\: for reading in keywords. or is this hidden for purpose to not break certain stuff?
kpoeck has quit [Ping timeout: 246 seconds]
taiju has joined #commonlisp
<jcowan> | is a character of a special type: multiple escape. What it does is not done by the readtable. : is just a token character: its interpretation happens at a higher level.
<_death> the readtable does contain the syntax types
<lotuseater> okay :)
<lotuseater> it was funny some days ago as i showed someone the symbol '|This is a symbol, really, I swear.| :D
<jcowan> Yes, it is. But \ and | are not implemented using readtable macro characters. You caan change what characters are used, but the behavior of single and multtiple escape chars is hardwired.
<_death> you can (set-syntax-from-char #\| #\a) and then | is no longer a multiple escape character
<lotuseater> yeah to having powers brings with it to know what one should NOT do
<jcowan> or (set-syntax-from-char #\$ #\|) and then $this is a symbol even though it doesn't look like it.$
zacts has quit [Ping timeout: 246 seconds]
<lotuseater> i know that :)
<jcowan> Hacking the readtable is mostly for reading non-CL languages.
<lotuseater> most of them are so hard to parse o_O or better to say it's so complex
<White_Flame> of course, the readtable interface isn't always the easiest to extend for every language. Sometimes you need to go raw
<jcowan> I should probably have said "non-CL Lisps". CLtL gives the example of !, which is the single escape char for Portable Standard Lisp.
<lotuseater> or opening foreign files as streams, reading all lines and break up piece by piece
<jcowan> I doubt it would help much for reading C.
<lotuseater> yes too much is allowed for writing C
<lotuseater> but this Fortran77 to CL project is quite interesting
<jcowan> The Compatibility Note at the bottom of https://www.cs.cmu.edu/Groups/AI/html/cltl/clm/node188.html explains how | is not a macro character.
<lotuseater> so NASA calls you "we need a FORTRAN77 expert" so no problem, now we do Lisp (again)
<lotuseater> thx
<lotuseater> I want the CLtL2 book, but it's so expensive ...
<jcowan> Well, it's all online
<lotuseater> haha yes as I have most of the top CL books, old and young, as PDF
<lotuseater> for working at the machine it's better, left window PDF, right emacs
<lotuseater> did you ever defined another dispatch character other than #\# ?
gaqwas has quit [Ping timeout: 258 seconds]
attila_lendvai has quit [Read error: Connection reset by peer]
attila_lendvai has joined #commonlisp
<lotuseater> oh I remembered reading about Symbolics they had their own Lisp implementations for compiling C, Ada, Fortran ^^
<moon-child> yes, but you probably wouldn't want to use a reader macro for that
<lotuseater> haha no don't worry
<jcowan> I found a copy of CLtL2 for $34 at the awesome bookfinder.com (price includes shipping to me, so YMMV)
<lotuseater> damn
<lotuseater> i have many of my good math books in my (physical) lib from zvab.com
<lotuseater> but also something like Feynman Lectures on Physics, Knuth's Concrete Mathematics or TAoCP, expensive ...
<jcowan> bookfinder indexes essentially all the physical-book retailers in the world
<lotuseater> have found in the university lib in the book sale (every for 1€) an old version of The METAFONTbook
<lotuseater> nice, thx for this tip. but the porto could kill me in the long run
<lotuseater> Common Lisp The Language 1 from 1984 for 23.65€
amb007 has quit [Ping timeout: 268 seconds]
amb007 has joined #commonlisp
<lotuseater> but now I found a big book (from 1996) about AutoLISP, could be helpful for the new potential job and I bet this small industry company still runs on much old stuff
sjl has quit [Quit: WeeChat 2.2-dev]
akoana has left #commonlisp [#commonlisp]
<lotuseater> moon-child: or finally doing this Hercules task and building a translator for COBOL to Java/C# or whatever banks/insurances mean is good
<hayley> I read that it is made very complicated by having rational arithmetic (bad for Java, fine for CL) and being able to change GOTO targets on the fly (very bad unless you give up and compile basic-block at a time).
<lotuseater> phew
<lotuseater> or the systems behavior must be changed safely stepping away from those hairy things
peterhil has joined #commonlisp
mister_m has quit [Ping timeout: 265 seconds]
<lotuseater> ok my eyes get tired, good night
lotuseater has quit [Quit: ERC (IRC client for Emacs 27.2)]
selwyn has quit [Read error: Connection reset by peer]
<etimmons> Xach: UIOP 3.3.6 is on the way. Being tested on the systems not yet covered by CI. Will hopefully be out in a day or two
frgo has quit [Remote host closed the connection]
frgo has joined #commonlisp
mister_m has joined #commonlisp
<jcowan> hayley: Java has BigDecimal, which should be a good choice for COBOL
<hayley> Right.
zacts has joined #commonlisp
cjb has joined #commonlisp
zacts has quit [Quit: Client closed]