jackdaniel changed the topic of #commonlisp to: Common Lisp, the #1=(programmable . #1#) programming language | Wiki: <https://www.cliki.net> | IRC Logs: <https://irclog.tymoon.eu/libera/%23commonlisp> | Cookbook: <https://lispcookbook.github.io/cl-cookbook> | Pastebin: <https://plaster.tymoon.eu/>
Inline__ has joined #commonlisp
amb007 has quit [Ping timeout: 252 seconds]
Inline_ has quit [Ping timeout: 260 seconds]
pdietz has joined #commonlisp
Inline_ has joined #commonlisp
<aeth> nij- is gone, but if you do need a common memory layout, then https://github.com/sionescu/static-vectors
<aeth> It's designed for CFFI and it only works on 1D, but it creates "bilingual" C/CL arrays with the main disadvantage being that you need to manually free them (or put them in a WITH- that manually frees them)
jello_pudding has quit [Ping timeout: 260 seconds]
<aeth> but (1) common memory layout and (2) pinned instead of moved with GC; however, I think they're always created on the CL side so I think one Lisp would have to treat it as purely a CFFI data structure
Inline__ has quit [Ping timeout: 260 seconds]
dipper has quit [Remote host closed the connection]
dipper has joined #commonlisp
<aeth> the part that will probably be different between implementations is the prefix (type+length), and perhaps the layout of the arrays if not 1D
dipper has quit [Remote host closed the connection]
dipper has joined #commonlisp
jello_pudding has joined #commonlisp
prokhor__ has joined #commonlisp
Inline__ has joined #commonlisp
prokhor_ has quit [Ping timeout: 260 seconds]
Inline_ has quit [Ping timeout: 260 seconds]
Inline_ has joined #commonlisp
thuna` has quit [Remote host closed the connection]
random-nick has quit [Ping timeout: 252 seconds]
amb007 has joined #commonlisp
Inline__ has quit [Ping timeout: 260 seconds]
dipper has quit [Remote host closed the connection]
amb007 has quit [Ping timeout: 246 seconds]
dipper has joined #commonlisp
Helmholtz has quit [Read error: Software caused connection abort]
Helmholtz has joined #commonlisp
amb007 has joined #commonlisp
dipper has quit [Remote host closed the connection]
amb007 has quit [Ping timeout: 260 seconds]
dipper has joined #commonlisp
Inline__ has joined #commonlisp
dipper has quit [Remote host closed the connection]
Inline_ has quit [Ping timeout: 252 seconds]
dipper has joined #commonlisp
azimut has quit [Remote host closed the connection]
<Nilby> just plain cffi:with-pointer-to-vector-data can work too
azimut has joined #commonlisp
amb007 has joined #commonlisp
amb007 has quit [Ping timeout: 255 seconds]
<pdietz> I've been seeing such performance problems with cffi.  The overhead can be very large.
dipper has quit [Remote host closed the connection]
CptKirk has quit [Ping timeout: 268 seconds]
dipper has joined #commonlisp
<Nilby> The overhead is usually close to the overhead for the implementations ffi, but the worst overhead is converting strings with encoding. When I matters I keep thigns in utf-8 bytes.
dre has quit [Quit: Leaving]
Oladon has quit [Quit: Leaving.]
jeosol has joined #commonlisp
perrierjouet has quit [Remote host closed the connection]
perrierjouet has joined #commonlisp
White_Flame has quit [Read error: Software caused connection abort]
White_Flame has joined #commonlisp
<pdietz> This was in very fast little C functions that take structs as arguments or return them as values.
perrierjouet has quit [Quit: WeeChat 3.7.1]
perrierjouet has joined #commonlisp
<Nilby> Hmmm. There's a lot problems with structs by value, but by pointer it should have less trouble. You might want to make sure your structs aren't getting converted to plists.
Inline_ has joined #commonlisp
CptKirk has joined #commonlisp
causal has joined #commonlisp
<Nilby> It's sadly true that it can be hard to get it close the raw C ABI speed, but I know under some conditions sbcl can essentially open code C calls.
Inline__ has quit [Ping timeout: 260 seconds]
Inline_ has quit [Ping timeout: 260 seconds]
dipper has quit [Remote host closed the connection]
dipper has joined #commonlisp
<pdietz> They are getting converted to plists.
<Nilby> It might be interesting to have a cffi that wouldn't allow the slow paths. I imagine it'd be harder to use though.
dipper has quit [Remote host closed the connection]
dipper has joined #commonlisp
<Bike> how would you avoid slowness for structs by value? seems kind of hopeless unless you never actually receive a struct from C that you make a lisp equivalent for.
nij- has joined #commonlisp
<Nilby> Sometimes you don't have to convert the whole struct, or you only need a few members, but it's seems like there's almost always at least one copy & convert. In CCL it can just have the C struct on the stack and I can sometimes just grab the few integers out if it I need. The whole struct by value is a bad hack in C too, which thankfully things like posix API avoid.
dipper has quit [Remote host closed the connection]
<Nilby> Sometimes it could pay off to just C data as a blob until you need it.
dipper has joined #commonlisp
<pdietz> That would be the case here.
dipper has quit [Remote host closed the connection]
dipper has joined #commonlisp
dipper has quit [Remote host closed the connection]
dipper has joined #commonlisp
ns12 has quit [Read error: Software caused connection abort]
ns12 has joined #commonlisp
<mfiano> Hi, it's been quite a while since I thought about any CL, but I'm brainstorming an idea in CL I want to tackle sometime by the end of the year. Can someone tell me which generic function is the one that is called after any initialization of a standard-object, such as instantiating, reinitializing, changing class, and whatever else I missed. I want to say it's SHARED-INITIALIZE, but I may be
<mfiano> forgetting some details and there is more to it than that.
AadVersteden[m] has quit [Read error: Software caused connection abort]
dipper has quit [Remote host closed the connection]
dipper has joined #commonlisp
epony has quit [Ping timeout: 246 seconds]
<Bike> mfiano: shared-initialize is called during initialization in any of those circumstances. if you use an :after method it'll be afterword.
<Bike> (the circumstance you missed is the most obscure one - when the class of the object is redefined and the object needs to be updated)
<Bike> afterward*
<mfiano> Ah, u-i-f-r-c
<mfiano> That's one I have only used a handful of times.
<mfiano> Ok, great. Thank you.
<Bike> no prob
<Bike> i don't think i have used u-i-f-r-c ever, just implemented it
<mfiano> It might actually be a "finger full". I know it was at least once.
<Bike> a what?
<mfiano> Smaller than a handful, but still having been touched.
<mfiano> I was being a little silly.
<mfiano> I'm currently studying CDC (content-defined chunking) algorithms, and I want to use CL to visualize the process (graphically) over time with different parameters.
<mfiano> When I get that far. Still studying and trying out some techniques.
waleee has quit [Ping timeout: 246 seconds]
pdietz has quit [Quit: Client closed]
AadVersteden[m] has joined #commonlisp
<nij-> Is it possible to write libraries in CL (like C libraries), but when called, the libraries do not have to call a full lisp in order to work?
dipper has quit [Remote host closed the connection]
dipper has joined #commonlisp
<shunter> Are you asking if it's possible to load a lisp library without a runtime?
epony has joined #commonlisp
perrierjouet has quit [Quit: WeeChat 3.7.1]
<nij-> (I don't know if there are lisp libraries to start with..)
<White_Flame> "when called" from what?
<White_Flame> from the REPL? no problemo
perrierjouet has joined #commonlisp
<White_Flame> there are lisp "systems", which are bundles of lisp code, usually managed by ASDF and quicklisp. That code could be libraries, it could be user utilities, it could be applications, the image doesn't care
<White_Flame> just functions, data, packages, etc
epony has quit [Remote host closed the connection]
karlosz has quit [Remote host closed the connection]
dipper has quit [Remote host closed the connection]
epony has joined #commonlisp
dipper has joined #commonlisp
dipper has quit [Remote host closed the connection]
dipper has joined #commonlisp
dipper has quit [Remote host closed the connection]
dipper has joined #commonlisp
<aeth> Do you mean running a CL as a .so? Do you mean tree-shaking so the unused part of the runtime gets removed? Do you mean launching a CL application through the command line using an existing already-installed CL instead of bundling a giant all-in-one executable?
<aeth> So, so, so many different things that come up that you could be talking about
Inline has joined #commonlisp
<nij-> aeth Oh yeah, thanks! I was trying to formulate.. I do mean running programs (written in CL) as an so.
<nij-> And yes, I hope the unused part of the runtime gets removed.
CptKirk has quit [Ping timeout: 260 seconds]
<nij-> I see this: https://github.com/quil-lang/sbcl-librarian which provides cl programs as so.. but I don't know what's under the hood. I thought only C or C++ could produce low-level stuff like so, but it seems i was wrong.
CptKirk has joined #commonlisp
Inline_ has joined #commonlisp
Inline has quit [Ping timeout: 260 seconds]
Inline__ has joined #commonlisp
dipper has quit [Remote host closed the connection]
Inline_ has quit [Ping timeout: 260 seconds]
dipper has joined #commonlisp
bilegeek has joined #commonlisp
Inline_ has joined #commonlisp
Inline__ has quit [Ping timeout: 260 seconds]
beach` is now known as beach
dipper has quit [Remote host closed the connection]
CptKirk` has joined #commonlisp
dipper has joined #commonlisp
nij- has left #commonlisp [Using Circe, the loveliest of all IRC clients]
CptKirk`` has joined #commonlisp
CptKirk has quit [Ping timeout: 260 seconds]
CptKirk` has quit [Ping timeout: 260 seconds]
CptKirk`` has quit [Ping timeout: 260 seconds]
mingus has quit [Quit: mingus]
Inline__ has joined #commonlisp
Inline_ has quit [Ping timeout: 268 seconds]
Inline_ has joined #commonlisp
dipper has quit [Remote host closed the connection]
Inline__ has quit [Ping timeout: 260 seconds]
Inline__ has joined #commonlisp
Inline_ has quit [Ping timeout: 260 seconds]
CptKirk has joined #commonlisp
Inline_ has joined #commonlisp
Lord_of_Life has quit [Ping timeout: 252 seconds]
Lord_of_Life has joined #commonlisp
Inline__ has quit [Ping timeout: 252 seconds]
Inline__ has joined #commonlisp
Inline_ has quit [Ping timeout: 260 seconds]
Inline_ has joined #commonlisp
dipper has joined #commonlisp
Inline__ has quit [Ping timeout: 260 seconds]
Inline__ has joined #commonlisp
shka has joined #commonlisp
Inline_ has quit [Ping timeout: 252 seconds]
Inline_ has joined #commonlisp
Inline__ has quit [Ping timeout: 268 seconds]
Inline__ has joined #commonlisp
Inline_ has quit [Ping timeout: 260 seconds]
Inline_ has joined #commonlisp
Inline__ has quit [Ping timeout: 268 seconds]
Inline_ has quit [Ping timeout: 268 seconds]
vn36 has joined #commonlisp
dipper has quit [Remote host closed the connection]
ttree has quit [Ping timeout: 268 seconds]
danieli has quit [Quit: Alpine Linux, the security-oriented, lightweight Linux distribution]
danieli has joined #commonlisp
pranavats has left #commonlisp [Disconnected: Hibernating too long]
bilegeek has quit [Remote host closed the connection]
bilegeek has joined #commonlisp
igemnace has joined #commonlisp
ryanbw has quit [Ping timeout: 252 seconds]
ryanbw has joined #commonlisp
_cymew_ has joined #commonlisp
bilegeek_ has joined #commonlisp
bilegeek has quit [Ping timeout: 255 seconds]
MajorBiscuit has joined #commonlisp
Algernon69 has joined #commonlisp
CptKirk has quit [Remote host closed the connection]
snits has quit [Ping timeout: 248 seconds]
pve has joined #commonlisp
Cymew has joined #commonlisp
MajorBiscuit has quit [Ping timeout: 260 seconds]
MajorBiscuit has joined #commonlisp
vn36 has quit [Ping timeout: 268 seconds]
aartaka has joined #commonlisp
enzuru has quit [Quit: ZNC 1.8.2 - https://znc.in]
enzuru has joined #commonlisp
Inline has joined #commonlisp
bilegeek_ is now known as bilegeek
vn36 has joined #commonlisp
cosimone has joined #commonlisp
amb007 has joined #commonlisp
amb007 has quit [Ping timeout: 252 seconds]
pranavats has joined #commonlisp
vn36 has quit [Ping timeout: 255 seconds]
aartaka has quit [Ping timeout: 248 seconds]
vn36 has joined #commonlisp
Inline_ has joined #commonlisp
Inline has quit [Ping timeout: 260 seconds]
bilegeek has quit [Quit: Leaving]
* jackdaniel gumbles something not intelligible
Inline__ has joined #commonlisp
thuna` has joined #commonlisp
<thuna`> Is it possible to get the current directory in lisp-executable programs?
<jackdaniel> *default-pathname-defaults* will usually return the correct result
amb007 has joined #commonlisp
<jackdaniel> but if you want to call the unix function, then you need to use an extension (either builtin or via ffi)
<jackdaniel> (apropos 'getcwd)
<jackdaniel> (apropos 'get-current-directory)
Inline_ has quit [Ping timeout: 260 seconds]
<Nilby> uiop/os:getcwd
Inline_ has joined #commonlisp
<thuna`> Yeah, that works. Thanks
amb007 has quit [Ping timeout: 252 seconds]
Inline__ has quit [Ping timeout: 260 seconds]
<jackdaniel> if you are going to use uiop, please please don't forget to add it in depends-on section of your asd file
nij- has joined #commonlisp
<AadVersteden[m]> So, I was really happy with the profiling tools I have in Common Lisp, but i'm somewhat stuck in my experiments right now.
<beach> Why is that?
<jackdaniel> why include uiop or why AadVersteden[m] is happy with their experiments? (what experiments? :)
<beach> The latter.
vn36 has quit [Ping timeout: 268 seconds]
<nij-> (ql:quickload :zmq) raises the subprocess error - it didn't include the correct files so that <zmq.h> was not found. How to alter its behavior so it compiles zmq successfully? Details: https://bpa.st/YSRA
Inline__ has joined #commonlisp
Inline_ has quit [Ping timeout: 260 seconds]
<AadVersteden[m]> Sorry, kids got in the way of the conversation ^_^. So, the profiling I ran shows I need less computing cycles in Lisp than in Elixir. However, when I make the roundtrip through an HTTP connection (which I haven't benchmarked but don't know a faster lib than what I use now), then the latency is substantially higher.
<AadVersteden[m]> I'm neither too sure how to address this, nor how to best benchmark this.
<AadVersteden[m]> I went for Fukamachi-ware as my understanding is that that's rather fast, although it may have caveats.
<AadVersteden[m]> sb-prof indicates most time being spent on functions I've benchmarked before, but those are faster than their Elixir counterpart so I'm clearly not measuring everything with that.
<AadVersteden[m]> I'm basically receiving an HTTP request (from another Lisp Docker container), transform it, send a request to another HTTP service (a SPARQL endpoint, also in a Docker container), and send back the response. The transforming bit can be quite elaborate
<nij-> In the ASD file, there is something mysterious to me: (cffi-grovel:grovel-file "grovel") .. among other (:file ..). It seems to be the failing point.
<nij-> Anyone knows what it is?
<AadVersteden[m]> Looking at CPU cores, I'm not CPU bound in either of the approaches but latency is still a real issue.
rgherdt has joined #commonlisp
Inline__ has quit [Quit: Leaving]
<thuna`> Do we have delete-* equivalents of write-*?
<thuna`> Probably not in the standard, but maybe there's a package for it?
scymtym has quit [Ping timeout: 260 seconds]
Brucio-61 has quit [Ping timeout: 248 seconds]
<beach> Like DELETE-CHAR, and DELETE-BYTE?
<thuna`> Yeah
<beach> What would those do?
<thuna`> Delete those from the file stream?
<beach> That would be a very strange stream operation, no?
<thuna`> It makes sense for file (and maybe string) streams
<nij-> For those who could help, I have a better detail description typed up here (https://bpa.st/U5TA). In short, I do not understand CFFI-GROVEL which seemed to make a mistake while compiling.
<beach> thuna`: Would it go through the entire (potentially infinite) stream and delete all those characters or bytes, so that they don't show up when a read is called?
<thuna`> beach: Oh, no, that's not how I meant it. So for example delete-char would delete the character that you would get with read-char, delete-line with read-line, and so on
<beach> Just read it and don't use it?
amb007 has joined #commonlisp
<thuna`> That doesn't remove it
<thuna`> I'm not exactly talking about streams, but files instead
<beach> Sure it does. The next byte or character read will be the following one.
<thuna`> A file with the contents "abcd" after delete-char will contain "bcd" instead
<thuna`> If delete-char was preceded by read-char then the contents would be "acd" instead.
<beach> What function in the operating system do you imagine Common Lisp would call in order to accomplish that?
<AadVersteden[m]> thuna`: You'd have to read and write the file. If you have multiple of these operations then I suspect you'd want to group them rather than to write to disk each time (or at least, asking to write it each time). It doesn't sound like a very complex primitive to write and I guess people would understand it when they read it.
<beach> thuna`: Every character after the one deleted would have to be moved, potentially on disk or some other external device.
<thuna`> AadVersteden[m]: So go through the file with :overwrite and just not write the sections that I want to "delete"?
<thuna`> Or :supersede, maybe
amb007 has quit [Ping timeout: 260 seconds]
<beach> thuna`: You understand that something like that can be very expensive in terms of performance.
<jackdaniel> in lispos file blocks should have size of one character, that would solve that! :)
<beach> jackdaniel: Yes, a linked list of such blocks would be a file.
<thuna`> beach: Do you mean moving everything with each delete-char operation or :supersede?
amb007 has joined #commonlisp
<thuna`> Is there an alternative?
<AadVersteden[m]> for a database-startup thing I did we kept a list of changes to be applied to the datastructure. If an OS would offer such thing then this could possibly be performant but I don't know of any offering this. Regardless of the performance, if that's the functionality you need, you may just take the performance with it :-)
<beach> thuna`: Imagine a hypothetical OS system call that deletes a character from a file. Since files consist of blocks of characters, that system call would have to move every character following the one you delete. And that, in turn, means reading the entire file and writing it back out with one fewer characters.
<jackdaniel> AadVersteden[m]: isn't that called a transaction log?
<thuna`> beach: maybe the stream could buffer those deletions, with something similar to force-output
* jackdaniel waits for thuna` to invent drei and input-editing stream :)
<thuna`> Not happening
jello_pudding has quit [Ping timeout: 246 seconds]
<thuna`> I'm not looking to die on this hill, so I'll just do it the normal way :)
<AadVersteden[m]> jackdaniel: the changes are akin to a transaction log, yes. The log is incomplete as changes are materialized based on heuristics and the log itself can be compacted. State is base state + changes.
<AadVersteden[m]> Are there any low-latency libraries for HTTP server and/or HTTP client anyone here knows of? I went with Fukamachi's code but the interface to it is fairly limited and I'm in tryout stage. I don't know which of these two steps is causing the higher latency and am unsure how to benchmark.
<jackdaniel> don't die, blow this hill up! :)
<jackdaniel> AadVersteden[m]: are you developing a high-throughput application?
<AadVersteden[m]> jackdaniel: I wouldn't classify it in the big data realm I've been part of earlier, this is normally running on a single (but sometimes quite beefy) server.
<jackdaniel> I'd just go with something with convenient interface then (and not grasp for "the fastest")
amb007 has quit [Ping timeout: 260 seconds]
<AadVersteden[m]> jackdaniel: oh no, speed is a real issue. Based on production data. That's what I'm aiming to tackle.
Brucio-61 has joined #commonlisp
scymtym has joined #commonlisp
pranavats has left #commonlisp [Error from remote client]
<jackdaniel> I see
jello_pudding has joined #commonlisp
<AadVersteden[m]> There's two parts: the processing time on Elixir is too high. We want to do more advanced processing and mutable objects will seemingly be key for achieving that. So there's a real need to shift to something allowing for that (discussed with people with intricate knowledge of BEAM, the runtime). I see that we can do the processing itself fast enough and that there's leeway, but it seems there is a latency in http connection
<AadVersteden[m]> that overshadows current processing. I don't know if I should look at incoming or outgoing but I can plug in alternatives. I'm tinkering with it either case.
<AadVersteden[m]> Cfr the amount of requests, I haven't checked but suspect it to be in the broad neighborhood of a million requests per day. It's more latency than throughput for the non-processing part.
Algernon69 has quit [Ping timeout: 252 seconds]
<_death> have you looked into iolib?
<AadVersteden[m]> _death: I have not, but I wouldn't expect me to write a faster http client/server than what was built before 🤔
<_death> I see.. well, probably best dig deeper into the cause of the performance issue first.. on linux there are tools like perf
jmd_ has quit [Ping timeout: 260 seconds]
amb007 has joined #commonlisp
pdietz has joined #commonlisp
amb007 has quit [Ping timeout: 260 seconds]
<nij-> Hmmm.. I have a usocket client (https://bpa.st/4YMQ) connected with a server setup with `nc -l 127.0.0.1 12321`, but whatever I typed into the lisp repl doesn't show up on the terminal. I'm sure it's connected, because when I kill lisp, that `nc` stops to listen.
<pjb> thuna`: POSIX only offers a very rudimentary kind of files: sequences of octets. You cannot insert or delete octets in those sequences. Only append octets. You may replace octets in those sequence, but only block by block (blocks are often something like 512 or 4096 octets).
<pjb> thuna`: other (older) operating systems had other kind of files. For example, sequences of records. You could then delete and insert records. There was also various kinds of indexed record files.
<pjb> thuna`: on POSIX system, when you what that kind of sophistication, you must use or implement a file access method library. For example, db3, sqlite, isam, etc. for character-by-character insertions and deletion, those libraries are called text editors.
<pjb> thuna`: in Common Lisp, you could use climacs, or hemlock.
<pjb> thuna`: you could want to develop a library exporting only the text file editing API, instead of a whole editor like climacs or hemlock.
<AadVersteden[m]> _death: Yeah, at least try to figure out if the http server or the http client is slow. Perf indeed, that's a good guess. I've been bitten my FOSS marketing claiming the FOSS library is fast XD
McParen has joined #commonlisp
<pjb> thuna`: and forget about streams, streams introduce a temporal aspect that is incompatible with editing (insert or delete) until you have a time machine. (think socket streams, protocols, remote, etc).
vn36 has joined #commonlisp
<_death> AadVersteden[m]: I think lukego and flip214 did some work to help with exposing lisp names to perf
random-nick has joined #commonlisp
Jach has quit [Remote host closed the connection]
<jackdaniel> preliminary support for emscripten: https://gitlab.com/embeddable-common-lisp/ecl/-/merge_requests/277 (contributions welcome, i.e if someone would provide a nice widget for a repl instead of default emscripten thing)
<AadVersteden[m]> If they read this, I'd love to get pointers. I'm trying to zone in based on what I know so far. It seems likely the issue is in the outgoing request and I think I might not be sending the request to the other endpoint in the exact same way so who knows.
<_death> nij-: you need to pass the socket stream to force-output (or finish-output).. also, no need for the your unwind-protect since with-client-socket already does that
aartaka has joined #commonlisp
<_death> AadVersteden[m]: I believe the code snippet is https://github.com/phmarek/sbcl/blob/master/contrib/sb-perf/export-syms.lisp
<nij-> I see. Thanks _death
aartaka has quit [Ping timeout: 248 seconds]
zacque has quit [Quit: Goodbye :D]
amb007 has joined #commonlisp
Lycurgus has joined #commonlisp
jeosol has quit [Quit: Client closed]
<AadVersteden[m]> Thanks for the suggestion and motivation all. It seems there's something strange going on with the connection-pool in dexador. Without the connection pool the lisp variant has about 2x the speed of the old system (which does a tad more, but I think that'll fit in the speed budget).
amb007 has quit [Ping timeout: 260 seconds]
jeosol has joined #commonlisp
frgo has quit []
Lycurgus has quit [Quit: Exeunt https://tinyurl.com/4m8d4kd5]
<pdietz> :thumbsup:
<jackdaniel> pdietz: where did you lose your "f"?
<nij-> Lol
<pdietz> I think it has to do with getting old and forgetting what name I'd been using.
<jackdaniel> ^_^
<nij-> rofl
<pdietz> This causes confusion with Paul H. Dietz, who has done interesting work but is not me.
<nij-> Does anyone know how burgled-batteries work (https://github.com/pinterface/burgled-batteries)? How does it call python without launching a python process?
<jackdaniel> nij-: it probably loads libpython and calls functions accordingly
<nij-> which libpython? (google shows there several)
<jackdaniel> whichever you have on your system?
<jackdaniel> do you know how dynamic linking works?
<nij-> I suppose. In the low level code, the dynamic stuff doesn't get embedded. But instead, it's called?
<nij-> Do you mean python can exist in the form of a shared object?!
<jackdaniel> yes, that's what I mean
<nij-> ?! (Can CL exist in such form too? separated question, asked few hours ago..)
<jackdaniel> yes, ecl works that way by default
<jackdaniel> there is libecl.so
<jackdaniel> recently sbcl also can be compiled to a shared object
<jackdaniel> try `ldd ecl` and you'll see
<nij-> and that means if other programs want to call sbcl, it doesn't have to wait for the full sbcl to launch?
<nij-> `ldd command not found`.. hang on
waleee has joined #commonlisp
<jackdaniel> that means that you may link your program with a runtime, but usually you will still need to call some "initialiation" function before using functions of such managed runtime
<nij-> hmmmmm..
<jackdaniel> so I'd say, that you'll have to wait for the "full <lisp> to launch", but not by calling a binary, but rather invoking the "launch" function after the library is loaded
<nij-> but that still means a lisp is launched, though it doesn't seem to be a separated process?
<jackdaniel> (i.e from your main() function or whenever)
<jackdaniel> I don't know what "launched" means, so I'm doing some guesswork here
<jackdaniel> if you define it that "launching" is "starting as a separate process" then no
<jackdaniel> I'm sure that beach smiles ironically right now ,)
<nij-> lol probably sighing (sorry beach)
vn36 has quit [Ping timeout: 268 seconds]
<McParen> hi, if a macro generates the argument to a function, for example (defmacro foo (&body body) (let ((bar (gensym))) (lambda (,bar) &body)), is there a way to refer to the gensym-generated bar from the body? is there a way to get the lambda list of the function i am in?
<jackdaniel> McParen: no, but you may name variables with known names
<jackdaniel> either (defmacro foo (var &body body) (lambda (,var) ,@body))
<jackdaniel> or (defmacro foo (&body) `(lambda (^omg-anaphora) ,@body))
<pjb> McParen: also, you may give access to it thru a function, or local symbol-macro: (defmacro foo (&body body) (let ((bar (gensym))) (lambda (,bar) (flet ((get-argument () ,bar)) ,@body))))
<pjb> (defmacro foo (&body body) (let ((bar (gensym))) (lambda (,bar) (symbol-macrolet ((the-argument ,bar)) ,@body))))
<pjb> or a rebinding.
<pjb> (defmacro foo (var &body body) (let ((bar (gensym))) (lambda (,bar) (let ((,var ,bar)) ,@body))))
<jackdaniel> this gensym+symbol-macrolet is kind of like sticking right hand in a left pocket, no?
<pjb> you'd do that if you wanted to protect binding to the gensymed variable.
<pjb> jackdaniel: yes.
<pjb> You could combine flet and symbol-macrolet, to prevent write access.
<jackdaniel> the variable itself may be optimized out, so merely being able to access the symbol does not guarantee that you can access the variable
<McParen> I am tring to not name the argument to the lambda, let the macro name it through gensym, but still be able to access it in some way from the body.
<jackdaniel> McParen: but what's the point of such gymnastics?
<_death> McParen: as the answers indicate, you just need to elaborate "some way" yourself
<McParen> I'm trying to hide a repetitive variable that has to be there, but is seldomly used.
<jackdaniel> is there a harm for giving it an actual name if it is used?
<jackdaniel> (even seldomly)
<pjb> McParen: I gave you a numbver of solutions.
<McParen> There is no harm, I am just trying to find out if and hw it can be done.
<McParen> pjb: thanks, I'm looking into them.
<_death> e.g., (defmacro foo ((&key (my-var (gensym))) &body body) `(lambda (,my-var) ,@body))
<pdietz> The only thing you'd worry about here is polluting packages with otherwise never used symbols.  But uninterned symbols (as created by gensym) would solve that.
Lycurgus has joined #commonlisp
<McParen> pjb: in both cases, flet and symbol-macrolet, I am introducing new variables that will be present when the macro is expanded, what i was trying to avoid.
<McParen> _death: that seems to be a nice solution. name the variable when needed, otherwise use a gensym.
<pjb> McParen: macroexpansion time is compilation time. if it's not used, it's not compiled in.
<pjb> Try: (defmacro foo (&body body) (let ((bar (gensym))) `(lambda (,bar) (flet ((get-argument () ,bar)) (declare (inline get-argument)) (symbol-macrolet ((the-argument (get-argument))) ,@body))))) (disassemble (compile nil (foo 'hi)))
seletz has quit [Ping timeout: 268 seconds]
<pjb> vs. (disassemble (compile nil (foo the-argument)))
<McParen> pjb: thanks, will try.
Lycurgus has quit [Quit: Exeunt https://tinyurl.com/4m8d4kd5]
waleee has quit [Ping timeout: 246 seconds]
vn36 has joined #commonlisp
<McParen> pjb: naming symbol-macrolet still pollutes the namespace, so i cant (defparameter the-argument 1) and then (funcall (foo (print 'hi))). What I tried to find out was whether it is possible to access a lambda list from a function itself, so I can let gensym name the argument. but thanks.
<McParen> _death's suggestion to only name the variable when needed and other wise gensym it is good enough for my case.
ryanbw has quit [Ping timeout: 260 seconds]
jeffrey has joined #commonlisp
<_death> note that you can use &key's suppliedp feature to decide whether to declare ignore the parameter later
random-jellyfish has joined #commonlisp
ryanbw has joined #commonlisp
random-jellyfish has quit [Quit: Client closed]
amb007 has joined #commonlisp
random-jellyfish has joined #commonlisp
amb007 has quit [Ping timeout: 252 seconds]
amb007 has joined #commonlisp
vn36 has quit [Quit: leaving]
amb007 has quit [Ping timeout: 255 seconds]
pdietz has quit [Quit: Client closed]
<mfiano> If I wanted to do some MOPery to make a class final, such that defining any new class in any package with the final class name symbol in the superclasses list and C-c C-c would result in an error at compile time. Is this possible, and where should I start looking?
amb007 has joined #commonlisp
pranavats has joined #commonlisp
<pjb> mfiano: I'd do: (defmethod initialize-instance ((object the-final-class) &key) (if (eql (class-named 'the-final-class) (class-of object)) (call-next-method) (error "final class")))
<pjb> at compilation-time, apart from undefining the final class, I don't see. Perhaps with a special meta-class?
pdietz has joined #commonlisp
<mfiano> Yes, but I'm wanting to do this at compile time with a metaclass somehow.
<Bike> defclass semi-happens at compile time. that might be enough.
<pjb> Then a method on ensure-class should let you do the same, at compilation-time, I'd guess.
<pjb> similar to the one on initialize-instance.
<mfiano> Doesn't ensure-class happen at runtime to finalize if need be, when make-instance is called though?
<pjb> Even a ensure-class :before method
amb007 has quit [Ping timeout: 246 seconds]
<mfiano> I'm wanting to get the error when a class that might not even be final attempts to build itself up from a restricted class
<Bike> ensure-class happens earlier. it's finalize-inheritance that you're thinking of.
<mfiano> Ah, no, I was thinking of ensure-finalized
<mfiano> Ok then, thanks a lot!
morganw has joined #commonlisp
_cymew_ has quit [Quit: Konversation terminated!]
<thuna`> "OPEN :IF-EXISTS :NEW-VERSION is not supported when a new version must be created" Isn't that the entire point of :new-version?
nij_ has joined #commonlisp
nij- has quit [Killed (NickServ (GHOST command used by nij_))]
nij_ is now known as nij-
nij- has quit [Killed (NickServ (GHOST command used by nij_))]
nij_ has joined #commonlisp
nij_ has quit [Remote host closed the connection]
nij- has joined #commonlisp
Cymew has quit [Ping timeout: 260 seconds]
<mfiano> No. It is speaking of when filesystems weren't so primitive.
epony has quit [Remote host closed the connection]
epony has joined #commonlisp
<thuna`> mfiano: Could you elaborate?
<mfiano> Lisp Machines allowed files to have different versions with the same name
<thuna`> Oh
<beach> So did many other operating systems.
insolarion has joined #commonlisp
<thuna`> Alright, so I decided to use :rename-and-delete, now https://0x0.st/o6eP.txt is signalling an error opening output, saying the file exists.
<thuna`> Actually, nevermind. I thought input would be the renamed file, not the new one
amb007 has joined #commonlisp
<McParen> is there an opposite to (declare (special foo))? A declaration that within the following lexical scope, foo is not special even if it was previous defined special?
amb007 has quit [Ping timeout: 246 seconds]
<McParen> or does the shadowing by a let or lambda list implicitely consider a local variable non-special?
<pdietz> Not needed.   "A special declaration does not affect inner bindings of a var; the inner bindings implicitly shadow a special declaration and must be explicitly re-declared to be special. special declarations never apply to function bindings."
<McParen> pdietz: okay, thanks very much.
<pdietz> However, a top level declaration of special would apply.
azimut has quit [Remote host closed the connection]
<pdietz> "When used in a proclamation, a special declaration specifier applies to all bindings as well as to all references of the mentioned variables."
<pdietz> clhs special
azimut has joined #commonlisp
<McParen> does a defvar or derparameter count as a top level declaration?
<beach> Yes.
<pjb> If it's a toplevel form!
<beach> pjb: Only then?
<pjb> in (let ((x 42)) (defvar *x* x)) defvar is not a toplevel declaration. the compiler may signal undefined variable errors.
<pjb> Try to compile-file: (let ((x 42)) (defvar *x* x)) (defun foo () *x*)
<pdietz> The defvar still creates a global declaration there, it just doesn't do it at compile time.
<pdietz> (unless you wrapped the proper eval-when around the let form)
azimut has quit [Remote host closed the connection]
azimut has joined #commonlisp
Dynom_ has joined #commonlisp
Dynom_ is now known as Guest608
random-jellyfish has quit [Quit: Client closed]
anticomputer_ has quit [Remote host closed the connection]
xretaxeous has quit [Quit: Connection closed for inactivity]
<nij-> Anyone familiar with cffi-grovel? I got a problem while installing cl-zmq.. https://bpa.st/6OCA
amb007 has joined #commonlisp
<jackdaniel> nij-: install zmq dev files from your repository
anticomputer has joined #commonlisp
<nij-> ? by that you mean.. install manually from a terminal?
<jackdaniel> zmq as I understand is a library available in your repositories
<jackdaniel> and cl-zmq are ffi bindings to that library
<jackdaniel> ffi bindings always require the library in question, and the groveller requires also header files I think
<nij-> What do you mean by 'repositories' here?
<jackdaniel> so say that you have installed libzmq, then you want something like libzmq-dev
<jackdaniel> package repositories (things you access with apt, or pacman, or packman etc)
<nij-> I used brew :'(
<nij-> It was easier back then when I was still on arch.
<nij-> I got pretty confused with brew..
<jackdaniel> I don't know what brew is, but probably some osc nonsense
<jackdaniel> osx*
<nij-> yes..
<kakuhen> i've avoided homebrew precisely because it "installs" a library and cant even at least add ${prefix}/lib to the ld path or install pkg-config entries
<nij-> wait! `brew install zeromq` does give me <zmq.h>
<nij-> but when I quickload, asdf attempts to use its own command to install
<nij-> but the problem is I need to add certain flags (as shown in the link above (here again https://bpa.st/6OCA))
<kakuhen> seems like a homebrew issue (unsurprisingly); this path is standard and would work on my mac
<yitzi> nij-: pzmq is more up to date than cl-zmq
zyni-moe has joined #commonlisp
<nij-> kakuhen I suppose the problem is actually here https://github.com/freiksenet/cl-zmq/blob/master/zeromq.asd#L20
<nij-> yitzi oh thanks *Trying now*
<nij-> i wonder what "p" stands for though
<kakuhen> what's wrong with the grovel file? seemed ok to me
<yitzi> That is what I use for common-lisp-jupyter...although I have comtemplated writing native Lisp for zeromq several times.
<nij-> yitzi seems like the same issue happens https://bpa.st/TBGQ
<nij-> kakuhen: 0: [RETRY] Retry #<PROCESS-OP > on #<GROVEL-FILE "pzmq" "grovel">.
<nij-> See, if I run that failed command, I got `<zmq.h> not found` error.
<yitzi> nij-: I'm not sure about your setup, but I've used homebrew+pzmq plenty without issues. Not with roswell, though.
zyni-moe has quit [Client Quit]
<nij-> However, if I add the flags `-I/opt/homebrew/Cellar/zeromq/4.3.4/include -I/opt/homebrew/Cellar/libsodium/1.0.18_1/include ` then it's fine
McParen has left #commonlisp [#commonlisp]
<nij-> hmm
amb007 has quit [Ping timeout: 255 seconds]
<_death> if it's just for your own use, you can add them in the asd file (:cffi-grovel-file "grovel" :cc-flags "...")
<kakuhen> nij-: definitely a homebrew issue
<pjb> McParen: (introducing a symbol-macrolet wihtout "polluting" the namespace).
<kakuhen> just installed zmq from macports and quicklisp compiled the entire system just fine
<kakuhen> screenshot for demonstration i guess
<kakuhen> i guess another potential point of breakage is whether zmq supports arm64
<_death> there's also a special cffi-toolchain:*cc-flags*
<kakuhen> no idea since I've never used zmq (only rabbitmq) and I stay as far away as I can from anything CFFI
tyson2 has joined #commonlisp
<nij-> hmmm..
pfd has joined #commonlisp
random-jellyfish has joined #commonlisp
euandreh has joined #commonlisp
amb007 has joined #commonlisp
amb007 has quit [Ping timeout: 255 seconds]
etimmons has quit [Remote host closed the connection]
random-jellyfish has quit [Quit: Client closed]
pdietz has quit [Ping timeout: 260 seconds]
akoana has joined #commonlisp
saura has joined #commonlisp
pfd has quit [Quit: Client closed]
pfd has joined #commonlisp
triffid has quit [Read error: Connection reset by peer]
saura has quit [Remote host closed the connection]
triffid has joined #commonlisp
saura has joined #commonlisp
saura has quit [Remote host closed the connection]
saura has joined #commonlisp
saura has quit [Remote host closed the connection]
nij- has quit [Ping timeout: 260 seconds]
amb007 has joined #commonlisp
amb007 has quit [Ping timeout: 246 seconds]
saura has joined #commonlisp
saura has quit [Remote host closed the connection]
Guest608 has quit [Quit: WeeChat 3.7.1]
pdietz has joined #commonlisp
Lycurgus has joined #commonlisp
cosimone has quit [Ping timeout: 255 seconds]
markb1 has joined #commonlisp
Josh_2 has joined #commonlisp
<Josh_2> Hey hey hey
<White_Flame> it's fat albert?
<Josh_2> :sunglasses:
triffid has quit [Ping timeout: 255 seconds]
<White_Flame> (old american cartoon started that way. also, I thought this was another channel :) )
<Josh_2> Seems that sly-who-calls seems to be broken for me :(
<Josh_2> I have a method being called somewhere in my code and I can't find it :(
<Josh_2> I say a method but actually its an old method before I changed its name, clearly I forgot to modify this instance ;(
<beach> Do you mean "generic function" rather than "method"?
MajorBiscuit has quit [Ping timeout: 246 seconds]
<Josh_2> I suppose
<Josh_2> I change d
<Josh_2> I changed service-name to version and somewhere service-name is still being called :(
jeosol has quit [Ping timeout: 260 seconds]
triffid has joined #commonlisp
<_death> fmakunbound
<Josh_2> Thats the problem
<Josh_2> it is unbound and I can't find it in the source :joy:
<_death> you have something that swallows the error? then maybe (defun service-name (...) (break "debug me"))
<Josh_2> I was just thinking that. I might also be able to just specialize the gf and then use M .
<beach> What does it mean to specialize a generic function?
<Josh_2> Sometimes I just wing it
srji has quit [Ping timeout: 260 seconds]
<jackdaniel> "specialize v.t. (a generic function) to define a method for the generic function, or in other words, to refine the behavior of the generic function by giving it a specific meaning for a particular set of classes or arguments. "
<beach> Thanks.
srji has joined #commonlisp
<jackdaniel> pleasure
<Josh_2> I found it
triffid has quit [Remote host closed the connection]
triffid has joined #commonlisp
jeffrey has quit [Ping timeout: 252 seconds]
pfd has quit [Quit: Client closed]
azimut has quit [Remote host closed the connection]
azimut has joined #commonlisp
MajorBiscuit has joined #commonlisp
pdietz has quit [Quit: Client closed]
cage has joined #commonlisp
jello_pudding has quit [Ping timeout: 252 seconds]
ec_ has quit [Ping timeout: 255 seconds]
ec_ has joined #commonlisp
MajorBiscuit has quit [Ping timeout: 246 seconds]
jello_pudding has joined #commonlisp
cosimone has joined #commonlisp
saura_62 has joined #commonlisp
etimmons has joined #commonlisp
jeosol has joined #commonlisp
ttree has joined #commonlisp
saura_62 has quit [Quit: Palaver https://palaverapp.com]
saura_ has joined #commonlisp
akoana has quit [Quit: leaving]
jmdaemon has joined #commonlisp
frgo has joined #commonlisp
<Josh_2> Postgres does not support ratios without me creating two integer columns and then recombining them when I restore the data into cl. Considering this is there any benefit to using ratios to represent monetary values?
nij- has joined #commonlisp
<nij-> Could someone help explain the behavior of with-open-file? The scenario: I have created a FIFO, and have written something into it.
<nij-> I then call this function (https://bpa.st/GAKA). Immediately, step 1 and 2 are fulfilled.
<nij-> However, I'd expect step 3 is also fulfilled immediately.
<jackdaniel> Josh_2: you always want to represent currency as ratios
<nij-> Anyway, now Lisp pauses here. I then write to the FIFO once again. Then step 3 is fulfilled, but the function doesn't return here.
<jackdaniel> or, if you have fixed precision, as i.e an integer is then multiplied x100, or x1000 etc
<nij-> I have to write to the FIFO the third time, for the function to return.
<jackdaniel> because floats are not precise
azimut has quit [Remote host closed the connection]
<Catie> I think the fixed-point approach is what Postgres takes for its monetary type
azimut has joined #commonlisp
<Josh_2> Catie: Its monetary type is a 8 bytes with 2 decimal places
saura has joined #commonlisp
[ has quit [Ping timeout: 248 seconds]
<Catie> I'd think that multiplying the value you get back from the database by 100 would give you an integer that can be used for fixed-point calculations
saura_ has quit [Quit: Palaver https://palaverapp.com]
<Josh_2> nij-: you can use alexandria to just open the file and read it for you
Noisytoot has joined #commonlisp
<Josh_2> #'alexandria:read-file-into-string
Lycurgus has quit [Quit: Exeunt https://tinyurl.com/4m8d4kd5]
<nij-> Yes, I found some other workarounds.. but this bug literally caused me 4 hours.. and I hope I can understand it before moving on.
<Josh_2> You do not need with-open-file for the uiop:read-file-string
<nij-> That's indeed the workaround I found - I just need uiop:read-file-string. But still,
<nij-> even with what I have in the code, I don't see why step 3 isn't fulfilled immediately after calling the function.
<Josh_2> Hmm
<Josh_2> (with-open-file (s "~/.emacs")(format t "beep")(force-output)(sleep 5) (uiop:read-file-string "~/.emacs")) -> beep ... 5 seconds ... <.emacs>
<Josh_2> I am not sure if I understand
<nij-> My file here is a FIFO. Maybe that's why?
<Josh_2> I dont know why that would matter.
<Josh_2> Maybe the file is in use somewhere else and thats what causes and issue :shrug:
<nij-> Oh!
<nij-> with-open-file macroexpands to (open file) ...
<Josh_2> yh
<nij-> But if you do `mkfifo /tmp/myfifo` and (open "/tmp/myfifo")
<nij-> it hangs there
<nij-> whereas if it is about `touch /tmp/myfile` and (open "/tmp/myfile")
<nij-> it returns immediately
cosimone has quit [Ping timeout: 252 seconds]
<nij-> so I conclude that in CL, #'open treats FIFO differently
<nij-> I wonder if this is a feature or bug.
<nij-> I now know why it happens, but I'm confused why that's the case.
<Josh_2> jackdaniel: Thanks for your input, this was the reason I chose to use ratios in the first place. Just a bit of faffing to get it all to work nicely with postgres
<nij-> CL shouldn't have to care if the underlying file is a regular file or a FIFO..
<Catie> nij-: Sure enough, it hangs on my machine as well until I write something into the FIFO
<Josh_2> Can't decide if I should use dedicated columns for numerator and denominator or just stick with what I have now which is JSONB
<nij-> Catie yeah, but why should that be the case? It's not clear why in CLHS http://clhs.lisp.se/Body/f_open.htm
<nij-> Btw I'm on SBCL.
<Josh_2> for ease JSONB is better, but for DB performance in the future dedicated columns will surely be faster.
<Catie> I just tested it with CCL, same result
<Josh_2> nij-: well you could use a background thread and not worry about it
<Catie> Ah, I think it's the open(2) syscall that does it
<Josh_2> just push the content when you get the content, use a lockless queue or something
amb007 has joined #commonlisp
<nij-> Josh_2 my real problem is solved
<Josh_2> Okay good to know :)
<nij-> Catie hmm can you reproduce something like this in other langs?
<Catie> nij-: https://paste.rs/PBT
<Catie> Let me see
<nij-> Hmm.. so this is by the UNIX design?
<Josh_2> Try the flag :io
<Josh_2> with with-open-file
<Catie> Behavior reproduced on FreeBSD
<nij-> Thanks Catie! I learned something today.
<nij-> Took me 4 hours so I really have to understand it =_= Thanks..
<Catie> I'm gonna see if I can reproduce it in C as well, but it's gonna take a bit because I'm out of practice
amb007 has quit [Ping timeout: 252 seconds]
<nij-> mmmhmmmm I'd also like to see your C code. I haven't practiced C at all.
<Catie> It does not block under C!
<nij-> :( wth.. hmm
<Catie> On Linux, I should clarify
<nij-> https://github.com/sbcl/sbcl/blob/master/src/code/fd-stream.lisp#L2549 this seems to be where it calls unix open
<nij-> (i'm on macos)
<Catie> Oh, so you're closer to BSD on that one! Let me try that as well
<Catie> Same behavior on BSD
<nij-> Maybe I should ask folks on #'sbcl?
<nij-> Perhaps it's just a bug. @@?
<Catie> It ain't just SBCL though, it does the same for me on CCL
<nij-> Yeah, it's not in CLHS that means it could be dependent to impl.
<Catie> Here's the code I'm using, I'm not _entirely_ certain it's equivalent, just a quick-and-dirty test: http://0x0.st/o6_C.c
<nij-> seems legit
<Catie> :DIRECTION defaults to :INPUT, which corresponds to SB-UNIX:O_RDONLY, which is the flag I used, so that's good
<nij-> ***** So for folks who'd like to help, here's the simplified question: (open FILE) hangs for fifo FILE but not regular FILE. I wonder why. This is observed on sbcl and ccl, but open() in C doesn't block. The relevant code in sbcl is here: https://github.com/sbcl/sbcl/blob/master/src/code/fd-stream.lisp#L2549***
<nij-> I will ask this again in #sbcl.
<nij-> (Thanks Catie)
<Catie> Oh yeah, absolutely!
<Josh_2> Did you try opening it with :direction :io ?
<nij-> With :direction :io there's an error -
<nij-> The file #P"/tmp/myfifo4" already exists: File exists
terrorjack has quit [Ping timeout: 248 seconds]
terrorjack has joined #commonlisp
mrcom has joined #commonlisp
azimut has quit [Remote host closed the connection]
azimut has joined #commonlisp
pfd has joined #commonlisp
Oladon has joined #commonlisp
Brucio-61 has quit [Ping timeout: 260 seconds]
scymtym has quit [Ping timeout: 252 seconds]
shka has quit [Quit: Konversation terminated!]
cosimone has joined #commonlisp
shka has joined #commonlisp
<pjb> Josh_2: https://www.postgresql.org/docs/current/datatype-money.html is too limited for a lot of usages. To small a range, not enough precision, for certain applications. I'd advise to use VARSTRING.
cosimone` has joined #commonlisp
<pjb> Josh_2: but it's still enough for the US deficit, so YMMV
<kakuhen> in other words it just works
<pjb> kakuhen: a lot of prices are given with 4 or more decimal digits.
<kakuhen> yes, gasoline prices come to mind
cosimone has quit [Ping timeout: 260 seconds]
azimut has quit [Ping timeout: 255 seconds]
<kakuhen> its common to see prices like $3.98 9/10
scymtym has joined #commonlisp
Brucio-61 has joined #commonlisp
<pjb> nij-: (open "/tmp/myfifo4" :direction :io :if-exists :append :if-does-not-exist :create :element-type '(unsigned-byte 8)) #| --> #<basic-file-binary-io-stream ("/tmp/myfifo4"/15 iso-8859-1) #x30200247E0CD> |#
<kakuhen> and the fraction is intended to indicate a price of $3.989 (which conveniently rounds to $3.99, an extra penny per gallon for gas stations!)
<kakuhen> outside of this niche use case i dont know where i see prices with precision beyond 2 cents
<kakuhen> foreign exchange market maybe?
<kakuhen> i guess two places
<kakuhen> precision beyond 2 decimal places*
<Catie> I recall an accountant friend telling me that you should do your calculations with three decimal places of precision
<jackdaniel> and since we are lazy we'll take four decimal places for a good measure, and round them to two in the ui ;)
cosimone` has quit [Remote host closed the connection]
<pjb> kakuhen: yes, and option markets.
<pjb> also, IRS calculations are made with a specific algorithm for decimal places. Eg. in France, we round up the cents, to have only integer euros in the results.
thuna` has quit [Remote host closed the connection]
pdietz has joined #commonlisp
jmdaemon has quit [Quit: ZNC 1.8.2 - https://znc.in]
waleee has joined #commonlisp
euandreh has quit [Quit: euandreh]
etimmons has quit [Ping timeout: 260 seconds]
euandreh has joined #commonlisp
etimmons has joined #commonlisp
jmdaemon has joined #commonlisp
jmdaemon has quit [Remote host closed the connection]
jmdaemon has joined #commonlisp
nij- has left #commonlisp [Using Circe, the loveliest of all IRC clients]
igemnace has quit [Quit: WeeChat 3.7.1]
random-jellyfish has joined #commonlisp
Krystof has quit [Ping timeout: 255 seconds]
cage has quit [Quit: rcirc on GNU Emacs 27.1]
<Josh_2> pjb: I am not going to use a string, I will use ratios because of their fantastic support in CL
Krystof has joined #commonlisp
<pjb> Josh_2: I mean in the DB convert the ratio to strings to store them!
dtman34 has quit [Quit: ZNC 1.8.2+deb2+b1 - https://znc.in]
dtman34 has joined #commonlisp
<Josh_2> I understand but I dont need to do that if I use two columns to store the numerator and denominator
<pjb> Josh_2: the advantage of using two integer columns is that you can get an approximate value in queries. But it would be simplier to store the exact value as a string, and an approximate as monetary or decimal.
<Josh_2> Ofc
<Josh_2> Its even simpler to use JSONB and use a class with two values, numerator and denominator and then let Shashts default behaviour export my amount as json :D
<Josh_2> Postgres has fantastic json support but I will *always* need a quantity in my payment intentions, not much of a payment without it :P
ryanbw has quit [Ping timeout: 260 seconds]
Fare has joined #commonlisp
markb1 has quit [Quit: Leaving]
ryanbw has joined #commonlisp
pdietz has quit [Ping timeout: 260 seconds]
random-jellyfish has quit [Ping timeout: 260 seconds]
causal has quit [Quit: WeeChat 3.7.1]
rgherdt has quit [Remote host closed the connection]
pranavats has left #commonlisp [Error from remote client]
shka has quit [Ping timeout: 252 seconds]
pdietz has joined #commonlisp
Fare has quit [Ping timeout: 260 seconds]
pranavats has joined #commonlisp
ttree_ has joined #commonlisp
ttree has quit [Ping timeout: 260 seconds]
morganw has quit [Remote host closed the connection]
ttree_ has quit [Ping timeout: 268 seconds]
bilegeek has joined #commonlisp
skyl4rk has quit [*.net *.split]
energizer has quit [*.net *.split]
z4kz has quit [*.net *.split]
hirez has quit [*.net *.split]
pieguy128 has quit [*.net *.split]
skyl4rk has joined #commonlisp
pieguy128 has joined #commonlisp
hirez has joined #commonlisp
energizer has joined #commonlisp
z4kz has joined #commonlisp
Fare has joined #commonlisp