freenode/#lisp - IRC Chatlog
Search
15:10:28
lukego
I'm able to declare foreign libs as dependencies here so long as I can identify them. (McCLIM is complaining it can't find truetype fonts but I'm putting that to one side for now.)
15:11:36
lukego
somehow feels dirty to (intern (string-upcase (pathname-name (pathname line-from-system-index.txt))) :keyword) but this is not the time to be squeamish..
15:28:12
pjb
lukego: you don't need to call pathname, it's called automatically by pathname-name when given a namestring.
15:28:49
pfdietz
In twitter I am told that writing seven lines of CL is "on the verge" of reimplementing the language. The things one learns.
15:30:54
lukego
it it too onomatopoeiac to write (loop for /some/system.asd = (read-line in nil) ...) ?
15:48:33
Xach
phoe: pfdietz's suggestion to use *macroexpand-hook* to work around a problem with code that can't be directly modified was met with "well then i may as well rewrite common lisp"
15:57:25
Xach
lukego: i don't know exactly how i feel about loop variables that look like pathnames but i am feeling something
16:12:01
Shinmera
So a brief test shows that a top-level invocation of a declaration defined with cltl2:define-declaration does not actually get invoked at all on SBCL. If I use the same declaration as part of a function definition it does get invoked. Am I missing something or is that expected behaviour?
16:16:03
Bike
cltl2 doesn't seem to mention this specifically, but it refers to it in the context of augment-environment, which wouldn't be used with a proclamation.
16:17:45
Bike
not based on my quick reading here, but if it did work for proclamations too that seems fine
16:18:26
Bike
i don't know if sbcl is prepared to do that, though. looking at the implementation, user declarations augment the lexenv, but that's not where proclamations go
16:20:46
Shinmera
To give context: I'd like to register functions to be automatically invoked when a change happens elsewhere in my system. Being able to use a declaration for that would have been really nice.
16:21:23
Shinmera
But given that I can't do proclamations, nor get the function name from a declaration being expanded, the only way to do it would be annoying for the user.
16:22:30
Bike
well, i think you could change implementations to have it work for proclamations, if only because cltl2 is used infrequently enough that they won't mind modifications
16:24:28
Shinmera
I don't think I'm patient enough to lobby for that to happen, nor to implement it myself.
16:56:52
pfdietz
I like *macroexpand-hook*. Using it to layer changes onto a code base, without changing that code, can be quite useful. Rejection made me sad. :(
20:43:00
Bike
i'm talking about uh, slide 7-1. i don't understand what it would mean for assert and MAXLIMIT to compose. i mean if nothing else is assert is taking a form that has a MAXLIMIT form in it, it's not a direct composition, but what would a direct composition mean then if you have compound forms
20:48:46
LdBeth
Until 7-1 it’s all about introduction to new comers. Jump ahead to 8 to see what is macro compose
21:10:50
copec
Some people aren't particularly fond of Graham's writing style: http://www.paulgraham.com/onlisp.html
21:17:50
copec
I've never actually found myself really needing continuations for anything, but they are awesome.
21:18:42
LdBeth
copec: nope, paul graham only talks CPS and macro individually. Combining CPS and macro has become interests only after 2000 in Daniel Friedman’s article
21:19:41
copec
I read it a decade ago, but iirc he builds up a macro system for continuations in CL, although I can't recall if it is actually CPS
21:22:35
LdBeth
copec: https://www.semanticscholar.org/paper/Writing-Macros-in-Continuation-Passing-Style-Hilsdale-Friedman/752575dc24b2bb6e74ee6146df71860e10e3aee9
21:24:20
LdBeth
Here’s the article. It makes a disclaimer that On Lisp implements call/cc with macro but not to be confused with the notation of cps style macro
22:10:23
jmercouris
I assume therefore that most of the functions and implementation is implemented in CL
22:11:06
jmercouris
so my question is, what is the minimum amount of functions you need to write to bootstrap a CL implementation?
22:11:42
phoe
you can generate the whole binary from Lisp, including what is currently generated from C as the "kernel"
22:12:08
phoe
which includes directly interfacing with the OS using Lisp, writing the required assembly using Lisp, actually assembling it using Lisp, doing GC using Lisp and so on
22:13:37
jmercouris
I don't see how that's possible, ultimately something has to go through the Potato compiler
22:13:43
Xach
jmercouris: in the 80s, there was a plan to separate the spec into "blue pages" and "yellow pages", where "blue" was the core, and "yellow" was built on that core, where blue was much smaller and yellow was all the convenience stuff.
22:13:47
sjl_
The number for Shen is 46. http://shenlanguage.org/OSmanual.htm I'd imagine CL would probably need a bit more.
22:14:58
Xach
jmercouris: beach has recently been working on things along those lines, in a researchy sense, and drmeister in a practical sense
22:15:13
phoe
but these are not 100% compatible with each other and all have been customized and maintained differently
22:15:22
sjl_
http://www.shenlanguage.org/shendoc.htm#The%20Primitive%20Functions%20of%20K%20Lambda is a better link for the Shen Kl core
22:17:05
jmercouris
how could one make a most portable language that can be bootstrapped really easily?
22:17:29
jmercouris
from what I understand, this is a topic of significant research, so I'm not expecting a hard answer here
22:18:35
phoe
in case of CL, it's complicated - CL is a sizeable language even when it comes to its basics upon which the rest can be built
22:18:42
Xach
Anyone making a "new" lisp these days has a lot of public domain source code they can reuse that is relatively portable, but it's not neatly divided into core+library.
22:20:39
phoe
CATCH/THROW and TAGBODY/GO are obvious control flow operators that are hard to construct otherwise
22:20:42
drmeister
jmercouris: It's been ready for distribution as a Common Lisp implementation for several months.
22:21:19
phoe
jmercouris: obviously it is, yes - the list of all symbols of CL package is public and we can align them into a directed graph that shows what can be implemented using what.
22:22:12
jmercouris
how could we align them into a directed graph without manually trying to implement all of CL in all of CL?
22:23:17
jmercouris
that's the thing though, can those functions be further reduced to a set of functions?
22:23:46
jmercouris
for example, could I write only 3 functions in potato that can be combined to produce all the "primitives" I need?
22:24:33
jmercouris
what if we slightly extended our spec with a couple of Lisp functions, could we get away with only two Potato functions?
22:25:51
jmercouris
drmeister: how did you decide what to implement in C++ for Clasp? I see it is a much bigger proportion of C++ than SBCL is C
22:26:22
Xach
it's a nice read on thinking about how to determine if something is "more primitive" than something else.
22:27:00
drmeister
We need to bootstrap from a C++ compiler. So I wrote whatever I needed to bootstrap in C++ until I can start using Common Lisp code during the booting phase.
22:27:20
drmeister
I also cribbed a lot from ECL - so if ECL implemented something in C I tended to implement that thing in C++.
22:28:07
White_Flame
jmercouris: I think your "I want to implement CL on top of Potato" is a bit off. You don't need to build CL on top of Potato. You can implement CL directly talking to the asm interfaces of the OS, bypassing Potato
22:28:48
jmercouris
White_Flame: I'm not trying to implement CL ontop of Potato, this is a purely theoretical conversation
22:29:17
White_Flame
jmercouris: right, but SBCL for instance isn't "built on top of C" inasmuch as it only uses C for some bootstrapping and low level runtime support
22:29:41
White_Flame
compiled CL functions in SBCL are not C functions, so I would say that does not count as "built on top of C", as it's no longer C that's running
22:33:17
White_Flame
things that I would consider "built on top of C" would be a C-based interpreter, a macro/function suite that allows you to program in the sublanguage from right within C, which expands to C code, or a Lang->C converter a la ECL
22:38:17
copec
Essentially all of the compilation to machine code (Or internal object code I suppose you could say) is done by CL based code, only the interface between that and the OS is in C
22:38:56
White_Flame
and technically that C layer is unnecessary, just easier to do it that way in a OS with a C API
22:41:03
copec
You could say they all trace their lineage back to a lisp image that was bootstrapped from ASM
22:42:43
phoe
copec: oh right, https://www.pvk.ca/Blog/2014/03/15/sbcl-the-ultimate-assembly-code-breadboard/
22:42:49
White_Flame
CL functiosn themselves have no C involved. But the API to hit the OS goes through C
22:44:33
copec
well, the internal assembler is used by all the code, but the CL code to build SBCL initially is run by the host CL implementation
22:49:10
copec
You might like https://github.com/clasp-developers/clasp/wiki/The-Build-Process jmercouris
22:50:13
logicmoo
one trick i am doing in WAM-CL is coding soemthning in prolog by hand.. hten translating ECL lisp src to Prolog to replace what i wrote in prolog by hand.. eventually will have no hand written Prolog code
22:52:50
copec
I asked beach if they had a strict subset of CL that SICL was implemented with, but the answer is nay. So it can be really confusing until you remember that once it has compiled itself enough times, the less optimized code gets replaced
22:58:14
copec
SICL is CL written in CL using all the modern knowledge of implementing a CL, according to my understanding
22:59:09
copec
Clasp is essentially enough of a CL written in C++, using the LLVM libs, to build SICL
23:21:18
copec
Also, Clasp has C++ objects working with a dynamic garbage collecting memory allocator, and drmeiste is a chemistry guy, not a cs guy
23:25:36
edgar-rft
Structure and Interpretation of Chemistry Programs (still to be written by drmeister)
23:40:14
pjb
jmercouris: sbcl shares some with cmucl. ecl shares some with kcl. ccl shares some with mcl.
23:42:00
pjb
jmercouris: there's no defined or unique kernel to CL. beach's programming sicl using the whole CL. You could theorically implement a CL using only the 35 special operators. Or just lambda. It's a silly question with no answer.
1:47:56
logicmoo
ACTION is trying to find the version of ECL that has teh least number of things implemented in C
1:49:51
dmiles
of course, aternatively i'd be happy with any full CL that has the least number of thing my interpreter would need to implement
1:57:25
dmiles
that translates purely into Prolog https://github.com/TeamSPoon/wam_common_lisp/tree/master/prolog/wam_cl
1:58:42
dmiles
to see it in actuion... https://github.com/TeamSPoon/wam_common_lisp/blob/master/t/sanity-test.lisp_load.md#compiled--umapcar-visualize
2:00:34
Bike
implementations sometimes are built in more complicated ways than like, having some lisp subset and then loading the rest of the language in like a library file
2:02:53
dmiles
there is probably even 3 levels... MinimalSupport + InitalCompiledToBackend + LibraryCompliedToBackendEachTime
2:05:34
dmiles
why i bring that is that up is that the LibraryCompliedToBackendEachTime is sometimes hard for me to tell from 2nd
2:06:31
Bike
if i'm supposed to know what these "levels" mean based on their names i uh, don't, sorry
2:37:03
dmiles
well what i should say.. is what be even more awesoem for me is if ECL wasnt bothering to make C files
2:37:45
dmiles
or better if a CL was never able to compile or translate anyhting.. if it was all merely an interpreter.. in which then i could decide where/when to compile things
2:38:16
Bike
if you have your own implementation it doesn't need to compile anything until compile or compile-file is called
2:41:16
White_Flame
while I haven't poked into your details, are you wanting to compile CL into Prolog, or interpret CL from Prolog?
2:42:26
dmiles
I have been so far compiling to Prolog (thus translating) then loading/executing the translated version
2:45:30
dmiles
the translator/compiler is mostly working but the last 29% of the code i need to write for it is still unknown.. heck it might be 50% still i need to do
2:46:48
White_Flame
the first 90% of the code takes 90% of the time. The final 10% takes the other 90% of the time.
2:51:06
dmiles
one problem was even though ECL code was helping out i still have to remove anything related to C backend
2:53:26
dmiles
would have.. so gonna try http://www.cs.cmu.edu/afs/cs/project/ai-repository/ai/lang/lisp/impl/clisp/0.html
2:56:13
dmiles
but still open to suggestions if someone knows of a CL interpreter that 90% or more is just written in .lisp
3:01:15
dmiles
that be acceptable as long as if it expected to bytecode its system libs i can get in there and stop that
3:05:54
dmiles
even with such an interpreter .. i am still taking chunks out of its interpeter making it call my compiler first then executing
3:07:15
dmiles
Bike: in the case with SBCL i would need to ensure it could be used with its compiler completely broken