freenode/lisp - IRC Chatlog
Search
5:15:35
no-defun-allowed
I looked at https://irclog.tymoon.eu/freenode/%23lisp?from=2018-11-26T00%3A14%3A11&to=2019-11-26T12%3A14%3A11&search=Lisp%20System%20Implementation&by#
5:22:04
anlsh
Thanks! Seems like the discussion hasn't been extensive, so I'll have to try to catch beach sometime
5:34:25
ebrasca
aeth: I have installed sbcl on my talos II, but I can't make it work with multithreading.
6:13:45
aeth
I think no-defun-allowed was also involved in the discussion iirc and no-defun-allowed knows the threading libraries.
6:15:21
aeth
me niether, but the benchmark would be simple. 1 thread, n threads (where n is number of cores), n*2 threads, n*4 threads (because power has 4-way SMT)
6:20:03
beach
anlsh: A lot of the book contains C code, and the strategy for implementing memory allocation is very different from what most implementations would do.
6:20:48
beach
I had hoped that it would discuss pros and cons with different implementation strategies, but it is basically just the code of one particular implementation.
6:25:09
anlsh
I see. As to the "too much C" complaint, were you hoping the author would bootstrap earlier?
6:26:17
beach
Well, I was hoping for an insight into different strategies. Among them, a strategy where everything is written in Common Lisp, and the pros and cons of that one.
6:27:39
beach
The title of the book suggested that. But, like I said, it is basically just the commented code of one particular implementation.
6:32:00
beach
anlsh: If the goal is to create a general-purpose Common Lisp implementation, today there is no particular reason to write it in a language other than Common Lisp.
6:33:49
anlsh
Thanks, I think you're right in that we're trying to get different things from the book. Follow-up, how much experience did you have with the topics in the book beforehand? I don't have any experience with compilers, and am wondering how approachable it would be
6:34:42
beach
I think it is fairly easy to understand. But it doesn't give any insight into different ways of creating a Common Lisp system.
6:35:35
beach
I am writing SICL at the moment, so I already have experience with different implementation strategies.
6:36:25
beach
anlsh: You would learn more about the pros and cons of different strategies by asking in #sicl than by reading that book.
6:36:42
anlsh
Yeah, my interest it is definitely from a different perspective. I was hoping to use it as an introduction to language implementation in general
6:37:58
beach
But if you don't have too many budget restrictions, go ahead and buy it just to check it out.
6:41:25
anlsh
Well, if it's not usable as an intro text to implementation stuff then I'll hold off for now
6:42:11
beach
Sure. Again, if you want to discuss different strategies, go ahead and do it here or in #sicl.
6:48:15
beach
anlsh: For example, most existing implementations were started before CLOS was part of the standard, so they all incorporate CLOS very late in the build process. I think that with a new implementation, that strategy is not a good one.
6:49:12
beach
Even SBCL suffers from that problem. The compiler is written without the use of generic functions.
6:53:01
beach
For instance, SICL can use DEFCLASS to define the class SYMBOL, but if you don't have CLOS, you have to define it differently.
8:54:32
lukego
I'm reading the ASDF docs but I'm still not sure what it is I'm supposed to do nowadays instead of pushing a directory onto ASDF:*CENTRAL-REGISTRY* to programmatically add a a directory to be searched for .asd systems?
8:57:40
jackdaniel
asdf looks for some magic config files where you may specify what is put where, afair it is described in a manual (but poorly written)
9:34:51
lukego
Situation is that I've used Quicklisp to create a "bundle" of all my dependencies, and setup the Lisp startup env to find all of those, but now I want to add the *.asd that live in my source tree somehow. These systems aren't really "installed" and so I don't have the linked from standard paths and configuration files. Maybe what I need is a custom lisp.sh that makes them findable at startup and use that as inferior-lisp-p
9:36:11
lukego
... So at runtime I don't have Quicklisp and I also don't want to hack well-known files in ~/ etc.
9:36:38
lukego
but actually the custom startup script will be fine, I'm already doing that anyway and just hadn't thought to plug in my systems there.
9:37:45
lukego
I've gone "full nix" and made a little distro of all the Lisp and Emacs packages that I need, and their configurations, using the nix tooling that grovels Quicklisp and MELPA. Seems to work surprisingly well now.
9:55:53
scymtym
lukego: i didn't catch whether you still it, but something like (asdf:initialize-source-registry '(:source-registry (:tree "/path/to/tree") (:tree "/path/to/directory/") :ignore-inherited-configuration)) configures the source registry programmatically
9:56:56
lukego
I really just want to add a path without disturbing what's already there, since that was painstakingly setup by some cl-wrapper.sh script that I didn't write and am only starting to understand now
10:08:42
jdz
lukego: There is also CL_SOURCE_REGISTRY environment variable (if you have not already seen it).
10:09:46
lukego
Thanks. I'm trying now with NIX_LISP_ASDF_PATHS that the nix common lisp wrapper seems to turn into :TREE paths for asdf. However they don't seem to be getting picked up and I'm not clear on how to ask ASDF exactly what its complete set of search paths is at runtime?
10:10:50
jdz
I remember struggling with this as well, and ended up using CL_SOURCE_REGISTRY, but exact details of my struggles evade me...
10:12:10
lukego
I'm concerned that this variable might be clobbered by the wrapper, but here goes nothing...
11:17:37
lukego
I'm looking for but not finding information about how to make org-babel start SLIME session(s) by itself. I feel like I've seen this on the interwebs before though?
11:23:28
lukego
I mean that if I open Emacs, and open a .org file with Lisp source, and press `C-c C-c' to try and build it, then it complains that no SLIME session is available to evaluate the Lisp code. So I need to do `M-x slime' first. But I have the impression that org is able to manage one or more sessions on it own? (Or maybe it only does that with other languages, I don't quite recall.)
11:26:35
lukego
(This is not something important, I can easily live without, just had a memory fragment of having seen a HOWTO once upon a time and not finding it again now. Could have been for e.g. R rather than Lisp or something though.)
11:29:30
oni-on-ion
https://emacs.stackexchange.com/questions/26142/is-it-possible-to-open-file-then-load-slime-automatically ?
11:38:49
_death
you can change org-babel-lisp-eval-fn to your own function that starts slime if necessary
12:11:50
easye
lukego: RE: ASDF, I've been experimentally <https://github.com/armedbear/abcl/blob/master/ci/asdf-finds-abcl.bash> creating a DSL file for every ASDF system I want to access.
12:12:27
easye
Having everything on the filesystem allows me to quickly M-x ag introspect what is currently available by invoking ASDF:INITIALIZE-SOURCE-REGISTRY
12:13:40
easye
And for patches to Quicklisp, it is sufficient to git clone things into <file:~/quicklisp/localprojects/> <https://github.com/armedbear/abcl/blob/master/.travis.yml#L43>
12:38:23
phoe
http://www.lispworks.com/documentation/HyperSpec/Body/f_string.htm tells me nothing about this.
12:41:38
phoe
There is an ANSI-TEST that assumes that it must be fresh every single time, and it fails on CCL.
12:49:12
jackdaniel
assuming that the same string may be returned, what about (%f) (setf (svref str 0) #\d) (%f) ;?
12:50:00
_death
if the result EQ is expected to be true then it assumes the string is not fresh.. I don't think you can assume either way, so you treat it as if it wasn't.. same for COERCE
12:50:27
phoe
_death: ideally I'd want the passage from the spec that says that the produced objects must be fresh
12:50:45
phoe
because in theory #'COERCE could cache its results and return them if the objects need not be fresh
12:51:21
easye
Aren't strings implicitly static objects for implementations? It's true for abcl as they thunk down to java.lang.String references.
12:55:27
flip214
I'm trying to use named-readtables. In my code I have (let ((*readtable* (copy-readtable))) (named-readtable:in-readtable :mine) (ignore-errors ...))) but still that readtable is used in the next commands sent via slime - which breaks parsing, of course.
12:56:19
phoe
I've annotated this paste with one more. If you use (string #\a) that is not wrapped in a function call, then a fresh string is produced.
12:56:33
trittweiler
flip214, in-readtable modifies a slime variable associating a package with a readtable. It has a global side-effect that way
12:58:27
trittweiler
flip214, sly (https://github.com/joaotavora/sly) I believe has proper support for named-readtables. Which means it looks for a contextual in-readtable form (like Slime does for in-package) and makes sure to send that to swank when evaluating.
12:58:37
jackdaniel
literal objects are described as either quoted or self-evaluating, so it would not be conforming for stadard function to return a literal object, no?
13:00:36
jackdaniel
but you've got a point, there are functions which may return literal objects. but I'd expect their specification to have such warning
13:03:18
_death
phoe: (ok, I figured out deftest syntax..) note that in the other cases STRING can return such objects.. the string itself as shinmera noted, or the symbol's name, which as you note should not be modified.. so it makes sense to expect that the string (string #\X) should also be treated as such, given that there's no special wording to contradict
13:03:24
jackdaniel
also what symbol name returns is not literal objects but rather internal state of the symbol object
13:04:25
Bike
"literal" means it literally appears in the code, using it to mean "can't be modified" is confusing
13:06:13
jackdaniel
the thing is that spec doesn't say, that returned object from character is immutable, but when you mutate it function starts to return incorrect results
13:07:09
jackdaniel
phoe: see above ^ #'string may start to return incorrect results in code which is not non-conforming
13:07:27
phoe
but a FLET function with optimize speed 3 everything-else 0 that calls (string #\a) is constant-folded into "a"
13:09:03
jackdaniel
phoe: there is nothing in spec, that you can't modify result of (string #\a), so you are not forbidden to modify it
13:09:24
jackdaniel
when you mutate resulting string and subsequent call (string #\a) returns something else than "a", then it is incorrect result
13:10:06
_death
disagree.. since it doesn't claim the string to be fresh, you could have a compiler macro that expands to "X" on form (string #\X)
13:10:13
jackdaniel
seems so. I would be more unsure in case of symbol passed to string - should it copy the symbol's name?
13:10:28
jackdaniel
because it is not said it calls (symbol-name ...) hence there is no restriction on immutability
13:13:11
Bike
these kinds of issues are precisely annoying to deal with because without real cases of it coming up it's just abstract
13:20:49
phoe
one second though - is an implementation allowed to constant-fold something that is not constantp?
13:21:41
Bike
constantp isn't even sufficient to describe all the constant folding a compiler can do since it can't know about lexical variables that happen to be constants, etc.