freenode/#lisp - IRC Chatlog
Search
5:45:59
iqubic
I thought you were doing the thing where it's always "morning" when you enter an IRC channel and "night" when you leave.
6:30:51
beach
Wow, more offers to help me with the work on SICL. Perhaps I should convert to being a project manager instead of writing the code myself.
6:34:35
beach
I have always explored the design space by writing code, so that would have to change. Or at least, I would have to stick to small code snippets for showing the consequences of some particular design decision.
6:35:45
whoman
hmm makes sense. architecting the garden geometry itself rather than tilling and plotting and weeding
7:59:46
phoe
or, simply use an implementation that allows you to extend CL:SEQUENCE, see http://www.doc.gold.ac.uk/~mas01cr/papers/ilc2007/sequences-20070301.pdf
8:35:27
beach
Let's suppose I have an initial executable containing the image of a minimal Common Lisp system. In particular, it does not contain an evaluator. Now, I can cross compile DEFMETHOD forms so that the result is in a FASL file that can be loaded into that minimal image.
8:35:41
beach
The code for a method has already been processed by MAKE-METHOD-LAMBDA, so the METHOD-FUNCTION of the method already contains definitions of NEXT-METHOD-P and CALL-NEXT-METHOD (we assume the default situation where a method function is called with a list of arguments and a list of next methods).
8:35:50
beach
So, in this minimal image, I must be able to call the applicable methods according to the method combination of the generic function. I can't really call COMPUTE-APPLICABLE-METHODS or COMPUTE-APPLICABLE-METHODS-USING-CLASSES each time I call a generic function, because these are generic functions as well, so I would get into an infinite computation.
8:36:14
beach
But in SICL, I have a call history in every generic function. It contains a list of pairs (S,E) where S is a signature consisting of classes of specialized arguments that have already been seen, and E is something that we can call an "effective method function".
8:36:20
beach
It is not an "effective method" because that term is define in the AMOP to be a form that needs to be converted by the evaluator to a function. Now, after some methods have been loaded from FASL files, I need to be able to take them into account when I call the generic function.
8:36:32
beach
So when the call fails because the call history does not contain an existing pair that will do, I need to compute a new such pair. But I can't do that by calling COMPUTE-EFFECTIVE-METHOD, because the result of such a call would have to be evaluated. So here is my tentative solution that I would like comments on:
8:36:41
beach
In the initial image, when a call to a generic function fails because there is no appropriate pair in the call history, I create a new one as follows: I call COMPUTE-APPLICABLE-METHODS-USING-CLASSES and perhaps also COMPUTE-APPLICABLE-METHODS as usual. Then, instead of calling COMPUTE-EFFECTIVE-METHOD, I call a different SICL-specific function called (say) COMPUTE-EFFECTIVE-METHOD-FUNCTION.
8:36:42
beach
It takes the applicable methods and returns a closure that can be used as the E component of the pair. The CODE for that closure is already in the image, so it is compiled. Therefore, creating the effective method function does not require any evaluator. Does this sound right, or am I missing something?
8:52:08
scymtym
beach: are the individual precompiled method functions compiled with particular lexical function bindings for NEXT-METHOD-P and CALL-NEXT-METHOD that are aware of this scheme?
8:53:30
beach
That method function, by default, takes a list of arguments to the generic function and a list of next methods.
8:53:56
beach
So, the cross compiler has already inserted definitions of NEXT-METHOD-P and CALL-NEXT-METHOD.
8:53:58
scymtym
sure, i was uncertain whether the way in which the list of next methods is passed is compatible between this scheme and the scheme eventually used once the compiler becomes available
8:54:47
beach
But later on, I will specify optimized versions for standard generic functions, so the methods would then have to be compiled again.
8:56:06
beach
Once I have the compiler in the image, I can ditch the first-class global environment that has been used for the initial image, and create a completely new first-class global environment that contains optimized versions of everything.
8:59:32
scymtym
i will have to read more about the bootstrapping procedure to understand why that couldn't be done in the host lisp
9:04:28
dim
the very simple image that depends on possibly nothing from the host? do you want to be able to bootstrap SICL from itself someday? I mean we have quite advanced Open Source standard CL implementations around that you could choose to depend on?
9:06:44
beach
The executable image is supposed to be a complete Common Lisp implementation, so it can't depend on any existing implementation. The host Common Lisp system, used to cross compile code to generate SICL FASLs and to create the initial image can in theory be any conforming Common Lisp implementation that also supports closer-mop.
9:09:45
dim
the simple image you're talking to is its own thing, you cross-compile it but then it runs by itself, without the need of any CL host around, right?
9:10:52
beach
Sorry! It is hard for me to describe something that I have been so familiar with for such a long time.
9:11:45
dim
I though SICL was about offering pieces of CL implemented in CL, following the metamodular idea, so that if e.g. an implementation has loop and other things but not CLOS, it could use SICL implementation of CLOS
9:12:31
dim
didn't understand that you want to produce a full CL image from SICL sources, and now the whole bootstrapping idea makes more sense
9:14:32
dim
so can you compile the SICL image from CL+SICL, then use this first SICL image to compile SICL again, and then use that second SICL image as a CL compiler/env?
9:15:14
dim
I think that's the classic compiler bootstrapping, in 3 stages, right? (I kind of remember that from classes ~20 years ago)
9:19:25
beach
dim: My initial plan was to define some kind of order between modules, so that one could start with some minimal Common Lisp implementation and then load modules in that order. However, that turned out to be too painful because one would have to keep track of what subset of Common Lisp to use for each module.
9:19:26
beach
Also, the maintainability of the code would suffer from not being able to use the full language. So I abandoned that idea.
9:27:45
dim
yeah, and it's not like you are pioneering CL anymore, you can trust/depend on having a good solid first implementation of the standard to use ; hell you even have a choice of Open Source solutions
9:34:37
beach
There is not an executable file named `sicl' that you can start by typing `sicl' to your shell prompt.
9:37:16
dmiles
ah I thought it was when you said the executable image is supposed to be a complete Common Lisp implementation, so it can't depend on any existing implementation.
9:39:15
beach
It becomes too boring to write things like "the executable image (should I live long enough to make the bootstrapping procedure complete enough that such an image might actually work)...."
9:46:24
dim
so SICL is about being able to write a full CL implementation in (only) CL, and with native first-class environments and some other nice improvements to the current standard, is that right?
9:47:18
beach
Right. The first-class global environments were invented mainly for the purpose of bootstrapping, but they can obviously be used for other purposes like sandboxing.
9:48:33
beach
There are very few "improvements to the standard". Mainly implementation techniques that I hope will be better than what currently exists. Like the fast dispatch technique, and the implementation of the sequence functions.
9:53:14
dim
in my book having generic “APIs” over sequences and streams (ala grey streams but natively so) and maybe hash table functions would be significant improvements to the standard “grey areas” (pun intended)
9:56:47
dim
I wonder if stream level abstractions make sense for higher level (network) protocols, such as MySQL or PostgreSQL protocols
10:25:38
Shinmera
For instance you could model exchange protocols with streams that emit objects representing messages.
11:04:54
ebrasca
I have write http://termbin.com/b11k but for some reason don't give expected checksums.
11:17:36
stylewarning
ebrasca: if you’re using SBCL there’s a dedicated function for that in the module SB-ROTATE-BYTE
11:19:54
stylewarning
ebrasca: then it might be worth abstracting it into a portable function and implementing the assembly code for it! :D
13:05:52
megachombasss
hello guys. do you see any redundant code, errors, or things i could do in other way in this code? https://codepaste.net/bc72wz
13:08:34
beach
And it's a bad idea to use identifiers in some language other than English, especially if, like now, you want an international crowd to understand it.
13:09:42
beach
Don't use the "get-" prefix in Common Lisp. Don't use the "is-" prefix either. Use the "p" suffix instead.
13:14:33
beach
Emacs indents three semicolons so that they are at the left margin, but two semicolons so that it is indented with the code.
13:15:04
beach
CamelCase, is when you have a capital letter in the middle of a word, like resolutionEtiquette.
13:15:38
beach
In Common Lisp, we don't use CamelCase. Use resolution-etiquette, or rather resolution-label instead.
13:17:05
beach
megachombasss: Perhaps it is a problem with TAB characters. In that case, make sure you don't use TABs in the code.
13:17:55
beach
megachombasss: Some paste services can handle it. Some others can't. It is best to avoid TABs.
13:19:29
beach
megachombasss: Don't use the "set-" prefix. Use a SETF function instead. LIke (defun (setf drapeaux) ...). Even better, (defun (setf flag) ...).
13:21:06
beach
megachombasss: So, fix the whitespace, the semicolons, the CamelCase, and the language, and then resubmit.
13:22:03
beach
megachombasss: Also, go read a text book on Common Lisp, and you will see how different their code looks from yours.
13:23:36
beach
megachombasss: What implementation of Common Lisp are you using that it doesn't tell you where it is?
13:24:54
beach
megachombasss: So if you want help, it is better to use one of the more widely used implementations.
13:26:06
Shinmera
You could try https://portacle.github.io, which will ship SBCL and should run without installation or admin privs.
13:27:40
beach
Oh, so I am wasting my time. You are not going to want to learn Common Lisp after this assignment is due. I guess I'll go do something else then.
13:31:39
megachombasss
tbh lisp itself doesnt interest me at all, knowing i have to do this project and teacher didnt give a single course on how lisp works
13:33:12
megachombasss
nono, dont ask you to do my course work (as i literally had no courses about it)
13:34:12
stylewarning
megachombasss: If you’re a beginning programmer, then the book Common Lisp: A Gentle Intro by Touretzky is a great book to teach yourself Lisp. If you know another programming language at an advanced level, then Practical Common Lisp is a great resource.
13:35:23
stylewarning
megachombasss: unfortunately for beginners, it’s easy to write bad Lisp code, with poor efficiency, style, and use of the language features
13:40:02
stylewarning
paule32: Write a function called GATE-EQUAL which tests if two gates are the same for your purpose. Happy to help after you’ve done that and can explain that function to me.
13:40:29
beach
paule32: I am asking you why, despite being told an uncountable number of times, you continue submitting code that does not respect the conventions. I have told you over and over again that it is very impolite. And you keep right on doing it.
13:58:14
KZiemian
do you know that book "Object-Oriented Programming in Common Lisp: A Programmer's Guide to CLOS" by Sonya Keene is free to download