freenode/#lisp - IRC Chatlog
Search
21:34:25
Oladon_work
I think I'm late to the discussion, but something which bothers me a ton is the recent trend of writing reducers "in a functional style" and copying the entire object each iteration just to add or change something.
21:35:22
White_Flame
Oladon_work: in an ideal world, with a Sufficiently Advanced Compiler™, that still could be optimized away
21:35:45
White_Flame
but yeah, when it's explicit, and its transient use like that, it might just be a needless big performance hit
21:36:00
Oladon_work
Oh, I wasn't talking about optimization, actually — my comment was while I was reading up and people were talking about mutability as if that's what functional programming is All About
21:36:24
Oladon_work
For me it's more the complexity that it adds... for no gain except being able to say "it's Functional!"
21:37:40
Oladon_work
I see it most often in JS: foo.reduce((item, result) => { return [...result, [foo.name]: transform(foo)] })
21:38:37
Oladon_work
Congratulations, you've avoided mutating "result", which exists only within your reduce operation (which should really be a map operation anyway, but...)
21:40:25
White_Flame
if an object exposes operations that are pure FP, then that's fine, just use them even when a mutation would be faster, because the operation is there & available. But to just bolt in weirdness like that is just weird
21:41:12
Oladon_work
Yup. Yet it's extremely popular right now, because "Functional Programming is the future, and Functional Programming = immutability!"
21:42:06
Oladon_work
Btw, I'm still hiring if anyone wants to come write Lispy JS on an actually-very-cool team doing cool stuff. :)
22:18:44
Oladon_work
Ah, that seems like a plausible interpretation. We're looking for senior developers, and the position is onsite.
22:22:22
aeth
White_Flame: In something like CL, you'd need to be able to mark data structures as pure, and for conses, since they're so simple, you'd need a separate immutable cons (icons or something). Even sufficiently smart just wouldn't work with CL's recompilation semantics and debugging ability.
22:25:35
aeth
Oladon_work: In some languages, like Python 3, stuff like map() don't cons up a new "list" (really, vector) anymore unless you explicitly convert the result into one. I guess it's sort of like a lazy sequence. That can avoid some of the overhead of certain FP styles. In CL, you'd probably just want to refactor a MAP into a MAP-INTO, though, if possible, so there's probably less of a demand.
22:26:53
aeth
It's funny seeing a language (JS) where you afaik run it in one thread emphasizing immutability so much, though, since the main initial pitch of languages like Clojure or Haskell 10 years ago is that immutable data structures are easier to work with in threads.
1:52:26
vms14
`(destructuring-bind (seconds minutes hours day month year week-day day-p zone) (get-date) ,@body))
1:53:36
vms14
but then I need to ignore all the non used arguments if I don't want to see a lot of warnings
1:54:33
vms14
what I'm doing wrong? I want to have a macro which asks for the current date and binds for you the variables
2:04:14
vms14
there was a format option to display the month number with words? like what does with roman numbers and english text numbers
6:43:44
Harag
I have a little object db I wrote, its designed in 3 logical layers basic, indexed and the kitchen sink thrown in. The idea is to use different asd files to load only what is needed for a layer. My question is should the layers be in their own package/namespace or should I keep it in the same namespace
6:49:18
Harag
that was my feeling as well but I was hesitant that I could find my self with circular references some time in the future as I add more functionality
6:59:03
Harag
I never used bknr-store, but my previous experience with clos based data stores left me disillusioned
6:59:28
PuercoPop
It can't be that naive if it has indexes. Storing things as plists seems like playing to Lisps strength more than anything.
7:08:42
Harag
:PuercoPop i call it naive because of that very fact, everything including the index is using lisp and minimal functionality, the way the data is stored in separate files often negates the need heavy indexing
7:09:12
aeth
Harag: as a last resort to avoid a circular reference, you can pass a symbol from one layer to another e.g. in a macro... it's pretty rare, though, even with one-package-per-file
7:09:15
no-defun-allowed
Okay, I broke something in SLIME and any attempt to type anything in the repl just gives me the message "Text is read-only". What should I do?
7:09:57
aeth
Harag: e.g. if A depends on B but B needs a symbol from A, then you can pass the symbol from A into B in e.g. a macro api.
7:13:15
Harag
:aeth ok, well I wont pretend I can see how that code looks in my head now but I will keep it in mind. the store will most likely only ever be used and extended by me so I will just have to solve the problem if it ever comes up
7:26:35
no-defun-allowed
doesn't like that, "Wrong type argument: integer-or-marker-p, nil" and the input has the package name font
7:27:28
ck_
hmm. Have you tried sending something to the repl already? C-c C-j or whatever the standard binding is
7:27:31
Harag
:PuercoPop ... on that point of lisp strengths, doing a reduce with string comparisons over 10k plists ... 0.004 to 0.008 seconds of real time... i can live with that
7:28:24
no-defun-allowed
C-c C-e works, I'm going to dump out a load form and restart since I made a method for that
7:29:28
ck_
Weird. Well, I have no further suggestions other than using the ielm repl to fiddle with the lisp repl buffer state
7:30:59
no-defun-allowed
I've restarted it and restored the state using make-load-form (which I wrote a method for).
7:38:35
schweers
no-defun-allowed: I’m a bit late for this, but maybe it happens again. Did you try killing the repl buffer and calling M-x slime-repl RET?