p_l changed the topic of #lisp to: Common Lisp, the #1=(programmable . #1#) programming language | <https://irclog.tymoon.eu/freenode/%23lisp> <https://irclog.whitequark.org/lisp> <http://ccl.clozure.com/irc-logs/lisp/> | ASDF 3.3.4
sonologico has joined #lisp
prince1 has joined #lisp
Bourne has quit [Read error: Connection reset by peer]
orivej has quit [Ping timeout: 256 seconds]
orivej has joined #lisp
karlosz has joined #lisp
Bourne has joined #lisp
ahungry has joined #lisp
josemanuel has quit [Quit: leaving]
Fare has quit [Ping timeout: 260 seconds]
Fare has joined #lisp
Neele has joined #lisp
ukari has quit [Remote host closed the connection]
ukari has joined #lisp
bitmapper has quit [Ping timeout: 246 seconds]
Neele has quit [Remote host closed the connection]
jprajzne has quit [Quit: jprajzne]
ThisIsGonnaBeGre has joined #lisp
zaquest has quit [Quit: Leaving]
jeosol has quit [Remote host closed the connection]
iAmDecim has joined #lisp
luni has quit [Remote host closed the connection]
cosimone has quit [Quit: Quit.]
<dlowe> reply smelly try again later
zaquest has joined #lisp
shukryzablah has joined #lisp
iAmDecim has quit [Ping timeout: 246 seconds]
dddddd has quit [Ping timeout: 256 seconds]
Fare has quit [Remote host closed the connection]
space_otter has joined #lisp
Oladon has quit [Quit: Leaving.]
Josh_2 has quit [Ping timeout: 258 seconds]
gioyik has quit [Ping timeout: 240 seconds]
igemnace has quit [Quit: WeeChat 2.7.1]
asarch has quit [Quit: Leaving]
gioyik has joined #lisp
Oladon has joined #lisp
aindilis` has joined #lisp
aindilis has quit [Ping timeout: 260 seconds]
semz has quit [Ping timeout: 246 seconds]
aindilis` has quit [Read error: Connection reset by peer]
aindilis has joined #lisp
ofc has quit [Ping timeout: 246 seconds]
semz has joined #lisp
semz has joined #lisp
semz has quit [Changing host]
EvW1 has quit [Ping timeout: 246 seconds]
xkapastel has quit [Quit: Connection closed for inactivity]
libertyprime has quit [Ping timeout: 264 seconds]
libertyprime has joined #lisp
aeth has quit [Ping timeout: 264 seconds]
quazimodo has quit [Ping timeout: 250 seconds]
aeth has joined #lisp
aeth has quit [Changing host]
aeth has joined #lisp
X-Scale has quit [Ping timeout: 240 seconds]
X-Scale` has joined #lisp
X-Scale` is now known as X-Scale
quazimodo has joined #lisp
gravicappa has joined #lisp
akoana has joined #lisp
twelvemonkeys has quit [Ping timeout: 265 seconds]
twelvemonkeys has joined #lisp
Bike has quit [Quit: leaving]
orivej has quit [Ping timeout: 250 seconds]
pilne has quit [Quit: ASCII a stupid question, get a stupid ANSI!]
<beach> Good morning everyone!
hiroaki has quit [Ping timeout: 264 seconds]
<beach> aeth: First-class global environments are not just a small extra feature the way package-local nicknames are. They require a large part of the existing system to be restructured and a lot of the code to be rewritten.
<beach> phoe: So I don't think first-class global environments would be represented by a single pull request. If I were to implement first-class global environments in some existing implementation, I would make gradual changes over a long period of time.
froggey has quit [Ping timeout: 256 seconds]
pluplog has joined #lisp
<beach> Plus, with first-class global environments, there is a (small) performance cost for things like SYMBOL-FUNCTION with a symbol that is not known at compile time. Maintainers of implementations that want maximum performance in all situations would not be willing to accept that.
froggey has joined #lisp
gioyik has quit [Ping timeout: 246 seconds]
<Oladon> Anyone here used spinneret for HTML templating? I'm trying to figure out the best way to implement nestable templates, and his deftag doesn't seem quite right.
ThisIsGonnaBeGre has quit [Ping timeout: 240 seconds]
gioyik has joined #lisp
mathrick has quit [Ping timeout: 246 seconds]
Oladon1 has joined #lisp
ebzzry_ has joined #lisp
Oladon has quit [Ping timeout: 250 seconds]
Oladon1 has quit [Client Quit]
Oladon has joined #lisp
ebzzry has joined #lisp
ebzzry_ has quit [Ping timeout: 256 seconds]
_whitelogger has joined #lisp
iAmDecim has joined #lisp
vlatkoB has joined #lisp
notzmv has joined #lisp
karlosz has quit [Quit: karlosz]
notzmv is now known as Guest97706
Guest97706 is now known as zmv
zmv is now known as notzmv
_whitelogger has joined #lisp
Lord_of_Life has quit [Read error: Connection reset by peer]
Lord_of_Life has joined #lisp
ebzzry has quit [Read error: Connection reset by peer]
ebzzry has joined #lisp
ebzzry_ has joined #lisp
Oladon has quit [Quit: Leaving.]
ebzzry has quit [Ping timeout: 256 seconds]
Oladon has joined #lisp
Oladon has quit [Client Quit]
narimiran has joined #lisp
Oladon has joined #lisp
<drmeister> Xach: I'm glad - you've probably read this... https://www.nytimes.com/2020/03/22/health/coronavirus-symptoms-smell-taste.html
sauvin has joined #lisp
sauvin_ has joined #lisp
sauvin has quit [Ping timeout: 264 seconds]
zaquest has quit [Quit: Leaving]
gioyik has quit [Ping timeout: 246 seconds]
xlarsx has joined #lisp
gioyik has joined #lisp
xlarsx has quit [Remote host closed the connection]
aeth has quit [Ping timeout: 256 seconds]
zaquest has joined #lisp
aeth has joined #lisp
iAmDecim has quit [Ping timeout: 240 seconds]
iAmDecim has joined #lisp
sauvin_ is now known as Sauvin
Oladon has quit [Read error: Connection reset by peer]
Oladon has joined #lisp
toorevitimirp has joined #lisp
<phoe> beach: I'm aware, it's a pretty big change after all.
quazimodo has quit [Ping timeout: 246 seconds]
quazimodo has joined #lisp
Cymew has joined #lisp
ear-the-art has quit [Remote host closed the connection]
ear-the-art has joined #lisp
shka_ has joined #lisp
<beach> phoe: Though there is one more advantage. When the code of a Common Lisp implementation is restructured in order to allow for multiple global environments, the code becomes more regular and more independent of the specific details of the implementation.
Oladon has quit [Quit: Leaving.]
terpri has quit [Remote host closed the connection]
terpri has joined #lisp
gioyik has quit [Quit: WeeChat 2.7.1]
random-nick has joined #lisp
shka_ has quit [Ping timeout: 258 seconds]
<ear-the-art> beach, sandboxing?
<beach> ear-the-art: It was aeth who asked whether I thought that first-class global environments would ever become part of existing Common Lisp implementations.
<ear-the-art> ah, hmm.
<beach> Then, phoe said he might someday be willing to merge a PR for CCL in a forked version.
ramus has quit [Ping timeout: 268 seconds]
<beach> One reason I started the SICL project is that I think the code of existing implementations is often old and hard to maintain. And I think it would be more work to fix that problem than to write a new implementation from scratch.
<beach> A new implementation would also be the opportunity to reconsider fundamental design decisions that may have been the right ones at the time but that no longer are.
jprajzne has joined #lisp
<beach> But it is going to take time to get a new implementation to be as fast and as stable as the most common existing Common Lisp implementations.
toorevitimirp has quit [Remote host closed the connection]
davsebam1e has joined #lisp
davsebamse has quit [Ping timeout: 250 seconds]
Codaraxis has quit [Ping timeout: 256 seconds]
<no-defun-allowed> Silly compiler question: do jump tables become less effective as the code they jump into becomes larger?
ebzzry_ has quit [Ping timeout: 250 seconds]
<beach> I seriously doubt that. Why would they?
space_otter has quit [Remote host closed the connection]
<no-defun-allowed> I'm still trying to guess reasons why binary search would be faster than using SBCL's jump tables in my bytecode interpreter.
<beach> I think it is very hard to get answers to such questions. It depends on the code generated by the compiler, on the processor architecture, on the processor implementation, etc.
KDr23 has quit [Ping timeout: 256 seconds]
<no-defun-allowed> :/
<beach> In this case, you also have a memory lookup for the jump table.
<no-defun-allowed> Yeah.
<beach> So if the binary search is very fast, then a jump table may not be able to compete.
<no-defun-allowed> Makes sense.
ebzzry_ has joined #lisp
amerlyq has joined #lisp
ramus has joined #lisp
<beach> no-defun-allowed: It may be a case that is similar to the comparison between PCL generic dispatch and SICL generic dispatch. PCL uses a table in memory and SICL uses binary search.
<no-defun-allowed> Yes, I based the dispatch off SICL binary search (and we have discussed it before).
Krystof has quit [Ping timeout: 246 seconds]
Josh_2 has joined #lisp
heisig has joined #lisp
<no-defun-allowed> You had suggested using a jump table yesterday, and I've been eager to test how SBCL handles those, but I haven't had very good results.
<Josh_2> Morning all. Does anyone know how I can optimize these 3 functions https://plaster.tymoon.eu/view/1719#1719 anymore?
KDr23 has joined #lisp
ealfonso has joined #lisp
ljavorsk has joined #lisp
ramus has quit [Ping timeout: 260 seconds]
<no-defun-allowed> Have you run it under a profiler to tell what is slowest?
<no-defun-allowed> And please don't use (safety 0) unless you are very certain that nothing can go wrong, and then only in small doses.
lavaflow has quit [Ping timeout: 264 seconds]
Lord_of_Life_ has joined #lisp
<Josh_2> I am using safety 0 in small doses
Lord_of_Life has quit [Ping timeout: 264 seconds]
Lord_of_Life_ is now known as Lord_of_Life
<no-defun-allowed> You appear to have an interesting definition of "small".
<Josh_2> using it in 3 functions is "small"
<Josh_2> considering the entire system they are a part of
<Josh_2> Besides, they are the backbone of the system, they need to be performant for the entire system to be performant
<no-defun-allowed> Have you decided that using (safety 1) would be much slower?
<Josh_2> It produces 1/3rd more machine code
<Josh_2> so I'd assume so
<no-defun-allowed> Have you bcnchmarked it?
<no-defun-allowed> bcnchmarked → benchmarked
<Josh_2> I have not benchmarked with safety 1
<no-defun-allowed> I would strongly suggest doing so before you make those assumptions.
vaporatorius has joined #lisp
vaporatorius has quit [Changing host]
vaporatorius has joined #lisp
<Josh_2> weird
<Josh_2> I'll use safety 1 then
<Josh_2> I don't know why but it scraped off a few hundred ms
<no-defun-allowed> It is usually unwise to use (safety 0) to disable runtime checks, because the problems that could arise if some invariants you decided on are broken would be more of a problem than the slight decrease in throughput caused by checks.
<phoe> have you profiled?
<no-defun-allowed> As Baker bluntly put it (in the case of some embedded systems), "rather than having the software discover its own errors in a benign way, the discovery of such errors is left to the FAA or a Congressional committee."
lavaflow has joined #lisp
orivej has joined #lisp
<no-defun-allowed> Looking at line 6, (THE BOOLEAN (LISTEN STREAM)) might be incorrect, because LISTEN only returns a generalised boolean. It is also excessive, because comparing an object to NIL is no faster if you know what the object could otherwise be.
Bourne has quit [Read error: Connection reset by peer]
<no-defun-allowed> I think READ-N-BYTES would be better written as a wrapper over READ-SEQUENCE, but it may be that spelling out the definition gives better type inference in your case.
libertyprime has quit [Read error: Connection reset by peer]
ramus has joined #lisp
<Josh_2> I removed "the" from listen
<Josh_2> I think to get a real speed improvement i'd have to redesign the entire parser
<Josh_2> I don't know why safety 1 sped it up a little bit but ¯\_(ツ)_/¯
<Josh_2> it did
dxtr has quit [Ping timeout: 258 seconds]
tcr has joined #lisp
pluplog has quit [Remote host closed the connection]
shangul has quit [Remote host closed the connection]
dxtr has joined #lisp
cg505 has quit [Quit: ZNC 1.7.2+deb3 - https://znc.in]
CrazyEddy has quit [Ping timeout: 250 seconds]
cg505 has joined #lisp
arduo has quit [Remote host closed the connection]
CrazyEddy has joined #lisp
ebzzry_ has quit [Ping timeout: 260 seconds]
shidima has joined #lisp
pjb has joined #lisp
Sauvin has quit [Ping timeout: 240 seconds]
ebzzry_ has joined #lisp
Sauvin has joined #lisp
Sauvin is now known as Sauvin
_jrjsmrtn has joined #lisp
__jrjsmrtn__ has quit [Ping timeout: 256 seconds]
SGASAU has joined #lisp
vert2 has quit [Ping timeout: 250 seconds]
<no-defun-allowed> Some implementations may type check at THE, some may assume the value will always be of the provided type.
vert2 has joined #lisp
zaquest has quit [Ping timeout: 264 seconds]
<no-defun-allowed> But profile your code, please. I would recommend SB-SPROF if you're on SBCL to get some prerequisite information.
orivej has quit [Ping timeout: 256 seconds]
zaquest has joined #lisp
vydd has quit [Quit: ZNC 1.6.6+deb1ubuntu0.2 - http://znc.in]
Lycurgus has joined #lisp
<heisig> There are also several tools for visualizing SBCL's profiler output, like clim.flamegraph and cl-flamegraph.
<no-defun-allowed> Absolutely, then you should move to the non-statistical profiler, which records calls and provides more precise information.
<no-defun-allowed> But the statistical profiler just checks a thread's call stack frequently, instead of wrapping functions from a set you choose, which I think is better for getting an idea of where cycles are burnt.
Josh_2 has quit [Ping timeout: 250 seconds]
ArthurStrong has joined #lisp
Lycurgus has quit [Remote host closed the connection]
<flip214> no-defun-allowed: is that aprof?
ebzzry_ has quit [Read error: Connection reset by peer]
<flip214> no, that's just for allocations
ebzzry_ has joined #lisp
<flip214> > SBCL includes both a deterministic profiler, that can collect statistics on individual functions, and a more “modern” statistical profiler.
Josh_2` has joined #lisp
xkapastel has joined #lisp
Bourne has joined #lisp
orivej has joined #lisp
Josh_2` has quit [Quit: ERC (IRC client for Emacs 26.3)]
libertyprime has joined #lisp
Josh_2 has joined #lisp
prince1 has quit [Ping timeout: 240 seconds]
libertyprime has quit [Read error: No route to host]
bitmapper has joined #lisp
shukryzablah has quit [Remote host closed the connection]
libertyprime has joined #lisp
|Pirx| has joined #lisp
Necktwi has quit [Ping timeout: 260 seconds]
ukari has quit [Remote host closed the connection]
ukari has joined #lisp
ebzzry_ has quit [Read error: Connection reset by peer]
swills has quit [Quit: No Ping reply in 180 seconds.]
swills has joined #lisp
joels has joined #lisp
add^__ is now known as add^_
rixard has quit [Read error: Connection reset by peer]
rixard has joined #lisp
igemnace has joined #lisp
ebzzry_ has joined #lisp
joels has quit [Ping timeout: 256 seconds]
ealfonso has quit [Ping timeout: 246 seconds]
wxie has joined #lisp
ak5 has joined #lisp
prince1 has joined #lisp
ak5 has quit [Client Quit]
Bike has joined #lisp
ljavorsk has quit [Ping timeout: 240 seconds]
orivej has quit [Ping timeout: 250 seconds]
prince1 has quit [Ping timeout: 260 seconds]
Necktwi has joined #lisp
ggole has joined #lisp
bendersteed has joined #lisp
dddddd has joined #lisp
wxie has quit [Ping timeout: 260 seconds]
SGASAU has quit [Remote host closed the connection]
SGASAU has joined #lisp
shidima has quit [Remote host closed the connection]
pjb has quit [Read error: Connection reset by peer]
pjb has joined #lisp
ukari has quit [Remote host closed the connection]
ukari has joined #lisp
<Xach> It's quicklisp dist day!
<beach> Congratulations!
<drmeister> Huzzah!
* Xach prepares to sound the alpenhorn of announcement
<jackdaniel> yay
<flip214> Xach: you're going to yodel as well?
rixard has quit [Ping timeout: 256 seconds]
<Xach> for platinum sponsors only
<flip214> will that be live or only a recording then?
mrcom has quit [Quit: This computer has gone to sleep]
mrcom has joined #lisp
<Xach> details will be in the email sent to platinum sponsors
<Xach> and posted in the platinum club lounge
cosimone has joined #lisp
pluplog has joined #lisp
ebzzry has joined #lisp
ebzzry_ has quit [Remote host closed the connection]
devrtz has quit [Ping timeout: 246 seconds]
rixard has joined #lisp
<phoe> <3
<phoe> how do I join the platinum club
orivej has joined #lisp
Necktwi has quit [Ping timeout: 260 seconds]
<jdz> phoe: You need to be introduced (sponsored?) by an existing member.
<phoe> jdz: ...are there any existing members at all
<jdz> First rule of the platinum sponsor club...
<Xach> one (but not the only) prerequisite is to stay on-topic in #lisp!
ebzzry has quit [Read error: Connection reset by peer]
<Bike> so there are no members, then
ebzzry has joined #lisp
<phoe> shit, no chance for an invidation then
<jdz> Bike: Just look at the list of people in this channel, and how many of them you know have typed anything?
<phoe> if one never typed anything on #lisp, have they been staying on-topic?
<jdz> Totally.
ebzzry has quit [Remote host closed the connection]
<phoe> they are much more on-topic than us, then
<jdz> They are the ones, watching us.
<phoe> we should take our leave while we still can
ebzzry has joined #lisp
TENEX has joined #lisp
TENEX has quit [Remote host closed the connection]
rixard has quit [Read error: Connection reset by peer]
Necktwi has joined #lisp
rixard has joined #lisp
<_death> what about customers of the steel bank?
<flip214> Bike: if there are no members, just assert yourself as the first one -- and declare independence!
<flip214> phoe: "Only the one who never types anything at all never errs" or so, right?
chip2n has quit [Quit: ZNC 1.7.5 - https://znc.in]
chip2n has joined #lisp
<phoe> flip214: I don't know if the platinum sponsors club can survive an infinite increase in its member ratio
<Xach> this is exactly the kind of behavior that will keep you out of platinum club
<flip214> phoe: it will happen only once, special cases just get an UNWIND-PROTECT
sunwukong has joined #lisp
akoana has left #lisp ["Leaving"]
devrtz has joined #lisp
ebzzry_ has joined #lisp
ebzzry has quit [Remote host closed the connection]
prince1 has joined #lisp
jeosol has joined #lisp
prince1 has quit [Ping timeout: 256 seconds]
cosimone has quit [Remote host closed the connection]
cosimone has joined #lisp
cosimone has quit [Client Quit]
cosimone has joined #lisp
lucasb has joined #lisp
arduo has joined #lisp
rumbler31 has joined #lisp
Cymew has quit [Ping timeout: 260 seconds]
libertyprime has quit [Read error: Connection reset by peer]
libertyprime has joined #lisp
* heisig just updated his Quicklisp dist to 2020-03-25
orivej has quit [Ping timeout: 250 seconds]
onixie has joined #lisp
onixie has quit [Remote host closed the connection]
SGASAU has quit [Read error: Connection reset by peer]
SGASAU has joined #lisp
orivej has joined #lisp
sjl_ has joined #lisp
efm has quit [Remote host closed the connection]
SGASAU` has joined #lisp
efm_ has joined #lisp
SGASAU has quit [Ping timeout: 240 seconds]
cosimone has quit [Quit: Terminated!]
SGASAU` has quit [Remote host closed the connection]
SGASAU` has joined #lisp
efm_ has quit [Ping timeout: 260 seconds]
libertyprime has quit [Ping timeout: 240 seconds]
FreeBirdLjj has joined #lisp
libertyprime has joined #lisp
FreeBirdLjj has quit [Client Quit]
libertyprime has quit [Read error: No route to host]
shangul has joined #lisp
<_Ark_> Does anyone know a way to get a nanosecond/cpu timestamp in Common Lisp (or at least sbcl)? I'm looking for something like Java's `nanoTime` https://docs.oracle.com/javase/7/docs/api/java/lang/System.html#nanoTime()
<_Ark_> I've tried `(get-internal-run-time)` along with `internal-time-units-per-second`, but on SBCL it gives milliseconds.
<_Ark_> `sb-ext:get-time-of-day` is closer, but it only goes down to microseconds.
<phoe> (local-time:now)
<phoe> but I wonder if that gives nanoseconds on SBCL...
<pjb> _Ark_: then multiply by 1000000.
<Xach> _Ark_: i don't know if there's a more direct way, but you could use sb-alien to use the underlying OS apis. if you know what OS api provides it, you could also grep SBCL sources for something that uses that API.
<_death> there exists a monotonic-clock library
<Xach> I don't see one at a glance but I am not looking super-hard
<Xach> _Ark_: out of curiosity, what will you do with the timestamp when you get it?
<pjb> or (com.informatimago.common-lisp.cesarum.time:get-real-time) #| --> 3.794139978273096D+9 |#
<pjb> or (com.informatimago.common-lisp.cesarum.time:get-run-time) #| --> 7.1337779999999995D0 |#
jcubic` has left #lisp [#lisp]
<Shinmera> _Ark_: sb-unix:unix-gettimeofday
<Xach> Shinmera: that does not do nanoseconds.
<pjb> Most computers don't know nanoseconds…
<Shinmera> Microseconds ought to be enough for anybody
<pjb> Until you have a 4 GHz processor :-)
<_Ark_> Xach: I want to add some built-in profiling to my game engine. Mircoseconds will work for this, but I was curious how fine-grain of time lisp can get.
<Xach> that is the spirit
<Xach> _Ark_: good detail
<Shinmera> It can get however fine grained the system offers
<_Ark_> Yeah I figured FFI was always an option. Was wondering if there was a "standard" way to do this. For some applications nano-time is desierable
<Shinmera> Like what
<Shinmera> That resolution won't be useful because it'll be highly dominated by noise anyway.
<Shinmera> Cycle counting would make more sense, but that too is riddled with issues.
<_Ark_> I used to be an APM (Application Performance Monitoring) devleoper for the JVM. Basically a simple profiler designed to run in production. We always measured in cpu nanoseconds. In practice it ended up being useful.
<_Ark_> Looking though some of the libraries people linked. Seems like `local-time` on sbcl is using `sb-ext:get-time-of-day` under the hood. I'll take a look at monotonic-clock next...
<jcowan> I once interviewed for Mellon Bank, does that count?
<jcowan> (Not for U.S. Steel, though)
<Shinmera> jcowan: ?
<jcowan> U.S. Steel is the corporate descendant of Carnegie Steel. CMU's money didn't come from nowhere.
<Shinmera> What context am I missing here?
<MichaelRaskin> yodel, I guess
<MichaelRaskin> (a mention of upcoming QuickLisp release lead to a bit of offtopic)
<Shinmera> I read that and still don't understand. Oh well, no matter.
yang has joined #lisp
Cymew has joined #lisp
<Bike> steel bank common lisp is descended from carnegie mellon university common lisp, because carnegie was a steel mogul and mellon a banker
shka_ has joined #lisp
<Shinmera> Yeah, I was missing that one message from _death a while back.
<_Ark_> For anyone following along, `monotonic-clock` is implemented using FFI. Here's the underlying system call: https://linux.die.net/man/3/clock_gettime
prince1 has joined #lisp
<_Ark_> I guess my take-away is that getting the CPU time will required an FFI call (or more desirably using a library that manages the FFI for you). To Shinmera's point, this is overkill and not helpful for most applications, so micro-time is likely what you want.
Cymew has quit [Ping timeout: 265 seconds]
iAmDecim has quit [Ping timeout: 256 seconds]
<phoe> either that, or you make a syscall yourself
prince1 has quit [Ping timeout: 256 seconds]
<_death> if you're willing to bear the consequences of rtdsc, you can also do that
<_death> *rdtsc
jprajzne has quit [Remote host closed the connection]
z147 has joined #lisp
<dlowe> worse, some computers claim to know nanoseconds and then only update their nanosecond counter every microsecond or so
<_death> resolution vs. precision
jmercouris has joined #lisp
ArthurStrong has quit [Quit: leaving]
phadthai has quit [Ping timeout: 250 seconds]
<jmercouris> when I use cffi:callback to pass a callback to some C code, how can I store that in the C code? what is it a void *?
<jmercouris> I don't even know what type I could store it as
<jackdaniel> data and function pointers are separate in C
<jackdaniel> you may call it Lisp-2 in this regard :-)
<jackdaniel> C-2 *
<pjb> jmercouris: well it's a function pointer, so you can cast it to a void*.
<jmercouris> is there a way to store the function pointer and invoke it later?
<pjb> jmercouris: in any case, the cffi declaration of the C function, and the C function itself don't need to have the same type of parameters.
<jackdaniel> pjb: in C standard casting function pointers to data pointers is undefined behavior
<pjb> (they really don't have the same type of parameters).
<pjb> jackdaniel: really?
<jackdaniel> yes
ebzzry_ has quit [Remote host closed the connection]
<jackdaniel> typedef void (*fp)(void);
<jackdaniel> now cast to fp and you are golden
metabyt[m] has quit [Ping timeout: 240 seconds]
<jmercouris> so I could say fp = xyz
<jmercouris> where xyz is the arg that I pass into the C function?
<jackdaniel> rater: fp foo; foo = &xyz;
liambrown has quit [Ping timeout: 256 seconds]
infra_red[m] has quit [Ping timeout: 256 seconds]
<jmercouris> I see, let me try this a little bit
<jmercouris> the C part of this code is giving me a headache
<_death> void call(void (*fp)(void), int arg) { fp(arg); }
Gnuxie[m] has quit [Ping timeout: 256 seconds]
<jmercouris> _death: I need to store it and call it later
<jmercouris> it is a callback which is why I was asking about the type
iAmDecim has joined #lisp
<_death> so, struct { void (*fp)(void); } stuff; void store(void (*fp)(void)) { stuff.fp = fp; }
<jackdaniel> jmercouris: please read this piece https://www.cprogramming.com/tutorial/function-pointers.html, I think that discussing C pointers is not very ontopic
infra_red[m] has joined #lisp
<jackdaniel> even if they are pointers to callbacks defined with cffi!
<Bike> function pointers and data pointers aren't interchangeable but you can use function pointers fine. declare a global variable with function pointer type, put it in a struct, whatever
<_death> you'd also want to take a context pointer, i.e. some void pointer to store as well and pass along when calling the function pointer
<pjb> jackdaniel: I see only a prevention of casting (void*) to float, in 6.5.4 of ISO/IEC 9899:201x Committee Draft — April 12, 2011 N1570
<pjb> to and from.
Gnuxie[m] has joined #lisp
grumble has quit [Quit: even though the storm calmed down, the bitter end is just a matter of time]
iAmDecim has quit [Ping timeout: 256 seconds]
grumble has joined #lisp
metabyt[m] has joined #lisp
<TMA> pjb: you need to consider the whole standard; undefined behavior need not be explicitely specified, the necessary condition is that the standard does not explicitely or implicitely specify it
<pjb> TMA: yes, but then the C standard doesn't specify a Turing Complete language either. So we could stop there.
<pjb> TMA: but if it's not formally forbidden, and all C compilers do the right thing, where's the objection?
<TMA> pjb: embedded platforms can have function pointers bigger or smaller than data pointers
<jackdaniel> pjb: in 6.3.2.3 (same document), pointes 7. and 8.; there is no specification about casting between object and function pointers
<jackdaniel> points8
liambrown has joined #lisp
<jackdaniel> it is certainly nice that it "usually works", but I think that there are architectures where normal data pointer is insufficient to store function address
<jackdaniel> s/address/pointer/
<pjb> Ok, so it could work or not, it's implementation dependent. So we'd need to cast to something like int(*)() or void(*)() perhaps. typedef void(*function_ptr)();
<jackdaniel> yes
Oladon has joined #lisp
<pjb> Anyways, my point was that the CFFI declaration of _death's store function above doesn't need to use the type of void(*fp)(void) as argument, but can take the cffi:callback type.
<pjb> Said otherwise, FFIs don't validate the function signatures across languages. If it could, we wouldn't have to declare the C functions in lisp!
cosimone has joined #lisp
rumbler31 has quit [Remote host closed the connection]
Lycurgus has joined #lisp
<jmercouris> not to fuel the off-topic discussion, but I read somewhere that it is apparently a posix specification that it should work
SGASAU` has quit [Remote host closed the connection]
SGASAU` has joined #lisp
<dlowe> I wonder if you could use DWARF debugging information to pull FFI definitions
whiteline_ has quit [Remote host closed the connection]
whiteline has joined #lisp
frgo has quit []
phadthai has joined #lisp
jprajzne has joined #lisp
ofc has joined #lisp
ukari has quit [Remote host closed the connection]
ukari has joined #lisp
Lycurgus has quit [Remote host closed the connection]
<pjb> dlowe: theorically, if it's available, yes.
SGASAU` has quit [Ping timeout: 240 seconds]
SGASAU` has joined #lisp
ggole has quit [Quit: Leaving]
<flip214> _Ark_: SBCL shows the CPU cycles in (time), (sb-ext:call-with-timing) can give that without parsing text, and then there's (sb-impl::read-cycle-counter) ...
z147 has quit [Ping timeout: 240 seconds]
frgo has joined #lisp
ear-the-art has quit [Ping timeout: 258 seconds]
rippa has joined #lisp
|Pirx_off has joined #lisp
|Pirx| has quit [Ping timeout: 256 seconds]
rumbler31 has joined #lisp
prince1 has joined #lisp
ear-the-art has joined #lisp
jmercouris has quit [Remote host closed the connection]
zmt01 has joined #lisp
zmt00 has quit [Ping timeout: 246 seconds]
prince1 has quit [Ping timeout: 265 seconds]
Oladon has quit [Quit: Leaving.]
sunwukong has quit [Quit: Leaving]
jeosol has quit [Remote host closed the connection]
iAmDecim has joined #lisp
Sauvin has quit [Read error: Connection reset by peer]
<jackdaniel> that is correct, dlsym returns a void pointer, it is briefly discussed here https://en.wikipedia.org/wiki/Dynamic_loading
iAmDecim has quit [Ping timeout: 256 seconds]
rumbler31 has quit [Remote host closed the connection]
luni has joined #lisp
ukari has quit [Remote host closed the connection]
sonologico has quit [Quit: Leaving]
ukari has joined #lisp
frodef has joined #lisp
SGASAU`` has joined #lisp
z147 has joined #lisp
ear-the-art has quit [Ping timeout: 256 seconds]
SGASAU` has quit [Ping timeout: 240 seconds]
sammich has quit [Quit: https://quassel-irc.org - Chat comfortably. Anywhere.]
ear-the-art has joined #lisp
xaotuk has joined #lisp
Josh_2 has quit [Ping timeout: 250 seconds]
sonologico has joined #lisp
pilne has joined #lisp
heisig has quit [Quit: Leaving]
ukari has quit [Remote host closed the connection]
ukari has joined #lisp
SGASAU`` has quit [Remote host closed the connection]
SGASAU`` has joined #lisp
efm has joined #lisp
Josh_2` has joined #lisp
Josh_2` has quit [Remote host closed the connection]
Josh_2 has joined #lisp
amerlyq has quit [Quit: amerlyq]
Josh_2 has quit [Client Quit]
<_Ark_> flip214: Thanks! I was not away of `sb-ext:call-with-timing`
z147 has quit [Ping timeout: 240 seconds]
ear-the-art has quit [Remote host closed the connection]
z147 has joined #lisp
SGASAU``` has joined #lisp
xaotuk has quit [Ping timeout: 250 seconds]
SGASAU`` has quit [Remote host closed the connection]
cosimone has quit [Quit: Quit.]
ear-the-art has joined #lisp
atgreen has joined #lisp
SGASAU``` has quit [Ping timeout: 256 seconds]
prince1 has joined #lisp
shangul has quit [Ping timeout: 250 seconds]
hiroaki has joined #lisp
prince1 has quit [Ping timeout: 240 seconds]
atgreen has quit [Ping timeout: 250 seconds]
atgreen_ has joined #lisp
|Pirx_off has quit [Ping timeout: 256 seconds]
iAmDecim has joined #lisp
z147 has quit [Ping timeout: 240 seconds]
efm has quit [Ping timeout: 240 seconds]
iAmDecim has quit [Ping timeout: 256 seconds]
efm has joined #lisp
cosimone has joined #lisp
pluplog has quit [Read error: Connection reset by peer]
vaporatorius has quit [Ping timeout: 250 seconds]
Krystof has joined #lisp
z147 has joined #lisp
flazh has quit [Ping timeout: 250 seconds]
narimiran has quit [Ping timeout: 246 seconds]
rumbler31 has joined #lisp
z147 has quit [Ping timeout: 240 seconds]
rumbler31 has quit [Ping timeout: 258 seconds]
efm has quit [Read error: Connection reset by peer]
bars0_ has quit [Quit: leaving]
vlatkoB has quit [Quit: http://quassel-irc.org - Chat comfortably. Anywhere.]
efm has joined #lisp
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
ym has quit [Ping timeout: 240 seconds]
shka_ has quit [Ping timeout: 256 seconds]
b0nn has quit [Ping timeout: 268 seconds]
ym has joined #lisp
b0nn has joined #lisp
flazh has joined #lisp
flazh has quit [Client Quit]
flazh has joined #lisp
orivej has quit [Ping timeout: 256 seconds]
orivej has joined #lisp
xkapastel has quit [Quit: Connection closed for inactivity]
efm has quit [Quit: Konversation terminated!]
sjl_ has quit [Ping timeout: 240 seconds]
|Pirx| has joined #lisp
Lord_of_Life_ has joined #lisp
Lord_of_Life has quit [Ping timeout: 250 seconds]
Lord_of_Life_ is now known as Lord_of_Life
izh_ has joined #lisp
lucasb has quit [Quit: Connection closed for inactivity]
ukari has quit [Remote host closed the connection]
ukari has joined #lisp
atgreen_ has quit [Ping timeout: 260 seconds]
gravicappa has quit [Ping timeout: 256 seconds]
luckless has quit [Remote host closed the connection]
luckless has joined #lisp
|Pirx| has quit [Ping timeout: 240 seconds]
|Pirx| has joined #lisp
izh_ has quit [Quit: Leaving]
tcr has quit [Ping timeout: 264 seconds]
aamukastemato has joined #lisp
atgreen has joined #lisp
atgreen has quit [Ping timeout: 256 seconds]
prince1 has joined #lisp
prince1 has quit [Ping timeout: 256 seconds]
iAmDecim has joined #lisp
rumbler31 has joined #lisp
jonatack has quit [Ping timeout: 260 seconds]
jonatack has joined #lisp
jonatack has quit [Client Quit]
jonatack has joined #lisp
jonatack has quit [Read error: Connection reset by peer]
Khisanth has quit [Ping timeout: 256 seconds]
jonatack has joined #lisp
clothespin has joined #lisp
Khisanth has joined #lisp
efm has joined #lisp
sponge5 has joined #lisp
bendersteed has quit [Remote host closed the connection]
hiroaki has quit [Ping timeout: 256 seconds]
cosimone_ has joined #lisp
cosimone has quit [Ping timeout: 256 seconds]
slyrus has joined #lisp
userself has joined #lisp
random-nick has quit [Ping timeout: 265 seconds]
asarch has joined #lisp
iAmDecim has quit [Ping timeout: 240 seconds]
iAmDecim has joined #lisp
asarch has quit [Quit: Leaving]
iAmDecim has quit [Ping timeout: 250 seconds]
sponge5 has quit [Quit: WeeChat 2.7.1]
karlosz has joined #lisp
|Pirx_off has joined #lisp
iAmDecim has joined #lisp
|Pirx| has quit [Ping timeout: 250 seconds]
iAmDecim has quit [Ping timeout: 250 seconds]
aamukastemato has quit [Quit: Leaving]
arduo has quit [Ping timeout: 256 seconds]