freenode/#lisp - IRC Chatlog
Search
15:30:50
ogamita
In the indirect pointer, you will find a block with N pointers. In the double indirect, a block with N pointers to blocks with N pointers (or N') so total N*N.
15:31:59
ogamita
and N*N*N for the triple. So block indices from 0 to 10 are directly found in the inode, then for blocks b-11 to b-11-n, you will find them indirectly in the block pointed by the 12th.
15:32:46
ogamita
then from blocks b-11-n-n*n to b-11-n-n*n*n you will find them double indirectly in the blocks pointed by the 13th, and for the blocks above in the 14th.
15:34:04
ogamita
Well, I mean, b in [0..11[, in [11.. 11+n[, in [11+n, 11+n+n*n[, in [11+n+n*n, 11+n+n*n+n*n*n[ and in [11+n+n*n+n*n*n, infinite[
15:36:21
ebrasca
If like to find file /file , What I need to do to find it? ( I know how to find root or some file with know inode )
15:37:34
ogamita
Well, the root of the file system is a fixed small inode number. You might want to have a look at the C sources of ext2 to be precise.
15:41:40
ogamita
The superblock contains the parameters to this structure, like the block size, (therefore the number of pointers per block), and the inode number of the first file, ie. the root.
16:26:55
dim
beach: I would have guess that the ⊤ ⊥ ⊤ notation is generic enough to cover your use case, even with CLOS, where you write your own implementation using the host one (first ⊤) and then compile it with the result (second part, ⊥), etc, but I'm not sure I understand enough what you're doing to know for sure
16:28:52
beach
dim: Yes, you are right, it works. But it does not allow me to explain how I can create the hierarchy of MOP classes inside the host, and it doesn't allow me to explain how I need multiple first-class global environments so that I can have several versions of "the same" class and "the same" generic function working on different kinds of objects.
16:33:01
beach
dim: But you are pointing out an interesting thing here. I have not seen an explanation as to the requirements for these T diagrams to work, and what is different about Common Lisp compared to other languages.
16:35:56
dim
the T diagrams are nodes of 3 edges, and what's interesting to them is how you can compose them
16:36:23
dim
left edge is the source language, bottom edge the implementation language, and rgith edge the target language
16:36:50
beach
Sure. And I think the T diagrams I need are fairly standard for cross compilation, but that's not what I am trying to explain. I am trying to explain the details of how to go about it.
16:36:53
dim
⊤ ⊥ ⊤ is the minimum composition of compilers you can do to both compile a compiler and then test it
16:37:39
dim
I've been introduced to ⊤ ⊥ ⊤ in the context of writing a compiler in the target language (writing a C compiler in C), not in the context of cross compilation…
16:37:59
beach
dim: One difference is that the Common Lisp compiler does not just take a file and produce another file without any other effects. The file it compiles may modify the global environment, and the next file to be compiled may need a modified environment to compile. Then, if you try to compile a Common Lisp system, the modifications to the environment may be such that the host system is destroyed.
16:37:59
dim
anyway, you need more precision in your drawings to explain bootstrapping the CLOS, I can see that
16:39:19
dim
beach: oh. I didn't think of the side-effects of being able to compile and execute your own code at compile time :/
16:40:01
beach
Yeah, I think those diagrams work for file-to-file translation without any information being stored in between.
16:40:56
dim
you go from a compiler to another one, you never change the compiler itself, it's all a read-only binary
16:41:27
dim
the only side-effect is that you have a new binary file, I think, in the ⊤ ⊥ ⊤ representation
16:42:38
dim
anyway I've been reading rme “This Old Lisp” transcript the other day and I left with a question for you: he mentionned wanting to make the CCL compiler smarter… (specific current project around register bindings)… is that something that Cleavir would help with, typically?
16:44:17
beach
dim: I would have to know what CCL does at the moment. But I do plan to implement several algorithms for register allocation.
16:47:08
dim
I remember having developed a naive and buggy register allocation thingy back when in engineering school, for a compiler assignment, with a notion of a “prison” where I would send bindings when I didn't have registers available anymore… never got the thing to work like I wanted ;-)
16:49:06
beach
I was thinking of using it for register allocation. You can peek ahead in the instruction stream and know which variable is needed furthest in the future, and spill that one when you need another register.
16:49:36
dim
the assignment was meant for us students to make a choice in between AST or direct code generation, the register optimisation was way out of scope, and also a very fun project, I though
16:52:37
beach
The point here is that the Cleavir compiler framework uses a pretty standard intermediate representation, modulo Common Lisp specific stuff like nested functions, etc. So many of the published algorithms can be implemented, sometimes requiring modification. Then the client Common Lisp system can choose which ones fit their needs.
16:54:54
dim
did you follow Andy Wingo's work on the Guile VM and compiler some years ago? he went full into CPS techniques and his blog post is full of details
16:55:17
beach
[about the difference between most languages and Common Lisp] I wonder whether one could say that the header files of C and C++ correspond to the environment transformation in Common Lisp. In Common Lisp, you compile and load a file. It provides a modified environment in which the next file is compiled, etc. With C or C++, this new environment must be provided explicitly for every new file compiled.
16:56:31
dim
maybe that's more on-topic https://www.wingolog.org/archives/2011/07/12/static-single-assignment-for-functional-programmers
16:58:31
dim
I'm not sure if the approaches implemented in Guile are going to be good inspiration for you if you're not doing CPS, but well, that's your call ;-)
16:59:11
beach
Thanks. Yes, I have made my decision. I studies CPS in depth in my youth, when I was working with Scheme, partial evaluation, etc.
17:03:25
beach
dim: Anyway, it is off topic, and if you don't know much about compiler technology, I won't elaborate.
17:05:29
beach
I could explain it to you in #sicl, but not today. It is Friday evening and I have had a long day and a long week.
17:15:02
jcowan
I don't find it so, at least not since age ten or thereabouts. A year is still a very, very long time, taken a day at a time as I do.
17:18:24
beach
Bah, think about the poor people wasting their time on using programming languages that are way less productive than Common Lisp. We are relatively lucky.
17:22:51
jackdaniel
extrapolating, given there is a programming language way more productive than common lisp we don't appreciate enough, we are the poor people ourself?
17:24:05
jackdaniel
being poor is a state of mind, I don't consider myself being poor even if there are more productive languages
17:25:02
jackdaniel
(likewise I don't find people finding joy in writing in python being poorer than me, maybe having a little worse taste)
17:28:04
jcowan
"Oh, I just root for all the teams. I guess you could call me an athletic supporter."
17:29:35
shka_
jcowan: though competition has more value then just letting your favorite team win ;-)
19:50:09
jmercouris
so how do I know what kind of strings exists? is there like #+drawin-p? or something?
19:50:09
elderK
Guys, is there a way to set the same default value for an optional parameter to a generic function, like, for all methods?
19:51:57
elderK
pfdietz: I was thinking of using an around method for assertions, like, checking that the parameters are of the right types.
19:54:16
jackdaniel
trivial-features provides uniform symbols in cl:*features* for certain features across implementations
19:54:49
jmercouris
okay, sorry, yes when I said strings, I meant the strings the symbols evaluate to
19:55:36
jmercouris
I am trying to say #+darwin, or #+unix, those macros, the sequence of characters, who defined them, that was my question
19:56:28
jackdaniel
if foo (by default in keyword package unless you provide package accessor) is in cl:*features*, then #+foo form will read form, and #-foo form won't read it. if foo is not there, then #+ foo form will not read it (etc)
19:56:34
jmercouris
and trivial-features generalizes that, and I believe, UIOP uses trivial features based on reader-macros I've seen people writing with it
19:57:03
jackdaniel
uiop is in "depend on me, I'll reimplement everything" camp, so I doubt it depends on trivial-features
19:57:51
Bike
trivial-features just makes sure that on an implementation that puts :macosx or something in *features*, instead of :darwin, :darwin is also there.
19:58:22
jmercouris
but how could I use that in asdf file? wouldn't I first have to load trivial-features?
19:58:55
jackdaniel
if you have trivial-features in this list, then asdf will load trivial-features and then reload your asd file
19:59:32
jmercouris
I assume it is just :system-depends-on (:trivial-features) within the defsystem form?
20:04:55
jmercouris
I don't understand the manual: https://common-lisp.net/project/asdf/asdf.html#index-system_002ddepends_002don
20:07:23
jackdaniel
If you need non-standard character encodings for your source code, use the extension system asdf-encodings, by specifying :defsystem-depends-on ("asdf-encodings") in your defsystem. This extension system will register support for more encodings using the *encoding-external-format-hook* facility, so .. etc
20:10:56
jackdaniel
https://common-lisp.net/project/asdf/asdf.html#index-_003aif_002dfeature-component-option
20:11:29
jackdaniel
in firefox it is Ctrl-f for free text search, that may prove useful in this manual
20:45:24
dim
ahah, I had forgotten that it's easy to start a swank server in an already running lisp, such as Clozure-CL, so that I can still hack using CCL in SLIME ;-)
20:45:56
dim
(because ccl is currently broken in macos and I have a test version that works but only in packaged/gui mode, for reasons)
20:47:27
pjb
dim: really, if you recompile it following the procedure, it currently works on mojave.
20:47:58
dim
aeth: I did at times, but it's frustrating, because some operations need to files to exist in the remote server and be in sync
20:48:59
dim
I guess I should use the GUI version to compile to the full distribution then, too. Or maybe brew install --head works?
21:15:41
dim
ok I made a local fork of the brew formula for ccl, using url "https://github.com/Clozure/ccl/releases/download/v1.12-dev.1/darwinx86.tar.gz" sha256 "c4dda85210a6d09301d0e4691c65a41824126096eb36b9c9fa40a16d72ae22ce", and it seems to be working its magic
21:21:05
dim
and I could verify that my src/save.lisp code works with CCL too, not only SBCL, so I'm happy
22:54:46
no-defun-allowed
i'd like a "lazy" class which only does some computation when values are requested from it, but this lazy class could become one of several classes and to preserve the illusion it is an instance of that class making it typep to the class would be nice
22:55:16
no-defun-allowed
the alternative is to write a lazy class for each target, but it'd be quite verbose
22:58:46
no-defun-allowed
then again dispatch would be screwy if you could, so yeah the verbose solution would be better