freenode/#lisp - IRC Chatlog
Search
22:08:22
pjb
I'm trying to use asdf:make-build, but I get errors "An error occurred during initialization: Component "<my-system>" not found.", even if I quickload successfully "<my-system>" before asdf:make-build. What would be the problem?
22:28:29
dim
pjb: could it be that you're using QL facilities to find your projects that are unknown to ASDF itself? ql:*local-project-directories* comes to mind
22:30:32
pjb
I've set asdf:*central-registry* with the paths to the directories where all my asd are.
22:31:54
dim
(asdf:initialize-source-registry) might be necessary after setting the central registry
22:37:37
pjb
Nope, same result with all the directories containing asd in the project and in ~/quicklisp in asdf:*central-registry*, and with (asdf:initialize-source-registry)…
22:41:13
pjb
Ok, it's an asdf problem with this setup. (asdf:oos 'asdf:load-op "<my-system>") fails too. Not specific to asdf:make-build. I'll debug that tomorrow.
0:04:22
White_Flame
thoughts on another stupid hack of mine: To READ multiple terms from a single string, encase the string with paren characters, and READ once into a list.
0:05:04
White_Flame
I think the only difference is that if there's an unclosed paren in the string, the location of the error would be different?
0:05:32
noobly
in the little schemere, there is a function as such: (define even? (lambda (n) (= (* (/ n 2) 2) n))). SO, because (* (/ n 2) 2) alwasy equals n, I've come to the conclusion that this either errata, a quirk of a specific scheme dialect. I'm using guile.. any help here?
0:06:25
White_Flame
this channel is about CL, not scheme. try #scheme. However, / might be an integer division or a divmod or something
0:12:14
noobly
and I'll try finding the specs, not quite sure how though (in emacs using guile, fwiw)
0:14:34
jmercouris
so if I make a program with asdf:make, right, it has an entry point, how can I keep that program running without doing a while true loop?
0:16:25
jmercouris
Bike: so the thing is, all events come from s-xml-rpc, invoked by xml-rpc from the client program
0:18:00
jmercouris
what if I used BT threads to run a loop that is sleeping 99% of the time to avoid the program closing
0:18:04
sjl
Is there some built-in function that takes a list and an element and appends that element to the list? I realize this will be slow.
0:18:30
pillton
jmercouris: You should wait for the thread which controls the event loop to terminate.
0:19:30
jmercouris
pillton: wait for the thread which controls the event loop...? how could I possibly know what thread s-xml-rpc is running on, or are you suggesting I make an event loop thread?
0:25:47
pillton
jmercouris: Have the main thread wait on a mutex which a s-xml-rpc handler sets upon termination.
0:26:45
jmercouris
are mutexs native to common lisp? or will I have to use a library or some bool or something?
0:51:39
no-defun-allowed
if you can chase the last cons in the list you can append to the end very quickly
0:52:03
no-defun-allowed
eg the results of (macroexpand '(loop for n from 1 to 10 collect n)) might involve such cons chasing
0:52:19
sjl
Sure. I could also use the queue implementation I wrote a while ago... I'm looking for a portable built-in or one-liner equivalent
0:55:36
sjl
starting with a vector and v-p-e would work, but v-p-e's args are in the wrong order and CL doesn't have flip
0:56:49
sjl
well, if I had flip and could live with reversed output it could be (flip #'cons) I guess
1:21:36
sjl
exactly. if append doesn't solve the problem, nconc will only not solve the problem faster and more dangerously
3:53:11
beach
What is your intended use for CL-R? It is hard to give advice unless the purpose is clear. Like, why would you want to give up reflection?
3:56:48
beach
jcowan: Another way of asking the same question, I guess: What problem with full Common Lisp is CL-R meant to solve?
3:57:56
pfdietz
Perhaps it's intended for more minimal, static compiled apps? Sort of a scheme-like CL?
3:59:13
beach
I am not saying there is anything wrong with wanting such a thing. I am just curious about the goal.
4:14:25
jcowan
I don't have in mind to actually write such a compiler, just lay down the work for what such a compiler might reasonably accept
4:15:25
jcowan
The hope would be to be able to get good performance from a more naive compiler than SBCL or SICL.
4:17:05
beach
And for the size part, are you thinking of a small number of applications for an operating system like UNIX?
4:17:47
beach
I am asking this, because if you give up either one, there are simpler ways of obtaining what you want.
4:18:03
jcowan
"The Lisp community must listen to the marketplace, which has shouted small, small, small and efficient, efficient, efficient for two decades [as of 1992]" (Henry Baker)
4:18:38
jcowan
His proposals are far more radical than anything I have in mind, and indeed in some ways more radical than Scheme or Racket
4:19:26
beach
jcowan: I am asking because, if think you might have a large number of applications, you can put most of the code in a shared library, so each application would be small.
4:19:32
jcowan
I was actually thinking about embedded processors and other highly constrained environments
4:20:26
jcowan
By 2018 standards, essentially all 1992 computers, to say nothing of 1972, were highly constrained environments.
4:21:25
jcowan
With whole-program compilation, tree shaking is trivial: omit anything not in the call graph
4:26:14
jcowan
Not when someone's library has the complete works of Shakespeare embedded in it. (Sorry, can't find the reference offhand.)
4:28:13
beach
For example, in order for CLOS to be efficient, you need the compiler at run time. So you probably need to give up CLOS as well in order to get both small size and good performance.
4:28:50
beach
And then the language is so far removed form Common Lisp that the CL part of the name is probably no longer justified.
4:29:29
jcowan
Why do you need the compiler at run time if you only have a fixed number of immutable classes, all known at compile time?
4:36:01
aeth
jcowan: For instance, I've come to the exact opposite conclusion about "Using (declare (type ...)) is the least-desirable mechanism to use"
4:36:48
aeth
jcowan: I've actually put a substantial amount of work into making macros that handle both declare and check-type at the same time to silence the critics because declare is simply too useful not to use in implementations that handle it reasonably.
4:37:01
jcowan
Am I right to think that (eval-when (:compile-toplevel) ...) has the effect of making any defuns it wraps available at compile time only? That would be the Right Thing for procedures at (Scheme) phase 1; that is, used only in the implementation of macros.
4:38:01
aeth
Macro-implementation functions tend to be available all of the time, possibly for easier debugging/testing, and they often are in a separate file to avoid a giant 300-line eval-when
4:46:26
pillton
jcowan: I don't understand why you would do it this way. Why don't you implement a CL compiler which isn't restricted to fast LOADing?
4:53:15
jcowan
The idea is that because CL-R is supposed to have full access to CL at compile time, you can write compile-time-only functions (for use in macros) that invoke features not part of CL-R.
4:53:49
jcowan
CL-R functions would be implemented in CL-R (or C or whatever) and then just compiled with the user's program.
4:55:03
pillton
jcowan: They all have the load requirement though. i.e. Function bindings aren't immutable, class bindings aren't immutable, classes aren't immutable and so on.
6:30:57
elderK
I was doing backquote expansion in my dreams last night, coming to terms with ``(,,a) kind of thing.
7:41:52
no-defun-allowed
what packages are there for making ASCII-art cons trees? i remember seeing one in a book
8:15:03
LdBeth
#'no-defun-allowed: and there's one output to CLX also in there, althought only works on CMUCL
8:54:19
jackdaniel
jcowan: as of ECL, feel free to ask questions on #ecl channel, I'll try to answer what I can
8:55:11
jackdaniel
what may be interesting to you is that I plan to slowly convert ecl_min (which is an ad hoc lisp implementation for bootstrapping working inside ECL's CLR) to be a conforming EuLisp Level 0
8:56:15
jackdaniel
sure, but I'm suffering from a constant lack of time, this project is high on my priority list, but this list isn't short anyway
9:01:56
jackdaniel
as of lisp-1 / lisp-2 here, it is strictly interpreted, so modifying evaluator here won't be a big problem
9:13:37
ogamita
jackdaniel: if you can make a defpackage and load and run those programs in that package, then it's a subset of CL.
9:14:52
ogamita
jackdaniel: I mean, you defpackage in CL to define the subset language, exporting only what's in it.
9:15:33
ogamita
For example, if your bootstrap language doesn't have hash-tables, you can export everything but hash-table stuff (and but defpackage if it doesn't have it).
9:16:33
jackdaniel
I don't quite follow, but if possibility to bootstrap CL from the base language (given sources in some form) is enough to make that language CL subset then fine, it is CL subset by such definition
9:16:48
ogamita
There are a few things that would require more work, as if it uses modular arithmetic. Then it may be a superset of a subset of CL: you would have to implement modular arithmetic in CL to run those programs as intended.
9:17:39
ogamita
It's not the possibility to bootstrap CL, but the possibility to run on CL that makes it a subset language.
9:17:39
jackdaniel
well, I'm fine with any label you come with for ecl_min (I don't really care, if it is CL subset - even better)
9:18:28
ogamita
The thing is that it would be better if it was CL, second best if it is a subset. Then you can use any CL implementation to bootstrap ecl!
9:19:23
jackdaniel
only part of sources is compiled with CL, rest is part of libecl core runtime (implemented in C)
9:20:06
jackdaniel
so compiling ECL with another Common Lisp is not possible (unless you reimplement ECL's core runtime in Common Lisp)
9:20:53
ogamita
Wouldn't going toward this direction be better than toward EuLisp? Isn't it essentially dead?
9:22:21
jackdaniel
it is a minimal language with a good specification (in contrast to CL as a maximal language with a good specification)
9:23:59
jackdaniel
I mean with respect to doability to provide standarized language for bootstrap environment
9:24:50
jackdaniel
(safe and standarized, ecl_min at the beginning is very unsafe without any condition system for instance)
9:27:54
jackdaniel
(by strictly interpreted I mean: it is minimally compiled to bytecodes and bytecodes are interpreted, not cons structures)
9:29:41
jackdaniel
but before I even start to work on that higher on the stack are: green threads and delimited continuations (I have a working prototype locally), compiler refactor for different backends and fast gf dispatch
9:33:28
elderK
makomo: I think I finally understand! At least, I was able to write my own once-only!
9:34:10
elderK
I wrote the usual pattern that we use gensyms with. Then I thought, right, how do I generate that?
9:34:29
elderK
Then there's the business of remapping a or whatever to the gensym, so when the body says ,a it's really referring to the gensymed stuff.
9:34:46
elderK
Once I wrote the expected expansion in a normal macro, I then worked backwards from that to try and replicate it.
9:35:32
makomo
yup, that is a very good approach to developing macros imo -- you see a pattern (i.e. start from an example) and try to abstract it
9:35:33
elderK
makomo: So, I have learned for instance that ``(,,a) -> `(,b). I.e. we have two ,,s so we're going to patch something in. But we only replace the ,a, not the entire ,,a
9:35:58
elderK
I was confused by seeing ,,@(....). But I figured out that it makes sense: Whatever is spliced in, the , kind of distributes.
9:36:36
elderK
Then I learned that ,`(.....) is basically a nop. It just means "Carry the thing after the , into the expansion, verbatim."
9:36:51
dim
I have once again a bug report containing: There is no applicable method for the generic function #<STANDARD-GENERIC-FUNCTION PGLOADER.CATALOG:FORMAT-TABLE-NAME (1)> when called with arguments (NIL).
9:36:59
elderK
So for ,`(,b) well, the next level just has the (,b). When that's expanded, the value of b will be chunked in, etc.
9:37:27
elderK
makomo: I wound up doing some "silly things" like color-coding parts of the macro, to highlight "when things actually do shit"
9:37:29
dim
I'm fed up of having those function calls with a NIL argument where it should be an instance of something, usually that's because I'm using find or the like and it didn't raise any result
9:37:40
elderK
Mentally, it's still a little fuzzy. But it felt like jumping between realities :P lol
9:37:52
dim
is there in CL an approach like the Maybe option type that would help systematically address the NIL propagation>?
9:38:55
elderK
:P Or it could just be that I've memorized PCL's version. I guess I'll try again in a week or so and see if I realy CAN do it from basics without referring to PCL :D
9:39:39
elderK
It's not returning null. It's basically returning a value wrapper. You can get the result from that, or say : Oh, it's null.
9:39:53
jackdaniel
elderK: this doesn't tell me much (I knew some C++, but it could be before this option was introduced)
9:40:21
elderK
Okay, well, imagine you have a wrapper. This wrapper can store a value of whatever. BUt it also has a flag that says whether it stores something ATM.
9:40:39
elderK
So, instead of returning null, you return an instance of this wrapper. And you can ask it: Hey, do you have a value?
9:40:59
elderK
It's useful in situations where "null" is not a good error return value, because it would be a valid result, say.
9:42:30
elderK
One benefit, at least in C++, is that it also adds a sense of assurance. Let's say you return some NULL and use it without checking. Well, you're going to crash MAYBE at some point. Depending on waht happens.
9:43:48
dim
jackdaniel: it's basically a way to say that if you receive NIL as an argument, just return NIL already