freenode/#lisp - IRC Chatlog
Search
22:26:50
mfiano
Minimum reproducible error: (compile nil (lambda () #.(sb-kernel:make-single-float -1)))
22:41:47
mfiano
Wasn't me this time. I did find about a dozen SBCL bugs over the last few weeks that have all been fixed, but not this one
23:07:34
thmprover
Is there a way to verify `double-float` is in fact IEEE 754 double precision (since the CL standard doesn't require it)?
23:10:23
aeth
there's an :IEEE-FLOATING-POINT in *features* but they might not all have that because I don't think that's standard
23:12:42
thmprover
I'd prefer to have an error raised if the CL implementation does not support IEEE 754, so the user would know and be sufficiently alarmed/informed.
23:13:03
aeth
thmprover: based on the implementation support of float-features, IEEE is pretty much guaranteed to be present on any living implementation unless you stretch the definition of "living" to include CLISP. https://github.com/Shinmera/float-features
23:13:36
mfiano
If present, indicates that the implementation purports to conform to the requirements of IEEE Standard for Binary Floating-Point Arithmetic.
23:14:24
aeth
Airship Scheme does #+(or ccl ieee-floating-point) and probably will have to for some time even if CCL adds it to *features*.
23:14:33
thmprover
aeth: I hoped that most modern Lisp implementations support it, but I am doing numerical analysis, so I want to be *certain*.
23:15:50
phoe
escalate to the maintainers and tell them to fix their stuff up. we've been in this ground multiple times now, and local nicknames exist nowadays.
23:16:12
aeth
frodef: And the pile of things that it's missing because of that is climbing, e.g. package local nicknames
23:16:14
thmprover
aeth: good to know about the package; but you mean, I should wrap all floating point computation in a `(with-float-traps-masked ...)`?
23:17:13
aeth
mfiano: Plenty of alive software hasn't made a release in 10 years. However, Common Lisp gets this ecosystem stability because it shifts the burden of a lot of bitrot onto the implementations, which must continue to add things over time.
23:17:39
aeth
mfiano: Sure, portable CL will continue to run in CLISP as long as it remains ANSI compliant with no compliance bugs (which undoubtably exist in every implementation)
23:17:57
aeth
mfiano: But most nontrivial CL uses some nonportable code, either as extensions or libraries.
23:18:38
aeth
e.g. If you use package local nicknames, you can't say that CLISP is living because you're actively working to break large parts of the Quicklisp ecosystem in CLISP.
23:18:55
aeth
That's just the most popular one, there's lots of other assumptions people make that don't work on CLISP.
23:19:12
mfiano
One can use defpackage-plus to gracefully fall back to global nicknames if you need to test your code on CCL
23:20:02
aeth
float-features is another one. Most numerical code should have with-float-traps-masked, and maybe you can have a fallback for implementations that float-features doesn't support, but if you're using it, you might also want to be able to deal with infinities and NaNs
23:20:08
mfiano
I try not to use implementation features apart from PLN because I value portability, and it took a look time before I accepted I would like to use PLN because of this
23:21:56
aeth
I don't test in or support CLISP anymore because enough of my dependencies are broken in it these days that it's not worth the effort to figure out exactly what subset I can test in it.
23:23:52
aeth
The worst dependency of mine is probably cl-sdl2, which I need to replace at some point. I tested it in Roswell a while back and it only ran in SBCL, CCL, and ECL.
23:24:37
mfiano
It wraps float trapping around every call, and on the way out in unwind-protect, which accounted for about 30% of the runtime last time I made a flamegraph
23:29:28
mfiano
One can push a feature, but a large number of shader programs would fail to link on Intel/Mesa.
23:30:18
mfiano
Here is a flamegraph view of one draw call for example. Look at that that time spent: https://i.lisp.cl/JmiUBd.png
23:38:26
mfiano
Xach: curious, I recall recently you did some image thing with an octree. Did you write the octree yourself, or use some library?
1:03:21
moon-child
is there a version of mapcar which errors if the lists it applies to aren't the same length?
1:19:12
no-defun-allowed
You iterate over all the lists, then instead of terminating when one is '(), you check if all are '(), and if not, then you signal an error.
1:20:26
aeth
Fortunately, at least one log bot was on the "correct" side of the netsplit for anyone else who was confused
1:20:43
aeth
The rest of us were wondering what these answers had to do with the package system. :-)
1:21:49
aeth
frodef: There are some low-hanging fruits in package features, including hierarchical and versioned, although you can sort of fake the former with reexporting symbols and you can definitely do the latter manually (although only Alexandria does this afaik).
1:22:05
aeth
frodef: But the solutions would be controversial so it would take a lot to get anything.
1:23:08
frodef
aeth: The problem with CL is, it was so good back in 1990 that it's still "good enough" :-)
1:27:41
aeth
frodef: No, it's more like... how many > 100 kloc projects are there written in CL that aren't CL compilers?
1:28:22
aeth
And compilers can just add whatever internals they want, so they're not really having to deal with mostly-portable CL.
1:29:33
frodef
aeth: I tend to disagree, I suspect the lack of a global "module" system/architecture is holding CL back.
1:30:24
no-defun-allowed
How do you handle having version X for one package, and version Y for another?
1:31:31
no-defun-allowed
You might put versions in the package "names" or something, so they don't collide. But then would FIND-SYMBOL take a versioned name? These things seem hard with packages as bundles of sybmols.
1:32:13
aeth
The new version just inherits from the old one for the most part. Sometimes removing, but mostly adding.
1:32:39
no-defun-allowed
I think first class global environments, specifically sticking each module in a FCGE with its dependencies, is a good idea, but then you have edge cases like one module returning a FOO:B that's different to another module removing FOO:B, cause they came from different package objects.
1:33:24
no-defun-allowed
So you might want to have package objects collude to not create duplicate symbol objects somehow, I dunno.
1:34:25
aeth
no-defun-allowed: Versioned packages are way simpler than FCGE, though. Essentially you want to inherit symbols in a new package from an old one (several libraries do this, including UIOP and defpackage-plus afaik)
1:34:38
White_Flame
PLN would allow you to have package foo-3.5: and package foo-3.6: simultaneously, but I think those canonical package versions are better handled in the .asd file than scattered around the source's defpackages & imports
1:34:48
no-defun-allowed
Gnuxie tells me that in Self and Newspeak, module imports are just assignments to slots, so you can provide whatever objects you want. But packages, querying the environment for packages, and all that introspective stuff makes it harder.
1:35:15
aeth
no-defun-allowed: Except, sometimes, you want to do one of three things: (1) remove a symbol (something deprecated got removed from the API), (2) add a symbol (by far the most common and totally safe), (3) replace a symbol (because foo.1:barfoo and foo.2:barfoo have two different implementations so they refer to two different functions)
1:35:38
no-defun-allowed
Yeah, that much could be done with diffs. That'd handle deduping symbol objects across package versions.
1:37:12
aeth
To complicate things a bit, you'd want one of the symbol conflict resolution options to be "don't use the latest, use this specific version instead"
1:37:43
aeth
So if you USE my-package and it stops working because of a symbol conflict (and, yeah, USE is bad in general), then you can just use my-package.2 or whatever.
1:41:58
fiddlerwoaroof
Personally, I tend to distinguish "code that I might eventually put into quicklisp" from "application code"
1:42:17
fiddlerwoaroof
And only use implementation-specific features in the latter sorts of projects
3:35:07
mfiano
https://common-lisp.net/project/asdf/asdf/The-package_002dinferred_002dsystem-extension.html
6:13:09
beach
frodef: See http://metamodular.com/SICL/environments.pdf for a description of first-class global environments.
6:13:14
troydm
okey this might sound like a dumb question but it seems that there are two local-projects directories when using roswell
6:20:15
troydm
it seems like top level local-projects directory is not part of ql:*local-project-directories*
6:26:27
troydm
or rather roswell adds ~/.roswell/local-projects to ASDF registry but not ql:*local-project-directories*
6:32:34
troydm
moon-child: I do use slime, but sometimes I start repl just to quickly check something
6:53:06
fiddlerwoaroof
Tab complete for symbols and M-i for documenting the current symbol is pretty handy
6:54:15
fiddlerwoaroof
As for "why": I occasionally use lisp on servers where I don't have emacs installed
6:54:52
fiddlerwoaroof
And, if I'm already doing stuff at the shell, sometimes it's easier just to use the REPL in the context of my current session rather than context-switching into emacs
7:01:22
no-defun-allowed
Although a touch convoluted, you could start SWANK on the server, then use SSH to port forward and M-x slime-connect to that.
10:05:43
sauvin
in sbcl, I'm suddenly getting hit with an "undefined variable" error or warning when I try (setq a '(1 2 3 4 5)). What could be wrong?
10:06:35
phoe
define your variables before setting them - globals via DEFVAR or DEFPARAMETER, locals via LET or LET* or the other utilities for binding
10:07:25
sauvin
Yeah, well, folks in this channel about 24 hours ago told me about that, which is why I'm asking. Worked in gcl, ain't working in sbcl, wtf!?
10:10:02
phoe
it's a good thing on one hand, and on the other, it has caused a fair share of breakages in libraries that were working before but then SBCL found ANSI CL conformance bugs in them
10:11:40
sauvin
Well, see, this was one of the reasons the folks here gave yesterday for me to move to sbcl: more conformant to the standard.
10:13:12
phoe
the question with SETQ on symbols always is: where is this particular symbol defined to be a variable?
10:13:37
beach
sauvin: It's kind of the other way around. It "works" in SBCL, since it signals a warning, and it does not "work" in GCL because it lets a detectable undefined situation pass silently.
10:17:34
sauvin
Because I don't understand it. I'm just now learning how to assign variables in lisp, and it's a lot more complex than in perl, and it's more complex than in the AutoLISP that I used to use heavily but haven't seen in twenty years.
10:18:12
no-defun-allowed
You are going to understand it even less, if you attempt to intentionally break it.
10:18:30
sauvin
So, anyway, let works at the top level. I'm a big fan of lexical variables anyway. I avoid globals wherever I can.
10:18:41
beach
sauvin: How is (setq <variable> <value-form>) more complex than <variable> = <value-form>?
10:19:39
no-defun-allowed
You are not breaking anything with LET. You're also not really breaking things with SETQ on undefined variables on its own, but attempting to dispose of the warnings your implementation makes for using SETQ in that way is breaking it.
10:19:59
no-defun-allowed
my $thing = ... would be like wrapping the rest of the body in (let ((thing ...)) ...)
10:20:20
phoe
declaring local variables in Lisp is done via LET and LET* and some other similar operators
10:21:16
no-defun-allowed
However, note that DEFVAR and DEFPARAMETER are always used to declare special variables, which are dynamically scoped. I think Perl is another one of the few languages with dynamically scoped variables.
10:22:03
no-defun-allowed
Yes, DEFUN, DEFPARAMETER and DEFVAR usually don't do what you want them to do, if you put them inside a function body.
10:22:08
sauvin
perl DOES have dynamically scoped variables, but there are very few circumstances under which their use encouraged.
10:22:49
no-defun-allowed
That is not so far off in Lisp; you use lexically scoped variables by default, but dynamic scoping is useful for cross-cutting "customization" of things.
10:23:21
sauvin
Yes, and i perl, I'd have to have some pretty convincing reason to use 'local', which means 'dynamic'.