freenode/#lisp - IRC Chatlog
Search
9:38:43
dmiles
from what i understand is that SICL does everyting right as far as it prevides a lisp that can be implmented with not one specific part that isnt writen in lisp
9:39:27
dmiles
meaning if you can impl at least these 100 or totallly a differnt 100 trampolines then you can get a full CL
9:53:02
dmiles
well trampoline is a littel too little.. what i really meant was at least some kind of REPL that does some lisp (not quite CL) and then by tramplines i mean at least some lisp functionality exists in the impl like #'EQ #'MAKE-VECTOR REPLACD
9:54:11
turkja
pjb: i'm now a bit confused.. to what it looks to me, Common Music 2 is a pure CL application, it just automatically ports some of the Scheme code (translated code looks horrible, but works). Anyways, you write the programs in CL. I'm using it with SBCL.
9:54:46
beach
dmiles: It is a common way of bootstrapping Common Lisp systems, and then the minimal system is written in something other than Common Lisp. I explicitly did not want to do it that way, because then I would have to write large parts of the system in a subset of Common Lisp and that turned out to be too painful.
9:56:21
beach
It is written using the full Common Lisp language. To create an executable, it requires that some of the code be executed by a host Common Lisp system.
9:56:34
jmercouris
I saw this article on reddit, and it got me thinking about clos: https://www.reddit.com/r/programming/comments/7h7ffc/implementation_inheritance_is_evil/
9:56:34
minion
jmercouris, memo from pjb: http://www.informatimago.com/develop/lisp/com/informatimago/small-cl-pgms/m-expression/index.html.in
9:56:34
minion
jmercouris, memo from pjb: have a look at: git clone http://git.informatimago.com/public/clang-ast
9:57:14
pjb
jmercouris: I don't agree that inheritance is evil. IMO a better formulation would be that inheritance is too complex for mosts human brains, it seems.
9:57:30
beach
dmiles: For example, the SICL LOOP macro uses standard classes to represent the clauses, so CLOS is required to expand the LOOP macro. And of course, CLOS uses LOOP a lot.
9:57:47
pjb
(there are books full of formal semantics of OOPL, so indeed, it may be too complex for most humans).
9:58:20
jmercouris
pjb: as far as I understand, interface inheritance = good, but implementation = bad, too much unexpected
9:58:38
dmiles
beach: ahah now i see.. that LOOP<->CLOS relation would happen in the immagined SICL i had
9:58:40
pjb
Well, in lisp we keep doing that. We call it "punning". Of course, it's done only at a small scale, eg. lists or trees are actually cons cells, so we may use car/cdr on them.
9:59:37
beach
dmiles: In SICL, I can also do things like (defclass symbol (t) ((%name ...) (%package ...)) (:metaclass built-in-class))
9:59:38
pjb
jmercouris: I'd tend to agree, once you follow strictly the lyskov substitution principle, with good pre/post conditions defined for each of your methods, you cannot randomly use inheritance just for implementation.
10:00:14
beach
dmiles: Most Common Lisp implementations must do something special for built-in classes, because most implementations start with a subset that does not contain CLOS.
10:01:20
jmercouris
it could also be my internet, I'm tethering as I have been moving these past few days... :\
10:02:08
turkja
This is how the translated code looks like: https://github.com/ormf/cm/blob/master/src/scales.lisp
10:03:06
pjb
Generated files cannot be maintained. This is why I started to write a C compiler targetting CL, to be able to run GNU emacs in a CL image.
10:03:35
turkja
pjb: originally yes, but it is somehow generated as Lisp, so it can be run on for example SBCL
10:05:39
beach
dmiles: By "the executable" I mean the SICL system itself, the one that gets executed when you type "sicl" to the shell prompt.
10:10:01
dmiles
beach: but it is for someone implementing lisp to borrow from so they dont need to maintain some copy?
10:11:33
beach
dmiles: Sure, it is free. But you can't use it to obtain a full Common Lisp system from a subset of Common Lisp. I have no defined dependency order. There are circular dependencies.
10:12:03
dmiles
beach: circular is jsut fine for me.. sinc ei jsut implenet whatever breaks your loop
10:12:51
jmercouris
pjb: It's okay, if you do try it though, please let me know, I would be very interested in feedback about the usability of it
10:13:46
beach
dmiles: Do you intend to implement LOOP to break the dependency of LOOP so that you can use SICL LOOP in your system?
10:13:46
dmiles
beach: i ended making a somewhat minimal loop i assume will be redified by XMLs loop.. in our case (SICL and I) I end up not using your loop if it ends up being an issue
10:17:27
dmiles
beach still i'll end up using ytour PACKAGE with my Less-Sub-CLOS jsut because my PACKAGE isnt all that brilliant
10:17:57
beach
jmercouris: That is a question that is too hard for me to answer, and if I tried, the answer would be misleading. I have lived in 5 countries on 4 continents.
10:20:41
turkja
beach: maybe you appear as australian because of your decent online times :) i'm at UTC+2 and log in usually around the same in the morning
10:21:47
jmercouris
Yep, sorry, didn't mean to derail the channel, I was just wondering because of the time discrepancies
10:22:09
dmiles
ACTION typing and grammar is so poor usualyl he is asked in English is his first language
10:23:39
dmiles
ACTION will probably do what ABCL did have sucky versions of lots of CL then let the .lisp libraries create the good versions
10:24:04
pjb
jmercouris: furthermore, beach originaly came from a country that doesn't exist anymore, and is living in a country that soon won't exist anymore either.
10:25:05
dmiles
(ABCL replaces the .java versions of MAKE-PACKAGE and HASH-TABLE with versions coded in lisp)
10:25:56
pjb
dmiles: the "replaces" part is only an artefact of the bootstrap process. You could more easily just generate a good lisp image eithout modifying the current one.
10:28:51
pjb
dmiles: I don't know precisely how sicl does it. In general, you can just build the future lisp image separately from the current process. Imagine you wrote it in C++!
10:30:03
dmiles
ah yes.. once the lisp is actualyl built on WAM CL.. and the entrie system is transpiled i suppose i never have to go back to my broken versions
10:30:14
jmercouris
pjb: How does the serialization process look? just like a memory dump? or does it have to be specialized and written?
10:31:08
pjb
jmercouris: it can be anything you want. The principle is to have an internal model of the new lisp image, and to save it to a file in the right format.
10:31:35
pjb
Since this file will contain the image loading part, you're free to do it however you want.
10:32:54
dmiles
(my package.trans.pl (which was made from package.lisp converting) replaces my https://github.com/TeamSPoon/wam_common_lisp/blob/master/prolog/wam_cl/package.pl dump bpackage version )
10:33:27
jmercouris
So you are saying that the implementation of the image saving may change dramatically without the kernel changing? is that the idea?
10:36:36
dmiles
also i can just "translate" SICL to *.trans.pl files and then go in an fix my translation errors
10:39:30
dmiles
(this info for jmercouris kind of... and to confirm with pjb if that is also part of what he meant)
10:40:53
dmiles
and realizing that beach's circular issue is not a problem if i dont even try to replace anyhting.. just run over everything and see what i can today translate into working
10:42:31
pjb
jmercouris: executable images (apart from ecl which doesn't actually generate images, but actual executables) contain code to load the rest of the image in their executable part.
10:42:55
pjb
jmercouris: and non executable images contain (usually) code to save an image, including an executable image, therefore they contain the code to load the image!
10:44:07
dmiles
it is probly extra work to uninclude the ability to write an image .. though AllegroCL did try for a bit
11:46:26
flip214
minion: note for attila_lendvai: Hi, would you care to discuss a small iterate feature request? You're the last committer, I didn't find anybody else caring about it.
13:08:45
phoe
I have a list (:a :b :c :d :e :f). There was a function that found an element in the list in a way that it returned the list's nthcdr containing that element, like, (foo :d list) ;=> (:d :e :f). What was that function?
13:13:05
Xach
i was hoping this was a case for the obscure (to me) http://l1sp.org/cl/get-properties
13:29:37
shka
heh, this makes me want to make new project named that-one-project-that-uses-get-properties :D
14:13:02
dmiles
for instance if i am printing out information about sometings in a list and that list might repeat.. the way i remember that i prointed the items is to put a property on that time
15:27:18
Xach
Shinmera: getting something new today - http://report.quicklisp.org/2017-12-03/failure-report/lionchat.html#lionchat
16:09:48
Shinmera
Looks like phoe broke it https://github.com/Shinmera/ubiquitous/commit/fca63bbe4c0a4215fe2f11eac16e14bb77ad07c6
16:12:18
scymtym
Shinmera: re that commit: the structure is (if found (values …) (values …) nil) instead of (if found (values …) (values … nil))
16:16:51
scymtym
on the bright side, since a few releases, the offending form would have been highlighted in SLIME instead of the whole method form. comparison: https://techfak.de/~jmoringe/macroexpansion-condition-locations.png
16:21:02
Shinmera
ACTION has been dealing with gamepads crap on all OSs today and isn't ready to handle the rest of the world he built crumbling too
16:33:34
kuwze
could someone point me at a good small codebase to learn how to break a project up? right now I just have a single humongous file.
16:35:04
beach
kuwze: It uses CLOS a lot, just like other modern Common Lisp programs. And it comes with documentation and tests.
16:39:09
pjb
kuwze: http://git.informatimago.com/viewgit/?a=tree&p=public/games/hangman-cocoa-lisp&h=e97207bf8840c93a3aa45f743c3ce3d56820e53c&hb=d2b05300c771147337bcbf074d4d7af60d813ff9&f=src
16:40:58
Shinmera
I guess while we're at it, Ubiquitous is fairly small. https://github.com/Shinmera/ubiquitous
16:57:21
kuwze
okay I am trying to figure out thus bug. first of all, it only happens sometimes when I compile the whole project (ql:quickload "cl-oanda"). the bug/error goes away when I quit slime and restart it.
16:57:31
kuwze
here is the relevant code: https://gist.github.com/kuwze/57079a629a67d8dca229c8d795728d57
16:59:09
Shinmera
dlowe: Apparently you sent me a note about Portacle debug settings a long time ago that I never got because plexi isn't in this channel?
16:59:50
Shinmera
dlowe: The answer is that it used to use restrict-compiler-policy to force debug to 3 at one point, until I discovered that certain systems like cl-opengl perform very poorly with that.
17:05:55
kuwze
beach: I guess I was trying to practice with macros; I am not sure what I was thinking at the time
17:06:42
beach
kuwze: You can practice macros if you like, but then do it with something that requires a macro. I don't think make-book does.
17:07:49
beach
That means either of several things: 1. Your Common Lisp implementation is buggy. 2. You are doing something that the Common Lisp HyperSpec says has "undefined consequences" and your Common Lisp implementation is taking advantage of that, or 3. You are using buggy foreign code.
17:08:58
kuwze
beach, in regards to the segfault: I am not using ffi, and I am using the mature CCL, so I guess it must be 2
17:10:23
beach
kuwze: Oh, and given your level of knowledge of Common Lisp, I think Cluffer is probably too complicated at this point. But I didn't know that when I recommended it. Sorry.
17:15:53
kuwze
I'm sorry, but what's the newbite channel for common lisp? I don't want to bog down this channel
17:18:08
Devon
(fboundp '(setf car)) => NIL (fdefinition '(setf car)) and (function '(setf car)) both err undefined-function; No simple way to detect setf-able names?
17:22:13
Devon
A function named (setf f) must return its first argument as its only value in order to preserve the semantics of setf.
17:23:28
beach
I can't find it now, but I think there is a general rule that when the Common Lisp HyperSpec says it's an "accessor", then it can be implemented either as a function or as a setf expander.
17:24:48
Shinmera
It's a function name, but that doesn't mean that an accessor needs to be a function
17:25:06
Shinmera
There is a section that specifies that an implementation is allowed to implement (setf foo) as a setf-expander on foo rather than a function.
17:29:00
Devon
The symbol CAR and the list (SETF CAR) are both function names. (fboundp 'car) works, if (fboundp '(setf car)) is not required to work, what does?
17:29:18
Shinmera
For each standardized accessor function F, unless it is explicitly documented otherwise, it is implementation-dependent whether the ability to use an F form as a setf place is implemented by a setf expander or a setf function. Also, it follows from this that it is implementation-dependent whether the name (setf F) is fbound.
17:30:23
Bike
the fact that you can (setf (car ...) ...) doesn't mean there's a function called (setf car). the setf working can also be accomplished by a setf expansion (into eg rplaca and returning the value)
17:31:34
Devon
Shinmera: Thanks for finding that. The question of how to detect whether a given symbol is setf-able or not remains unanswered.
17:32:07
pjb
And even if (setf f) is bound, it's still implementation-dependent whether it's used by setf!
17:32:17
Bike
get-setf-expansion will return a default sometimes, and if it returns the default you can check whether (setf f) is bound
17:32:42
Bike
but i don't know if that's reliable, maybe an implementation could return a non-default setf expansion that still doesn't work
17:32:58
pjb
Bike: I wouldn't be so sure. I'd rather use (macroexpand-1 '(setf (f x) v)) to check whether there's a (setf f) function…
17:42:18
Devon
(second (fourth (multiple-value-list (get-setf-expansion '(#:foo #:bar))))) => #'(SETF #:FOO) in CCL but it smells unportable
17:43:41
Bike
there can also be situations like, you have a file with (defun (setf foo) ...), and also (setf (foo ...) ...) forms in the file. while compiling the file there is no setf function (and no custom setf expansion), but it'll be fine when it's loaded
17:44:16
pjb
(second (fourth (multiple-value-list (get-setf-expansion '(car x))))) #| --> #:g66321 |#
17:47:59
Devon
(defsetf file-position file-position) => FILE-POSITION ; So CCL does it and implementations have so much latitude in this, it'd be truly bizarre to forbid it.
17:49:52
Devon
11.1.2.1.2 Constraints on the COMMON-LISP Package for Conforming Programs ... undefined ... 13. Defining a setf expander for it (via defsetf or define-setf-method).
17:52:24
Bike
maybe the reason it doesn't have a setf is that it doesn't return the new value like setf is supposed to.
18:01:32
Devon
Thanks everyone, (incf (file-position s) i) will have to wait for the next *ahem* ANSI committee.
18:10:56
pjb
Devon: notice however that it should work on implementations running on POSIX systems, and assuming the stream is a binary stream or uses a 1-1 encoding.
18:16:17
pjb
Devon: also, (defun fpos (stream) (file-position stream)) (defsetf fpos (stream) (position) `(file-position ,stream ,position)) and then: (incf (fpos stream) i)
18:33:58
Devon
pjb: Needs gensym s `(let ((,s ,stream)) (unless (file-position ,s ,position) (error "Unable to set file position.")) (file-position ,s))
18:34:43
pjb
If you want to give more precise errors, ok. (incf nil) #| ERROR: The value nil is not of the expected type number. |# would do too.
18:37:01
Devon
Sans error checking still needs the gensym temp s '(let ((,s ,stream)) (file-position ,s ,position) (file-position ,s))
18:39:34
Bike
i mean, in the defsetf body stream is bound to a symbol. you don't have to worry about multiple evaluation.
20:54:24
aeth
"The function was called with fourteen arguments, but wants exactly twelve." I've created a monster.
20:55:11
aeth
And, yes, this is *with* helper struct objects, standard objects, and arrays to try to minimize that number.