freenode/#lisp - IRC Chatlog
Search
17:40:41
mfiano
phoe: Did you figure out what you're going to do regarding the depressing situation?
17:44:19
phoe
the spec is owned by the community, ANSI CL is a derivative work of it, so is CLHS, so is Franz spec
17:46:53
phoe
it wasn't wrong, the copyright status of dpANS3 is highly dubious, because it's impossible to assert with 100% certainity that we get permission from *everyone* who participated in the discussion
17:46:57
mfiano
It mentioned something along the lines of dPANS never making it to the public domain, and explicit permission from the contributors must be obtained for derivative works.
17:49:24
phoe
the thing is that I think I can depend on kmp's intuition on the matter and go full "it's free real estate" on dpANS3
17:50:16
phoe
because the other option is literally writing a new specification from scratch that does not depend in *ANY* way on dpANS or ANSI CL
17:50:47
phoe
which will then be mistrusted, because it's not *the* spec or *the* standard that everyone's been following for decades.
17:51:31
mfiano
Not saying anyone would get sued, but if it does happen, that could be very damaging to a single user without the funds for a good lawyer.
17:51:50
jackdaniel
wasn't the last draft published precisely for sake of avoiding the copyright drama?
17:51:51
phoe
and anyway people will go "but what does The Spec™ say" which will cross-pollinate with the new document anyway, casting more legal shadow on the new spec anyway.
17:54:11
phoe
CLUS was originally an idea of reformatting the specification and integrating errata into it
17:54:13
mfiano
I believe phoe wants to separate the spec from the reference for CLUS, modernizing the spec with fancy HTML and fixups
17:54:55
phoe
the language reference is doable mostly from scratch, sure thing, but the spec is the spec
18:04:20
jackdaniel
I'd just take dpans3 and assume it is public domain, splitting a hair in four will lead you to nowhere
18:05:06
jackdaniel
if you are not going to commercialize it, then it may be even in fair use territory
18:05:16
mfiano
Regardless, I think one of the contributors would have sent a cease and desist letter at some point to the many distributors of the dpANS documents if it was indeed an issue.
18:58:07
aeth
imo CL21 failed because it (1) was too radical (and a lot of it looked different just for the sake of being different), (2) was one person's tastes (not really consensus-based afaik), (3) oversold itself ("the true successor"), and (4) probably was inefficient (actually making a new Lisp implementation/dialect would let it be efficient)
19:02:13
aeth
But a few reader macros aren't really good enough reasons to bring in something huge and partially nonidiomatic as a dependency like cl21 or rutils.
19:06:37
aeth
Don't underestimate the effect of #4 on adoption, either. I think a lot of people using CL in 2020 are using it over alternatives because it is (or at least can be) fast.
19:07:12
aeth
If you make it into just another scripting language with no concern for performance, it doesn't offer much over scripting languages with huge communities like Ruby or Python.
19:11:43
aeth
I think another thing new "standard libraries" in CL get wrong is that they do things backwards. They do the library and then expect applications to follow, rather than deriving the library based on what their applications actually need.
19:13:07
aeth
Standards should follow use, ideally quite a few different use cases from different parties.
19:13:35
phoe
there's this weird thing that modifying Common Lisp requires one to modify the standard
19:13:44
aeth
I could be wrong, but most of these "new standard library" libraries tend to just look at cool features from other languages to borrow/steal
19:15:59
aeth
e.g. I used to bring up short-float being too precise to use IEEE half-precision floating point as an example, but someone pointed out that the actual standard says "Recommended Minimum Floating-Point Precision and Exponent Size", so implementations actually can just use hardware short-float if they want and they're just lazy.
19:17:02
pve
I'm super guilty of "borrowing from other languages", but I believe I have realistic expectations regarding adoption
19:22:04
pve
i actually made a working hindley-milner implementation in CL, but never got around to polish it up
19:22:21
aeth
phoe: yeah, but (1) it's probably not compatible with the choices I had to make to make Scheme work on CL and (2) I'd rather do language integration at the ASDF level with different extensions than do the #lang foo thing.
19:23:18
pve
but that was a long time ago, then later decided to do smalltalk and it's looking much better
19:25:41
aeth
pve: well, it's not ready yet... but I will have it. https://gitlab.com/mbabich/airship-scheme
19:27:15
aeth
(1) I use %scheme-boolean:f, which is just a constant that evaluates to '%scheme-boolean:f, as the false value. Since in most CLs, NIL is just a symbol not treated specially, it shouldn't really hurt performance, but it separates nil from #f
19:28:14
aeth
(2) I invert case to maintain almost all compatibility in a case-sensitive language. Idiomatic CL is writing lower-case that gets automatically upcased, and idiomatic most-other-languages (that don't use camelCase at least) is just writing lower-case that is preserved as lower-case, so this is the easiest interop
19:29:39
aeth
(3) I'm going to have (iirc, I left it broken from a partial refactor a while back) a minimal "runtime" that guarantees tail recursion (with a trampoline) and continuations (transforming the Scheme via macro to continuation-passing-style). Any CL entry point will handle this, as well as turning #f into nil
19:30:17
aeth
(4) On the CL side, I have two macros, define-scheme-procedure and define-scheme-predicate, where the difference is that the latter turns NIL into #f (i.e. %scheme-boolean:f) while the former treats NIL as the empty list.
19:32:52
aeth
(5) Scheme libraries are going to define both an ASDF system and a package for that ASDF system. Since Scheme is a Lisp-1, imports will rebind in a top-level LET. The only issue I see with this is that the symbols in e.g. lists will be namespaced to where they were defined.
19:34:28
froggey
I'm curious, why a symbol for false instead of a more anonymous object? like (make-instance 'standard-object)
19:34:58
aeth
froggey: A symbol for false is exactly how CL implementations operate: a symbol for NIL, which is false (and the empty list) so it will basically behave identically.
19:36:41
aeth
Oh, and (5b) I Lisp-1-ified the DEFTYPE because defining a Scheme type also defines a predicate of the same name, and the names all end in ?. This is because portable Scheme is basically "predicately" typed, e.g. the pair? type, tested with the pair? predicate)
19:38:23
aeth
phoe: Portable Scheme doesn't really have a type system like CL's, it just provides a bunch of predicates to test for if something is of that type or not. So I could have called it something like pair or scheme-cons (or even just cl:cons, it's the same thing) and put it in the same type namespace as CL's, but I decided to call it pair?
19:41:18
aeth
That is, it generates (deftype pair? () 'cons) and I could even just do (defun pair? (obj) (typep obj 'pair?) but I made a special case for when a predicate already exists (i.e. CONSP) just in case that's a faster path in the CL compiler (and if the type winds up being a SATISFIES type, things might go exactly backwards).
19:43:33
aeth
And the Scheme itself will generate something (for now, not final) like (defun r7rs::pair? (continuation obj) (funcall continuation (pair? obj)))
19:44:51
aeth
phoe: There are basically three ways the types could work. One is a DEFTYPE with a generated TYPEP predicate, another is an efficient DEFTYPE with a built-in predicate (like CONSP) that should be identical, and the third way is a predicate that's efficient with a SATISFIES in the DEFTYPE.
19:46:37
aeth
I'm actually pretty happy of some workarounds I found to avoid SATISFY types where you think they'd be necessary. e.g. even though it looks like zero? is just an ordinary predicate and not a type one, I actually define an efficient type for it, at least afaik. (define-scheme-type* (zero?) zerop `(or (real 0 0) (complex (real 0 0))))
19:47:12
aeth
That is, zero? is the predicate ZEROP and the corresponding efficient type is the real from 0 to 0 inclusively or the complex with both parts from 0 to 0 inclusively.
19:48:17
phoe
"The imaginary part can be a float zero, but can never be a rational zero, for such a number is always represented by Common Lisp as a rational rather than a complex."
20:02:09
aeth
pve: I have an advantage in that I'm translating a small specified language into a similar large specified language.
20:03:48
aeth
I don't have to design and implement at the same time, I just have to implement, and it's mostly about solving the mismatches.
20:17:48
pve
aeth: I'm not tackling the smalltalk standard lib anytime soon.. currently I'm at "smalltalk syntax with CL machinery", so I basically wrapped many (most?) of the standard CL functions
20:28:39
pve
aeth: I'm going to upload the code to github soonish, but if you're interested, here are a couple of pictures I like to show people that hopefully give an idea of the current state:
20:31:39
pve
Just finished writing the indendation code for the emacs mode, which was much harder than I expected. I'm not ashamed to admit I spent waay to much time fiddling with it.
20:34:48
aeth
pve: So how do you get the interactive, image-based Smalltalk development environment that Smalltalk is famous for?
20:36:39
aeth
pve: I haven't done ASDF integration yet but I've probably lost a few days every now and then trying
20:38:37
aeth
it looks like you do everything in a [ ... ] reader macro, though, while I am trying for a slightly different technique, essentially trying to make the .scm files indistinguishable from ordinary Scheme files.
20:38:51
aeth
(and it has to have a custom reader, since there are minor points of syntactic incompatibility)
20:44:27
pve
I tried to make the asdf integration optional though, so an app/script is loadable without having to make an asd file
20:45:02
aeth
For me, ASDF integration is pretty mandatory afaik because that's the logical way to handle Scheme libraries, beyond just using packages.
20:56:35
pve
aeth: when you say "asdf integration" do you mean being able to do (asdf:load-system "my-scheme-lib")?
21:00:35
aeth
pve: maybe, but more importantly, actually handling the Scheme libraries as ASDF systems, e.g. https://gitlab.com/mbabich/airship-scheme/-/blob/master/scheme/base.sld
21:01:40
aeth
Notice how R7RS's define-library seems to cover both DEFPACKAGE and DEFSYSTEM in scope... In this case, (scheme base) could represent an underlying package scheme/base (or airship-scheme/scheme/base) and an underlying system airship-scheme/scheme/base
21:03:19
aeth
I could probably extend it to add declarations for description/version/author/maintainer/license/homepage/bug-tracker/source-control and make it map to DEFSYSTEM more clearly
21:03:39
aeth
It can also have (include "foo.scm") in the definition, which basically maps to :components
21:10:35
pve
i mean that with that code, the custom asdf components can be used in asd-files (in the second imgur picture, top right)
21:12:11
aeth
right, afaik, I would just have to parse (include "foo.scm") as defining a Scheme source file component, with the main complication being something like (include "bar/foo.scm") and other than that, everything cleanly maps either to DEFSYSTEM or DEFPACKAGE
21:16:15
aeth
The hard part might be getting Quicklisp to detect them as systems without (1) being a top-level .ASD file and (2) being a .ASD file at all, but package-inferred-system exists as a thing that creates an ASDF "sub"system for each file and it works fine, so there's probably a way to do it from the top level .ASD file
21:17:55
aeth
I've always seen it as defining a new thing... "module" or something? For each subdirectory.
21:18:34
aeth
it definitely does something fancy when package-inferred-system is being used, though, since it's all... inferred from names that match the paths
21:19:23
aeth
yeah, sorry for being unclear, I mean, I've never seen (:file "bar/foo") I've always seen it as defining something for "bar" and then putting "foo" under it
21:23:00
pve
yeah, usually the :module component is used when you have a subdirectory containing some code
21:26:59
pve
but did you know that asdf automagically looks for the definition of teh system foo/bar in foo.asd?
21:28:07
phoe
wait a second - in ASDF, (:file "foo/bar/baz/quux") means quux.lisp in a directory subtree foo/bar/baz/
21:37:54
aeth
pve: well, not quite, since that's one-system-and-package-per-file, while Scheme's library system is closer to "normal" CL, where you have a separate file listing all of the files to include
23:15:37
Fare
If sharks^WIP lawyers smell enough money to go after a new CL standard, we've already won.
23:16:23
Fare
At best they'll get us to rename the project and do a clean room rewrite. But they only would do that if there's a big enough community for the thing to matter.