freenode/#lisp - IRC Chatlog
Search
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.
13:22:51
xificurC
well this was fun to read. not. Let me ask something more on topic. I've seen people link to the OUT macro from ytools several times. However I don't see the package (ytools) in quicklisp. Is anyone using it? Is there a fork with a different name where the OUT macro is available? Or does everyone just stick to FORMAT?
13:26:35
xificurC
this is a link (pdf) to the docs if someone doesn't know what the heck am I talking about - http://cs-www.cs.yale.edu/homes/dvm/papers/ytdoc.pdf
13:29:04
xificurC
_death: link? Do you have some accompanying docs? Do you know of other FORMAT alternatives?
13:32:05
_death
it's also extensible, for example https://gist.github.com/death/4e273d14e671a3c64f3be10cab2aa1b2
13:56:01
elderK
_death: Also, unrelated: When I see your name, I think of Death, The Grim Reaper from Terry Pratchett's Discworld series :)
13:57:26
elderK
On another tangent: I wonder how many CL / Scheme programmers there are in the world. Like, those capable of writing CL / Scheme in a professional capacity.
13:58:00
elderK
I have specified "CL" and "Scheme" rather than "Lisp", because I don't want to include say, AutoLisp or Emacs Lisp :P
14:00:45
elderK
"Perhaps there is some Great Filter, that extinguishes most programmers before they become truly enlightened?" :P
14:01:08
elderK
Or perhaps the majority of the Lisp programmers are hidden somewhere, sleeping. Hibernating maybe :P
14:01:54
elderK
Or perhaps, the majority of programmers in the world are simply too young, too naive, too immature? And the Great Lispers are waiting for us to wisen before bestowing us with their knowledge? :D
14:11:12
dlowe
It's a somewhat unpopular opinion but I think the mystique of lisp is misplaced and actively harmful to its popularity
14:12:18
_death
there are some quantities that could help estimating.. e.g., number of quicklisp installs (Xach publishes quicklisp data every now and then.. guess he could log IP addresses or User-Agent for better estimates..), number of github users with CL repos, or committers to CL repos, number of lisp subreddit subscribers, number of stackoverflow users asking/answering CL questions, etc.
14:14:17
ogamita
xificurC: the only criterial for quicklisp is that it should have an asd file and compile without error on sbcl.
14:14:42
elderK
It would be interesting to get like some hard numbers on: How many people say, install some CL implementation, tinker with it for a little, then leave it behind. Of the number that do, you know, play for awhile and leave it behind, some fraction of them will have taken something neat from the language, from whatever dialect they may have used. Then the other, I assume the larger fraction, will simply leave it behind with nary another thought.
14:15:47
elderK
It's like recently I learned that one of the people who inspired me originally to look into Lisp, actually doesn't seem to think it's useful for day-to-day stuff. That amazes me. Instead, he believes that it has a lot of lessons to offer, things to learn and take from.
14:16:20
ogamita
elderK: in a professional capacity, is the strong criteria in your question. Not lisp…
14:17:40
elderK
dlowe: I'm not sure it's necessarily a Lisp problem - but more an FP one. Languages such as Standard ML or Haskell have "mystique" too. Although, I'd imagine Haskell is somewhat more popular than Lisp. Of course, that's just my intuition - I have nothing to support that claim.
14:18:05
ogamita
elderK: given the statistics on the age pyramid of lisp programmers, we could assume that you need 20 years experience in programming to become a professional lisper. That's about the age when a lot of programmers switch to something else.
14:18:22
shka__
i heared some time ago advice to avoid using print-object for printing unreadable stuff, however, it is ok if implementaiton is wrapped in the print-unreadable-object macro, isn't it?
14:18:38
beach
ACTION was going to say that it doesn't seem to be the case that any great knowledge is required in order to program professionally, but he won't because he will surely be contradicted.
14:18:45
ogamita
elderK: otherwise, given that half the programmers are newbies with less than 5 years, yes, the majority are simply too young.
14:18:59
elderK
Well, that's perhaps one reason I've been investing so much time over the past month. I've been investigating / playing with Lisp on and off for damn near ten years - but never made the "jump." But, I've been getting more and more... not sick of - something else - of C and C++.
14:19:23
elderK
I've always figured: If I was going to move to something other than C or C++, I'd move to Lisp rather than something like Python or Scala or *shudder* Java.
14:19:32
pfdietz
I'm not sure it takes more time to master Lisp than it does to master C++. The latter seems to be rather complex these days.
14:20:33
ogamita
elderK: I think he's misdirected. you can verify it yourself, by translating some non-trivial lisp program you wrote, into Java or C. Try to keep the lisp style.
14:20:44
elderK
pfdietz: I agree with you - I think CL is much smaller and much more understandible as a language these days compared to C++. That being said, it's one thing to "understand the language" and another to apply it well.
14:21:18
elderK
ogamita: For many years, I wrote C and C++ code in a way that could construed as "more functional than average"
14:22:33
ogamita
You can do something. It certainly gives better C programs IMO. But it's hard for the author, because so much infrastructure is lacking (no GC, no conditions, etc). And coworkers are always complaining…
14:22:39
elderK
dlowe: Iono. "Idiomatic" C++ changes with every revision. More and more, it involves making good use of TMP, too, in some capacity. You don't need TMP and stuff to deliver a good product, of course. And what is "idiomatic" differs depending on who you speak to, but, by and large, it seems to be heading in that direction. And has been, for quite some time.
14:24:59
elderK
Iono. I spent a lot of time last year and earlier this year, "modernizing" my C++ capabilities. I spent a /massive/ amount of time experimenting with template metaprogramming and studying a vast number of libraries involving it, as well as others generally thought of as representing "great modern C++." I completed that process with an increased appreciation for CL and Lisp in general.
14:25:31
elderK
I mean, I've appreciated Lisp's qualities for a long time. But, learning and tinkering with C++ TMP for /real/ work, well, it left me desperately wanting to do such metaprogramming in something like CL.
14:28:46
PuercoPop
I want to prefix with 0s a number. From reading 22.3.2.2 my understanding is that (format nil "~2,0D" 1) should work. However I get 0 is not a character
14:52:39
pfdietz
Using cl-string-match right now, although I wish it was on a git site I could do pull requests on.
15:36:05
ogamita
Wild guess: reduce the --dynamic-space-size parameter? Nah! I don't think that'll work.
15:36:19
heisig
beach: That happens when you have too many funcallable-instances. These are allocated in immobile pages.
15:36:26
ogamita
I would have thought sbcl was able to lock down pages. Perhaps there's an OS limit on the locked down pages.
15:37:16
heisig
As of how to fix it - I don't know. I stopped making my most frequently used objects funcallable. But in your case that won't work.
15:45:30
dim
I want to ask if it works in CCL, as a reference point, but it might be that you're working on something that is tightly coupled with SBCL at the moment?
15:47:14
dim
my current trick is to develop interactively using one and build images and run tests with the other, and I've got used to using CCL interactively in the SLIME REPL by default, and SBCL for saving images and running tests
15:48:12
dim
of course using (sb-ext:restrict-compiler-policy 'debug 3) in ~/.sbclrc makes the experience of interactive development almost the same using either one of those, I still have a slight preference for CCL in interactive mode
15:48:42
dim
I like using defstruct, for instance, because I'm lazy, and CCL knows how to redefine them on the fly in a way that mostly works
15:52:26
dim
v1.11.5 from memory, unless you're using Macos Mojave, then v1.12-dev.4 as published on https://github.com/Clozure/ccl/releases
16:05:33
beach
With CCL I get an error that I am calling a standard reader method with one argument, but it requires two. :(
16:10:58
dim
I've read that rebuilding CCL from sources is fast and easy, all done from the CCL REPL ;-)
16:13:33
dim
rme from CCL mentionned that they have projects to make their compiler smarter, because it's quite dumb to this day, and maybe, maybe SICL would help, longer term
16:14:35
dim
anyway I'm having too many ideas, and I'm playing with your time here, sorry about that, I'll go back to fixing bugs in my job's software written in C now :/
16:18:33
dim
yeah I know... I don't think that in this instance I could have convinced the team to use CL instead, even Python was out the picture because not everyone there knows how to program in Python... and in truth our main software (an extension to PostgreSQL, named Citus, providing distributed query planning etc) has to be written in C anyway
16:20:01
dim
I considered building PL/CL (we have PL/Python, PL/C, PL/...) a couple times, but I'm not knowlegeable enough yet to make that happen: we would need a background worker running the CL image and then lighter CL processes in the PostgreSQL backends where you could run local things and communicate with the central image, I guess