freenode/lisp - IRC Chatlog
Search
14:19:21
Shinmera
I did some linear algebra stuff in 3d-matrices, but I didn't have to make it fast or guaranteed precise, so the pain was reduced.
14:20:59
stylewarning
Vectors and matrices for 3D programming is usually pretty minimal. One lisp file and maybe 100 or so lines of code
14:22:56
Shinmera
It also definitely falls into your category of "untangling x levels of horrible macros".
14:26:29
stylewarning
Shinmera: those macros are at least understandable compared to https://github.com/matlisp/matlisp/blob/master/src/base/coordinate-accessor.lisp
14:33:39
Shinmera
Aight. https://github.com/matlisp/matlisp/blob/master/src/utilities/template.lisp#L88
14:34:33
JuanDaugherty
coloring within the lines of CLOS may be beyond the capabilities of the average bear
14:38:31
stylewarning
Anyway, definitely not looking to put down that library and that person's hard work, but it is a good example of a different point on this spectrum of library quality and construction
15:14:59
beach
I wonder whether that was a list of things JuanDaugherty avoids: 1. disputations. 2. me. 3. other nasty stuffs. That would imply that I am some nasty stuff.
15:15:33
Shinmera
Making a wrong statement, ignoring questions about it, and then calling people questioning small minded sure is quite the stunt.
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?