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>
MumblyFoo has quit [Remote host closed the connection]
rgherdt_ has joined #commonlisp
random-nick has quit [Ping timeout: 240 seconds]
gigamonkey has joined #commonlisp
Inline has joined #commonlisp
kdlv has joined #commonlisp
s-liao has quit [Quit: Client closed]
rgherdt_ has quit [Ping timeout: 240 seconds]
s-liao has joined #commonlisp
Lord_of_Life has quit [Ping timeout: 250 seconds]
Lord_of_Life has joined #commonlisp
srhm has quit [Ping timeout: 240 seconds]
servytor has quit [Quit: Connection closed for inactivity]
nature_ has quit [Ping timeout: 250 seconds]
scymtym has quit [Ping timeout: 250 seconds]
occ has joined #commonlisp
jealousmonk has quit [Quit: ERC (IRC client for Emacs 27.1)]
Catie has quit [Quit: heading home]
nature has joined #commonlisp
Guest74 has joined #commonlisp
Bike has joined #commonlisp
wheelsucker has quit [Remote host closed the connection]
Catie has joined #commonlisp
<hayley> Here is the demonstration video I promised yesterday: https://www.youtube.com/watch?v=9TQTMvoPJJY
<elderK> Hey guys, I was wondering if there's any portable way to ensure that something is allocated on the stack, and have a specific size in bytes. I figure not so much.
<elderK> A related question is, say when we're doing bitwise stuff, how to ensure that we're truly operating on fixnum types?
<elderK> Or, in that case, would it simply be better to use whatever intrinsics your implementation provides?
<Bike> usually you can look at the disassembly and get an idea of what's happening at runtime
<Bike> at high optimization levels some implementations (or at least, sbcl) will note at compile time when it has to do things like box floats that hurt efficiency
<hayley> Stack allocation is an implementation issue, not a language issue.
<Bike> there's no portable way to ensure that something has a given size in bytes, and i'm not sure it's reasonable to expect that. you can request objects be stack allocated with the dynamic-extent declaration but that's the limit of your power there
<Bike> implementations may document what they do, e.g. sbcl's manual is very specific about how and when it stack allocates objects
<elderK> Thank you :) I've been doing some hobbyist game development recently in C++ and have been toying with the idea of doing it in CL instead. I've been using a lot of bitwise tricks and stuff. Was wondering if any of them would carry over.
<elderK> Like, a single integer encoding lots of fields. From my last big experiments in CL, I found bitwise arithmetic to be a little odd, mostly because integers are effectively unlimited width.
<elderK> At least, that was my understanding then. Is it correct?
<hayley> Yes.
<hayley> But I've never found anything unexpected by using unsigned integers throughout.
<elderK> Aye but say you want to have a 32bit integer that encodes two things. There's no portable way to ensure that the integer really is using only 32bits of storage, right?
<hayley> I don't see how you do it generally, but practically you could expect that to be the case.
<thomaslewis> Would this fit your use case?
Inline has quit [Ping timeout: 240 seconds]
<Bike> it sounds like elderk is talking about internal operations more than external i/o
<elderK> Aye, internal.
<elderK> It may simply be that if I want this level of detail / control, I shouldn't use CL. Or, I can use CL and just deal with some things being "larger" than are strictly required. That's okay, too.
<elderK> I'm no expert at all. I'm not even sure I'd be classed as an intermediate CLer so, you know, it's all good information to learn.
<hayley> The best move would probably be to declare the right type, e.g. (unsigned-byte 32), then have the compiler decide whether that is a subtype of FIXNUM or not.
johnjay has quit [Ping timeout: 250 seconds]
<hayley> If it is, then you get fast unboxed integers. If not, you still have a working program.
johnjay has joined #commonlisp
<Bike> optimization of the runtime involves a lot of different concerns, which is why the general paradigm is to leave it up to the implementation, but also to provide hints to help the process along
<Bike> if you have _demands_, that can screw a lot of things up
<Bike> even c/c++ implementations aren't required to have exact bitwidth integer types
s-liao has quit [Quit: Client closed]
cjb has quit []
s-liao has joined #commonlisp
<Bike> of course you can sometimes get to the point where you really can make demands, but that takes some time and thought
Krystof has quit [Ping timeout: 260 seconds]
lisp123 has joined #commonlisp
<Guest74> elderk: what kind of bitwise tricks are you using?
ec has quit [Quit: ec]
lexi_sparks has joined #commonlisp
taiju has quit [Ping timeout: 250 seconds]
taiju has joined #commonlisp
<White_Flame> elderK: there are bit vectors for boolean flags, and LDB for accessing multi-bit values from inside integers
<White_Flame> struct/object slots are usually all going to be full word width and tagged. Unboxed/small values can be had in type-declared locals within a function (including local FLET/LABELS functions able to pass around unboxed values among themselves), and in :element-type specialized arrays
<White_Flame> (declare (fixnum <varname>)) and (the fixnum <value>) or (logand #xffffffff <value>) style masking are going to be common in micro-optimizing various things
<Bike> sbcl can do unboxed slots in structs
<White_Flame> can it do smaller packed slots?
beach` is now known as beach
<Bike> don't know the exact limits off the top of my head. i don't think it does packed bitfields, but it can probably put two singles in a 64 bit word and such
<beach> Good morning everyone!
<Guest74> i think i read somewhere it doesn't do things like 8,16,8 , maybe 8,8,8,8, but that may have been from very old mailing list messages.
Devon has joined #commonlisp
<Bike> https://github.com/sbcl/sbcl/blob/master/src/code/early-raw-slots.lisp#L99-L172 looks like it doesn't do integers shorter than words
waleee has quit [Ping timeout: 246 seconds]
<Bike> don't quote me on that, this is deep in the internals obviously
cosimone has quit [Quit: ERC (IRC client for Emacs 27.1)]
Devon has quit [Ping timeout: 260 seconds]
Oladon has joined #commonlisp
pranavats has left #commonlisp [#commonlisp]
<jmercouris> You are all missing the point, it’s not about = and == being confusing being true- you could take literally any statement I make and jackdaniel would take the opposite stance to try to make me look stupid
<jmercouris> However, I’m not quite dumb enough to take the bait and even engage, it is a well known fact that = and == are commonly confused
<White_Flame> I don't know about confused, but it can be a hard-to-notice typo
<jmercouris> This is of course implied
<jmercouris> I think this is obvious by the fact that I mentioned eq and setf
<White_Flame> but even that is a bit novice
<jmercouris> Is it though? I didn’t realize experts don’t make mistakes
<jmercouris> My eyes frequently jump across letters and symbols and I misspell things
<jmercouris> I often see one thing and then only see another when looking carefully
elderK has quit [Quit: Connection closed for inactivity]
tyson2 has quit [Remote host closed the connection]
Lord_of_Life has quit [Quit: Laa shay'a waqi'un moutlaq bale kouloun moumkine]
semz has quit [Ping timeout: 250 seconds]
Lord_of_Life has joined #commonlisp
s-liao has quit [Ping timeout: 256 seconds]
s-liao has joined #commonlisp
<jackdaniel> jmercouris: you are clearly rude enough to publicly impy malice on my side. next time I will ban you - enough is enough. this is final warning
<jmercouris> Ban me for what? Calling you out?
<jmercouris> Perhaps I should ban you for your degrading comments
jmercouris was banned on #commonlisp by jackdaniel [*!*sid438340@*.hampstead.irccloud.com]
jmercouris was kicked from #commonlisp by jackdaniel [jmercouris]
nature has quit [Ping timeout: 240 seconds]
<beach> hayley: Nice demo! Looks very sophisticated!
s-liao has quit [Quit: Client closed]
aartaka has joined #commonlisp
<hayley> beach: Yeah, well, I didn't present it - some asshole even cut me off when I was trying to present it to the other finalist students, as we had some time between (private) presentations.
<beach> Wow, why would anyone do that? What was that person's reason for doing it?
semz has joined #commonlisp
<hayley> And, to add insult to injury, my group came a close second and we just got access to some startup funding shit. Not that the first prize of getting an internship with GitHub was appealing either.
<beach> Still, that's nice!
<hayley> Sure..
user|29 has joined #commonlisp
<hayley> Ironically (relative to what I mentioned in the video about "breakout rooms"), I got cut off because the organisers and judges were in another room, and were unaware of what was going on in the student room.
lexi_sparks has quit [Ping timeout: 240 seconds]
<beach> I see.
aartaka has quit [Ping timeout: 250 seconds]
akoana has left #commonlisp [Leaving]
user|29 has quit [Client Quit]
notzmv has quit [Ping timeout: 240 seconds]
<hayley> My mistake was probably calling the solution a "virtual classroom" when describing it to my team initially, as it does not look like a classroom at all.
<hayley> The only similarity to a real classroom is a physical metaphor, where you can walk up to someone and see what they did.
<Guest74> more like a playground
<hayley> Sure.
pranavats has joined #commonlisp
taiju has quit [Ping timeout: 268 seconds]
Bike has quit [Quit: Connection closed]
<lisp123> I have a question - Often one uses their own package that shadows some of CL's symbols. Using IBCL as an example, this requires :use :ibcl in every package definition. Is there a way to *temporarily* hijack the CL package so that *all* forms are evaluated with the user's custom CL package (e.g. IBCL in this example)?
taiju has joined #commonlisp
<lisp123> (Namely in my case, to be able to load all system definitions in the context of the custom package and not :CL)
<hayley> Unless IBCL is exactly the same as CL, then it is probably a bad idea.
Devon has joined #commonlisp
<lisp123> Its very similar, and not for 'production' I guess
<hayley> But you could define a IBCL-USER package like (defpackage #:ibcl-user (:use #:ibcl)) and then evaluate forms in that package.
<beach> lisp123: By the time you get to evaluation, it is too late. The package of a symbol is determined at read time.
Guest74 has quit [Ping timeout: 240 seconds]
<beach> lisp123: It ought to be possible to bind *package* before loading source code.
<lisp123> beach & hayley: thanks
<lisp123> (for context), so what I was thinking of doing was replacing CL with IBCL (which stores source code in a hash table). Then loading ALL of quicklisp (every package) and having available every function's source code on demand
<lisp123> Now, many people will put :use :cl in their package defintion, so I think binding *package* may not work, or maybe I am mistaken?
<hayley> Surely your Lisp implementation already keeps source tracking information, and Quicklisp keeps ASDF systems on disk.
<lisp123> Not in a good form, lot of things get expanded out
<lisp123> could i redefine cl:symbol temporarily and then replace it back to the original afterwards?
<hayley> I hope not.
<lisp123> Another idea could be to hijack read and replace :cl with :ibcl for example every time and also bind *package* to :ibcl?
<White_Flame> can package local nicknames shadow global package names?
<hayley> Another idea would be to think of a better idea.
s-liao has joined #commonlisp
user|29 has joined #commonlisp
<lisp123> hmmm ok
user|29 has quit [Client Quit]
<lisp123> I have an alternative (although curious to know an answer to White_Flame's question) - Can one replace the standard reader of a lisp implementation with Eclector's?
Devon has quit [Ping timeout: 264 seconds]
<lisp123> I got a solution :) So I'm good. But if anyone knows a way to shadow :cl with :some-package, that would be great
<White_Flame> you should be able to change your implementation's implementation
<beach> lisp123: Sure, you can create your own loader using Eclector+EVAL. It might be a bit tricky.
<White_Flame> beach: but what if that code then calls CL:READ?
<beach> Hmm.
Devon has joined #commonlisp
<beach> You would have to configure Eclector to intern symbols in your own package rather than the CL package.
<beach> Luckily, Eclector was made to be able to do stuff like that.
<lisp123> beach: I will read into all of that. It would be too many questions so I will do some self-study first, but hopefully I can research and figure how to 'create a loader'
<lisp123> Thanks
Catie has quit [Quit: rcirc on GNU Emacs 29.0.50]
lisp123 has quit [Quit: Leaving...]
<beach> Good luck.
alvaro121_ has joined #commonlisp
holycow has joined #commonlisp
<holycow> hi
<hayley> hi
<holycow> hi hayley
<holycow> you keep crazy hours
<holycow> :)
<holycow> noob question
<holycow> i'm playing with clog and when i run the demos, it opens up a browser and connects the app via websocket. this is fine.
<hayley> Well, it is only 5:40pm here.
<holycow> however, in sbcl, it doesn't release the command prompt so i can continue evaluating forms
<holycow> oh!
<holycow> anyway, i noticed that if i ctrl-c in the sbcl window, it provides an interrupt option and i can abort out into a command prompt
<holycow> the browser demo keeps on working but i have access to the sbcl command prompt after i abort
shka has joined #commonlisp
<holycow> what is this ctrl-c in sbcl? my sysadmin kickedin an had me press ctrl-c just to test.
<holycow> i wasn't expecting that to do anything
<holycow> hayley: oh, you are upside down?
<holycow> and under lock down?
<hayley> C-c invokes the debugger.
<holycow> heh ;)
<hayley> holycow: Yes and partly.
<holycow> ohhh it does? aha.
doulos05 has joined #commonlisp
<doulos05> Hello! Is there anybody on that can help me clear a mental log jam around using LTK?
frgo has quit [Ping timeout: 250 seconds]
<doulos05> This is my first attempt at building an actual GUI, and I think I'm doing it wrong.
<doulos05> I've got stat block readouts of a couple of fairly complex CLOS objects that I want to put on the screen and then change as the game goes on.
<doulos05> So I made a function (display-record-sheet unit target-frame) that takes the stats from the unit object, drops them into labels and other GUI widgets, and lays those out within that target frame.
<doulos05> I had hoped I could just call that function again to "redraw" the record sheet, but the moment (display-record-sheet) gets called a second time, it breaks the binding on all commands I have bound to any widgets in the frame.
<doulos05> I confirmed this by setting up the window, interacting with the button, and then calling the redraw function manually and interacting with it again. The calls to (print) don't output to standard-output and nothing in the record sheet updates.
VincentVega has joined #commonlisp
<doulos05> DO I have to keep every single GUI widget around within scope of my main loop and setf to update them? I was trying to do it this way to simplify things.
<holycow> VincentVega: what do they call a big mac in amsterdam?
z3t0 has joined #commonlisp
bhyde[m] has quit [Quit: Client limit exceeded: 20000]
holycow has quit [Quit: Lost terminal]
White_Flame has quit [Remote host closed the connection]
White_Flame has joined #commonlisp
Cymew has quit [Ping timeout: 240 seconds]
taiju has quit [Ping timeout: 240 seconds]
<beach> doulos05: Did you consider using McCLIM instead of LTK?
bhyde[m] has joined #commonlisp
<doulos05> This is my first time ever attempting a GUI. Is there a good, beginner friendly tutorial for McCLIM?
<beach> I know it is being worked on. I don't recall the state of it. But #clim is very helpful with questions.
<beach> doulos05: The advantage of McCLIM is that you are working with a single safe language with established debugging tools.
<doulos05> Yeah. The other question I have is "How hard is this to set up on my Mac?"
<doulos05> I'll poke around there and see. I'd love to work with McCLIM if I can. I'll hop on #clim and see if anybody there has gotten it working on MacOS.
<beach> I don't know. Perhaps you have too many constraints on your GUI framework to make McCLIM feasible at this time. I just thought I should mention it to give you the option of avoiding FFI hell.
<doulos05> Avoiding FFI hell is worth jumping through a few hoops.
<beach> That's what I think myself.
<beach> I know there is a CLX backend and a framebuffer backend. I suspect there is no Mac-specific backend at this point.
<beach> But then, I don't use commercial operating systems, so I don't know.
gaqwas has joined #commonlisp
edgar-rft has quit [Quit: Leaving]
doulos05 has left #commonlisp [ERC (IRC client for Emacs 28.0.50)]
amb007 has quit [Ping timeout: 250 seconds]
amb007 has joined #commonlisp
shka has quit [Ping timeout: 256 seconds]
taiju has joined #commonlisp
attila_lendvai_ has joined #commonlisp
pjb has quit [Ping timeout: 240 seconds]
Devon has quit [Ping timeout: 256 seconds]
Devon has joined #commonlisp
bcasiello has quit [Read error: Connection reset by peer]
Oladon has quit [Quit: Leaving.]
Devon has quit [Ping timeout: 240 seconds]
aartaka has joined #commonlisp
rotateq has joined #commonlisp
Cymew has joined #commonlisp
amb007 has quit [Ping timeout: 250 seconds]
amb007 has joined #commonlisp
dec0d3r has quit [Quit: Leaving]
nwoob has joined #commonlisp
<nwoob> I was reading about CL and everywhere people wrote like learning Lisp gives you different perspective and enlightenment.
<nwoob> Does that comes when you have very advanced understanding of CL?
Krystof has joined #commonlisp
<jackdaniel> nwoob: many small pieces of "enlightenment" come from simple stuff, like incremental compilation
<nwoob> or can the difference be seen and realized when a newbie start learning
<jackdaniel> or metaprogramming with the operator defmacro
<jackdaniel> some people get very surprised when they learn that + is implemented as a function
<rotateq> :)
<jackdaniel> or that it is possible to use the IF form as an rvalue
<jackdaniel> (using c++ terms)
<beach> nwoob: What languages do you already know?
<nwoob> so I should also learn another language
<jackdaniel> there are many other things that are pretty basic in common lisp but get gross really fast when you try to achieve them in some other popular languages
<nwoob> beach: I know javascript
<beach> I see.
<nwoob> I know intermediate JS, I'm not advanced in that
<beach> Yes, well, you are used to automatic memory management which is good.
s-liao has quit [Quit: Client closed]
amb007 has quit [Read error: Connection reset by peer]
lisp123 has joined #commonlisp
rgherdt_ has joined #commonlisp
amb007 has joined #commonlisp
amb007 has quit [Read error: Connection reset by peer]
amb007 has joined #commonlisp
s-liao has joined #commonlisp
mingus has joined #commonlisp
Qwnavery has joined #commonlisp
aartaka has quit [Ping timeout: 246 seconds]
aartaka has joined #commonlisp
Qwnavery has quit [Quit: WeeChat 3.3]
Jing_ has joined #commonlisp
<beach> nwoob: We definitely encourage you to learn Common Lisp, and both #commonlisp and #clschool can answer questions that you might have.
Jing has quit [Ping timeout: 245 seconds]
mingus has quit [Ping timeout: 256 seconds]
gaqwas has quit [Ping timeout: 240 seconds]
taiju has quit [Ping timeout: 250 seconds]
mingus has joined #commonlisp
<lisp123> Are there any good examples of where CL shines?
<lisp123> (short, simple, etc.). Like a small program that is much shorter / elegant in length vs. another popular language (Python seems to be all the rage)
mingus has quit [Ping timeout: 264 seconds]
mingus has joined #commonlisp
<lisp123> Generic Functions might be a good candidate that is easier to grasp (macros seem a bit advanced for that basic "this is why CL is great")
mingus has joined #commonlisp
<beach> lisp123: I think the difference is more pronounced in a large software system.
<beach> For small things, you can always find a language that has that particular construct built in.
<beach> lisp123: For example, purely functional languages are usually more terse for simple things.
<lisp123> beach: That's a good point. CL does tend to lend itself to more 'robust' and 'reliable' code
<beach> Definitely.
<lisp123> And given the language itself is from 1994 and still so good, that's like testament in itself :)
<VincentVega> holycow: Big Mac is a Big Mac, but they dip that shit in mayonnaise.
macaw has quit [Quit: macaw]
<beach> lisp123: While (as WSCL shows) there is a lot of undefined behavior in the standard, most implementations are fairly safe. Which is not the case for most implementations of C or C++ for instance.
<lisp123> Indeed
<beach> And, as I pointed out in #clschool yesterday, as soon as you have a large program, you need conditions/exceptions. And C doesn't have those (though it has setjmp/longjmp), and I have been told that C++ exceptions are so useless that large organizations won't use them.
<VincentVega> lisp123: Since I got aquainted with lisp, I have had a certain affection for the or macro, especially if you are looking for a quick and easy showcase of prefix notation.
<beach> So in a large and safe program, a lot of explicit code must be dedicated to handling exceptional situations in languages such as C or C++.
<lisp123> beach: Yes, the condition system is also really good and well thought through
<beach> So again, Common Lisp will shine more in code that needs that stuff, which is in larger serious systems.
<lisp123> VincentVega: That's actually a great example (benefits of prefix notation, delayed evaluation)
<lisp123> beach: Makes sense
<VincentVega> lisp123: yeah : )
mingus has quit [Ping timeout: 256 seconds]
aartaka has quit [Ping timeout: 268 seconds]
<rotateq> lisp123: better ask for the small amount of things where it doesn't shine directly :)
aartaka has joined #commonlisp
nwoob has quit [Ping timeout: 240 seconds]
<lisp123> rotateq: True, that will take up less heap space :)
<rotateq> now this one quote comes again to my mind, and it lists many non-trivial topics
nwoob has joined #commonlisp
scymtym has joined #commonlisp
occ has quit [Ping timeout: 256 seconds]
snits has quit [Ping timeout: 268 seconds]
mingus has joined #commonlisp
snits has joined #commonlisp
snits has quit [Ping timeout: 256 seconds]
alvaro121_ has quit [Ping timeout: 250 seconds]
snits has joined #commonlisp
mingus has quit [Ping timeout: 264 seconds]
taiju has joined #commonlisp
s-liao has quit [Ping timeout: 256 seconds]
ahlk has quit [Remote host closed the connection]
Guest4598 has joined #commonlisp
Guest4598 has quit [Client Quit]
s-liao has joined #commonlisp
occ has joined #commonlisp
lisp123 has quit [Quit: Leaving...]
rain3 has joined #commonlisp
amb007 has quit [Ping timeout: 256 seconds]
amb007 has joined #commonlisp
amb007 has quit [Read error: Connection reset by peer]
amb007 has joined #commonlisp
NeoCron has joined #commonlisp
random-nick has joined #commonlisp
nwoob has quit [Ping timeout: 264 seconds]
NeoCron has quit [Remote host closed the connection]
s-liao has quit [Quit: Client closed]
paule32_ is now known as paule32
kadir has joined #commonlisp
amb007 has quit [Ping timeout: 246 seconds]
amb007 has joined #commonlisp
nwoob has joined #commonlisp
amb007 has quit [Read error: Connection reset by peer]
amb007 has joined #commonlisp
Cymew has quit [Ping timeout: 256 seconds]
didi has left #commonlisp [O bella ciao bella ciao bella ciao, ciao, ciao.]
amb007 has quit [Read error: Connection reset by peer]
amb007 has joined #commonlisp
VincentVega has quit [Ping timeout: 264 seconds]
pjb has joined #commonlisp
mingus has joined #commonlisp
pranavats has left #commonlisp [#commonlisp]
scymtym has quit [Ping timeout: 256 seconds]
pranavats has joined #commonlisp
amb007 has quit [Read error: Connection reset by peer]
amb007 has joined #commonlisp
<jackdaniel> hayley: I'm not sure how much you use C, but confusing = with == for a seasoned C/C++/Java programmer is similar to confusing car and cdr for a seasoned common lisp programmer
mingus has quit [Ping timeout: 246 seconds]
tyson2 has joined #commonlisp
<Nilby> I thought I made a mistake once, but thankfully I was mistaken.
scymtym has joined #commonlisp
amb007 has quit [Read error: Connection reset by peer]
VincentVega has joined #commonlisp
amb007 has joined #commonlisp
hineios has quit [Quit: The Lounge - https://thelounge.chat]
mingus has joined #commonlisp
hineios has joined #commonlisp
s-liao has joined #commonlisp
theothornhill has joined #commonlisp
mingus has quit [Ping timeout: 256 seconds]
edgar-rft has joined #commonlisp
aartaka has quit [Ping timeout: 256 seconds]
theothornhill has quit [Remote host closed the connection]
theothornhill has joined #commonlisp
theothornhill has quit [Remote host closed the connection]
attila_lendvai_ has quit [Ping timeout: 256 seconds]
Guest74 has joined #commonlisp
s-liao has quit [Quit: Client closed]
s-liao has joined #commonlisp
Cymew has joined #commonlisp
<jcowan> Historically the distinction between = and == was introduced because of the (IMHO very dubious) decision to make assignment an expression. In Basic, a = b = c means that a is assigned true if b and c are equal and false otherwise. To assign both a and b to c, you write a, b = c.
theBlackDragon has quit [Ping timeout: 268 seconds]
edgar-rft has quit [Quit: Leaving]
attila_lendvai_ has joined #commonlisp
<Guest74> :)
<Guest74> If I wanted to keep a base system free of external dependencies. What is the best way to provide additional functionality that has external dependencies?
Devon has joined #commonlisp
pve has joined #commonlisp
<beach> An ASDF system definition?
<beach> Not sure I understand the issue.
<Guest74> so I have a raster package that can be used without deps.
mingus has joined #commonlisp
occ has quit [Ping timeout: 240 seconds]
<Guest74> and then I have additional functionallity, like loading images, or display to a screen or framebuffer.
<jackdaniel> define a system "whatever" that pulls everything and depends on "whatever/core"
<jackdaniel> where "whatever/core" implements vanilla functionality
<Guest74> I'd like to have the core package named the package.
aartaka has joined #commonlisp
<jackdaniel> then name it whatever and name the full one "whatever/with-bells (and whistles)"
<Guest74> I'd like it all to have the same name, but asdf doesn't like that.
<jackdaniel> then how the consumer would distinguish them?
<jackdaniel> you may load a module under :if-feature too
mingus_ has joined #commonlisp
<Guest74> oh, that sounds interesting.
<jackdaniel> (defsystem "foo" :components ((:module "core" …) (:module "whistles" :if-feature (:and :bells :whistles) …))
servytor has joined #commonlisp
<jackdaniel> that said having separate systems would be (imo) much cleaner for potential users
<Guest74> i think so too. and then you can add any features you want.
<Guest74> but asdf always complains when the system name is different than the package name.
cage has joined #commonlisp
<jackdaniel> no it doesn't
<Guest74> it does for me. Can never properly find the system.
<jackdaniel> it complains when the base system name is different than the filename of the asd file
<jackdaniel> base system name is "<whatever-comes-before-slash>" in "<whatever-comes-before-slash>/subsystem"
nwoob has quit [Ping timeout: 240 seconds]
<jackdaniel> if the file is named other than <whatever-comes-before-slash>.asd it will complain
<jackdaniel> that was a source of a certain issues because when introduced it broke a few things, moreso it started complaining for systems named like "cl-fad-tests"
Bike has joined #commonlisp
<Guest74> yes, i find it inconvenient. But i will try a longer named system with appropriately named asd and load into the core package.
<jackdaniel> for Fare's defense it was to speed up locating systems (without loading all asd files along the way)
<Guest74> then again, maybe I'm overthinking it and most people load everything including the kitchen sink into their images.
mingus_ has quit [Read error: Connection reset by peer]
mingus has quit [Read error: Connection reset by peer]
<jackdaniel> I think that the most common practice is what I've mentioned, that is the main system with all features named "name" and depends on its subsystems that contain sub-functionalities, like "name/base", "name/bell", "name/whistle"
<etimmons> Not just a speed up. It also prevents .asd files that aren't explicitly being searched for from running arbitrary code/loading arbitrary systems.
<Guest74> I hate that slash.
<jackdaniel> etimmons: well yeah, but that not even could, but /should/ be solved by writing a separate reader for asd files. I suppose that given all defmethod forms littering existing systems definitions that ship is already gone
<Guest74> does clpm have a different strategy or just uses asd's?
<etimmons> jackdaniel: I agree. But :defsystem-depends-on could still be a bit tricky to handle, even with a separate reader.
<etimmons> Guest74: CLPM is (largely) responsible only for installing dependencies and tracking what got installed. Finding and loading systems is all ASDF's job.
<Guest74> ah, so nobody is working on an asdf replacement? Or is that what Shinmera's new thing is?
<Shinmera> It is.
<Guest74> exciting times ahead.
<Shinmera> Haven't had time to work on it recently
<Guest74> understandably
<Shinmera> But I'd say most of the hard bits are done
Bike has quit [Quit: Connection closed]
<paule32> hello, what the topic? a new lib ?
Bike has joined #commonlisp
<jackdaniel> etimmons: wouldn't that be easier though? if you have a separate parser, then you learn that the definition depends on another system and you load it beforehand. and since you don't have actual code in asd, then there shouldn't be problems with accessing package that doesn't exist yet
<Guest74> I wonder what the next ecosystem shift will be? some sort of collaborative coding?
<jackdaniel> you will have copilot write random c code that looks almost like its doing something correctly. sounds like a joke, but if we have stackoverflow-based coding, why not randomized-foss-laundery one?
<paule32> you missing contributers ?
<etimmons> jackdaniel: I was thinking more along the lines of pathological cases. Where you couldn't even tell what systems an .asd defines until the :defsystem-depends-on have been loaded. I'm pretty sure I could do something like that with ASDF right now.
<etimmons> You'd either have to restrict the naming convention (what we have today) or restrict what a :defsystem-depends-on can sanely do.
<jackdaniel> etimmons: if we take canonical grammar of the asdf system from the manual, then it goes like (defsystem <name> <option-name> <option-value> ...) so defsystem-depends-on could be found with a non-turing-complete-reader I think; and if we assume that asd may contain code, then I agree that it is impossible
davep has joined #commonlisp
jealousmonk has joined #commonlisp
<paule32> ah, okay. i already thinking about my own parser, too. but then it will break iso lisp
s-liao has quit [Quit: Client closed]
<paule32> i began the source code in pascal
<paule32> like more for a web module for the apache2.4
nature has joined #commonlisp
<etimmons> jackdaniel: What I have in mind doesn't require code in the .asd file. IIRC, Guest74 wanted children system names to be separated with #\-. It's not too much of a stretch to combine that idea with package inferred systems using some new system class.
<Guest74> so :if-feature requires the feature to be set before asdf starts planning. Is it possible to set a feature for the planning stage within the system definition?
<etimmons> So if you've got foo.asd and bar.lisp, bar.lisp would define the system foo-bar. How would foo-bar be found? The special parser doesn't help you here because ASDF doesn't know that bar.lisp defines the foo-bar system until foo's :defsystem-depends-on have been loaded.
<etimmons> So we're back to either enforcing a naming convention or eagerly loading everything's :d-d-o
<jackdaniel> etimmons: I'm ignorant regarding inferred system names so I can't keep up with the discussion :p I'll need to trust you on this
Cymew has quit [Ping timeout: 260 seconds]
<jackdaniel> I'm not against the naming convention, I've mentioned a separate parser as a solution to the arbitrary code problem
<jackdaniel> (when only reading system defintions)
<etimmons> jackdaniel: I wish I were ignorant of them :). I regret switching a number of my projects over to them and am working to revert that.
<etimmons> Totally. I'm just pointing out that, given ASDF's current model, that doesn't help you much. Because in the end, even something as simple as extracting the names of defined systems could require loading the :d-d-o.
<etimmons> (or whatever defmethods users have squirreled away in the .asd)
<jackdaniel> sure, that's why I think that it is not possible to fix it now
<etimmons> Now maybe ASDF 4 could get away with making the .asd more declarative. But I kind of doubt it since so many things would break.
<Guest74> I don't think anybody will write that.
<paule32> a transpiler ?
<Guest74> asdf 4
occ has joined #commonlisp
<paule32> i have the source code of clisp, it is in C, and i had the idea to make a iso lisp system like alegro franz, but free, but i saw no interesst
<Nilby> I wrote a thing that needed all the .asd's in quicklisp to be declarative, and it only failed on a few systems and I could come up with non-full-parsing workarounds for most things.
<etimmons> Well, maybe it's possible... Use the special parser to read the file. Look for some marker indicating it's ASDF 4 compatible (or contains only a defsystem form with no :d-d-o). If found, register all the systems, etc. (and have access to features such as arbitrary system names). Otherwise, require the current naming convention and fall back to existing behavior.
<jackdaniel> Nilby: I did the same! :)
<Nilby> But I really wish for an fully declarative system defintion, and evaluation configuration to be separate.
<jackdaniel> a few years back, to generate quicklisp distributions
<jackdaniel> and a graph of dependencies
asen has joined #commonlisp
<etimmons> Guest74: I'm not sure, but it's possible that features set in earlier build phases (like :d-d-o ) could affect :if-feature in later phases. But in general, I do think the features need to be present before planning.
<Nilby> someday maybe I'll finish my thing like debian "aptitude" for quicklisp. I have to merge my tui table widget and tree widget.
<Guest74> that's unfortunate. I've written quite a few systems that include/exclude certain things based on a future encompassing system and was kind of hoping I could just set the feature in that future system.
<Guest74> kinda did that so people could use the individual systems without including my opinionated everything-and-the-kitchen-sink.
<etimmons> Yeah, that's something I really like about Python/pip. You can provide options specifying which features you want installed for each package. Closest we've got to that is just separate system names.
<Nilby> :d-d-o setting features for later :if-feature seems to always work for me
<Nilby> not that it's elegent or anything
<etimmons> I typically do either what jackdaniel suggested (foo/core foo/bells) or make systems like foo and foo+bells (in separate .asd files, of course)
<jackdaniel> fun fact: if you have * in a name of the file, slime gets confused :)
<etimmons> Oh, many implementations get confused by that as well
amb007 has quit [Read error: Connection reset by peer]
amb007 has joined #commonlisp
<Guest74> my use case is cause I'm lazy and would rather have one package, e.g. my vector graphic stuff that can render svg paths, where I'd like to define the functions for display on my surfaces but also provide people the option to render on x11 windows.
<jackdaniel> perhaps it is the implementation underneath what gets confused, I didn't dig into it
Inline has joined #commonlisp
<Nilby> the whole :documentation #.(slurp "REAMDE.md") is funny though
attila_lendvai_ has quit [Ping timeout: 256 seconds]
rain3 has quit [Read error: Connection reset by peer]
<pve> lisp123w: were you able to "shadow" the CL package? (reading the logs here)
theBlackDragon has joined #commonlisp
edgar-rft has joined #commonlisp
<Guest74> nilby: I'm thinking of going the other way and just have my readme generated from the documenation. Somebody must already be doing that.
<jdz> Some implementations get confused with colons in file names, too.
<etimmons> jackdaniel: I thought I wrote up a list somewhere, but can't find it again. I do remember for sure that it's basically impossible to use files with wildcards in their name on ABCL and ECL.
<jackdaniel> etimmons: I was about to say "who uses ecl anymore" as a joke, but got scared that too many people would nod with a serious look in their eyes :)
<Guest74> ugh, i thought linux had a problem with * in the filename, but was able to create one, just can't remove it now.
<jackdaniel> Guest74: rm file\*.foobar
<jdz> Or single quotes.
<Guest74> lol, I'm so used to the repl i used the wrong shell command.
<Nilby> Guest74: Yes, that's the direction I like, but harder to get spiffy text features.
<Guest74> yeah, that's been keeping me from writing anything. Do you include some sort of markdown or not?
amb007 has quit [Read error: Connection reset by peer]
<Guest74> it'd be nice if there was a way to display a docstring in different formats.
amb007 has joined #commonlisp
<Guest74> or maybe decide the future is here and just ignore everybody who uses describe/documentation at the repl.
<etimmons> jackdaniel: Been many years since I chatted with him, but I know a researcher that swore by ECL. Only CL implementation he would use because he really liked the C interop.
<Nilby> Guest74: I don't, but it doesn't matter since there's nobody reads it.
tyson2 has quit [Remote host closed the connection]
<Guest74> they will once there's a nice documentation reader!
<jackdaniel> well if not anyone else, I use ecl :) (and in seriousness I'm aware of a few people using it in both commercial and foss settings)
<Guest74> it can be used on android right? it's on my to research list.
<etimmons> Although SBCL is my primary, I always do my best to test on ECL as well :)
rotateq has quit [Remote host closed the connection]
<jackdaniel> Guest74: yes, and Polos Ruetz ported EQL5 to android too
<Nilby> I use ecl all the time to compile sbcl on my phone.
<jackdaniel> so you may use all of qt5 in there
<jackdaniel> (including graphical repl and such)
<Guest74> unfortunately my brain isn't smart enough for qt. Or it wasn't last time I looked at it.
<jackdaniel> well, eql5 gives you lispy way to work with it
<Guest74> my hope is to write usable systems my brain can understand and then have smarter people make them better.
<jackdaniel> it is a really cool project (it is a shame that it works only under ecl, otoh that highlights some strengths of ecl)
<Guest74> well at least it look s like qml is pretty compatible with my ui stuff. Probably wouldn't be hard to write a converter.
<etimmons> Speaking of testing, for the Gitlab inclined folks here I've been working on scripts for Gitlab CI that make it pretty trivial to run tests on multiple implementations. Not ready for primetime quite yet, but if you want to be a guinea pig/give feedback it's at <https://gitlab.common-lisp.net/clci/gitlab-ci>
<jackdaniel> Guest74: if you have questions then author reguarily hangs out and reads logs on #ecl
<jackdaniel> (the software author, not the blog post)
<Guest74> I'll try to keep that in mind. must finish the linux ui stuff first.
<Guest74> do any other implementations allow with-slots on structs besides sbcl?
asen has quit [Quit: Client closed]
asen_ has joined #commonlisp
waleee has joined #commonlisp
<jackdaniel> probably most, it costs very little to define a method for slot-value-using-class
<Guest74> puts trivial:with-slots onto stack.
attila_lendvai_ has joined #commonlisp
<Guest74> not really, someone else please write it.
JeromeLon has joined #commonlisp
<Guest74> jackdaniel: do you guys use xlib:put-raw-image at all? need some examples as doesn't seem to be working for me.
<jackdaniel> I don't think that we do
Jach has joined #commonlisp
NotThatRPG has joined #commonlisp
nwoob has joined #commonlisp
ahlk has joined #commonlisp
ec has joined #commonlisp
asen_ has quit [Read error: Connection reset by peer]
asen_ has joined #commonlisp
asen_ has quit [Max SendQ exceeded]
nwoob has quit [Ping timeout: 264 seconds]
ym has joined #commonlisp
nwoob has joined #commonlisp
<paule32> okay, i will try to provide a modern lisp, but i need a little time to working in it. the idea is, to provide a tui, and gui, but this tertier projects. i think the system have a solid basis, so i need some feedback in steps that follows, you are the guys with huge knowledge
<jackdaniel> paule32: perhaps it is me being tired, but I don't understand what you are going on about from the moment you have joined
<beach> paule32: Do you mean ANSI Common Lisp rather than "ISO Lisp"? Or do you mean ISLisp?
<paule32> jackdaniel: i saw you, that you discuss of changes in lisp, and i working of a module like lisp interpreter
<paule32> few month ago, i began to collect informations what is need, to provide a free franz
<beach> paule32: And what is the purpose of this project? How is it different from what we have?
<beach> paule32: What is a "free franz"?
<paule32> simply nothing, beach, the fact is, i am not satisfied with other languages like c++, you have to compile in bigint lib if you want huge math ops. but the most langs. only provide cpu bit wide math ops (also 2^64 as limit e.g.
<paule32> and lisp has it native
<paule32> free franz was a little joke of me, today :-) sorry. i working on a free gui like alegro
<paule32> but free
attila_lendvai_ has quit [Read error: Connection reset by peer]
<beach> paule32: So a GUI IDE but for an existing Common Lisp implementation?
aartaka has quit [Ping timeout: 240 seconds]
aartaka has joined #commonlisp
<paule32> yes
<beach> paule32: For a particular Common Lisp implementation, or for any conforming Common Lisp implementation?
amb007 has quit [Ping timeout: 240 seconds]
<paule32> few months ago, i used clisp, but you tell me that i could use sbcl
amb007 has joined #commonlisp
<paule32> this was a work, at begin to minimize lazarus pascal executables, and using modules
<paule32> then i had the idea to use modules in lisp, too, to not have so big executes
<paule32> like hard disk space minimizing
<paule32> okay, in times of gigabyte not the thing, but i come from ms dos times, there where all bit and byte was need
<paule32> and this was, and is my intention
<Guest74> is retrospectiff the only tiff reading/writing library? i thought there was another one but cliki doesn't show anything.
<paule32> beach: and as result of the apache module, you can have a look at: "https://www.kallup.net/pub" there comes a creditial screen: user: paule32, pass: test3232, then i comes a bootup screen, and then a windows xp like screen with windows, that you can move, and resize: and that was the beginning... stay tunes :)
Catie has joined #commonlisp
<beach> I don't know how to use Windows, and I don't understand what the purpose is. Sorry.
<paule32> the windows things, you can see are fakes, it can be changed to linux like look and feel, but i working on a windows machine, so i inpired by windows. and the idea was to bring dos/cli applications to web applications
notzmv has joined #commonlisp
VincentV` has joined #commonlisp
VincentVega has quit [Ping timeout: 240 seconds]
nwoob has quit [Quit: leaving]
frgo has joined #commonlisp
shka has joined #commonlisp
amb007 has quit [Ping timeout: 264 seconds]
<NotThatRPG> Kind of a shapeless query: I am running tests on GitHub, using SBCL where a long-running test runs for c. 10 minutes on my laptop, but on GitHub's servers it times out after 6h. Honestly, kind of at a loss about where to being to figure it out. Any suggestions? Wondering if it might be some compilation settings issue, although on the GitHub node we are compiling with `(safety 3)`
<NotThatRPG> Any suggestions/hints?
amb007 has joined #commonlisp
bcasiello has joined #commonlisp
tyson2 has joined #commonlisp
ec has quit [Quit: ec]
ec has joined #commonlisp
X-Scale` has joined #commonlisp
X-Scale has quit [Ping timeout: 264 seconds]
X-Scale` is now known as X-Scale
<jackdaniel> console log shows something? i.e whether it stucks somewhere?
ec has quit [Remote host closed the connection]
<jcowan> I have found what I think is a bug in SBCL 2.1.9 and ECL 21.2.1, or at least a questionable interpretation of the ANS. In both systems, (= 1.1 1.1d0) returns NIL, even though the arguments have in some sense "the same value" (an undefined term). My guess is that they are being compared as rationals, even though the contagion rules do not apply to this case.
ec has joined #commonlisp
ski_ is now known as ski
<Catie> I can replicate this behavior in CCL and CLISP. The definition and examples in the HyperSpec would indicate that this is incorrect behavior, notably that they say "(= 3.0s0 3.0d0) is true."
alvaro121_ has joined #commonlisp
lisp123 has joined #commonlisp
<mfiano> I would expect that to be NIL. The standard doesn't mandate how floats should be encoded, and any reasonable implementation would use IEEE-754 which are very different values, unlike 3f0 and 3d0
<jcowan> Presumably examples aren't normative
<mfiano> That is correct
<jcowan> (We have some folks in Schemeworld who claim that at least some examples *are* normative, which annoys me.)
<jcowan> But I don't agree that 1.1f0 and 1.1d0 are different values numerically.
<Catie> The spec says, "These examples are not considered part of the standard," and notes that they could be removed. But it also says "the examples provide ... consistency checks for the rest of the material." Given these two things and that the definition for = reads, "The value of = is true if all numbers are the same in value; otherwise it is false", and "=, /=, <, >, <=, and >= perform necessary type conversions", I w
<Catie> ould expect that 1.1 and 1.1d0 would be equal under the predicate =
<mfiano> But they aren't the same in value on most implementations, only in printed representation.
<Catie> I think you and I have different definitions of "value" in this case
<mfiano> Perhaps
<mfiano> 1.1d0 is stored as the value of (* 0.55d0 2d0)
<mfiano> which also does not have an exact operand in binary
<mfiano> there isnt enough guard bits in single precision
occ has quit [Ping timeout: 240 seconds]
<Catie> From my standpoint, mathematically the numbers are the same, even if they may have different precisions. That is, a number with a decimal point has a "value" and a "precision", and these two things are separate. Of course, I'm not a mathematician, so I might just have a completely wrong model of how numbers work
<jackdaniel> Catie: would you expect 23/123456 be = to 24/123456 ?
occ has joined #commonlisp
<Catie> jackdaniel: no, those have different "values". Why that example in particular?
<jackdaniel> fact that printed representation in decimal is similar doesn't mean that floats in binary are
<_death> we've been through this kind of discussion recently.. 1.1f0 is rounded by the reader to 1.10000002384185791015625, while 1.1d0 is rounded to 1.100000000000000088817841970012523233890533447265625
<NotThatRPG> @jackdaniel: No, not finding anything in the console log that suggests anything. Just a list of the test names as they are run and then a timeout message.
cosimone has joined #commonlisp
<jackdaniel> i.e difference between 1.1 and 1.1d0 represented in memory may be bigger than 1/123456
<jackdaniel> (of course these are made up numbers)
<Catie> Oh I see, so the printed representation of a FLOAT is a truncated version of the actual value it stores
<jackdaniel> yrs
<Catie> s/stores/represents/
<jackdaniel> yes*
<mfiano> Ignoring all this, it is already a mistake to be comparing any floating point numbers for equality.
<Catie> Okay, I'm seeing the disconnect now
<mfiano> Without relative and/or absolute tolerances
<jackdaniel> that's why you should always represent currency as ratios
<Catie> mfiano: Oh I agree, it sucks as a problem
<jackdaniel> and that's why floats are the biggest disaster in compiting since 1444anno domini
<etimmons> NotThatRPG: How do you quit the process? If it's not explicit, maybe Github's infra is keeping stdin open or something like that.
<jackdaniel> computing* (im on phone)
tyson2 has quit [Remote host closed the connection]
<Catie> Fixed-point numbers all the way
<NotThatRPG> @etimmons: That's a good pointer. I should look and make sure that the tests have actually failed to complete as opposed to completing but somehow hanging before the process ends.
<mfiano> Catie: Actually fixed-point numbers have different issues making them unsuitable for a lot of tasks
<Catie> mfiano: please elaborate, I'm blissfully unaware of these downsides
X-Scale has quit [Ping timeout: 256 seconds]
<mfiano> One minute, let me recollect from my notes
<Catie> No worries! I really appreciate it
X-Scale` has joined #commonlisp
X-Scale` is now known as X-Scale
<Guest74> edify the rest of us please
alvaro121_ has quit [Ping timeout: 246 seconds]
<mfiano> I regret sharing this, because I lost the citation I obtained the information from, but https://gist.github.com/mfiano/6d42aa7500e43df248a5f0a360509264
<_death> if you want, you can compare (= 1.10000002384185791015625f0 1.10000002384185791015625d0) and get T since double-float subsumes single-float, numerically speaking
<Bike> mfiano: i don't see how this doesn't apply to floating point as well?
amb007 has quit [Ping timeout: 256 seconds]
<mfiano> Well that particular issue does
<lisp123> Does anybody have a CLASS-EQUAL utility function (EQUALP on all slots) I can borrow? Want to check if my implementation is correct
amb007 has joined #commonlisp
<Nilby> the only non-integer number representation that isn't junk is functional generative, but humans haven't fully discovered the math yet
<Guest74> ah, i misread that, thought people were talking about fixnum not fixed point.
<Catie> No I was! I think I just have my terminology mixed up
<Bike> yeah, i'm sure there are other rasons floating point is better, though i am not capable of articulating them
<Guest74> raisins even.
<_death> if you want decimals, you can use decimals (Intel has instructions for BCD.. not sure if anyone still uses them)
<Catie> What's it called when, for example, you use the integer value "1000" to represent the real number "1.000"?
<Bike> fixed point
<Catie> Oh okay, I had it right
<Bike> the decimal point is "fixed" three digits from the end
<jcowan> 1.1 and 1.1d0 are the same in the sense of rationalize (assumes floats are as accurate as the format), different in the sense of rationalize (assumes floats are perfectly accurate). Rationalize returns 11/10 for both values, but rational returns 9227469/8388608 and 2476979795053773/2251799813685248 respectively.
<mfiano> _death: That lets you more accurately represent some numbers, but only 100 different fractional values compared to 256 with binary. I would say overall binary is more accurate
<Bike> the "radix point", i suppose i should say
<Guest74> isn't that different from fixed point if you're just using a fixnum shifted a few decimal places over.
<mfiano> it indeed does accurately represent 1.3 easily though
<Catie> And with bignum support, there's no real limit to the number of decimal digits you could choose to encode
<_death> mfiano: different needs require different representations
<mfiano> Yep
<jcowan> One way to get a feel for how floats work is to look at the table at https://en.wikipedia.org/wiki/Minifloat#All_values_as_integers, which shows you one possible 8-bit IEEE float representation in which all values are integral. It lets you represent integral numbers between -122880 and +122880 inclusive (plus infinities and NaNs) in just 8 bits at the expense of accuracy.
<Nilby> cl:pi isn't π and 1/3 can't be printed except as 1/3 which is a generative notation
<mfiano> fixed-point BCD is good when your fractional values are covered.
<Catie> So really fixed point numbers will get you easily-understandable rounding and meaningful comparisons within a certain decimal precision, correct?
<mfiano> 16-bit fixed bcd offers you 10k fractional values, 65536 with binary.
<mfiano> the binary format cannot exactly represent some of the values that you can exactly represent in decimal form, the binary format does exactly represent better than six times as many values. For monetary values. once you round the result down to cents (two digits to the right of the decimal point), you’re definitely going to get better results using the binary format.
<mfiano> not that i recommend that :)
<Guest74> just store money in cents not dollars.
<Catie> Fixed point
<jcowan> Except in times of hyperinflation
<mfiano> financial software requires greater precision than cents, but yes, rationals or the smallest integral unit is best
<_death> then when there are multiple currencies involved, you need to pick the least common denominator ;)
<Catie> What precision does financial software require?
roelj has joined #commonlisp
<mfiano> typically 4 decimal places, as opposed to 2 with cents
<Guest74> don't try and collect anything less than cents. superman will come after you.
<Catie> Huh. Still, that's far from insurmountable
ec has quit [Remote host closed the connection]
ec has joined #commonlisp
<_death> and then, when the value of currency drops considerably and new coins are introduced, you may need to change your stuff again
<Catie> I'm still seething over the ERP system I had to work with that stored currency as a float, and used "round" and "truncate" interchangeably
<_death> but maybe by then, you'd be unemployed and free from such issues
<mfiano> There's also the scaled numeric format which scales fractional components to integer values, but of course you decrease the range of possible integer portion values
<jcowan> Interest rates often are xx.99%, which given currency with cents requires 4 digits
<Catie> Scaled numeric, yeah! That's what I was looking for, thank you
<Catie> jcowan: Oh okay, that makes sense! I was wondering what the purpose for the extra decimal points was
<Nilby> new money needs more fractional bits
<jcowan> Of course, scaled bignums are also possible: the Python class Decimal works like that
<mfiano> but basically, binary representation is nice if you don't know the values you'll be working with in advance
<mfiano> if you do, there are several others to choose from!
<jcowan> (From its introduction in 1927 to its abolition in 1946, the Hungarian pengő inflated about 10^29 times, losing half its value every 15 minutes on average.)
<_death> the main issue with rationals etc. is that they are slow.. it's weird to me that CLIM uses rationals, which sometimes get out of hand
<mfiano> there is another problem
<Nilby> i'm kind of sad that CL doesn't have a defacto standard way to do big decimals or scaled outside of maxima
<mfiano> you have the possibility to get enormous numerators or denominators, either overflowing or allocating bignums :)
<jcowan> Hence the story of the student and the TA: "My numerical program is much too slow!" "Add a decimal point to any one number, and all will be well!"
<_death> "My numerical programs gives incorrect results!" "Add a d0, and all will be well!"
<Catie> For a given value of "all"
<_death> or "l0" and use clisp's to extend precision until it's sufficiently correct
<mfiano> reminds me i want to patch highlight-number.el...it detects eN but not fN/dN
<Catie> Has anyone run into any major issues binding *read-default-float-format* to 'double-float? I've had that as my default for a while and occasionally run into issues compiling files, but that's not a big enough problem for me to switch back. Is there anything else I might want to be on the lookout for?
lisp123 has quit [Remote host closed the connection]
<mfiano> If a developer assumes no suffix to be a single float, that's their problem
<_death> Catie: it's often impractical, because a lot of code uses unadorned literal representations like "1.1", and also contains type declarations, assuming it's a single-float, and sometimes safety 0...
<mfiano> It's unfortunate they don't adorn or wrap in with-standard-io-syntax
<Catie> Ah! I can't say I love that, but it does make sense
<_death> Catie: so the usefulness of *read-default-float-format* is limited only to cases where you can make good assumptions about the input to the reader
<mfiano> I agree with that
<_death> and I've joined the "part of the problem" crowd :).. I assume 1.1 is a single-float and don't bother with f0
<mfiano> i forget, is s0 supposed to be short/half/16 for implementations that support that?
<Catie> Shucks. I haven't been doing anything resource-intensive enough that it would make a difference, so I've been prioritizing accuracy. I guess I should be careful going forward
<Nilby> the trouble might be when someone running your code falls through the floor where you didn't
<Catie> Nilby: that makes sense as well, I didn't think of that
<Nilby> e.g. clipping problems in games, 3d etc.
ec has quit [Ping timeout: 276 seconds]
NotThatRPG is now known as NotThatRPG_away
ec has joined #commonlisp
<jcowan> mfiano: Short-float certainly could be 16 bits.
<Guest74> I forget if it was in sbcl code or mailing list, but they were talking about doubles being able to be 8 bits.
<mfiano> True. The only time I use them, I build them myself with ieee-floats for use with OpenGL half-float format
alvaro121_ has joined #commonlisp
<Catie> Surprisingly, it looks like CLISP uses different precisions for all four float formats
<Catie> Or maybe it only has three and the printer is messing with me again. But either way, three different float formats
<mfiano> Catie: CLISP has infinite precision floats, which means by just binding a value, you can compute the nth pi digit...which makes me question the standard conformance since it is a "constant variable"
lisp123 has joined #commonlisp
<Catie> ECL also seems to have three distinct formats
<_death> jcowan: short-float minimum is 18 bits
<jcowan> ah
<Bike> huh, really?
<Catie> mfiano: That surprises me! Although I guess it shouldn't, it links with one of the FSF's math packages huh?
<_death> clhs short-float
<Bike> so it is. i did not know that.
<mfiano> Catie: I'm not sure about that one
<_death> I think aeth complained about it in the past
<Bike> clisp uses GMP for multi precision float, i think
<Catie> I vaguely recall it being an option when I built it. I'll double-check!
<mfiano> Oh gmp?
<jcowan> float-precision is your friend for figuring out these things.
<Bike> beats implementing all those numerical algorithms oneself
<mfiano> SBCL has a contrib for that as well
<_death> mfiano: clisp has an -ansi flag
<mfiano> Oh huh
<Catie> I was thinking of a different package, whoops
Inline has quit [Ping timeout: 250 seconds]
<_death> mfiano: hmm, though it doesn't affect the pi thing
<mfiano> _death: Hmm, I always questioned if the pi thing is a conformance bug, but didn't know about the flag...now i'm thinking it is really a bug
<_death> well, the fact that you need to use ext: feature for it means it may be a feature
JeromeLon has quit [Quit: WeeChat 3.0.1]
<_death> Bike: actually, I think it's permissible to have 16-bit short floats
<_death> Bike: since the clhs only speaks of "recommended" minima
<Bike> oh ho.
amb007 has quit [Read error: Connection reset by peer]
amb007 has joined #commonlisp
<jackdaniel> half-precision floating point is a thing
<_death> usually in GPUs, no?
<mfiano> Rarely used, but GL defines half-float types
<jackdaniel> for sse too I think
<jackdaniel> and gcc has such extension
<mfiano> It is a widely known fact that double floats are a serious performance trap on the GPU. I wouldn't be surprised if half-float was too
<_death> right, seems in 2012 they added some instructions for it
<jackdaniel> either way it would be fun to have short-float as such pocket monster :)
<jackdaniel> I've considered that at some point of time for ecl, but I've decided that this is a project without any meaning and I don't have time for it
<jackdaniel> (short floats as 16bit, not ecl)
<_death> if you don't utilize simd it, there's no real point I guess (storage is cheap)
<Guest74> ecl has simd support doesn't it?
<_death> Warning: Cannot disassemble the binary function #<compiled-function FILL 0x7fe0906889f0> because I do not have its source code.
<_death> funny warning, that :)
<Catie> I get that warning basically any time I try to disassemble under ECL
<_death> disassemble shows C code there
ec has quit [Quit: ec]
<_death> I tied disassembling (defun my-fill (x) (declare (type (simple-array single-float (*)) x)) (fill 0.0 x) x) though.. calls cl_fill
<_death> arguments reversed, sigh
<jcowan> Clisp has 17-bit short precision, LispWorks has 19-bit short precision
<Guest74> huh, I didn't know about fill.
<Guest74> thought it might be useful for clearing a raster but seems to only fill one element.
<_death> what do you mean?
<Guest74> filling a flat raster with a colour like #(#xFF 0 0 #xFF
<Guest74> )
<_death> do you represent each pixel as a vector?
<jackdaniel> try (compile nil '(lambda () whoatever))
<jackdaniel> s/compile/disassemble/
lisp123 has quit [Quit: Leaving...]
<jackdaniel> it does have simd
<Guest74> no, each pixel is n-channel amount of elements in the raster.
davep has quit [Quit: Connection closed for inactivity]
<_death> jackdaniel: hmm, gives me that warning if I try to disassemble a function defined in "foo.lisp" after (load (compile-file "foo"))
<Guest74> man clx errors are quite uninformative. i really need to stop crashing it.
<jackdaniel> _death: generally ecl can't disassemble functions compiled with C (but it can functions compiled with bytecmp)
<_death> I see
<jackdaniel> if you want to "disassemble" such function, you may need retain intermediate transpiled files (to see C file - compile-file has such arguments), or to disassemble .fas file with standard platform tools
<jackdaniel> file.fas is a shared object (.so, .dll etc)
<jackdaniel> if you want to see how a form would be compiled, just pass it to disassemble
<jackdaniel> i.e (disassemble '(lambda () 42))
<_death> right, ghidra works :)
ec has joined #commonlisp
<_death> decompiler gives similar output https://plaster.tymoon.eu/view/2703#2703
akoana has joined #commonlisp
sander has quit [Quit: So long! :)]
<|3b|> half floats can save a lot of bandwidth on GPU, for computation looks like it might be twice single float, or might be 1/64th depending on cards :/ graphics mainly cares about the bandwidth part since intermediate calculations tend to need the extra precision. neural nets like half floats (and even smaller floats) for computation though
ym has quit [Ping timeout: 256 seconds]
ec has quit [Ping timeout: 276 seconds]
<|3b|> actually i guess mostly 2x performance for half floats, with only geforce10xx being 1/64?
* |3b| wouldn't mind having 16-bit SHORT-FLOAT in CL, though most of the time i use them it is in foreign memory going to/from a GPU anyway
<|3b|> though there is the question of whether one could trust the performance and numerical behavior of 16-bit floats if it isn't always mapping directly to CPU hardware.
kadir has left #commonlisp [WeeChat 3.3]
<_death> maybe one could hack sbcl to change the array header for a different element type, utilize the pun, and revert back
tyson2 has joined #commonlisp
bcasiello has quit [Read error: Connection reset by peer]
bcasiello has joined #commonlisp
Lord_of_Life has quit [Excess Flood]
Lord_of_Life has joined #commonlisp
<_death> or create a new header similar to displaced arrays..
<Guest74> ugh, apparently xlib:put-raw-image does not behave like xlib:put-image. It will not send the data in multiple requests. It wont even check if the data will fit in one request and so hangs with anything larger than max request size.
<_death> it would have endianness issues similar to C, though
<Guest74> welp, that was a lot of wasted time.
elderK has joined #commonlisp
waleee has quit [Ping timeout: 240 seconds]
<NotThatRPG_away> A follow-up on my earlier question about tests that finish locally, but bog on GitHub CI. I have noticed one big difference: when I run the tests locally, FiveAM (for they are 5AM tests) runs them in lexicographic order by name. But on GitHub CI, they are in what looks like a random order. I'm not sure what could account for that difference.
NotThatRPG_away is now known as NotThatRPG
alvaro121_ has quit [Ping timeout: 250 seconds]
alvaro121_ has joined #commonlisp
scymtym has quit [Ping timeout: 268 seconds]
tyson2 has quit [Remote host closed the connection]
<jackdaniel> Guest74: isn't put-raw-image what you've been proclaiming for clx persistently though - "provide raw x11 protocol and let the client handle higher abstractions"?
<jackdaniel> like i.e splitting the request
<Guest74> multiple requests are part of the protocol.
paule32_ has joined #commonlisp
<jackdaniel> perhaps I'm looking in the wrong place, but putimage (the x11 request) is not specified to split the request
alvaro121_ has quit [Ping timeout: 240 seconds]
<Guest74> are you being intentionally obtuse?
<jackdaniel> (and xlib:put-image is specified to put some lipstick on that native request)
paule32 has quit [Ping timeout: 244 seconds]
<jackdaniel> no, and please try moderate your language
<jackdaniel> what I'm saying is that you are inconsistent with your own previous intentions expressed in clx repository
<jackdaniel> s/is specified to put/is defined to put/
ec has joined #commonlisp
waleee has joined #commonlisp
ym has joined #commonlisp
gaqwas has joined #commonlisp
tyson2 has joined #commonlisp
VincentV` has quit [Read error: Connection reset by peer]
amb007 has quit [Ping timeout: 245 seconds]
amb007 has joined #commonlisp
ym has quit [Ping timeout: 240 seconds]
stacksmith has joined #commonlisp
<stacksmith> Good morning
sander has joined #commonlisp
<stacksmith> Does anyone know why Emacs would stop treating one of the .lisp files in my project as a lisp file?
<stacksmith> It refuses to do SLIME stuff, like compile file or function...
<NotThatRPG> What's in the mode line for that buffer (as opposed to mode line of working buffer)?
<NotThatRPG> I mean the emacs mode line at the bottom of the window. But the "mode line" as in a line at the top of the file, commented, with settings, is also worth checking.
<stacksmith> normally, (Lisp Paredit adoc [my-proj-name sbcl]); crappy file: (Lisp)
<mfiano> M-S-; major-mode RET
<stacksmith> Why would it suddenly stop SLIMEing just that file?
<mfiano> type that in both buffers
<stacksmith> mfiano: both report lisp-mode
cage has quit [Quit: rcirc on GNU Emacs 27.1]
<mfiano> Then something strange is going on. I have never seen that with SLY at least.
<mfiano> I'm not very familiar with SLIME though.
<mfiano> Maybe someone else could further debug
<etimmons> Does `M-x revert-buffer` in the the crappy file (with SLIME running) fix it?
<etimmons> I've had this happen to me before where opening a file before running M-x slime caused SLIME's key bindings and other stuff to not apply
<mfiano> Interesting. Maybe that's another thing to add to the "SLY fixed it" list
<stacksmith> sadly I've been editing the file trying to get it to work so reverting is not possible.
<mfiano> Just save it to disk, then revert-buffer
<stacksmith> That does nothing
<mfiano> and M-x slime-compile-defun does not work?
<mfiano> That is, are the major mode key maps messed up, or is SLIME just not working at all
<pjb> stacksmith: etimmons: M-x normal-mode RET should reset the major mode to what emacs thinks it should.
<pjb> (might be better than revert-buffer)
<etimmons> Good to know
<stacksmith> slime-compile-defun seems to have compiled a function
<stacksmith> M-x normal-mode RET does nothing useful
<mfiano> Ok so something clobbered the keymap
<mfiano> Interesting
<stacksmith> Peculiar that Paredit is gone
<mfiano> What does it even say for C-h k C-c C-c ?
<NotThatRPG> I would have guessed that meant that something went wrong in your hook functions or something, causing the failed buffer not to be properly initialized
<stacksmith> undefined
<NotThatRPG> Anything in the *Messages* buffer?
<mfiano> What happens if you do M-x lisp-mode RET ?
<mfiano> If that fixes it, I'd double check it really is a *.lisp extension and not a typo
<stacksmith> Ah. M-x lisp-mode RET says 'unmatched bracket'
<mfiano> Oh then do M-x check-parens
<stacksmith> OK, fixed paren and M-x lisp-mode fixed it.
<stacksmith> That was a shit and a half, as usability goes.
<mfiano> Odd how it crippled everything. It has never done that for me
<mfiano> Glad to help though
<pjb> paredit-mode will deactivate itself when parentheses become unbalanced, but this should not deactivate lisp-mode or slime.
<stacksmith> Thanks a lot
amb007 has quit [Read error: Connection reset by peer]
amb007 has joined #commonlisp
taiju has quit [Ping timeout: 264 seconds]
taiju has joined #commonlisp
aartaka has quit [Remote host closed the connection]
aartaka has joined #commonlisp
cosimone has quit [Quit: ERC (IRC client for Emacs 27.1)]
akira121__ has joined #commonlisp
roelj has quit [Remote host closed the connection]
occ has quit [Ping timeout: 240 seconds]
gaqwas has quit [Ping timeout: 240 seconds]
aartaka has quit [Ping timeout: 256 seconds]
ec has quit [Ping timeout: 276 seconds]
servytor has quit [Quit: Connection closed for inactivity]
Jing_ has quit [Remote host closed the connection]
Jing has joined #commonlisp
akira121__ has quit [Remote host closed the connection]
Guest74 has quit [Quit: Connection closed]
alvaro121 has joined #commonlisp
s-liao has joined #commonlisp
ec has joined #commonlisp
lexi_sparks has joined #commonlisp