freenode/lisp - IRC Chatlog
Search
18:06:14
phoe_
I just deleted CL-YESQL from ~/quicklisp/local-projects because it is now available in Quicklisp. How can I tell Quicklisp, or ASDF, that it should fetch the project from Quicklisp instead of looking for it in local-projects, without restarting the Lisp image?
18:06:50
flip214
phoe_: IIRC quicklisp will see automatically that the ASD is gone, and re-fetch as necessary.
18:08:26
phoe_
flip214: it's on a remote machine and has some precious state that I don't really feel like losing right now.
18:09:06
flip214
phoe_: well, a quick way might be to start _another_ lisp, do the (ql:quickload ...) there
18:32:35
Xach
phoe_: sorry not to answer sooner. (asdf:clear-system ...) would probably have done the trick.
19:02:46
davide89v
okok but clisp is still in use? because i've seen the development is stopped at the year 2010
19:03:58
White_Flame
it apparently has a very fast bignum library, and it tends to be compilable on many odd varieties of systems starting from just a C compiler
19:04:41
phoe_
And also, it is an interpreted implementation, by default. So it does not have any compilation overhead, which is good for scripts. This, and its portability like White_Flame mentioned.
19:06:59
White_Flame
although the repos always have an older version, but just 1.3.1 vs 1.3.19 claimed here
19:08:23
koenig
As in, I'd like to use it to "script" my C/C++ code vs. something like TCL or Python.
19:09:58
White_Flame
davide89v: the preferred development environment is Emacs + SLIME (connector between emacs & a running lisp), which provides a lot of really good interactivity
19:11:42
minion
davide89v: please look at pcl: pcl-book: "Practical Common Lisp", an introduction to Common Lisp by Peter Seibel, available at http://www.gigamonkeys.com/book/ and in dead-tree form from Apress (as of 11 April 2005).
19:12:15
White_Flame
davide89v: google brings me to this cheat sheet: http://pchristensen.com/wp-content/uploads/2008/02/slimecommands.pdf
19:21:00
flip214
davide89v: depending on how much effort you already spent with vim, you could also try vim+slimv. that's similar (albeit not as good) to emacs+slime.
19:21:46
flip214
shka_: I tried 4 or 5 times to install evil from tutorials, and failed every time ;/
19:22:42
flip214
davide89v: perhaps https://shinmera.github.io/portacle/ might be an idea worth looking into.
19:23:49
shka_
davide89v: well, as i said, my main argument is that slime and emacs are trivial to setup with roswell
19:23:54
phoe_
I actually dared to install Atom and check its slime-atom plugin, but gosh, it's still in its early stages.
19:28:46
flip214
davide89v: just stick with sbcl right now; you'll most probably have a package for that in your linux distribution anyway.
19:33:52
phoe_
now it's a crazy niche language of people with grey beards who eat parens on breakfast.
19:35:23
oleo
i downloaded it once but didn't use it much.....haven't looked in the docs or readme either....
19:42:11
flip214
for graphic capabilities, write logo or postscript. the latter has quite a few bits to teach, even.
19:45:40
flip214
well, it's a stack-based language. if you didn't learn one of these before, it'll teach you new things.
19:48:46
rpg
somehow I thought this was in Alexandria, but it seems not (although I may have an old copy)
20:04:18
White_Flame
rpg: I've written an entire suite of recursive traversal/search stuff, and there ends up being so much variation that I can see why alexandria doesn't include it
20:05:33
White_Flame
the "deepness" depends on if it'll traverse through arrays, hashtables, object slots, etc
20:05:42
phoe_
(traverse foo as tree of conses for bar if (eq (car bar) 'x) replace bar with (list 1 2 3 4))
20:05:50
rpg
The test first has to decide what kind of tree nodes are interesting (e.g., symbols), and then do the real test, and doing that while in subst-if seems to work nicely
20:06:54
phoe_
(traverse foo as 3D array of structs foo-struct for bar if (foo-struct-baz bar) do (setf (foo-struct-baz bar) 42))
20:54:32
Grue`
it's LET (useful) + BLOCK (useful) + TAGBODY (occasionally useful) in one single macro
20:57:40
Grue`
phoe_: by the same logic, I should macroexpand every macro in my code so it's more readable
20:59:56
aeth
phoe_: If you judge languages by ability to self-implode just (declaim (optimize (speed 3) (safety 0))) and you will have a language almost as powerful as C... not quite, GC still prevents a lot.
21:00:55
phoe_
aeth: I know, I know. Except I can't (declaim (optimize (safety 3))) in C, even if I wished.
21:01:45
phoe_
oleo: there's no portable way of doing this, and it's always dangerous because you never know when GC is going to *need* to kick in, e.g. when you run out of heap.
21:01:47
Bike
i think you could just as well use handler-case for stream-error and not do a goto, but then you have both handler-bind and handler-case, so meh
21:02:58
Bike
aircraft also have a nice process where "user error" is expanded into "okay, what can we do to make users not do this in the future" which is pretty alien to programming
21:03:58
aeth
phoe_: I'd much rather have a non-GCed CL-like Lisp if I had to write code for C's niche. I don't need high-level syntax in a not-very-high-level language. Syntax gets in the way.
21:05:23
aeth
Every language wants to look like math, but (1) math is a 2D language with rich symbols and (2) math is kind of ambiguous (e.g. what is tau or k or p or u? depends)
21:07:07
phoe_
When I call a DEFUN, how does an implementation know if the function is redefined with another version?
21:07:43
phoe_
If I C-c C-c a DEFUN form a few times, there is no remark from the implementation that I'm redefining something, but if I change a thing in the form and then hit C-c C-c, SLIME tells me there's a warning because I'm redefining a function.
21:08:15
Bike
it looks up the function from the symbol at runtime. it doesn't have to do anything special
21:09:27
aeth
phoe_: The problem is that a good static Lisp probably needs integration with at least one CL implementation to be more useful than C.
21:10:14
aeth
An alternative would probably be to make type declarations, structs, etc., more powerful and have a way to do no-gc like in D.
21:10:19
phoe_
aeth: what kind of integration do you mean? And where do you set the boundary of what is GCed and what is not GCed?
21:12:12
phoe_
I bet that if there's a stop-the-world GC, then all threads must be stopped nonetheless - if non-GC code accesses GCable data, which I bet is possible
21:12:14
aeth
I am not sure about all of the details of D, it's further down my list because it's fairly obscure.
21:12:41
White_Flame
phoe_: if all memory accesses use read barriers, then you can let them run concurrently
21:13:24
aeth
I suspect a (declaim (gc 0)) would be hard to do in CL, and might need a revision to the spec
21:14:22
Bike
the spec wouldn't have to be changed, since it only defines like two things remotely related to memory anyway, and none of them are a garbage collector
21:15:58
phoe_
aeth: what would a (declaim (gc 0)) mean in practice? that all variables now need to be stack-allocated?
21:16:23
aeth
phoe_: yeah, basically dynamic extent either works or it errors rather than compile afaik
21:16:36
whoman
i have never seen the term "meta" used to hint or imply off topic things. also whats going on seems quite on-topic. i fail to see the logic.
21:18:04
phoe_
aeth: I bet you can tell SBCL to disassemble the code it compiles and err out the moment it finds any allocation.
21:18:23
Bike
phoe_: not really. nyef's mentioned the possibility a few times, but it's not trivial.
21:18:53
Bike
aeth: that's more like, "we don't use heap allocation, so you might as well just turn off gc" isn't it
21:19:24
aeth
phoe_: You need to make sure that most of the standard is usable no-gc and many popular libraries, and you'd probably need to extend structs to make them less painful
21:19:27
Bike
phoe_: dunno. finding the full set of operators that allocates. deciding whether something that /can/ allocate actuallyw ill. probably.
21:20:01
phoe_
actually rewriting the standard library is going to be terrible since most of it is written in CL
21:20:08
Bike
since your code calls other code, and that other code is not compiled with such settings.
21:20:46
phoe_
unless you feel like maintaining two versions of the static library: one that conses and one that does not.
21:21:51
phoe_
Bike: I bet you will want the compiler to err out if you e.g. use MAPCAR inside (gc 0).
21:23:14
phoe_
yes, but you won't be able to stack allocate the whole list if you don't know the list's length.
21:23:42
Bike
sure, so you just take the minimum of all the lists and allocate that. or you just cons on the stack as you go. it's doable.
21:23:59
aeth
phoe_: (map 'foo #'+ foo-1 foo-2) might stack allocate if foo is a sequence type of known length
21:24:48
aeth
Most maps in SBCL will allocate, though... the lambda (or the curry if you use that from alexandria)
21:27:24
aeth
Well if you define the lambda separately and then (declare (dynamic-extent my-lambda)) it might work properly in the map?
21:30:54
aeth
I suspect that #'+ uses a special optimization in map, though. I can't write by hand code as efficient as produced by (map 'foo #'+ foo-1 foo-2) in SBCL's disassembly
21:34:52
White_Flame
if you used a literal lambda expression in there, I presume it would attempt to inline it as well
21:50:31
aeth
(deftype foo () `(simple-array single-float (2))) (defun test (u v) (declare (foo u v)) (map 'foo #'+ u v)) (defun test-2 (u v) (declare (foo u v)) (map 'foo (lambda (x y) (+ x y 2)) u v))
21:50:35
aeth
Now e.g. (let ((u (make-array 2 :element-type 'single-float :initial-element 2f0)) (v (make-array 2 :element-type 'single-float :initial-element 42f0))) (list (test u v) (test-2 u v)))
21:53:53
aeth
It looks like test-2, even when optimizing for speed, does inline the function (if that's what "; #<FUNCTION (LAMBDA" is in the comments of the disassembly?)
21:55:06
aeth
I suspect test-2 isn't that much more efficient than this: (defun test-3 (u v l) (declare (foo u v) (function l)) (map 'foo l u v)) when you do e.g. (test-3 u v (lambda (x y) (- x y 10)))
21:59:25
aeth
Hmm, so I guess one issue is that curry is in alexandria and not the core language. If curry was built into SBCL, couldn't it special case things like this? (map 'foo (curry #'+ 2) v)
22:02:14
pjb
aeth: (shadow 'map) (defun map (&rest args) (apply (function cl:map) args)) (define-compiler-macro map (…) …) and you can special case map curry yourself!
22:02:35
aeth
Hmm... If done that way, could it then handle (alexandria:curry #'+ 2f0) efficiently, even though curry itself is defined in alexandria?
22:02:53
aeth
And I'm not sure how it handles special cases, if it's not sufficiently generic, it'd be... painful
22:03:52
aeth
Actually, the specific example of (map 'foo #'+ u v) is better than any code I could write myself when I last tried.
22:12:45
Bike
i think map in sbcl has a source transform or whatnot so that it's usually inlined into something.
22:16:44
Bike
https://github.com/sbcl/sbcl/blob/master/src/compiler/seqtran.lisp#L133-L179 here's the one for map.
22:18:56
Bike
for any call to map you can usually resolve the result type at compile time. and if it's a fixed (map ...) call rather than apply, you can expand into a loop in place.
23:37:40
whoman
is common-lisp.net highlighting all code example blocks so fancily, or is it just me ??
0:08:37
whoman
i am suspecting that some parts of mcclim use SB-GRAY:* and other parts using TRIVIAL-GRAY-STREAMS:*
1:03:16
slyrus
whoman: there's only one usage of sb-gray in McCLIM AFAICT, and that's sb-gray:stream-line-length in Core/clim-basic/encapsulate.lisp
1:05:31
slyrus
I don't see any goatee stuff in current McCLIM. Maybe you have an old one lying around some where?
1:05:50
whoman
strange, really? 1: ((LAMBDA NIL :IN "/usr/share/common-lisp/source/mcclim/Goatee/conditions.lisp"))
1:06:44
whoman
i think this is part of a debian package (new system here), not sure why it would be present
1:15:26
whoman
okay, thank you =) i am there but wasnt sure about activity level. also yes i have been thinking to help with mcclim a lot lately, ive seen the bounties, and i dont have especially positive feelings for software these days except lisp stuff (my previous and currently idle passion was nextstep/openstep/smalltalk)
1:21:34
trn
Oh... In case anyone wants to play with it, I have a public-access Multics system up I'm seriously trying to run somewhat peofessionally, and it has the last Maclisp on there and working, if anyone wants to play with it.
1:29:35
trn
But if you want to avoid learning how to admin a Multics site I vow to keep this up and do the hard work :)
1:30:29
trn
I'm just not as much into Lisp as I should be I Emacs is sort of insufferable to me (heretical, I know).
1:31:17
White_Flame
I think there's a lot of people here who merely endure emacs, because it's the best way to Lisp
1:31:46
whoman
im going to try myself some climacs in a few moments; been digging into the lisp history still for the last couple months on and off. i want to see modern/mobile touch CLIM hmm
1:34:09
whoman
not sure how to say that. but i am imagining another way to work with the alphabet and parens.
1:36:50
trn
I'll make a web interface for automatic accounts once I decide how that won't be abused/abusable.
1:38:08
whoman
i cant be sure myself just yet, going to learn up on multics on the web while i make supper for a little bit as i poke around if that is cool
1:39:12
trn
No problem, the guest account besides not being able to send messages or mail and no persistent aren't otherwise limited
1:42:42
pjb
Of course, first thing I tried and failed was (list (lisp-implementation-type) (lisp-implementation-version)) :-)
1:43:14
trn
I've mainly been trying to play with their PL/I and almost have a working Gopher server for it
1:44:27
trn
Heh, the lcp here comes from the Bull release not MIT - I will surely look to see if there is a later lcp there.
1:45:03
trn
There were a few different source releases of MR12.x with various additions that found their way out over the years.
1:48:03
trn
Yeah. It's essentially going to be a hack since there isn't native TCP on it, so I'm abusing a serial line.
1:50:07
trn
mainly just to return who -a -long and similar status messages and maybe offer an interactive/browsable help interface
1:54:38
trn
I do not know enough about the system yet to know if wdc/video system has any decent frontend like curses or vms SMG$
1:56:17
trn
Like I said before, I'm an old user but a new admin - and I didn't get free access to play with whatever I to in the past either
2:01:02
aeth
My personal opinion on emacs is that I don't like (GNU) emacs... I just don't like the other options even more.
2:01:58
trn
whoman: Oh - I tried to update the "cost" accounting to print a true cost and ended up getting divisions by zero because there isn't enough precision to show low cost charges :)
2:02:08
whoman
the mac-only (clozure?) seemed alright. the rest look like basic windows95 file manager apps
2:04:12
aeth
e.g. CL, Scheme, Clojure, etc., all have SLIME-like environments (I'm counting SLIME as a SLIME-like environment!) but I don't think elisp does!
2:07:11
trn
I never liked any of them tho. I started on DEC so went from EDI to EDT to LSE and then switched from LSE to vim, mainly to have the same editor on VMS, OS/2,
2:07:21
aeth
Whatever replaces Emacs probably will have to have Emacs keys. Too many Lispers built muscle memory that way (unless they use one of several vi-style emacs packages). That will probably be its lasting legacy, even if people eventually move away from it.
2:09:25
trn
Like, I had it setup for my shell and I read mail and IRC'd with it. I've since been cured.
2:09:42
whoman
these days elisp is quite nice. we just got tagged records/structs, threading/concurrency, dynamic modules (.dll/.so), and what else.. oh lexical binding
2:10:21
aeth
I use many features in CL that few if any other Lisps have. That's probably why I use CL in the first place.
2:10:54
whoman
elisp has most of those features also. i assume it wouldnt be as fast or as spec-conforming
2:11:38
aeth
Well, yes, that's the thing, I use the features to be fast. If I just write the same things in elisp, not only will they be slower, they won't even be the fastest way to do the equivalent thing in elisp.
2:11:39
whoman
for most of the code i have been starting out to write (lisp newbie), can be done in both elisp and common... but two things bug me so i havent hard-decided on which one to persue completely
2:12:03
trn
I mainly use sbcl when I'm playing with Lisp, but I'm lurking around the Clasp guys as well and watching their progress.
2:12:48
whoman
i like the idea of clasp and ecl. but also i ran REmacs yesterday and its a lot faster than normal Emacs
2:15:01
whoman
i was on a clojure kick for a while. but havent had a system with enough memory since then.
2:15:13
trn
Well, thats *your* 3 seconds but you likely wasted lots of "system" time listing and editing and serial line banging :)
2:16:21
z3t0
I am parsing some markdown files and am wondering which would be the better way to work with the data
2:16:44
z3t0
A stream will be used to read the data to begin with, but should i just convert it to a string before working with it?
2:17:26
whoman
z3t0, ironically, there is a bunch of nice elisp code that does a lot of markdown stuff. just use some of that =)
2:18:19
aeth
My main language before CL was Python. I love SBCL because my intuition is about 10x slower than what the result is in SBCL. And then add another 1.5x speedup from a CPU upgrade since those days. All while using a language that's arguably higher level than Python.
2:18:44
aeth
Python vs. SBCL is the difference between a slow interpreter and an average compiler, but it's a huge difference.
2:19:57
whoman
i grew up on C and fell in love with objc/openstep/nextstep/smalltalk/gnustep, got lost in opengl and web stuff, had a passionate affair with haskell, and then wanted to find some clojure/clozure/closure to all the adventures
2:20:27
trn
whoman: http://www.alsoftiphone.com/iCAS/ and http://www.reduce-algebra.com/obtaining.php - so - apparently not
2:21:29
aeth
whoman: Here's some micro-benchmarks, which obviously aren't everything, but they do put SBCL in the class of fast languages rather than the slow ones. https://benchmarksgame.alioth.debian.org/u64q/which-programs-are-fastest.html
2:22:13
aeth
And even if they are everything, taking a 5x slowdown over C to use SBCL seems more worth it (especially with today's computers) rather than e.g. a 10x to 300x slowdown.
2:24:20
aeth
Let's assume SBCL is actually, 100% verifiably 4x (not 5x, I was reading the graph wrong) slower than C... that's not that bad. And it also means that there's plenty of room for even a 2x speed improvement in the future.
2:24:36
whoman
not it itself, more the community and all the places it is and roles it plays. like respecting a prostitute or fast food chain i guess.
2:25:08
trn
ACTION starts antipa - anti-python-action. We'll start some small riots and wave "TREAD ON ME. NOW" flags and demand an end to the tyranical and dehumanizing practices of enforced whitespace and syntax.
2:25:23
aeth
Starting with Python isn't the worst, there can be worse, e.g. starting with JavaScript.
2:26:32
whoman
aeth, with how beginning english-users cant write in straight lines? i dont think the whitespace is so good for that =)
2:28:30
trn
aeth: BLISS isn't as bad as it looks at first however. Neither is COBOL for all the whining that has evoked. These people have clearly never been exposed to DIBOL or IBM RPG, for example.
2:29:15
aeth
trn: Well, afaik, a lot of those languages aren't supposed to be general purpose languages. e.g. COBOL is probably best compared to SQL afaik. And you wouldn't write an RPG in RPG.
2:34:09
whoman
i think the only 'whitespace' i can handle is haskell, but there is where i love the WS a lot
2:35:25
whoman
writing blender plugin about ~1000loc, it was easy to do quick edits and random scrap kind of programming, just like web stuff. so i am mostly neutral to actually working with it
2:36:17
whoman
i really liked C/c++/objc a lot, so i dont mind javascript and rust at all. nothing else like that though (D, C#, lua, blah blah..)
2:36:54
whoman
one withstanding issue about rust apparently is compile speed. but community is large with heavy momentum
2:37:23
aeth
(Although maybe not a very major deal breaker. Some people use CCL because they can't tolerate SBCL's compile speed.)
2:37:59
whoman
sbcl compiles really fast for me here, i think its really the compiler prints that slow it down
2:38:17
aeth
whoman: I can't personally stand C++, it's basically the JavaScript of things that need to be extremely fast.
2:38:28
whoman
(like most things.) but there was one thing that took a long time to compile, i forget which package it was
2:38:30
aeth
i.e. Throw every feature together and have terrible decisions for backwards compatibility.
2:39:20
trn
If anyone wants accounts with storage message me and I will attempt to contact MIT people and see if there is a later Maclisp I can get on there.
2:39:41
whoman
aeth, i used to hate it a lot, the same as java, or c# or any other corporate brochure, but these days its got quite some nice features with its templates and other c++17 stuff. too complex for me though, i just like it now where i disliked it previously
2:39:50
aeth
whoman: Every now and then I hit a strange edge case where SBCL takes forever (sometimes figuratively, sometimes literaly) to compile, but no other CL. Almost certainly some bug or strange interpretation of the code. But that can be fixed, like any bug.
2:40:11
aeth
I'm surprised such an SBCL-slowdown bug made it into a library. Most people use and test with SBCL afaik.
2:45:39
aeth
Afaik, CL was absolutely huge... in the 90s. And now it's normal sized, if not a bit underweight, even though it hasn't changed at all. Scheme might soon be larger than CL, depending on what gets passed in r7rs-large.
2:46:05
aeth
If at one point they were equally sized, C++ has gained about 5,000 features since then.
2:47:33
aeth
r5rs was the norm for a while, then r6rs was a larger spec that was seen as not very Scheme-style, so the compromise was to split Scheme into an r5rs-style r7rs-small and a larger language r7rs-large that could be used for more portability
2:48:26
aeth
r7rs-large was, at least at one point, talked of as making Scheme as large or larger than CL, but I'm not sure if that's still the case, or if it was ever the case.
2:48:33
whoman
ohh spec. java is big, also the web specs are huge, if we combine css3/html5/ecmascript+
2:48:59
aeth
CL is not just the HyperSpec, though. There's a large number of de facto standards in CL, too, like the Meta-Object Protocol (MOP).
2:50:42
aeth
Stuff in alexandria and cl-ppcre could reasonably be core parts of other languages, but don't need to be core in CL because the libraries are there.
2:50:49
vtomole
So scheme wants to be portable and the only option is to make it big? hmm sounds like the T programming language.
2:51:36
aeth
The problem with r5rs and r7rs-small Scheme is that almost any program written in portable Scheme is probably not going to be that useful because the standards are too small. e.g. r7rs-small has no hash table.
2:52:42
aeth
Oh, and there are some practically-standard SRFIs (and some became part of r7rs-small after being so popular for r5rses), but it's nothing like CL, where you can just use Quicklisp.
2:53:21
whoman
a lot of CL implementations are similar. but scheme implementations are more different than each other than CL impls. Racket has a lot of stuff.
2:53:28
aeth
Scheme SRFI support is a matrix of more than a dozen implementatoins implementing different ones, out of hundreds.
2:53:53
aeth
There are fewer, larger CL implementations that only have to deal with a few major portability things roughly comparable to what SRFIs are, like CFFI.
2:55:01
aeth
In CL, you just have to worry about "does this support bordeaux-threads? CFFI?" etc. Not anywhere near as big of a deal, and the answer is almost always yes for the major ones like SBCL, CCL, ECL, etc.
2:56:49
aeth
stylewarning: Numbers are probably the main weakness in your list. I don't think there's a real clear portability library there for e.g. handling NaN and +/- inf etc.
2:57:42
aeth
There are probably 3 libraries that partially do numerical portability, but no clear standard like CFFI, bordeaux-threads, closer-mop, etc.
2:58:39
stylewarning
I complain about this every day probably: CFFI needs more to interact with a lot of C
2:59:21
aeth
Just about everything needs more attention in the CL ecosystem, at the library and implementation level, imo.
2:59:53
aeth
At least on Freenode IRC, CL appears to be much more alive than a lot of 1980s languages, e.g. Pascal.
3:00:34
aeth
Even the superficial stuff like := probably prevented countless bugs that people wrote and continue to write in C and languages that use its syntax
3:00:38
whoman
i remember pascal was kinda fun to work with . i think i did that before C, forhigh school
3:02:10
aeth
Oh, CL is one of the few languages that does things the way I like it, btw. = for equality, and something else for assignment.
3:04:16
aeth
CS is probably the most mathematical major subject that isn't math, statistics, or physics.
3:04:55
aeth
Computer people fool themselves into thinking that they're not doing mathematical things because they (usually) use different kinds of math than the physicists do, that's all.
3:05:51
whoman
also architects and other kind of engineers. numbers and ratios and symmetry and patterns are very important.
3:06:17
whoman
ah, ok =) his name came to mind for some reason too. i couldnt remember the association
3:07:29
aeth
whoman: Engineers, at least at my university ime, are students who barely get through the lower level math and physics, not really understanding the material. And then they're the ones who actually do all the practical applications of such material, somehow.
3:07:53
aeth
whoman: The people who really understand the material go on to idk impractical theoretical things. :-p
3:09:45
aeth
Or maybe the good engineers take all the lower level classes at the high school level because they're going to take 5+ years to graduate anyway.
3:11:26
vtomole
Cl is not growing that's for sure. From the logs online, seems like it was still pretty good in 2007
3:18:14
aeth
I'd much rather have long-float be 80-bit extended precision or 128-bit quadruple-float.
3:18:28
aeth
The right, unambiguous solution if the standard could be updated would probably be to add more levels above double-float
3:21:54
aeth
I think it would be better just to add different levels of float to a float list, perhaps with an arbitrary at the top, if the standard is flexible enough to allow that. (I'm not sure.) http://www.lispworks.com/documentation/HyperSpec/Body/t_short_.htm
3:23:38
aeth
16-bit (short-float, but technically too imprecise to pass the hyperspec), 32-bit (single-float), 64-bit (double-float), 80-bit (extended-float), and 128-bit (quadruple-float) are about all one needs to support, and maybe not even the 80-bit one.
3:24:07
aeth
The only ambiguity is whether long-float is extended-float or quadruple-float or arbitrary-float. The rest map cleanly to standards.
3:25:36
aeth
The issue with e.g. making long-float an arbitrary float on SBCL is... what about when SBCL is ported to a platform that supports IEEE quadruple float, where long-float is a natural fit there?
3:26:17
Bike
stylewarning: you'd probably have to include some kind of "upgrading" mechanism, so that a 62 bit float is just a 64 bit float if that's what the machine has
3:27:14
aeth
(In fact, SBCL runs on SPARC and PowerPC already, so it could in theory use a long-float quadruple float there, perhaps.)
3:27:26
Bike
you'd also have either an implementation limit on n or soft arbitrary floats, which are not trivial. (i personally would have to grap taocp or something to implement them)
3:27:55
aeth
stylewarning: one problem with modeling floats on arrays is the literal notation for floats
3:29:43
aeth
Just about everyone who just puts "1.0" and assumes it's a single-float should afaik think twice about that assumption because of (setf *read-default-float-format* 'double-float) unless I'm wrong
3:30:05
aeth
So any new float system past just having a long-float needs a literal notation, or a reason why not to have one
3:32:48
Bike
actually, i'm not sure how arbitrary precision floats would work. clisp has an (ext:extended-float-digits) or something accessor, but that means you have only one kind of extended float at any given time, and you can just... gain and lose precision?
3:34:36
aeth
And if you permit the arbitrary precision floats to use hardware support where there is a match (potentially 80 and/or 128 bits), then what if the hardware supports both 80 and 128 bits?
3:34:37
Bike
and how do you like, get a high precision float? do some arithmetic and specify the precision you want to end up with? or have a different read syntax...
3:35:05
Bike
i thought the idea was there would be some arbitrary number of fixed precision machine floats
3:36:07
aeth
stylewarning: there is no way to say #single-float-array-of-3(1f0 2f0 3f0) but there is a way to say 1f0 2f0 3f0
3:36:23
aeth
Working with arrays is actually very inconvenient unless you write a few macros or functions to handle the common ones.
3:36:42
aeth
It's common to define "vec" or "vec3", for instance. And then you can just say (vec 1f0 2f0 3f0)
3:36:49
Bike
different unsigned byte lengths aren't distinct in the runtime. you have fixnums and you have bignums, and the length of an integer is obvious from its syntactic form.
3:39:22
aeth
I have to do something like this to make working with specialized arrays of known length easy enough to work with: https://gitlab.com/zombie-raptor/zombie-raptor/blob/b5639da6be400c1482545fe7a874bf3bd0b3db08/util/util.lisp#L92-106
3:40:23
aeth
But it's one thing to add conveniences, and another to take away conveniences (or at least not have them for some float types when others have them), i.e. the 1s0 vs. 1f0 vs. 1d0 vs. 1l0
3:40:51
aeth
stylewarning: I think SBCL optimizes things like mod when it knows the integer is very small
3:41:32
stylewarning
Or optimized SSE arithmetic on notionally boxed types like complex double floats
3:43:15
Bike
numbers don't have to maintain an identity so they don't really need to be boxed, but ive lost the connection to floats.
3:49:24
slark
hello, if i pass to the &body body parameter of a macro `(foo).. the body will contains (`(foo)) right .
3:56:36
Zhivago
Well, `(,@body) would get you back something equivalent to (list ''(foo)) which would evaluate to ('(foo)).