freenode/#lisp - IRC Chatlog
Search
10:44:26
shrdlu68
"Too long have I lived in the mountains, and too much have I listened to the streams and trees: now I talk to them as to goat-herds"
10:44:41
jackdaniel
ACTION notes (even if he already closed this window), that his point was the internal feeling of superiority of the speaker what is deterring, not language advocacy itself
10:46:45
shka
jackdaniel: well, your internal feelings may or may give some impression, you may be just misinterpreted as well, especially if you are not perfectly socially calibrated
10:47:58
fm4d_
Hi, could someone give me an advice how to create keyword symbols? For example I would like to convert '((test . 1) (test2 . 2)) into (:test 1 :test2 2). I've explored the symbol-making functions but none of them seems to be able to do this. Thanks :)
10:48:58
_death
fm4d: a keyword symbol is simply a symbol in the package named "KEYWORD".. intern takes a package designator
10:55:52
schweers
if you really want a symbol which has a lowercase name, you can say '|sym| or (lengthy) '\s\y\m
10:59:31
fm4d_
btw is it in accordance with clisp style to generate keyword symbols dynamically like that?
11:04:19
loke
the blang package name is equivalent to KEYWORD, so ::foo is equivalent to keyword::foo
11:04:50
loke
schweers: Also makes sense, since I can't think of any any actual use case for writing a keyword with doube :
12:38:48
xificurC
I'm running slime and compiling definitions with slime-compile-defun. Now I get a condition of "The value NIL is not of type STRING" but the top of the backtrace shows my function which doesn't even take strings. I guess something it passed nil to something else. Why can't I see the call beneath it? :(
12:58:46
beach
xificurC: Oh, it could be that your implementation is doing tail merging, so that the call below it disappears.
13:00:36
schweers
beach: how do you set optimization qualities in general? do you only set them in .sbclrc and never change them?
13:01:45
schweers
I was thinking I’d like to have rather aggressive optimizations for production, but not for debugging and/or testing. And I’m not sure how to properly do that
13:02:26
beach
Correct. At least not at that level. I design good data structures and algorithms instead.
13:04:25
schweers
random9899: do you recall in which chapter? I don’t have the dead tree version on me right now
13:07:14
schweers
hm, I guess in 7.7 Writing and Benchmarking Compilers. Not freely available. I hope I’ll remember to look at that tonight when I get home.
13:27:42
random9899
tho you also have to consider other stuff like some declarations getting only considered for compiled code etc....
13:28:48
random9899
and despite their name with progn, they use a (locally, cause progn does not accept declarations
13:32:28
random9899
ya with them schweers you can enable fast compilation at some point and go back to safe compilation at another point in your code....
13:34:27
random9899
but since it's a macro and macros are not guaranteed to be expanded before compilation, you'll really have to couple normal macro stuff (for runtime) with compiler-macro versions of those (for compile time)
13:34:38
schweers
uhh, I just realized something. If I say (declaim (optimize (debug 3))), does the effect it has stop at the end of the file I’m currently compiling/loading/executing?
13:35:08
schweers
It seems to me, the answer must be no, as there would otherwise be no point in putting such a form into .sbclrc
13:37:10
random9899
schweers afaik some stuff does not get effect at runtime, probably the compiler decides to ignore some settings
13:38:10
schweers
so (declaim (optimize (safety 3))) (locally (optimize (safety 0)) (defun really-well-tested ...)) (defun not-so-well-tested ...) does pretty much what I expect: set safety to 0 for WELL-TESTED, but back to 3 for the rest (i.e. NOT-SO-WELL-TESTED in this contrived example)
13:39:01
schweers
what is the benefit to running it at read time? As far as I remember DECLAIM has its effect at compile time, right?
13:40:05
random9899
naaaa, safety 3 is ok, but as long as you don't specify the other optimizations which are diagonally opposite to it you may not get what you expect
13:58:36
random9899
declaim has it's effect at compile-time only when the file-compiler (compile-file) is being used on a file containint that (declaim.....) form
13:58:58
random9899
If a use of this macro appears as a top level form in a file being processed by the file compiler, the proclamations are also made at compile-time. As with other defining macros, it is unspecified whether or not the compile-time side-effects of a declaim persist after the file has been compiled
14:02:41
random9899
declare expressions must appear as actual subexpressions of the form to which they refer -> i.e. not (declare (optimize bla bla bla)) but (declare (optimize (bla bla bla)))
14:12:01
random9899
Although the execution of a proclaim form has effects that might affect compilation, the compiler does not make any attempt to recognize and specially process proclaim forms. A proclamation such as the following, even if a top level form, does not have any effect until it is executed: (proclaim '(special *x*))
14:12:53
random9899
(eval-when (:execute :compile-toplevel :load-toplevel) (proclaim '(special *x*))) In most such cases, however, it is preferrable to use declaim for this purpose.
14:14:43
random9899
so declaim is almost like the above eval-when proclaim, only that you have to bear in mind that compile-time effects are still not guaranteed untile the file-compiler compiles some stuff....
14:14:59
random9899
and last but not least Since proclaim forms are ordinary function forms, macro forms can expand into them.
14:16:41
lukego
How does one troubleshoot ccl exiting with the message "double free or corruption (out)"? My lead is that it's happening when I create a bunch of threads and sockets.
14:18:30
random9899
SBCL is essentially a compiler-only implementation of Common Lisp. That is, for all but a few special cases, eval creates a lambda expression, calls compile on the lambda expression to create a compiled function, and then calls funcall on the resulting function object. A more traditional interpreter is also available on default builds; it is usually only called internally. This is explicitly allowed by the ANSI
14:18:30
random9899
standard, but leads to some oddities; e.g. at default settings, functionp and compiled-function-p are equivalent, and they collapse into the same function when SBCL is built without the interpreter
14:19:16
random9899
so it talks about runtime compilation not load-time compilation as would happen with compile-file
14:20:38
lukego
Yeah. I suppose that if this is heap corruption then gdb will probably wake up long after the real problem. But I might be lucky. Otherwise I can try to minimize the test case.
14:24:19
lukego
How many threads is "a lot" for ccl btw? is there some number at which there be dragons?
14:28:41
lukego
shka_: I see things like polling conditions at 1kHz and figure that's putting some pressure on the kernel
14:29:11
shka_
p_l: i have no idea, i just know that i didn't ran well back when i was still programming on windows
14:32:59
lukego
fe[nl]ix: Hm. I have 64GB ram on this machine and I don't think I'm bumping that limit, but good to keep in mind.
14:33:32
lukego
ccl isn't starting in gdb for me. Have to sort out some dependency. But meanwhile maybe I can strace/ltrace a little to check for allocation failures or the like.
14:33:33
random9899
The three big moments in a Lisp expression's life are read-time, compile-time, and runtime. Functions are in control at runtime. Macros give us a chance to perform transformations on programs at compile-time. ...read-macros... do their work at read-time.
14:33:33
random9899
Macros and read-macros see your program at different stages. Macros get hold of the program when it has already been parsed into Lisp objects by the reader, and read-macros operate on a program while it is still text. However, by invoking read on this text, a read-macro can, if it chooses, get parsed Lisp objects as well. Thus read-macros are at least as powerful as ordinary macros.
14:35:55
p_l
shka_: process/thread manipulation generally takes more time on NT, which is why threads & threadpools were advocated since beginning
14:36:13
random9899
https://www.reddit.com/r/lisp/comments/1xozx1/readtime_conditionalsevaluation_of_several/
14:40:57
random9899
welp, there was an ieee paper about the mathematical fatality of threading/concurrent
14:41:39
p_l
if one digs deep enough, windows first shows a message passing system between each process and kernel, and if you dig deeper you find undocumented support for ASTs
14:42:16
random9899
afaik there's not even 1 single time reference like 1 ns on what you can depend on with the current hw we have, it's all voltage dependent.... not ?
14:42:39
random9899
so what do you go for timing it well as threading programmers when you have to rely on such things ?
14:43:22
lukego
random9899: I usually use the RDTSC/RDTSCP instructions. Those are based on a reference clock that doesn't vary. at least on recent CPUs that support the relevant feature flag
14:45:35
beach
jmercouris: I am flattered of course. But I am thinking I would like for SICL to be slightly more advanced than it currently is.
14:50:00
random9899
On Windows platforms, Microsoft strongly discourages using the TSC for high-resolution timing for exactly these reasons, providing instead the Windows APIs QueryPerformanceCounter and QueryPerformanceFrequency.[2] On POSIX systems, a program can get similar function by reading the value of CLOCK_MONOTONIC clock using the clock_gettime function.[3]
14:50:53
random9899
Since the family 10h (Barcelona/Phenom), AMD chips feature a constant TSC, which can be driven either by the HyperTransport speed or the highest P state. A CPUID bit (Fn8000_0007:EDX_8) advertises this.
14:52:17
lukego
have to be careful though e.g. be prepared for different cores to have different epocs. but it's a low level feature :) and libc has slightly higher level things on top
14:53:25
random9899
There is no promise that the timestamp counters of multiple CPUs on a single motherboard will be synchronized. Therefore, a program can get reliable results only by limiting itself to run on one specific CPU. Even then, the CPU speed may change because of power-saving measures taken by the OS or BIOS, or the system may be hibernated and later resumed, resetting the TSC. In those latter cases, to stay relevant,
14:54:05
lukego
fe[nl]ix: True. Though I think all CPUs made in the last N years have the invariant TSC.
14:55:17
lukego
otherwise I believe glibc can give you a more consistent clock with nanosecond precision that is (safely) sourced from TSC under the hood.
14:57:41
lukego
fe[nl]ix: btw do you know how is iolib support on LispWorks and on Mac? (known to not work? or known that somebody does that? etc)
15:42:18
beach
Help me think this through, please: I would like to transform the dpANS TeX files to a bunch of files that I can compile with a single LaTeX command, say pdflatex.
15:42:28
beach
There are several obstacles. For one thing, the dpANS files do not use LaTeX, and a number of TeX macros basically emulate LaTeX macros in incompatible ways. For another, each chapter is meant to be compiled with TeX separately, so there are files that are included in each chapter file. Furthermore, there is a mixture of "semantic" macros and typesetting macros, and I would like to get rid of the typesetting macros without
15:42:28
beach
sacrificing the semantics macros. I would also like to replace the specific TeX macros that have counterparts in LaTeX.
15:42:40
beach
The purpose of the exercise is to obtain a maintainable LaTeX document with indexes, table of contents, cross references etc. This LaTeX document would be the basis for WSCL.
15:42:41
beach
I would then start modifying the text, probably putting original paragraphs in appendices and referring to them from the main text. But that's in the future. So how do I go about this in a way that does not introduce too many errors? I don't mind manual editing. It is not urgent.
17:39:44
random9899
The whole language always available. There is no real distinction between read-time, compile-time, and runtime. You can compile or run code while reading, read or run code while compiling, and read or compile code at runtime.
17:39:44
random9899
Running code at read-time lets users reprogram Lisp's syntax; running code at compile-time is the basis of macros; compiling at runtime is the basis of Lisp's use as an extension language in programs like Emacs; and reading at runtime enables programs to communicate using s-expressions, an idea recently reinvented as XML.
17:40:47
Bike
if you have a question you want answered or topic you would like to discuss, please use your own words
18:01:16
phoe
random9899: Graham has quite a lot of essays, they're a rather good reading as long as you take him with a pinch of salt
18:03:15
random9899
i put the quotes, well wrt to the confusion arising in people when talking about read-time, run-time and compile-time....like with schweers about his question about what a #.(declaim...) is different from a normal (declaim ..) etc....
18:06:14
jackdaniel
question: given cltl2 interface is implemented, how am I supposed that variable is unknown for my own declarations? example: (let ((x 3)) (declare (ignore y)) …) will issue a simple-warning
18:06:36
jackdaniel
I want to do the same in a function in cltl2:define-declaration, the thing is that lexical variables are note yet in the environment
18:07:23
jackdaniel
so variable-information will fail to find y even if it is there (let ((y bam)) (declare (phoe y)) …)
18:07:45
jackdaniel
phoe: lexical variables are not in the environment yet at the time of invoking declaration lambda function
18:08:50
phoe
like, hm - the list of new bindings from LET needs to be passed to the declaration function
18:08:52
jackdaniel
I know how to do it *using* compiler internals, because I'm already doing that, but not sure how to achive it simply using cltl2
18:13:22
phoe
This seems to be rather silly. Inside (let ((x 3)) ...), I would expect X to be lexically bound. Even inside a (declare ...) that might happen in there.
18:14:02
jackdaniel
declarations are processed at compilation time, there is nothing to be bound yet. only some information in lexenv may be present
18:15:24
jackdaniel
when you have flet, first you process definitions *then* you extend the environment
18:15:40
jackdaniel
when you have lable,s first you extend the environment and then you process definitions
18:16:43
Bike
declare isn't like a separate form or anything. it makes sense to think of (let ((y bam)) (declare (phoe y)) ...) as being like (let+ ((y bam phoe)) ...). there is probably no time at which the variable is bound but not typed as far as the environment is concerned.
18:17:11
Bike
in other words i don't understand what either of you are talking about. "declaration lambda function"?
18:19:12
Bike
cltl2 doesn't seem to specify what the environment is for or when the function is called.
18:20:30
Bike
I suppose you could say that the environment is first augmented with a lexical y, then that's passed to the define-declaration function, and then that's used to produce the actual environment used for processing the body.
18:21:04
Bike
in the case of (phoe y) as a free declaration, the environment passed to the declaration function would have y unbound, i.e. variable-information returns NIL.
18:21:19
jackdaniel
I'm asking, because I'm trying to figure what's the right thing to do (implementing cltl2 for ECL – first writing a test suite)
18:22:24
Bike
it's not so much a lack of implementation as it is bugginess. they're probably still in the tracker
18:22:47
Bike
https://bugs.launchpad.net/sbcl?field.searchtext=cltl2&search=Search&field.status%3Alist=NEW&field.status%3Alist=INCOMPLETE_WITH_RESPONSE&field.status%3Alist=INCOMPLETE_WITHOUT_RESPONSE&field.status%3Alist=CONFIRMED&field.status%3Alist=TRIAGED&field.status%3Alist=INPROGRESS&field.status%3Alist=FIXCOMMITTED&field.assignee=&field.bug_reporter=&field.omit_dupes=on&field.has_patch=&field.has_no_package=
18:24:10
Bike
the one i hit was 769592, which is that augment-environment signals stupid errors sometimes because it goes through internal compiler machinery that immediately signals when it hits inconsistencies, because they matter for compilation but not cltl2
18:24:53
Bike
i wrote a cltl2 wrapper library but didn't bother with it. and it has so many users! at least zero
18:25:15
Bike
if you do want to worry about it, i think what i described would be a reasonable way to do it
18:25:37
phoe
Bike: I would be worried if it had negative user count; knowing how much you deal with C++ it would likely mean an integer overflow
19:16:44
fiddlerwoaroof
But, I appreciate what it does, I've always been slightly annoyed about the duplication between the ASDF system's dependency lists and the defpackage forms
21:11:26
aeth
fiddlerwoaroof: It simplifies your definitions of external dependencies, but it doesn't simplify your definitions of internal dependencies that much because unless your project is flat, you are going to have to create a /foo.lisp for every /foo/ so you can just import my-project/foo instead of my-project/foo/bar