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/>
comatory_ has joined #commonlisp
karlosz has quit [Quit: karlosz]
karlosz has joined #commonlisp
thomaslewis has joined #commonlisp
notzmv has joined #commonlisp
comatory_ has quit [Ping timeout: 248 seconds]
thomaslewis has left #commonlisp [#commonlisp]
comatory_ has joined #commonlisp
lagash has quit [Remote host closed the connection]
lagash has joined #commonlisp
comatory_ has quit [Ping timeout: 248 seconds]
comatory_ has joined #commonlisp
comatory_ has quit [Ping timeout: 268 seconds]
karlosz has quit [Quit: karlosz]
pmwals096 has joined #commonlisp
comatory_ has joined #commonlisp
thomaslewis has joined #commonlisp
thomaslewis has left #commonlisp [#commonlisp]
waleee has quit [Ping timeout: 248 seconds]
dmgk has joined #commonlisp
pmwals096 has quit [Ping timeout: 248 seconds]
Noisytoot has quit [Ping timeout: 255 seconds]
pmwals09 has joined #commonlisp
Noisytoot has joined #commonlisp
splatt990 has joined #commonlisp
pmwals09 has quit [Ping timeout: 248 seconds]
hashfunc has joined #commonlisp
irc_user has joined #commonlisp
020AAAOT1 has joined #commonlisp
Devon7 has quit [Ping timeout: 252 seconds]
hashfunc has quit [Remote host closed the connection]
hashfunc has joined #commonlisp
hashfunc has quit [Remote host closed the connection]
hashfunc has joined #commonlisp
jealousmonk has quit [Remote host closed the connection]
jmdaemon has joined #commonlisp
jmd_ has quit [Ping timeout: 248 seconds]
livoreno has joined #commonlisp
nij- has joined #commonlisp
<nij-> Two questions.. uiop:launch-program allows as to talk to the process with :stream. Which kind of socket does it use? Does it work on all of linux, macos, and windows?
<nij-> Second, if I want to do socket programming portably (on all three os types), what kind of socket should I use? BSD socket doesn't work on windows iirc.
jmd_ has joined #commonlisp
jmdaemon has quit [Ping timeout: 252 seconds]
<nij-> Hmm.. it sees to call sbcl's run-program, which relies on bsd socket.. does that mean it won't work for windows users?
020AAAOT1 has quit [Ping timeout: 256 seconds]
karlosz has joined #commonlisp
comatory_ has quit [Ping timeout: 256 seconds]
comatory_ has joined #commonlisp
hashfunc has quit [Ping timeout: 255 seconds]
masinter has quit [Quit: ~ Trillian - www.trillian.im ~]
thuna` has quit [Ping timeout: 252 seconds]
<_death> where do you see the use of sockets?
<White_Flame> external programs should be connected by normal stdin/stdout/stderr pipes
azimut has quit [Ping timeout: 268 seconds]
asarch has joined #commonlisp
<asarch> How could you make a function like: (calc '+ 10 10) or (calc '- 8 3) or (calc 'exp 2 9)?
<asarch> (defmacro calc (operator a b) (operator a b)) says 'operator' is never used
<White_Flame> `(funcall ,operator ,a ,b)
<White_Flame> also, this is a lisp-2, 'operator' isn't a function, and the operator parameter is never used
<asarch> ?
<White_Flame> you also can't directly do (list operator a b), because you're passing in the operator quoted
<White_Flame> (operator a b) is a function use of the symbol OPERATOR, there is no variable use of the parameter OPERATOR
<asarch> Is there a way to "force" to use the parameter OPERATOR?
<White_Flame> just use it ;-P
<White_Flame> I gave you the body to use
<White_Flame> with funcall
<asarch> Thank you!
<asarch> Thank you very much!
<White_Flame> but understand what the problem is, and why the solution works
specbot has quit [Remote host closed the connection]
minion has quit [Remote host closed the connection]
<asarch> Ok
aartaka has joined #commonlisp
minion has joined #commonlisp
specbot has joined #commonlisp
thomaslewis has joined #commonlisp
<asarch> Chapter 16 of Land of Lisp
<White_Flame> i don't have it in front of me
thomaslewis has left #commonlisp [#commonlisp]
<beach> asarch: I do not recommend that book.
ryanbw has joined #commonlisp
<asarch> That's my only reference :'-(
<beach> asarch: PCL is available online, and so are several others.
<asarch> Is that the full book?
<asarch> Do you remember when I made the PDF version of that book? I think something is missing
<beach> That link contains my comments on the first few chapters.
<asarch> That book "tastes" like when you are in a hurry and you grab "something" to eat
<asarch> It gives you more questions
ttree has quit [Ping timeout: 248 seconds]
MajorBiscuit has joined #commonlisp
Furor has joined #commonlisp
<asarch> Wouldn't be great to use '?' as the last character of predicates? (e.g. (empty? ...))
Colere has quit [Ping timeout: 268 seconds]
<White_Flame> I use that a lot. that's also Scheme style
shka has joined #commonlisp
<asarch> I read it from the Dylan programming language introduction book
igemnace has joined #commonlisp
Krystof has joined #commonlisp
sander is now known as sndr
<splittist> There's a lot to like about Dylan. It's an interesting (...) mix of well-thought-through and rushed.
<splittist> (and, I guess, off-topic)
Posterdati has quit [Quit: KVIrc 5.0.0 Aria http://www.kvirc.net/]
Posterdati has joined #commonlisp
irc_user has quit [Quit: Connection closed for inactivity]
lottaquestions_ has joined #commonlisp
lottaquestions_ has quit [Read error: Connection reset by peer]
lottaquestions_ has joined #commonlisp
lottaquestions has quit [Ping timeout: 244 seconds]
lottaquestions_ has quit [Client Quit]
anticomputer has quit [Remote host closed the connection]
gxt has quit [Remote host closed the connection]
lottaquestions_ has joined #commonlisp
anticomputer has joined #commonlisp
gxt has joined #commonlisp
<asarch> Dylan, Self, Newspeak
Tallund has joined #commonlisp
<asarch> Anyway. Thank you guys. Have a nice day :-)
asarch has quit [Quit: Leaving]
<jackdaniel> (setf (fdefinition 'calc) #'funcall)
<jackdaniel> (mind that answers to the question about 'making a function' made a macro)
attila_lendvai has joined #commonlisp
totoro has quit [Read error: Connection reset by peer]
Dynom_ has joined #commonlisp
Dynom_ is now known as Guest9872
<Tallund> Hi, I'd recently tried to implement type generics in custom collections defined by defstruct via macro. The struct would be created with a read only slot of type 'symbol' to act as a type specifier that would be read out at macro expansion time into a backquoted declaration form preceding collection operations. And I did succeed, actually- for
<Tallund> values known at compile time. It fails as soon as I call the function-like-macro on a collection bound to a fresh let form within the REPL. I think I've read something about runtime type declarations somewhere and started trying to figure that out with a type specifier symbol retrieved only then but I've been having trouble finding anything about
<Tallund> the evaluation semantics for the different declaration forms. Am I wasting my time here? Is there a better way to do this? Is there maybe some quicklisp package that implements generics I didn't find in the curated list?
<beach> Tallund: Declarations are not forms, so they are not evaluated.
frgo has quit [Ping timeout: 248 seconds]
<flip214> I seem to remember that clouseau (or was it something in McClim?) would show a graphic of a CLOS class hierarchy, but I can't find that any more. Any hints, please? Thanks a lot!
<beach> flip214: The CLIM listener can do that. I believe it has a "," command for that, like ,show class subclasses or something similar.
<Tallund> Huh. Does that enable me to 'make runtime declarations'?
<beach> Tallund: But it is hard to say what is going wrong since you are not showing your code.
<Tallund> I'm a bit embarrassed to share it but I'll do so in a moment after testing it again.
<beach> Tallund: I don't know what that means, but I was telling you about "the evaluation semantics for the different declaration forms".
<beach> And there is no such thing because of what I said.
<flip214> beach: ah yeah, thanks! even a menue item that just asks for the class name.
<beach> flip214: Yes, maybe so.
<beach> Tallund: Like I don't know what a "type generic" is, nor a "custom collection".
<beach> Others might, of course.
<beach> Tallund: But maybe you are asking about the semantics about type declarations in general. The answer is that the implementation is free to ignore them.
<Tallund> I had Java's varying List<>s in mind when I said that, which could be specified to be of type 'List<String>' for example, and Java would then do its' typical compile time type checking upon insertion of elements into the specific list object and the retrieval of elements from the same object
<beach> Tallund: The standard says that a type declaration is a promise from the programmer, and the implementation may or may not check it.
<Tallund> That List<> bit I mentioned would be an example of collection type generics, at least as far as I know
<beach> Tallund: Trying to make Common Lisp behave like a statically typed programming language is usually a bad idea in the first place. For example, there is no Common Lisp declaration that will declare the type of every element of a list.
rendar has quit [Quit: Leaving]
<beach> ... unless you use SATISFIES of course.
gxt has quit [Remote host closed the connection]
rendar has joined #commonlisp
rendar has quit [Changing host]
rendar has joined #commonlisp
gxt has joined #commonlisp
<contrapunctus> Tallund: you might be interested in Coalton.
<Tallund> My thought was just to automatically generate the declarations from a type specifier given in one place, specified as a struct's slot value, instead of having to repeat the everywhere manually
<Tallund> Hoo, this is nifty
<Tallund> I vaguely remember hearing about this somewhere.
<jackdaniel> as a side note, in clim a presentation type sequence may have the element type specified
<jackdaniel> (that has expected implications on parsing and typed input)
frodef has quit [Ping timeout: 268 seconds]
gxt has quit [Remote host closed the connection]
gxt has joined #commonlisp
<beach> Tallund: If you want to make sure the implementation checks your types, you need to use CHECK-TYPE or something similar. A type declaration is not guaranteed to work.
<Tallund> I was mostly looking to leverage SBCL's type inference as far as I could get it to for producing macro expansion time declarations
<Tallund> Type inference is the wrong term here, since I'm trying to fetch a value, it would be a sort of value inference
<Tallund> My bad
<Tallund> Hastebin's parsed it as a cpp file for whatever reason
<Tallund> There's the code in question, at least, all that I think is relevant
<beach> Since declarations are not forms, you can't turn an element of a vector into the type supplied to a type declaration, unless that vector is known at compile time.
<beach> You would have to use TYPEP and ERROR.
<beach> And, again, even if you could, the implementation would not be guaranteed to check the type. For SBCL, I think it depends on the OPTIMIZE settings whether it does that or not.
Brucio-61 has quit [Ping timeout: 248 seconds]
<Tallund> Ok, ok, ok, I think I'd need straight up reflection and macros all over the damn place in order to achieve the kind of value inference I had in mind.
<beach> A macro won't fix the fact that a declaration is not a form.
<beach> But you can store the type specifier in an element of a vector and then use TYPEP at run time.
<Tallund> No, but I think I can manually implement some value inference via compile time form evaluation in macros.
<beach> Maybe so. I don't know what "value inference" is, so I can't tell.
<White_Flame> I think the literal interpretation of that phrase would be constant propagation
lispm has joined #commonlisp
<Tallund> The ugliest solution I have in mind is just putting a bunch of symbols to act as type specifiers into a hash map and then I fetch the correct type specifier where it is needed
<Tallund> White_Flame: Wonderful, I now have a google search term!
<White_Flame> that simply means eg (+ 2 3) gets compiled as literal 5
<_death> if you want compile-time checks, you can generate per-type code to do that
<White_Flame> inferring the value at compile-time, if it's all given constants
lispm has quit [Client Quit]
Brucio-61 has joined #commonlisp
<beach> Tallund: What is the advantage of having a symbol act as a type specifier, rather than using the type specifier itself?
<_death> like (define-typed-stack single-float-stack single-float) that can generate the constructors and operators
<beach> OK.
<Tallund> White_Flame:
<Tallund> > that simply means eg (+ 2 3) gets compiled as literal 5
<Tallund> I think it'd be more than that, but I don't have enough intuition or knowledge to contest that statement
<Tallund> beach: From my understanding and experimentation, type specifiers are a subset of symbols that themselves name a type, and not in the sense that symbols acting as variable names do
<_death> (the checks may or may not be there; in sbcl, you may get some of them by its type inference, supposing the push operation is inlined)
<beach> Tallund: Type specifiers are not necessarily symbols.
<Tallund> t, the symbol that is treated as the boolean value of true, also names the type T, as in, the object hiearchy root
<beach> Tallund: (integer 3 7) is a type specifier, for example.
<Tallund> ...Ah.
<Tallund> > What is the advantage of having a symbol act as a type specifier, rather than using the type specifier itself?
<Tallund> I think I was hoping for SBCL to spit out optimized code via some kind of dynamic just in time compilation+ optimization, and with type checks
<_death> (you can also declare the push operation's function type, if it is a function)
<Tallund> Which I realize is a completely ridiculous idea now that I think about it
<_death> you can perform the JIT compilation yourself..
<_death> clhs compile
<Tallund> Really, you should've figured out I don't know where the hell God put me once I started asking about 'evaluating declaration forms at runtime with type specifiers retrieved at runtime'
<Tallund> Thank you by the way, I found out a lot I wanted to know here
<beach> Pleasure.
<beach> Well, I kind of did, in that I pointed out that declarations are not forms, so they are not evaluated.
<Tallund> Thank you again, then, for humoring me this long
<beach> Sure.
<Tallund> _death: Thanks for linking me to CLHS compile, this makes some things a lot easier.
<_death> note that compilation may be expensive, so you need to consider the tradeoff and proably make good use of caches
<_death> *probably
pmwals09_ has joined #commonlisp
pmwals09_ has quit [Ping timeout: 256 seconds]
<Tallund> I agree. As much as it bothers me, it would make the most sense I think if I then packaged the jit'd functions for the struct, in the struct, as a primitive pseudo object
<Tallund> And into a hash map for reuse elsewhere too
<flip214> set-pprint-dispatch says it's using EQUAL for type comparison -- so I can't use a base class and a generic function, I'd have to register each subclass as well.
<flip214> Is there another mechanism that makes this easier? (Yeah, I can loop over the subclasses known at compile time, but still...)
<_death> I think you can.. the paragraph is about determining whether there's an existing entry associated with it
attila_lendvai has quit [Read error: Connection reset by peer]
scymtym has joined #commonlisp
<flip214> _death: thank you!
<scymtym> flip214: when you inspect a class in clouseau, expanding the sub- and superclasses "places" should display graphs. the context menu on those values can be used to toggle between list and graph display
totoro has joined #commonlisp
karlosz has quit [Quit: karlosz]
<pjb> Tallund: there are three ways to do it: (EVAL lambda-expression) (COERCE lambda-expression 'function) and (COMPILE nil lambda-expression)
<pjb> Tallund: EVAL could produce an interpreted function, COMPILE must produce a compiled-function, COERCE could do what's best (fastest?) for the implementation. You also have to take into account the number of times you need to produce a function, vs. the number of times you will call it.
jmd_ has quit [Ping timeout: 244 seconds]
totoro has quit [Quit: ZNC 1.8.2+deb2+b1 - https://znc.in]
Cymew has joined #commonlisp
<flip214> scymtym: ah yeah, right! clim has a left-to-right layout which works better with the class names, though -- top-to-bottom becomes too wide.
<flip214> thanks!
<flip214> If my package names use "/" in their names ("foo/data", "foo/impl", ...), how would I escape that in a FORMAT call? (format nil "~/foo/data:my-format/" x) doesn't work, neither does \\/ ...
pve has joined #commonlisp
SR-71 has joined #commonlisp
<yitzi> flip214: forward slash isn't a character that needs escaping. `~/` is a format specifier that calls a function. http://clhs.lisp.se/Body/22_ced.htm
<yitzi> If you are trying to output "~/" then it is the tilde that needs escaping.
<flip214> yitzi: my function needs a package (else CL-USER is used!), and my package name contains a #\/. But a / means "end of function name"...
<yitzi> Try `(format nil "~~/foo/data:my-format/" x)`
<yitzi> I think I've misundertood.... the function name is "foo/data:my-format"?
<flip214> yes
<yitzi> You can't do that. The spec says the function name can't have / in it. http://clhs.lisp.se/Body/22_ced.htm
<flip214> yeah, I gave the package a nickname without /
random-nick has joined #commonlisp
totoro has joined #commonlisp
kami_ has joined #commonlisp
kami_ has quit [Client Quit]
totoro has quit [Quit: ZNC 1.8.2+deb2+b1 - https://znc.in]
totoro has joined #commonlisp
Cymew has quit [Ping timeout: 252 seconds]
thuna` has joined #commonlisp
Brucio-61 has quit [Read error: Connection reset by peer]
Brucio-61 has joined #commonlisp
<nij-> _death White_Flame I see. Thanks :)
Tallund has quit [Quit: Client closed]
<scymtym> flip214: i think that depends, a horizontal layout would roughly be class-name-width * graph-depth wide while a vertical layout should be something like class-name-width * max-node-degree. so a horizontal layout would be good for a shallow hierarchy with lots of mixins or superclasses in general
* scymtym should probably make the orientation configurable
<dbotton> is there a "good" way to add to .asd files the ability to do a git clone (and when needed a git pull)?
<flip214> dbotton: https://asdf.common-lisp.dev/asdf/Creating-new-operations.html add a :git-pull operation?
jeosol has quit [Quit: Client closed]
<dbotton> I'll look in to that way, seems common enough has anyone written one before?
<dbotton> or some generic "command line" extension?
<dim> I'd say thanks to Quicklisp it's not needed that much; in between releases I would simply git clone/pull into quicklisp/local-projects though
pranavats has left #commonlisp [Error from remote client]
scymtym has quit [Ping timeout: 248 seconds]
Brucio-61 has quit [Ping timeout: 268 seconds]
Brucio-61 has joined #commonlisp
scymtym has joined #commonlisp
attila_lendvai has joined #commonlisp
<pjb> flip214: (defpackage "FMT" (:use) (:import-from "FOO/DATA" "MY-FORMAT") (:export "MY-FORMAT")) (format t "~/fmt:my-format/" arg)
<pjb> flip214: and if your function itself has a bad name: (defun fmt:my-format (&rest args) (apply #'foo/data:my/bad/name args))
Everything has joined #commonlisp
ec has quit [Quit: ec]
thomaslewis has joined #commonlisp
thomaslewis has left #commonlisp [#commonlisp]
<Bike> there's an emit-lexical-set but nothing uses it?
<Bike> er
<Bike> wrong channel, excuse me
dlowe has joined #commonlisp
Everything has quit [Quit: leaving]
pranavats has joined #commonlisp
ahlk has joined #commonlisp
aartaka has quit [Ping timeout: 256 seconds]
aartaka has joined #commonlisp
Cymew has joined #commonlisp
thomaslewis has joined #commonlisp
thomaslewis has left #commonlisp [#commonlisp]
aartaka has quit [Ping timeout: 256 seconds]
aartaka has joined #commonlisp
frgo has joined #commonlisp
dlowe has quit [Ping timeout: 256 seconds]
Devon7 has joined #commonlisp
livoreno has quit [Ping timeout: 256 seconds]
Devon7 is now known as Devon
causal has joined #commonlisp
frgo has quit [Ping timeout: 268 seconds]
Cymew has quit [Ping timeout: 268 seconds]
comatory has joined #commonlisp
comatory_ has quit [Ping timeout: 268 seconds]
comatory has quit [Ping timeout: 248 seconds]
causal has quit [Quit: WeeChat 3.6]
azimut has joined #commonlisp
aartaka has quit [Ping timeout: 268 seconds]
aartaka has joined #commonlisp
masinter has joined #commonlisp
aartaka has quit [Ping timeout: 256 seconds]
aartaka has joined #commonlisp
aartaka has quit [Ping timeout: 256 seconds]
thomaslewis has joined #commonlisp
thomaslewis has left #commonlisp [#commonlisp]
karlosz has joined #commonlisp
karlosz has quit [Client Quit]
triffid has quit [Remote host closed the connection]
MajorBiscuit has quit [Ping timeout: 248 seconds]
MajorBiscuit has joined #commonlisp
dra_ has joined #commonlisp
pmwals092 has joined #commonlisp
szkl has quit [Quit: Connection closed for inactivity]
pmwals092 has quit [Ping timeout: 248 seconds]
MajorBiscuit has quit [Ping timeout: 252 seconds]
cage has joined #commonlisp
ober has joined #commonlisp
<dbotton> Is there a way to check if a directory exists without creating it? (only found ensure-directories-exist)
<jackdaniel> how about (directory "/tmp") ;?
<jackdaniel> nevermind
<jackdaniel> that won't do :)
<White_Flame> you could do (ignore-errors (truename #p...))
<White_Flame> clunky in performance but simple
<jackdaniel> how about (directory "/tmp/") ;?
<jackdaniel> mind the trailing slash
<White_Flame> (uiop:truename* #p...) returns NIL on non-existence instead of erroring
<White_Flame> oh, there it is, uiop:director-exists-p
<White_Flame> +y
jmdaemon has joined #commonlisp
<dbotton> thanks!
cage has quit [Quit: rcirc on GNU Emacs 27.1]
masinter_ has joined #commonlisp
masinter has quit [Ping timeout: 256 seconds]
orestarod has joined #commonlisp
igemnace has quit [Read error: Connection reset by peer]
attila_lendvai has quit [Read error: Connection reset by peer]
ttree has joined #commonlisp
comatory has joined #commonlisp
azimut has quit [Ping timeout: 268 seconds]
tyson2 has joined #commonlisp
morganw has joined #commonlisp
comatory has quit [Ping timeout: 256 seconds]
comatory has joined #commonlisp
<kagevf> dbotton: maybe cl:probe-file?
<Shinmera> There's also filesystem-utils:directory-p and others.
pranavats has left #commonlisp [Error from remote client]
fiddlerwoaroof has quit [Ping timeout: 255 seconds]
comatory has quit [Ping timeout: 252 seconds]
comatory has joined #commonlisp
fiddlerwoaroof has joined #commonlisp
comatory has quit [Ping timeout: 268 seconds]
thomaslewis has joined #commonlisp
comatory has joined #commonlisp
thomaslewis has left #commonlisp [#commonlisp]
tyson2 has quit [Remote host closed the connection]
comatory has quit [Ping timeout: 248 seconds]
pranavats has joined #commonlisp
comatory has joined #commonlisp
azimut has joined #commonlisp
Lord_of_Life_ has joined #commonlisp
Lord_of_Life has quit [Ping timeout: 248 seconds]
Lord_of_Life_ is now known as Lord_of_Life
xaltsc has quit [Ping timeout: 255 seconds]
xaltsc has joined #commonlisp
thomaslewis has joined #commonlisp
thomaslewis has left #commonlisp [#commonlisp]
thomaslewis has joined #commonlisp
thomaslewis has left #commonlisp [#commonlisp]
karlosz has joined #commonlisp
jeosol has joined #commonlisp
azimut has quit [Remote host closed the connection]
azimut has joined #commonlisp
comatory has quit [Ping timeout: 252 seconds]
comatory has joined #commonlisp
tyson2 has joined #commonlisp
jeosol has quit [Quit: Client closed]
<pjb> dbotton: (directory "/tmp/") works perfectly well.
azimut has quit [Ping timeout: 268 seconds]
azimut has joined #commonlisp
comatory has quit [Ping timeout: 248 seconds]
jealousmonk has joined #commonlisp
azimut has quit [Remote host closed the connection]
azimut has joined #commonlisp
comatory has joined #commonlisp
<nij-> Anyone knows how CFFI works? I mean, lisp has to talk to C in some way. Which channel do they use? Do they use bsd sockets?
<Bike> cffi is not a communication between processes. it is a way for lisp code to run c code and vice versa, all in the same process.
comatory has quit [Ping timeout: 248 seconds]
<Bike> lisp functions can call c functions similarly to how they would call other lisp functions, and the reverse can be done through callbacks.
<pjb> nij-: CFFI works by expanding macros to implementation specific FFI.
jeosol has joined #commonlisp
<pjb> nij-: the channel used is that of the FFI = Foreign Function Interface.
<aeth> you could always try writing a CFFI hello world and running DISASSEMBLE on the function to see what it's doing
comatory has joined #commonlisp
<pjb> or rather, use macroexpand: (macroexpand-1 '(cffi:defcfun clock :int)) #| --> (progn nil (defun clock nil (cffi-sys:%foreign-funcall "clock" (:int) :convention :cdecl :library :default))) ; t |# (macroexpand-1 ' (cffi-sys:%foreign-funcall "clock" (:int) :convention :cdecl :library :default)) #| --> (ccl:external-call "_clock" :signed-int) ; t |#
comatory has quit [Ping timeout: 256 seconds]
<aeth> which is faster depends on the implementation and if it's helpful enough to comment or otherwise make known that it's calling, in this case, ccl:external-call
<aeth> (if that isn't inline, which it very well could be
<aeth> )
comatory has joined #commonlisp
thomaslewis has joined #commonlisp
nij- has quit [Ping timeout: 244 seconds]
thomaslewis has left #commonlisp [#commonlisp]
tyson2 has quit [Remote host closed the connection]
comatory has quit [Ping timeout: 248 seconds]
comatory has joined #commonlisp
<nij-> got disconnected oops
nij- has joined #commonlisp
<nij-> running c code in lisp code.. in the same process.. how is that possible?
<Bike> it's all running on the same machine in the end. a lisp compiler can just generate a C call instruction sequence.
<nij-> Hmm.. I see.. so there's not another C runtime listening and doing work..
<nij-> Can I do this for other langs like python? Or does it just work for lower level langs like C?
MajorBiscuit has joined #commonlisp
comatory has quit [Ping timeout: 256 seconds]
<aeth> the problem with other languages is that they have a much larger runtime, probably including a garbage collector, too
<Bike> well, to run C code there probably does have to be some kind of c runtime linked in. like you're not going to be able to call into libc without linking libc.
<aeth> and two different garbage collectors can interfere with each other
<aeth> iirc
comatory has joined #commonlisp
<Bike> C is fairly unique among programming languages in having defined binary interfaces for a variety of architectures, meaning that there is a clear and documented way to write the machine instructions to call into C
<nij-> so for other langs, it's better to have two of them communicating via a socket or something?
<Bike> which is not true of python, though there are some other lisp/python things
<Bike> and cpython has a C API, so you could probably call into python that way
<aeth> Yes, to talk between language A and language B, you have them both pretend to talk to language C, in this case C.
<dbotton> <Shinmera> thanks very usefull
<nij-> aeth why should I include the third language?
<nij-> is it better design or something?
<Bike> nah, it's just that lisp and python aren't set up to talk directly, but they are both set up to talk to c. so to speak.
<contrapunctus> nij-: pick up one of these forks - https://github.com/pinterface/burgled-batteries/network/members (unless there's something newer I don't know of...)
<Bike> or have them in separate processes and talk over sockets. depends on what you are doing.
<White_Flame> C really doesn't have a 'runtime' as much as just a bunch of library calls
karlosz has quit [Remote host closed the connection]
<nij-> is talking via C usually faster and more efficient than using a bsd socket?
<Bike> it has a runtime, but you only need to care about crt0 if you're doing pretty funky stuff
<White_Flame> it's basically because the OSes basically expose C interfaces
<White_Flame> so that defines the ABIs that codegens have to follow
<nij-> suppose I need to pass large data between two runtimes
<aeth> docker microservices
<aeth> or maybe k8s
<nij-> aeth (is that for me)?
<aeth> I was just thinking about the most overengineered to do it, which is actually probably also the most common
<nij-> I want to make something that works for many languages.
<Bike> if stuff is in the same process, you might be able to send a pointer to it, so there wouldn't be any copying and it would go quick. over a socket you'd have to actually send the data. but there are other things you could do, like mmapping
<nij-> Bike oh I see that's a good point.. hmm
comatory has quit [Ping timeout: 268 seconds]
<aeth> if you don't care about the implementation and it's your highest priority, you could use a runtime that's designed for that
<aeth> e.g. ABCL runs on the JVM
Guest76 has joined #commonlisp
comatory has joined #commonlisp
<aeth> then you don't have to hack together something that could break unexpectedly
<nij-> it should also be impl. agnostic, and it wouldn't only work for CL.
<nij-> I even hope it to be lang agnostic.
<aeth> well, the last 2 criteria are how you get the JVM and similar things
<nij-> But yea, I'd start thinking with CL.
<aeth> you can get all 3 if you implement the other languages (like Python) on top of CL
<aeth> but the other language implementations might not be as fast or feature rich as their main implementations
<nij-> Bike - about the same process could save time: different lang interprets data differently.
<nij-> So even if they are in the same process, being able to point to the same address doesn't necessary means it's fastr right?
<nij-> at some point some translation of structures still needed to be done
<nij-> (or am I missing something?)
<aeth> nij-: you'd probably try to meet in the middle. If something lower level than python, maybe it can have octet arrays
<Bike> depends on the nature of the data. cffi lets you write to memory pretty much like you'd do in C, so C can read it without any kind of translation.
<Bike> all of this stuff pretty much depends on what exactly it is you are doing. without knowing that i'm going to have to be pretty vague.
<aeth> nij-: but there are a lot of different approaches, e.g. you could put it in a separate program, launch it with uiop:launch-program, and communicate that way (inter-process, I think).
<nij-> I see. I want to make a lisp program that is ready to talk to any other popular languages in order to use their libraries.
<nij-> aeth I was looking at uiop:launch-program the other day, but using :stream to talk to each other is kind of fragile.
<nij-> For example, if both runtimes want to send others many tasks at the same time, the channel is likely to be broken.
<nij-> So I ponder it may be safer and more robust to use a mature socket as the communication interface.
<nij-> Bike: besides that, I expect to run intensive calculations (CPU bound) on both sides, and send large datas.
<nij-> (How large? Sometimes larger than memory limit, but sometimes not.)
<aeth> you should probably start with a specific solution for a specific use case or else you will just wind up with something incredibly general and overengineered, but probably not that fast in the long run... and maybe you'd reinvent microservices
<nij-> (Perhaps 2~20 GB).
<aeth> (or the JVM or COM)
<aeth> so, so, so many attempts over the years at stuff like this
<aeth> from just about every angle
<nij-> aeth Yeah.. I'm still trying to narrow what's the best appoach to my problem. And then I will select an existing solution.
pve has quit [Quit: leaving]
AmateurLisper has joined #commonlisp
Guest76 has quit [Quit: Client closed]
<nij-> aeth Damn.. COM page contains a lot of attempts. I don't even know where to start..
<nij-> what do people use nowadays when it comes to communicating between run times? And what's the standard practice for common lisp?
<White_Flame> there are many standards to choose from, or roll your own
ebrasca has joined #commonlisp
<nij-> Definitely I don't want to create another standard :D
<nij-> It'd be best if there's a clearly winning standard.
<White_Flame> often people create individual commands instead of having an "anything goes" rpc
<White_Flame> with a specified command interface, then you can avoid introspection if other languages don't support it
<aeth> these days people probably just don't care about the overhead that much and use JSON... in part because it's probably going to have to go over the network anyway
<aeth> unless you're scripting, such as for a game or a text editor
AmateurLisper has left #commonlisp [Leaving]
AmateurLisper has joined #commonlisp
comatory has quit [Ping timeout: 248 seconds]
comatory has joined #commonlisp
tyson2 has joined #commonlisp
comatory has quit [Ping timeout: 268 seconds]
Guest9872 has quit [Quit: WeeChat 3.6]
comatory has joined #commonlisp
hrberg has quit [Quit: https://quassel-irc.org - Chat comfortably. Anywhere.]
hrberg has joined #commonlisp
<jcowan> Language C is always C, except when language B is C.
comatory has quit [Ping timeout: 252 seconds]
<jcowan> (Language C is never B.)
waleee has joined #commonlisp
comatory has joined #commonlisp
comatory has quit [Ping timeout: 248 seconds]
comatory has joined #commonlisp
comatory has quit [Ping timeout: 268 seconds]
comatory has joined #commonlisp
tyson2 has quit [Remote host closed the connection]
dra_ has quit [Ping timeout: 248 seconds]
comatory has quit [Ping timeout: 252 seconds]
Furor is now known as Colere
rgherdt has quit [Remote host closed the connection]
rgherdt has joined #commonlisp
comatory has joined #commonlisp
tyson2 has joined #commonlisp
azimut has quit [Remote host closed the connection]
azimut has joined #commonlisp
comatory has quit [Ping timeout: 268 seconds]
comatory has joined #commonlisp
comatory has quit [Ping timeout: 256 seconds]
comatory has joined #commonlisp
MajorBiscuit has quit [Ping timeout: 248 seconds]
Noisytoot has quit [Ping timeout: 248 seconds]
comatory has quit [Ping timeout: 248 seconds]
comatory has joined #commonlisp
Noisytoot has joined #commonlisp
comatory has quit [Ping timeout: 248 seconds]
comatory has joined #commonlisp
orestarod has quit [Ping timeout: 268 seconds]
Noisytoot has quit [Ping timeout: 248 seconds]
comatory has quit [Ping timeout: 252 seconds]
comatory has joined #commonlisp
tyson2 has quit [Remote host closed the connection]
shka has quit [Ping timeout: 256 seconds]
comatory has quit [Ping timeout: 252 seconds]
comatory has joined #commonlisp
<masinter_> for constrained channels use CBOR
<masinter_> at least CBOR has the most buy in, in IETF
<Kingsy> has anyone had a strange issue with the sbcl stepper not allowing the step into of functions? When I do it, it just resumes execution. I am really frustrated by it. I feel like having a working stepper might really help me understand lisp as I learn, perhaps its a emacs specific problem I just don't know.
<masinter_> api's are being done with quic / http3 and json
comatory has quit [Ping timeout: 268 seconds]
comatory has joined #commonlisp
Noisytoot has joined #commonlisp
masinter_ has quit [Quit: ~ Trillian - www.trillian.im ~]
masinter has joined #commonlisp
comatory has quit [Ping timeout: 256 seconds]
grawlinson has quit [Quit: SIGTERM]
grawlinson has joined #commonlisp
comatory has joined #commonlisp
karlosz has joined #commonlisp
comatory has quit [Ping timeout: 248 seconds]
comatory has joined #commonlisp
rgherdt has quit [Ping timeout: 255 seconds]
Noisytoot has quit [Ping timeout: 248 seconds]
tyson2 has joined #commonlisp
comatory has quit [Ping timeout: 248 seconds]
comatory has joined #commonlisp
rgherdt has joined #commonlisp
Noisytoot has joined #commonlisp
Alfr has quit [Ping timeout: 268 seconds]
comatory has quit [Ping timeout: 248 seconds]
comatory has joined #commonlisp
rgherdt has quit [Ping timeout: 268 seconds]
karlosz has quit [Remote host closed the connection]
Noisytoot has quit [Excess Flood]
rgherdt has joined #commonlisp
Noisytoot has joined #commonlisp
comatory has quit [Ping timeout: 256 seconds]
comatory has joined #commonlisp
Noisytoot has quit [Excess Flood]
zachel has quit [Ping timeout: 252 seconds]
Noisytoot has joined #commonlisp
cosimone has quit [Remote host closed the connection]
random-nick has quit [Ping timeout: 252 seconds]
Noisytoot has quit [Excess Flood]
Noisytoot has joined #commonlisp
Noisytoot has quit [Ping timeout: 256 seconds]
Noisytoot has joined #commonlisp
morganw has quit [Remote host closed the connection]
Noisytoot has quit [Ping timeout: 268 seconds]
Noisytoot has joined #commonlisp
comatory has quit [Ping timeout: 268 seconds]
AmateurLisper has quit [Ping timeout: 248 seconds]