josrr has quit [Remote host closed the connection]
DustyDynamite has quit [Quit: Leaving]
anticomputer has quit [Remote host closed the connection]
thuna` has quit [Remote host closed the connection]
anticomputer has joined #commonlisp
synchromesh has quit [Read error: Connection reset by peer]
synchromesh has joined #commonlisp
dnhester` has joined #commonlisp
dnhester` has quit [Ping timeout: 255 seconds]
igemnace has joined #commonlisp
ec has quit [Remote host closed the connection]
ec has joined #commonlisp
rainthree has joined #commonlisp
pranavats has left #commonlisp [Disconnected: Hibernating too long]
istewart has quit [Quit: Konversation terminated!]
amb007 has joined #commonlisp
amb007 has quit [Ping timeout: 272 seconds]
triffid has quit [Quit: triffid]
<beach>
younder: I think I have said this before, but you don't need to worry about the front-end of the compiler. We already have libraries for that. Assume your input is a graph of instructions similar to the MIR defined in Muchnick's book.
<beach>
younder: So the semantics of the special operators is already taken care of.
notzmv has quit [Ping timeout: 255 seconds]
<chsasank>
anyone messed around with libjit or libgccjit?
<beach>
younder: Not sure about your references to "Stands CICL", but perhaps you meant my name and the name of the system I am developing (SICL = "SICL Implements Common Lisp" (thank you phoe)).
<beach>
younder: All (not just mots) of the compiler can be written in portable Common Lisp. A compiler is mostly just a thing that takes characters as input and creates bytes as output. Any programming language, though a Common Lisp compiler is a bit more complicated because it needs access to the startup environment and such.
<beach>
s/mots/most/
<beach>
*sigh* Any programming language can be used to create a compiler.
<beach>
younder: There is nothing that needs to be done to make the SICL compiler "standalone". It is compiled using a host compiler, and it can then compile itself. There is no way to get around this fact, given that the compiler is written in Common Lisp.
<beach>
younder: As I have said several times, CPS is not a replacement for SSA.
rtypo has quit [Ping timeout: 246 seconds]
chomwitt has joined #commonlisp
<beach>
younder: I suggest you look at Muchnick's book for a list of optimizations on the level of MIR, like global value numbering, redundancy eleminiation, etc. But also things like path replication (according to our paper: http://metamodular.com/SICL/path-replication.pdf).
<aeth>
50/50 chance IRC clients think that that ) is part of the URL
<aeth>
(IRC clients or terminals if an in-terminal client.)
<beach>
Yes, ERC has problems like that. I should have taken that into account.
<aeth>
iirc, <> is the way you're supposed to do it, but some clients/terminals probably don't respect that (<https://example.com>)
<ixelp>
Example Domain
<beach>
I see.
<mfiano>
aeth: It isn't my IRC client, but my VTE that doesn't have problems with either of the two forms, IRC program or not.
<beach>
minion: What does VTE stand for?
<minion>
Vegetalcule Thingliness Egghead
<mfiano>
virtual terminal emulator. The X11 client program that connects to a linux pseudo terminal device
<beach>
I see.
dnhester` has joined #commonlisp
msavoritias has joined #commonlisp
<aeth>
or wayland I'm assuming
dnhester` has quit [Ping timeout: 264 seconds]
shka has joined #commonlisp
rainthree has quit [Read error: Connection reset by peer]
rainthree has joined #commonlisp
tedwing has joined #commonlisp
azimut has quit [Ping timeout: 260 seconds]
crumbles has joined #commonlisp
amb007 has joined #commonlisp
amb007 has quit [Read error: Connection reset by peer]
amb007 has joined #commonlisp
tedwing has quit [Ping timeout: 268 seconds]
dtman34 has quit [Ping timeout: 256 seconds]
infos has joined #commonlisp
waleee has joined #commonlisp
zxcvz has joined #commonlisp
zetef has joined #commonlisp
zetef has quit [Ping timeout: 255 seconds]
zetef has joined #commonlisp
Pixel_Outlaw has quit [Remote host closed the connection]
<younder>
beach changed add references to SICL.. sorry. I have always been aware that the compiler would be written in lisp. Also that it is compiled with SBCL and will eventually by compiled with SICL itself. A - meta - compiler.
traidare has joined #commonlisp
tedwing has joined #commonlisp
<younder>
beach as for CPS being a replacement for SSA. You said it could be rewritten as SSA, but also that it might not be efficient to do so.
tedwing has quit [Ping timeout: 264 seconds]
<beach>
What I have said is that with CPS you don't get the advantages of SSA, because to get those advantages, you may get a quadratic blowup of the size of the code, and CPS has a linear "blowup".
<beach>
If you do CPS conversion, you start with assignment conversion, and then your program is automatically SSA, but the assignment conversion removes all the advantages of SSA.
<beach>
... well maybe not all, but the essential ones.
<beach>
But it is fine if you require client code to do the SSA conversion. You can just assume it has been done.
<beach>
younder: Right now, SICL uses SBCL as a host for bootstrapping, but all that is required is a conforming Common Lisp implementation that also has CLOSER-MOP. So it does not depend on SBCL.
<beach>
younder: MIR is a graph of instructions and operands. An instruction takes one or two operands and produces zero, one, or two results. The operands and results are represented by (say) instances of standard classes that have a size slot. Same for the instructions. An instruction can have any number of predecessors, and either zero, one, or two successors.
<beach>
younder: Typical instructions are arithmetic like ADD, logic like AND or SHIFT, tests such as LESS.
<younder>
beach CLOSER-MOP - Pascal's lib, OK. Also I first need a runtime environment. I cant just crash the compiler I am working in each time generation fails.
<beach>
You mean you need such an environment for testing?
<younder>
yes
<beach>
I need to think about the best way to do that. But for now, you can concentrate on implementing the graph and the optimizations in Muchnick's book (and others).
<beach>
Actually, register allocation and code generation before optimizations.
<younder>
agreed
<beach>
And you can start with a very stupid register allocator.
<beach>
.... where all operands are on the stack, and you load registers from the stack, apply the operation, and store the result(s) on the stack.
green_ has joined #commonlisp
pranavats has joined #commonlisp
notzmv has joined #commonlisp
ymir has quit [Ping timeout: 256 seconds]
pve has joined #commonlisp
dnhester` has joined #commonlisp
tedwing has joined #commonlisp
dnhester` has quit [Ping timeout: 272 seconds]
tedwing has quit [Ping timeout: 255 seconds]
pranavats has left #commonlisp [Disconnected: Hibernating too long]
waleee has quit [Ping timeout: 268 seconds]
pranavats has joined #commonlisp
pranavats has left #commonlisp [Disconnected: Replaced by new connection]
dtman34 has joined #commonlisp
pranavats has joined #commonlisp
msavoritias has quit [Remote host closed the connection]
mgl has joined #commonlisp
elderK has quit [Quit: WeeChat 4.1.1]
dino_tutter has joined #commonlisp
NicknameJohn has quit [Ping timeout: 264 seconds]
donleo has joined #commonlisp
donleo has quit [Client Quit]
donleo has joined #commonlisp
NicknameJohn has joined #commonlisp
donleo has quit [Remote host closed the connection]
donleo has joined #commonlisp
tedwing has joined #commonlisp
ebrasca has joined #commonlisp
tedwing has quit [Ping timeout: 252 seconds]
dcb has quit [Quit: Connection closed for inactivity]
dino_tutter has quit [Quit: Leaving]
danza has joined #commonlisp
mzan has joined #commonlisp
dino_tutter has joined #commonlisp
Alfr has quit [Quit: Leaving]
rgherdt has joined #commonlisp
alcor has joined #commonlisp
amb007 has quit [Remote host closed the connection]
amb007 has joined #commonlisp
mgl has quit [Ping timeout: 272 seconds]
dnhester` has joined #commonlisp
mgl has joined #commonlisp
dnhester` has quit [Ping timeout: 256 seconds]
mgl has quit [Ping timeout: 256 seconds]
igemnace has quit [Read error: Connection reset by peer]
igemnace has joined #commonlisp
Alfr has joined #commonlisp
chomwitt has quit [Ping timeout: 240 seconds]
dnhester` has joined #commonlisp
chomwitt has joined #commonlisp
amb007 has quit [Ping timeout: 255 seconds]
amb007 has joined #commonlisp
random-nick has joined #commonlisp
Lycurgus has quit [Quit: leaving]
josrr has joined #commonlisp
dnhester` has quit [Ping timeout: 255 seconds]
chomwitt has quit [Ping timeout: 260 seconds]
cl-arthur has quit [Ping timeout: 260 seconds]
danza has quit [Ping timeout: 252 seconds]
tedwing has joined #commonlisp
tedwing has quit [Ping timeout: 264 seconds]
msavoritias has joined #commonlisp
zxcvz has quit [Quit: zxcvz]
alcor has quit [Ping timeout: 260 seconds]
yitzi has joined #commonlisp
nij- has joined #commonlisp
<nij->
Anyone knows how sbcl exposes itself as a C library?
<nij->
When C calls sbcl this way, does it work by launching an sbcl as a subprocess, and talk to it via pipes?
<nij->
I wonder if they are counted as different processes, and therefore have to communicate using IPC.
awlygj has joined #commonlisp
<bike>
doesn't sound like it, from the manual
<bike>
given that you can call lisp callback functions from C
* nij-
doesn't see any contradictions..
<nij->
So if C program launches SBCL as a subprocess.. why can't (or why is it surprising that) C can call lisp callback functions?
<bike>
because you would have to do IPC rather than just calling a function normally?
<gilberth>
That could have been made transparent.
<nij->
bike I'm guessing perhaps sbcl abstracts that out?
<nij->
gilberth ?
<bike>
i mean i guess, but i feel like the manual would mention an important detail like starting a separate process
<gilberth>
I was doing the reverse quite some time ago and plan to do it again. Namely addressing some C library but have that library running in a different OS process to keep some sanity. Including callbacks back into the Lisp. Tricky? Sure. Impossible? Nope.
<bike>
do you have some other reason to think it's doing that?
<nij->
bike I see.
<nij->
I'm just curious. Having it as a subprocess is the only way I could imagine how they have implemented it.
<nij->
I wonder if there's a better "dark magic" that I don't understand yet.
<gilberth>
What makes you think so?
<nij->
gilberth You mean the possibility of that dark magic?
<gilberth>
Yeah, like what would be so special about that that you call it dark magic.
<nij->
Hmm.. my intuition. I don't know. I just feel that IPC could be inefficient from time to time. And if it is just a wrapper over IPC, why was it hard (people seemed to have been waiting for it for a while) to implement?
<nij->
gilberth I call anything I don't understand fully black magic. Haha.
<nij->
(Sorry for the term.)
<bike>
why would it have to be a subprocess?
<gilberth>
nij-: Was it really that hard? I mean, I can certainly turn CCL into a .so if I wished, but I just won't bother. You would need to "boot" the Lisp, but beyond mmaping the image file not much is really happening.
alcor has joined #commonlisp
Oddity has quit [Ping timeout: 255 seconds]
<younder>
In C it is fairly common to split a program into several .so files. That way you can modify the program while it is running, A thread checks to see if the sub-modules have changed and reload them.
<younder>
Because .so files are movable in memory it isn't so difficult to call out.''
<nij->
How would it be otherwise? I couldn't imagine. Anyways, thanks for the input.
<nij->
Oh, I see. Another way is to embed sbcl as a coroutine.. Maybe this notion is what I lack. I'm readin' it onw.
<bike>
it's all just code. why would it need a subprocess.
monospod has quit [Quit: Konversation terminated!]
<gilberth>
And why would it need to be a coroutine?
<gilberth>
nij-: Lisp isn't as special as you appear to think. As bike said, it's all just code. Doesn't matter whether a C compiler or a Lisp compiler was used to generate that code.
<nij->
(I understand this point.. still..)
traidare has quit [Ping timeout: 255 seconds]
<gilberth>
Let me try to explain it differently. With regular FFI we already can mix Lisp and C as we wish. Lisp can call C, which can call Lisp, which can call C again, and so on.
<gilberth>
So what's the fundamental difference in making Lisp being that foreign library that you address from C?
tok has joined #commonlisp
<nij->
I see. I don't understand how FFI works either. I appreciate your inputs, but I'm afraid that this starts to get off-topic for #commonlisp..
<gilberth>
nij-: You still assume more magic than there really is.
tyson2 has joined #commonlisp
dnhester` has joined #commonlisp
<nij->
I understand that ultimately everything is just executable blocks of instructions.
<nij->
(And I think I'm slowly getting it..)
rainthree has quit [Ping timeout: 260 seconds]
dnhester` has quit [Ping timeout: 272 seconds]
rtypo has joined #commonlisp
azimut has joined #commonlisp
tedwing has joined #commonlisp
tedwing has quit [Ping timeout: 255 seconds]
ronald_ has quit [Ping timeout: 264 seconds]
traidare has joined #commonlisp
johnjaye has quit [Ping timeout: 260 seconds]
nij- has quit [Ping timeout: 252 seconds]
tedwing has joined #commonlisp
tedwing has quit [Ping timeout: 264 seconds]
luna-is-here has quit [Ping timeout: 255 seconds]
azimut has quit [Ping timeout: 260 seconds]
jjnkn has joined #commonlisp
ronald has joined #commonlisp
AetherWind has joined #commonlisp
awlygj has quit [Ping timeout: 255 seconds]
<chsasank>
btw on SSA conversation, beach is right. CPS is *not* SSA at all. It's a very misleading slogan.
<chsasank>
But clearly SSA *is* functional programming because we only do let but not setf.
<chsasank>
I have a feeling (and some example conversions) that SSA is actually similar to functional level language proposed by Backus
<chsasank>
Actually the way the actual data structure of SSA sounds very similar to SSA
<chsasank>
similar to FL I mean
ronald has quit [Read error: Connection reset by peer]
ronald has joined #commonlisp
<chsasank>
take following ssa: (x, y) -> x1 = x*5; x2 = x1/3; y1 = y + 10; r = x2 + y1; return r
<chsasank>
equivalent FL function is (in same notation as Backus): +[ / . [0, ~3]. * . [0 , ~5], +.[1, ~10]]
<chsasank>
I know the program looks 'pointless', but compare this program to how SSA is stored in memory
chiselfuse has quit [Ping timeout: 260 seconds]
chiselfuse has joined #commonlisp
NicknameJohn has quit [Ping timeout: 268 seconds]
tedwing has joined #commonlisp
triffid has joined #commonlisp
agrosant has joined #commonlisp
yitzi has quit [Ping timeout: 252 seconds]
yitzi has joined #commonlisp
johnjaye has joined #commonlisp
mm007emko has quit [Ping timeout: 272 seconds]
dcb has joined #commonlisp
chomwitt has joined #commonlisp
<skin>
I just learned that Alexandria has `line-up-first` and `-last`, which are implementations of `->` and `->>` from the arrows library. That's pretty cool.
<skin>
but I wonder if they have already or plan on adding the equivalent of `-<>`. that's my favorite one.
dnhester` has joined #commonlisp
mm007emko has joined #commonlisp
zxcvz has joined #commonlisp
zxcvz has quit [Client Quit]
dnhester` has quit [Ping timeout: 260 seconds]
luna-is-here has joined #commonlisp
occ has joined #commonlisp
pranavats has left #commonlisp [Disconnected: Replaced by new connection]
pranavats has joined #commonlisp
<Mondenkind>
chsasank: I mean you can ssa without assignment conversion also
<Mondenkind>
but a given ssa is isomorphic to a cps
<Mondenkind>
'how ssa _is_ stored in memory' there is a large solution space
ymir has joined #commonlisp
occ has quit [Read error: Connection reset by peer]
luna-is-here has quit []
<chsasank>
Mondenkind: good point. I am talking how LLVM SSA is stored. I suppose other projects might have different representation
<chsasank>
Mondenkind: see above comments about SSA by beach
luna-is-here has joined #commonlisp
occ has joined #commonlisp
josrr has quit [Remote host closed the connection]
<beach>
chsasank: There is no contradiction that I can see. Can you?
<chsasank>
but CPS as a language can do 'more' than a SSA
<beach>
Right, so that last paper essentially says that if you turn a program into SSA, you an then turn the SSA into CPS. But I still haven't seen an algorithm for turning an arbitrary program into CPS directly without using assignment conversion. I am sure it must exist, but I have never seen it.
<beach>
*you can then
<beach>
Such a program must also have a quadratic blowup, unless of course there is a way to turn an arbitrary program into SSA without a quadratic blowup, which seems unlikely, though I haven't seen a proof for that either.
<beach>
Anyway, time to go have dinner with my (admittedly small) family. I'll be back tomorrow.
mm007emko has quit [Read error: Connection reset by peer]
mgl has joined #commonlisp
mm007emko has joined #commonlisp
istewart has joined #commonlisp
<Mondenkind>
chsasank: the major ones I know of are sea of nodes and ssa as abstract interpretation. both of which are much, much nicer than llvm-style
luna-is-here has quit [Ping timeout: 240 seconds]
nani is now known as inventor500
inventor500 has quit [Changing host]
inventor500 has joined #commonlisp
inventor500 is now known as nani
a51 has quit [Quit: WeeChat 4.2.1]
puke has quit [Ping timeout: 272 seconds]
tedwing has quit [Ping timeout: 264 seconds]
ymir has quit [Ping timeout: 255 seconds]
<paulapatience>
skin: see Serapeum's ~>
gizmatic has quit [Quit: gizmatic]
<paulapatience>
You can choose where to place the var
<skin>
thanks
luna-is-here has joined #commonlisp
luna-is-here has quit [Client Quit]
luna-is-here has joined #commonlisp
johnjaye has quit [Ping timeout: 264 seconds]
dnhester` has joined #commonlisp
thuna` has joined #commonlisp
holycow has quit [Quit: Lost terminal]
tyson2 has quit [Remote host closed the connection]
holycow has joined #commonlisp
dcb has quit [Quit: Connection closed for inactivity]
occ has quit [Ping timeout: 264 seconds]
nij- has joined #commonlisp
igemnace has quit [Quit: WeeChat 4.2.1]
dcb has joined #commonlisp
pfdietz has quit [Quit: Client closed]
chomwitt has quit [Ping timeout: 264 seconds]
rainthree has joined #commonlisp
attila_lendvai has joined #commonlisp
mgl has quit [Ping timeout: 260 seconds]
easye has joined #commonlisp
Lycurgus has joined #commonlisp
rainthree has quit [Read error: Connection reset by peer]
msavoritias has quit [Ping timeout: 264 seconds]
tedwing has joined #commonlisp
easye has quit [Remote host closed the connection]
tyson2 has joined #commonlisp
easye has joined #commonlisp
ymir has joined #commonlisp
Oddity has joined #commonlisp
zetef_ has joined #commonlisp
zetef_ has quit [Client Quit]
zetef has quit [Ping timeout: 255 seconds]
tedwing has quit [Ping timeout: 255 seconds]
dnhester` has quit [Ping timeout: 264 seconds]
santiagopim has quit [Ping timeout: 240 seconds]
jjnkn has quit [Quit: leaving]
easye has quit [Remote host closed the connection]
easye has joined #commonlisp
nij- has quit [Ping timeout: 260 seconds]
ymir has quit [Ping timeout: 264 seconds]
chrcav has quit [Ping timeout: 264 seconds]
random-nick has quit [Ping timeout: 260 seconds]
dnhester` has joined #commonlisp
infos has quit [Quit: leaving]
traidare has quit [Ping timeout: 255 seconds]
Alfr has quit [Quit: Leaving]
random-nick has joined #commonlisp
dnhester` has quit [Ping timeout: 256 seconds]
dnhester` has joined #commonlisp
tyson2 has quit [Remote host closed the connection]
johnjaye has joined #commonlisp
tyson2 has joined #commonlisp
Alfr has joined #commonlisp
mgl has joined #commonlisp
<okflo>
o/
<okflo>
may I ask a macrology-question :)
<okflo>
I am trying to expand flet-definitions via macro:
<okflo>
(macrolet ((mymacro ()
<okflo>
`(myfun (val)
<okflo>
(print val))))
<okflo>
(flet ((mymacro))
<okflo>
(myfun 5)))
<okflo>
but this fails - with "The FLET definition spec (MYMACRO) is malformed."
<okflo>
many thanks for any hints!
chomwitt has joined #commonlisp
<bike>
okflo: macro forms like (mymacro) are forms. you can put them where forms go, not just anywhere. the definitions of an flet are not forms, so they're not expanded.
triffid has quit [Remote host closed the connection]
triffid has joined #commonlisp
<okflo>
ahh, I see.
<Alfr>
okflo, instead you may want to define a myflet ... or rather with-my-functions macro.
NicknameJohn has joined #commonlisp
elderK has joined #commonlisp
<okflo>
thanks for the hint, have to process your hint...