freenode/#lisp - IRC Chatlog
Search
22:47:53
makomo
how come clsql's insert-records doesn't support inserting multiple records at once :(
22:55:19
dialectic
Ok, I haven't tested this yet, but I need some opinions: is string interning worth it for a well organized symbol table? I thought I'd get cheap string tests out of it but I'm wondering if the overhead for interning strings makes it come out the same.
22:58:58
aeth
Hmm, Ryzen 3000 is coming out tomorrow. It sure would be nice if a 12 core computer (the most in tomorrow's launch, but not overall) would actually be a substantial improvement in CL compilation times over a 4 core computer.
23:00:32
dialectic
Plus the whole bestiary of new features every few years. I would hate to be a maintainer for GCC or Clang.
23:01:05
aeth
Still, we should start a gofundme to send out as many Ryzen 9 3950X (coming out in September) to as many people involved in CL build processes and CL compilers. Only $749. https://en.wikipedia.org/wiki/Ryzen#Zen_2_microarchitecture
23:04:19
aeth
Not every compiler is thread safe afaik, which is why the last attempt to parallelize ASDF does heavyweight forking insetad of lightweight threads. Although they might have improved since then.
23:04:24
Petit_Dejeuner
Wasn't someone on here talking earlier about how SBCL uses fork or something?
23:05:22
Petit_Dejeuner
Side not, I feel like I'm losing my mind. I used to be apple to SBCL and SLIME working perfectly on any machine with little to no effort, but not it feels like the REPL is always broken for some reason.
23:06:42
dialectic
As one of the poor people using the SLIME package for Atom, I have never had a bug free environment
0:42:05
DaveLib
hello i am running sbcl i am trying to compile a common lisp program i just downloaded : clfswm common lisp full screen window manager i just tried and got an error message last month i came to this channel and someone here solved it for me by giving me a single line lisp command to insert into the lisp spurce code i recall the issue was to add an item to a PATH variable since then my computer crashed and i lost my old files
0:43:10
White_Flame
I don't know about that specific error, but the first problem to solve is one of having good backups.
0:44:25
DaveLib
yes i reinstalled my os after the crash and this time i did a separate home partition so i can reinstall oif necessary without losing my personal files
1:02:35
DaveLib
Thanks saturn2: i found the old solution in those logs i will try it again it worked for me last time
1:08:13
stacksmith
aeth: I wrote a macro 'with-' that automatically (or manually) creates package-local accessors to struct, class or foreign object instances and can prefix them on per-instance basis. It can use existing instances or create new ones (including temporary CFFI foreign objects). It can also combine multiple with- style macros, and bind single or multiple values. http://github.com/stacksmith/cl-with
1:09:48
stacksmith
Well, it uses the same syntax for all slotted objects, and lets you, in a single statement, use any number of objects with different prefixes for slots...
1:12:41
dialectic
stacksmith: How do I use with-foo if it's in another package? I have to explicitly import?
1:15:13
stacksmith
Yeah, it is a bit of a pain - if it starts with a symbol it assumes it's a binding, not a with- aggregation...
1:17:00
stacksmith
I tried a few different ways, but it is most natural to have the symbol in the first position be a binding... A list for multiple values. A keyword for with- macros.
1:17:38
dialectic
Just add one more clause. If it starts with a list and the CAR is QUOTE, it's like the keyword case.
1:18:11
dialectic
If you're doing a multiple-value-bind and one of your new bindings is the symbol QUOTE, you're a bad person.
1:19:00
stacksmith
Actually, the way it stands you always create bindings in *package*. So if you specify a symbol in another package it can always treat it as a with-... clause.
1:56:33
stacksmith
I think it's useful. Anyway, I just did it. I don't ever want to look at this code again, and I can imagine a with-macro in another package situation... My idea of always using local bindings sucked - with :old you use existing bindings which could well be in another packege...
6:03:31
Godel[m]
Hi, I'm trying to use read time evaluation macro `#.` with a function which is in the same file as the function call and get error that the called function is undefined (at read time). Is there any way to resolve this without splitting them in two separate files and compiling one before the other? Is there a way to force compilation of a function/sexp before read time evaluation takes place? An example of the scenario:
6:03:31
Godel[m]
https://bin.disroot.org/?316c523091169696#7Ir1LoUETE0dpC7Y8GVC7mgRYXomirC1YJN4rmnyZn4=
6:05:36
no-defun-allowed
Maybe load-time-value would be more appropriate, then remember to wrap FACTORIAL in an (eval-when (:compile-toplevel :load-toplevel :execute) ...) form
6:06:07
no-defun-allowed
Though, when loading or compiling a file, it's done one form at a time, right? Then the LTV wouldn't be needed.
6:59:18
beach
(FLET ((FUN (...) ...)) ...) is basically the same as (LET ((FUN (LAMBDA (...) ...)) ) ...) except that in the first case, FUN is in the function namespace, and in the second case, it is in the variable namespace.
7:10:32
beach
fragamus: Sure, a macros is just a function that takes a form and returns another form.
7:11:30
beach
fragamus: But your question is ambiguous. Do you mean that another macro is defined DURING THE EXPANSION of the first one, or BY THE EXPANDED FORM?
7:12:23
beach
fragamus: You typically don't want to do that. It is best if macro functions are side-effect free.
7:14:01
LdBeth
Usually there is a staging limitation, the reason is obvious: you cannot can a function not yet loaded into the environment
7:17:17
fragamus
once macro code gets generated dynamically, and some lisp code is generated also which refers to the new macro, then that is part of the expansion
7:19:12
LdBeth
If you’d like to make all the things “static” that’s not trivial. Although not completely impossible.
7:20:19
beach
fragamus: I agree with LdBeth. In Common Lisp, a macro definition (by DEFMACRO) is turned into a macro function that is compiled after the DEFMACRO form has been expanded.
7:21:05
beach
fragamus: When a macro call is encountered by the compiler, the compiler executes the macro function to obtain an expansion, and then compiles the expanded form instead.
7:22:56
beach
Yes, and there is no "dynamic" compilation of the macro definition. It is done once when the macro definition is encountered.
7:23:24
beach
fragamus: In fact, DEFMACRO is itself a macro that expands to something like (setf (macro-function ...) (lambda (form environment) ...))
7:25:07
beach
That is kind of implied by the fact that it compiles the expanded form in place of the macro form. It doesn't treat the expanded form any differently from other forms.
7:26:24
beach
So you start by writing yourself a Lisp system that is not an implementation of Common Lisp?
7:30:00
LdBeth
Or maybe you could lookup hygienic macro or other meta programming technology, even call by need evaluation that does some sort similar thing to macros
7:33:16
Godel[m]
About the read time evaluation macro, if the result of evaluation is a struct, sbcl says it doesn't know how to dump a struct (I'm not dumping a runtime image though). Is there a way to tell it how to dump it? Or is there a list of types it knows how to dump?
7:35:28
LdBeth
Göd.el: it’s a little hard to comprehend but you can search some tutorial thing about it
7:36:30
fragamus
sometimes people don't get why syntactic sugar causes problems. I need compelling reasoning to drive the point home
7:37:09
aeth
syntactic sugar is great, I just don't want to wait until the next version of the language to get it (and in the case of CL, that would be quite the wait!)
7:37:37
beach
fragamus: Are you trying to convince someone else to use Lisp? It is nearly impossible to convince people, because there are very strong psychological forces involved.
7:38:08
LdBeth
fragamus: it usually means the reader of your code have to spend extra time to understand how those syntax works if you didn’t design these properly or these are not well documented
7:38:53
beach
fragamus: No. It happens to very smart people too. Carol Dweck calls it a "fixed mindset". She has some good talk available on YouTube.
7:40:12
LdBeth
In the meantime, if that’s a well recognized thing (in the domain of problems you want to solve) that haven’t been introduced into the programming language, that should work reasonably fine
7:40:18
aeth
It takes a lot of time to master a programming language, which is a time investment people don't want to repeat, even if it's faster the more you do it.
7:40:59
ck_
I have less trouble understanding the absence of popularity of lisp than the popularity of other languages, like Java for example
7:43:36
jackdaniel
some people criticize lisp for being to easy to work with, as in: it is easier to wrap "scratch-my-itch" hack than to contribute to existing solution
7:44:49
ck_
yes, exactly. I once attended a talk about "finding a good cond-let library" (for clojure)
7:45:04
jackdaniel
if I had to play devil's advocate I'd say, that I'd prefer one complete library after 5y than 100 incomplete libraries in a week
7:45:08
ck_
baffling. There's probably three dozen cond-let macros people have whipped up in half an hour around
7:46:02
ck_
Well it's not like lisp is all impromptu and no planning. The (Hyper)spec is a great achievement.
7:46:10
no-defun-allowed
(defmacro if-let ((variable value) then else) `(let ((,variable ,value)) (if ,variable ,then ,else))) ; three dozen and one
7:48:51
fragamus
jackdaniel: just remember when you play devil's advocate, you are merely saying what satan would say
7:49:31
jackdaniel
well, I like Common Lisp and I work with it a lot, but this language has serious flaws neverless, so I'm far from calling it panacea (and shy away from comparing with other languages)
7:50:24
jackdaniel
because such criticism would be very flawed unless I'm expert in *both* languages
7:50:55
jackdaniel
I can compare CL with C: both languages are different, have different purpose and are incomparable
7:52:29
ck_
Okay I disagree somewhat. Of course different languages have different paradigms and a direct comparison is not always fruitful. But to say you shouldn't compare anything at all between languages is throwing out the contents with the bathwater
7:53:16
jackdaniel
no, I'm just saying that it is too often seen that people compare A to B where they know only A in fact
7:54:34
aeth
jackdaniel: I think the library issue is just because of who's making the libraries for CL. Almost entirely amateur projects.
7:55:38
fragamus
I think non-lisp languages require one to inhale the syntax in order to properly step over it when meta-programming
7:59:36
LdBeth
Since there’s a lot of string rewrite based languages before or near when lisp invented
8:08:46
Godel[m]
LdBeth: Looks like SBCL does know how to dump structures without needing make-load-form iff the struct definition is evaluated before the call to dump it. I hadn't put the struct definition in eval-when.
9:51:40
Godel[m]
I just noticed, upon putting defuns inside `(eval-when (:compile-toplevel :load-toplevel :execute) ... )`, CCL doesn't compile those functions, and I get `Undefined Function` errors. SBCL works fine.
9:53:56
Godel[m]
(I mean, I get the errors from the toplevel (sly) not when I call them inside the file.)
9:55:48
beach
Godel[m]: The standard allows for the compilation environment to be different from the startup environment.
9:56:30
beach
So it is possible that CCL defines the function in the compilation environment and then discards that environment once the compilation is done.
9:58:12
beach
Because compiling a file should not have any side effects on the run-time environment.
9:59:34
Godel[m]
I have an asdf package, I compile it and switch to the package, should I expect the symbols in it to be loaded after compilation of all the files?
10:00:41
beach
OK, let's try some correct terminology. I take it you have an ASDF *system* (not a package), right?
10:02:44
beach
When the compiled files in the system are loaded, you will see all the side effects of all the top-level forms in the files.
10:03:41
beach
So the effect should be very closed to the effect you get if you LOAD all the source files.
10:08:49
beach
Any symbol without a package marker, or with an explicit package marker in any of the files will typically exist.
10:13:40
beach
Not sure about names of lexical variables in a system where the packages are created only in the compilation environment.
10:18:32
beach
Names of lexical variables that are not otherwise needed in the compiled code (like, say, for debugging purposes) are not necessarily present after the system has been loaded.
10:20:00
beach
Example: Put this in a file: (defun ff (xxx) (1+ xxx)) or something like that. Start SLIME. Type (proclaim '(optimize (debug 0) (speed 3))) and then (compile-file <name-of-lisp-file>).
10:20:30
beach
This is SBCL I am trying now, so now, restart your Common Lisp system by typing ,restart or something like that.
10:22:40
beach
However, since SBCL does not distinguish between the compilation environment and the startup environment, if you stay inside your running SBCL system, compiling the file will create the symbol XXX, simply because the file is being read by READ.