freenode/#lisp - IRC Chatlog
Search
0:59:56
PuercoPop
Basically the problem is that it applies < to complex numbers, that only applies to reals
1:00:56
PuercoPop
I'm going to recommend to change the typep to real. However I'm wondering it would make sense to implement an ad-hoc order
1:03:12
aeth
PuercoPop: Distance from 0 (assuming it's on the real-imaginary plane) with the real part as a tie breaker could be another way to sort complex.
1:12:25
aeth
There's probably a way to combine ABS and PHASE so it gets the regular sorting order on reals as well, e.g. (phase 1) is 0.0 and (phase -1) is pi
1:12:25
PuercoPop
aeth: I've opened the issue on the SLIME issue tracker but the fix only for Sly, maybe you can send a PR that orders numbers that way?
1:15:22
drmeister
Given a quicklisp system - is there a way to get the dependency graph before quicklisp starts compiling stuff?
1:16:02
aeth
hmm... Backwards sort of PHASE's angle and then ABS would work for complex in a way that also works on reals. i.e. if PHASE is the same, tiebreak with abs (since it's float you wouldn't be able to use =, though).
1:18:24
aeth
(obviously it's faster to have a typecase and only do this for complex, but you could still encounter things like #C(1d0 0d0) and #C(-1d0 0d0))
1:23:44
aeth
PuercoPop: Maybe something like this but without = (since you can't really use = on floats)? Sorts by angle then magnitude in a way that behaves like < if the imagpart is 0. (defun complex-< (x y) (if (= (phase x) (phase y)) (< (abs x) (abs y)) (> (phase x) (phase y))))
1:24:09
aeth
There's probably a name for something like this because sorting complex is not a new problem.
1:26:03
Bike
it's pretty easy to prove there's no total order, and that's about where things usually end
1:29:39
aeth
Bike: This seems like a weaker issue, though: can we produce a function that works with #'sort?
1:37:51
Xach
drmeister: .asd files are loaded and can run arbitrary lisp code, including loading and building other things. also :defsystem-depends-on is a problem.
1:38:41
Xach
drmeister: then you can look at the relationships between systems without much trouble.
1:39:08
Xach
drmeister: also, quicklisp precompiles info about those relationships, so if every system is from quicklisp, you can query quicklisp's indexes instead of asdf's.
1:43:40
Xach
drmeister: with quicklisp, i compile and load everything, and record what actually gets loaded, and use that to find the de facto relationships.
1:45:53
drmeister
We have the clasp build down to about 30 min by forking every compile-file that we can.
1:46:11
drmeister
Then we build the Cando quicklisp systems and it drops back to serial mode and takes an hour - ugh.
1:47:05
drmeister
I'm thinking that I should load everything with quickload and then determine the system dependencies once everything is loaded and save the dependency graph to use the next time we build.
1:48:21
drmeister
POIU would be nice - but it's broken. A faster compiler would be nice - but... llvm.
1:50:18
aeth
drmeister: The problem with compiling systems in parallel is that some systems change globals as part of their compilation process, even though they probably shouldn't do that and should leave that to the user (except for pushing to *FEATURES* and a few other niche cases)
1:54:44
drmeister
If I quickload systems from the leaves in to the root in separate forks it will compile all of the source code once and then I can quickload the root and it will hopefully all work.
1:55:58
drmeister
I'm going to change compile-file so that it compile-files into a temporary file and then atomically renames it to the target.
1:56:00
pfdietz
The advantage of compiling things in parallel is you can fail when people do that (which is wrong, as what happens when you reload precompiled fasls into a new image?)
2:02:42
pfdietz
If you've already compiled a system, you can just load the fasls, right? So if the compile process caused some side effect that you're depending on, you won't get that just by loading the fasls.
2:17:41
pfdietz
In general, any global change that you depend on should go into an eval-when that causes it to be performed when the fasl is loaded as well.
2:18:41
drmeister
I'm looking at asdf-viz - it visualizes these things but I can't make hide nor hair of it.
2:30:06
no-defun-allowed
dot's a program for spitting out SVGs from edges of a graph, so half the program would probably just be flattening the tree of dependencies
5:22:57
rk[ghost]
it returns icky, in values.. i forget.. how to grab first part of a values return?
5:30:02
rk[ghost]
pillton: thanks much. that saved me grepping thru a bunch of files to see how i used it in a project (who knows which one, long enough ago) :P
6:03:31
elderK
I've switched clients - it may have been a long long time ago. I didn't check the timestmap :P
6:04:03
equwal
I can't remember. I have a vague memory, probably I was talking about how in emacs you can get a library to rotate the in-frame windows.
6:33:00
elderK
Like, do they just use destructuring-bind and let it do checking, or do they first verify the structure /then/ call destructuring-bind
6:43:30
equwal
So only error check something that you think should be legal but which requires special treatment.
6:44:02
elderK
Right, so in that case I'd specify "Slots are of the form (name type &key (count 1)).
6:47:42
equwal
The point of my suggestion is that you wouldn't check any of that since it is a waste of your effort and isn't meaningful anyway. The only reason you might check is if you want to make sure that your program fails in a specific way when that happens.
6:57:59
equwal
Though I was just going to modify my emacs init file, but now I am programming udev and systemd.
7:00:37
equwal
Hasn't worked with GNOME in my experience, since GNOME has it's own incomplete system for keybindings.
7:01:17
no-defun-allowed
cause just in emacs is 4 lines of elisp, and ctrl-caps swapping was 2 in xmodmap so i imagine it's not too hard
7:01:17
equwal
So you have to change the keybinds on hotplug of the keyboard, which requires watching Udev with a systemd script.
7:06:10
equwal
Spent a decent amount of time trying to find that. Lots of bogus answers on stackoverflow.
8:08:55
hajovonta
work issues, family issues... I currently don't have a desk at home and did no CL recently :(
8:10:31
hajovonta
I couldn't find a way to incorporate CL into my daily job in the past year. We hopefully get a new assignment for next year though, and I'm optimistic.
9:40:47
hajovonta
sindan: I think many system engineering type assignments give possibilities to develop something in CL
9:44:08
sindan
hajovonta: just curious, CL is wonderful but it's far too powerful and flexible for many managers' taste, and if they know anything about software development, they know that the developer market is not big, therefore they resent having critical systems dependant on just one person, but maybe you knew that already
9:48:06
ogamita
Yes, anytime you start writing #!/bin/bash quick, type ^W^W usr/local/bin/clisp -ansi -q -E utf-8 instead.
9:49:32
ogamita
equwal: what pain do you have in swapping [] with ()? (apart the need to adapt to the new layout?)
9:54:23
sindan
bash is a horrible choice anyway, I'd choose python for anything now over, say, 0 lines
9:58:05
aeth
I think a language doesn't get a conciseness advantage over bash until 100 lines or so (but you probably want to go away from bash before that point)
9:59:25
hajovonta
sindan: you are right, they won't let me write critical systems, but there are many tedious tasks involved, like installing, configuring and integrating components, and chances are that procedures require manual effort, where CL can step in, to save time (for myself)
9:59:46
hajovonta
that's why I said system engineering, because software development is where you develop something that others will use
10:00:27
heisig
sindan: I would be more enthusiastic about Python if it were not about 50x slower than CL. Furthermore, I find it extremely hard to write Python programs that do not contain subtle errors.
10:01:48
hajovonta
heisig: care to share pointers on that topic? My colleagues are enthusiastic about Python.
10:03:41
heisig
In my benchmarks, Python is always 20-200 times slower than Common Lisp code. The 50x I mentioned was when comparing adventofcode solutions with one of my colleagues.
10:04:15
heisig
But that is not the biggest problem of Python. The big problem is that the language has so many pitfalls.
10:04:46
Cymew
All the world is enthusiastic about python, as it's everyones darling for some reason. It's dog slow, and Ruby is even slower. But, this is seriously off topic.
10:04:53
jdz
[My only $0.02 of off-topic material] My bet is that people like Python because of the many libraries, which means they only have to write glue code.
10:05:58
hajovonta
heisig: I'm interested in looking at your performant CL code. I sometimes need to improve my CL code performance, but struggle to do so
10:06:38
hajovonta
at hackerrank, the requirements of completion are some 10x higher for CL code than for say Java or C++
10:07:17
hajovonta
Cymew: no, but I use SBCL and I know it has a profiler, but don't know exactly how to use it or what to look for
10:08:30
aeth
hajovonta: most things are caught by SBCL when you (declare (optimize (speed 3))) in a function
10:08:44
Cymew
In general, you want to find where in the code you spend most time, and figure out why.
10:11:09
hajovonta
I know the basic principles, like look for tight loops, and don't optimize code sections that don't contribute much to the time elapsed, but usually stuck with optimizing the identified parts
10:12:50
heisig
hajovonta: Maybe I should write a blogpost about how to write fast Common Lisp code over Christmas :) But the examples that I mentioned were not even optimized code. Baseline CL beats Python by orders of magnitude.
10:13:56
Cymew
I've found the profiler usually tell me my code spend time in a place which makes me go "huh?" and then realize that I can pre-calculate data and do some inline DECLARE.
10:16:04
Cymew
Surprisingly often you really don't optimise at all, just rethink, after seeing the profiler output. But, maybe that says more about me being bad at using the best algorithm from the start... ;=)
10:20:05
sindan
I have profiled some SBCL code of mine, and the results also make me wonder. IIRC most of the time is used in consing thousands or millions of times, it's quite unexpected
10:21:06
sindan
heisig: would like to read some advanced post (meaning it doesn't have to be a boring "primer") on how to optimize CL code
10:24:21
ogamita
aeth: this is plain wrong. Any programming languages is a clear win from 0 lines of bash, just because bash has no data structure.
10:25:02
ogamita
aeth: when you start having to implement first class arrays, structures, trees, anything in bash, you explode the LOC!
10:28:31
sindan
bash is to cobble together two or three utilities, it barely does arithmetic, when I see bash scripts in the hundreds of lines I wonder what is on the author's mind. And yes, they are going to bomb on any mistake, unless you read the return code of everything you do and do if() error handling sprinkled all over the logic... a nightmare no matter how one tries to go about bash
10:30:26
sindan
and I would not write long programs in python (meaning well behaved, efficient system programs), but as glue code it's unmatched because there are libraries for everything.
10:40:36
beach
For one thing, it doesn't have an independent standard, so it is not such a great idea to choose it for a serious commercial project.
10:49:53
ogamita
beach: You're confusing the name and the essence of the thing. Here statement is just a non-terminal name in a grammar. It's definition is that of a form, and a form is an expression . The only things that are executable in lisp are expressions.
11:06:01
sindan
Well, typical #lisp: still, no valid criticism. And you reply, if any, still won't be valid criticism, just more snarky comments
11:06:50
jackdaniel
as of standards, I don't see a big practical difference between finished standard (like CL), and finished reference implementation (like python2), given both are freely available and won't change.
11:08:33
sindan
jackdaniel: true, but the stink of aristocratic pretentions about lisp here never goes away.
11:10:27
jackdaniel
sindan: I must warn you (for the last time), please do not try to offend people on this channel
11:11:39
sindan
I am not trying, it seems. It looks like I am suceeding. I asked about technical points. I only get personal opinions, at best.
11:18:50
jackdaniel
to make myself clear: "no big difference" was *not* about quality and under the assumption, that said reference implementation has a written specification of how it behaves. my point was that both a) won't change; b) may be reimplemented; the only difference is that one has a "standard" sticker
11:23:23
heisig
sindan: Sorry, I was having lunch. Are you still around and want to hear my thoughts about Python? (Btw, I use Python myself, especially when I intend to share the code with my coworkers afterwards).
11:59:53
ogamita
sindan: the problem is that you don't understand the consequences. We start from a very small number of apparently "small" things, such as no independent standard, statements, significant whitespaces, no multi-line lambda, but the consequences are huge. If you're not experimented, you may not forsee them and understand.
12:00:35
ogamita
sindan: but basically, any one of those items (or the mess with lexical scopes), would be already redhibitory.
12:01:04
ogamita
sindan: we could probably go on and find hundreds of problems, but it's no use, once there's already one disqualifying problem.
12:04:40
sindan
ogamita: thanks for some points. Down at #lispcafe I was saying that python is not to teach CS concepts. It's a language to get things done, admirably put together considering what it attempts to cover.
12:06:02
sindan
And the hyperspec is full of footnotes about quirks, I don't have to mention then dozens of them. We like lisp and program around its quirks.