freenode/lisp - IRC Chatlog
Search
2:38:54
Bike
implementations of Lisp and C can use other representations internally. adding up the sizes of C objects won't accurate reflect memory usage in a C program because the allocator has its own overhead, etc
5:24:39
moon-child
on 2020-04-06 and 2020-07-30 he said ' Good morning everyone!' (with a leading space). Capitalization and spelling are completely consistent, though
5:29:16
aeth
All of Freenode has been like that for years. A lot of that is various cloud bouncer services and bridges, like the Matrix bridge. We have some active users from Matrix, but I only notice most of them when the Matrix bridge goes down.
5:31:18
moon-child
aeth: I wouldn't pin too much of it on matrix. IRC has always been filled with lurkers
5:31:43
aeth
moon-child: yes, but you used to be able to assume that joins/parts were joins/parts, but that's rarely the case with all of the bouncers/cloud/bridges/etc.
5:32:14
no-defun-allowed
And I believe that joins/parts do match up, otherwise the Freenode people would be very annoyed with the Matrix people.
5:33:17
no-defun-allowed
And the Matrix people came up to me one day, annoyed that I hadn't given the bot permissions to kick inactive people.
5:34:16
aeth
slightly more on topic, but with all these bridges on Freenode now, there still isn't one from the CL world afaik...
5:35:30
no-defun-allowed
http://metamodular.com/Common-Lisp/suggested-projects.html has some of the important parts though.
5:35:46
aeth
JS already has everything and they rewrite JS things as new JS things regularly, anyway
5:36:44
aeth
no-defun-allowed: chat and voice chat are missing, but those are... maybe the two most important things for socializing on the internet (it does have an email client, though)
5:37:06
moon-child
I mean, an IRC client|server in lisp wouldn't be hard. Latter wouldn't be very interesting, and as for the former there's erc et (probably) al
5:38:35
no-defun-allowed
That's easy, do arecord | lisp -e "(loop with stream = (usocket:socket-stream (usocket:socket-connect "conscordapp.com" 1337 :element-type '(unsigned-byte 8))) for byte = (read-byte *standard-input*) do (write-byte stream))"
5:40:47
no-defun-allowed
I have a graph of the cumulative distribution function for the UTC time of "gme RET". Now I'm wondering why I made the graph.
5:41:00
aeth
just an example from the public logs: https://irclog.tymoon.eu/freenode/%23lisp?from=2020-07-27T00%3A40%3A15&to=2020-10-27T12%3A40%3A15&search=Good%20morning%20everyone%21&by=beach
5:41:11
moon-child
no-defun-allowed: and having done that, it's relatively easy to read back audio, write it to stdout, and have a >/dev/dsp at the end
5:41:40
no-defun-allowed
Hence why it's an exercise for the reader. The server would be somewhat harder though.
5:42:55
aaaaaa
interesting notice at https://irclog.tymoon.eu/freenode/%23lisp?from=2020-01-27T00%3A40%3A15&to=2020-10-27T12%3A40%3A15&search=Good%20morning%20everyone!&by=beach
5:43:05
aaaaaa
beach said "I have the same for "first-class global environments", "Common Lisp HyperSpec", "Common Lisp", "(first) Climacs", "Second Climacs", "Good morning everyone!", "Good afternoon everyone!", etc. etc."
5:43:29
no-defun-allowed
I'm also confused about what timezone the times are reported in; the mean is about 3:45 of some time zone.
5:46:31
no-defun-allowed
Indeed it did. ("already" is strange from _here_, because we entered daylight savings on 2020-10-04)
5:50:51
Nilby
Not time again. I've spent more leap seconds than have happend agonizing about timezones.
6:18:40
beach
aaaaaa: Abbrevs save A LOT of time, and I am always surprised to learn how few people use them.
6:19:18
beach
aaaaaa: In addition, they decrease the number of typos, so there is less typing for correcting mistakes.
6:20:37
beach
aaaaaa: And I use abbrevs for correcting common typos too. For instance, my fingers seem unable to type "the", and they more often come up with "teh". So I have an abbrev for "teh" that expands to "the".
6:22:41
TMA
beach: I don't use them because the Czech language is heavily inflected so there is not much to gain, unless there is a good language model to help. Which there is not, unless GPT2 or GPT3 was hooked in.
6:24:51
TMA
sure. I would feel like having a split personality if I used for one language and not for the other
6:25:40
beach
But I write a lot of French too, and there, abbrevs make things much faster as well. Different abbrevs for different languages, of course.
6:28:11
beach
But don't worry. I am not forcing people to be more efficient. I was just remarking on an observation.
6:30:29
TMA
I have tried to use them when I attempted to write my thesis , my setwas rather small, I felt there were not enough of the opportunities. Moreover the abbrevs I came up with started to clash with real words; I seemed unable to remember the unique ones. After I noticed I have forgotten to use the abbrev for the third time in a row I gave up
6:40:57
TMA
I needed to stop and think what was the abbrev for this even if I remembered there was in fact one
6:42:59
TMA
on the other hand, abbrevs (or smart completion) are awesome in code. I take m-v-b instead of multiple-value-bind. Not so for plain text.
6:45:52
beach
Well, there are two aspects to that observation. One is that you would not start by defining abbrevs and then try to remember them. You would start by observing words or phrases that you type frequently, and only then make an abbrev.
6:45:59
beach
The second observation is that you have to get used to your abbrevs so that you remember them. That is the same problem with any learning. In the beginning, it feels (and probably is) less productive, because you have to look things up fairly often. Only after some time do the savings kick in.
6:46:01
beach
It is of utmost importance for productivity to avoid the temptation of always using what you know. One must struggle in the beginning in order to get the great benefits later.
6:47:30
beach
If you don't take the time and temporary loss of productivity, you will always be stuck with the minimum set of key sequences, or worse, use the mouse too often.
6:48:27
beach
I have observed this again and again with my students. They use the arrow keys to go from the middle of a function to the beginning of that function. Even after I tell them about C-M-a and C-M-e, they continue with the arrow keys.
6:48:58
beach
I estimate that during a single 2h lab, the average students spends half an hour or so with unnecessary keystrokes.
6:49:48
beach
But, I also know that this phenomenon is due to some very strong psychological forces that are tough to compete with.
6:50:30
beach
And I am totally convinced, that as software developers, we have the obligation to fight those forces as much as we possibly can.
6:52:59
beach
In one of my industry talks, I present some figures about relative time for learning certain things, compared to the savings once these things have been learned. Humans tend to get the proportions wrong by 2 orders of magnitude. Not by calculating, but by letting the "fast" brain module make the decision rather than the "slow" one.
7:00:49
autumn[m]
I remember seeing a quote, somewhere (maybe on something about plan9?) that despite people swearing up and down that using the keyboard felt faster, the people given a task and asked to do it with the mouse actually were. But they may not have been using something like vim or emacs, idk!
7:09:44
beach
It is very hard to design experiments that show with some statistical significance such a result.
7:14:42
aeth
I probably learned about on average a command a month... which is a lot now, but it took time
7:16:25
beach
And since we are on the subject, another use for abbrevs is to avoid subjecting the other people in a conversation to your own abbreviations, like "idk", "thx", "afaict", etc.
7:17:28
beach
aeth: My point is that, despite being told about a faster way of doing it, they continued to use the painfully slow way.
7:19:04
Nilby
It might be hard to design an experiment, but it's easy to see the facts in a student lab.
7:19:07
beach
To become more productive, one has to pause each time and possibly look up the key sequence before taking the easy way out. It feels horrible, but the gain is just around the corner, contrary to the estimate by the "fast" brain module.
7:22:10
beach
Learning can be painful. But, by doing it frequently, one gets used to the feeling, and it can become quite enjoyable.
7:26:36
beach
And again, as software developers, I think we have an obligation to become more productive. Not just to make the industry as a whole more productive, but to prevent overwork and burnout. By becoming more productive, one can take more time for personal activities, like writing a library, or (very often) learning even more stuff to become even more productive.
7:29:39
Nilby
Sadly now with my Lisp environment fairly decent, my limitation is almost mostly in my slow/no brain module.
7:35:10
charlie770
Is there a book or an article, where I can see common-lisp app development in action?
7:41:03
beach
Nilby: The terminology "fast" and "slow" brain module is from the work of Kahneman "Thinking, fast and slow". The fast module is the one that is very bad with calculations and statistics. Trust the slow one more.
7:41:53
beach
Nilby: I recommend reading the book during the time your colleagues spend their day with unnecessary keystrokes.
7:42:34
charlie770
"Little bits of lisp" looks like a common-lisp tutorial. What I want is development of a full app. For eg. writing a compiler
7:43:42
minion
charlie770: look at LiSP: "Lisp in Small Pieces". This book covers Lisp, Scheme and other related dialects, their interpretation, semantics and compilation. To sum it up in a few figures: 500 pages, 11 chapters, 11 interpreters and 2 compilers. <http://pagesperso-systeme.lip6.fr/Christian.Queinnec/WWW/LiSP.html>
7:45:14
beach
charlie770: Also for writing a compiler, you probably need something like the books by Andy Appel and the one by Muchnick.
7:46:02
beach
charlie770: Such a thing, written in Common Lisp, would very likely make heavy use of CLOS, so that would be a good start to get more familiar with.
7:49:07
beach
charlie770: Then you should know that CLOS is not like traditional object-oriented programming.
7:51:45
aeth
Most languages (1) have your methods live with the class definition and (2) give methods a special infix dot syntax
7:52:54
aeth
so you have to live with their style of OOP (especially in Java) at the core of the language
7:53:34
aeth
On the other hand, CLOS lets you treat your methods mostly like functions, and you mostly use them for the polymorphism.
7:54:32
aeth
You don't have to really use CLOS, but more importantly, if someone else is heavily using CLOS in their library's API that you're using, you don't really notice.
7:55:59
aeth
charlie770: (defmethod foobar ((obj integer)) 1) (defmethod foobar ((obj string)) 2) (values (foobar 42) (foobar "hi")) => 1 2
7:56:23
no-defun-allowed
charlie770: I'm curious as to how you formed an opinion on object oriented programming then.
7:56:54
aeth
And FOOBAR itself is a generic function that is, in this example, implicitly created... You could put (defgeneric foobar (obj)) in front if you want
7:58:08
aeth
CLOS in particular does polymorphism based on the class of the argument, where classes are a subset of types.
8:00:29
charlie770
aeth: I'm aware of "selecting a function based on arguments" from SICP. I just never linked it to the word polymorphism.
8:00:59
easye
Does anyone know if under Windows SBCL expands a #\~ to a user home directory when parsing Pathname namestrings?
8:01:18
aeth
charlie770: there are a few other phrases, like e.g. "dynamic dispatch" (which in this case also means it's done at runtime rather than at compile time)
8:03:26
no-defun-allowed
Dynamic dispatch is a defining feature of object-oriented programming, and I suppose it kinda exists with typeclasses in some functional languages.
8:04:25
aeth
charlie770: most will have dynamic or static dispatch. Iirc, C++ is an example of the static kind, where the information is available at compile time. A quick search shows that it does have some dynamic dispatch, too, but it's very different from CLOS's because CLOS has multiple dispatch
8:05:52
aeth
Just one method will do, I guess. (defmethod foobar ((obj1 string) (obj2 number)) (values obj1 obj2))
8:06:34
aeth
Many hide the first argument since there's always going to be one and only one like that in a method
8:07:12
aeth
The typical example here is a collision method, and Wikipedia has it. https://en.wikipedia.org/wiki/Multiple_dispatch#Common_Lisp
8:08:24
aeth
Notice that 2 classes and 2 arguments means 4 methods... so there can be a lot of combinations if you really wanted to take advantage of multiple dispatch.
8:09:18
aeth
This chapter from PCL goes into detail... http://www.gigamonkeys.com/book/object-reorientation-generic-functions.html
8:11:33
aeth
Common Lisp rarely is the only language with a feature (maybe just the Common Lisp condition system?), but it has an interesting combination of features.
8:12:00
no-defun-allowed
Dylan has a condition system, but it's basically the Common Lisp condition system.
8:12:38
charlie770
aeth: The problem with classes, like macros is they that they can be used everywhere. You can wrap them around anything and still have a working program. People use oop as a silver bullet for every problem. They just don’t know what the problem is. Makes you wonder if there’s a method to his madness😉. If I wanted to understand oop, I think I need to know when not to use it.
8:13:36
aeth
CL just gives you a bunch of different equally-powerful tools to solve a problem and lets you decide which ones to use
8:14:08
phoe
that's the case with e.g. Java which has an "everything is a class or its subpart" approach
8:14:42
phoe
CLOS is optional do indulge in when you program in CL, since CL is a multiparadigm language and doesn't limit the programmer in choices like Java does
8:14:47
aeth
As I said a while ago, you can simultaneously entirely avoid CLOS in your code, and not even notice if other people's code that you're using is written via CLOS... mainly due to the uniform syntax and the focus on generic functions (verbs, not nouns)
8:15:17
aeth
Lots of languages give you the first option, but then if you use someone's library, you're going to have to deal with foo.bar()s
8:16:27
aeth
Okay, you'll probably notice MAKE-INSTANCE, but I like wrapping (MAKE-INSTANCE 'FOO ...) with a MAKE-FOO function, personally.
8:17:35
no-defun-allowed
Multiple inheritance and packages used to (approximately) enforce encapsulation instead of class relations.
8:18:49
aeth
With CLOS you have methods living with generic functions instead of with the classes... and the uniform syntax (generic functions are just functions) rather than the typical dot notation of method calls (which is infix and encourages noun-based APIs that focus on the object)
8:18:52
no-defun-allowed
I'm not sure if I should have expected you to know or not, given that you started this discussion with "I dislike object-oriented-programming!"
8:19:40
no-defun-allowed
Encapsulation is how you stop the external world from modifying the stuff that you don't want it to modify.
8:20:10
cl-arthur
charlie770: Would recommend you spend more time with it to the point where it's understandable and known if your main irk is confusion
8:20:17
aeth
charlie770: Encapsulation is often seen as an essential OOP feature, especially by C++/Java programmers, but in many languages it's just by convention. Really, I don't see it as an essential part of OOP because everyone does encapsulation to some extent. (At least, if it's some form of structured programming.)
8:21:44
aeth
Often, languages do just have a "private" keyword that they put in front of their methods and/or slots
8:22:43
charlie770
cl-arthur: I try to learn it. Then again, after a while, I think "I could probably do all this with macros"
8:22:44
aeth
CLOS is more in the encapsulation-by-convention camp (naming conventions, to be specific), like Python. Iirc, Python uses __foo (or is it __foo__?) while CL uses %foo
8:23:05
aeth
Arguably, the only true way to encapsulate in CL is with a closure (which is an entirely different kind of thing than OOP)
8:23:50
no-defun-allowed
You also have packages, and an agreement with the client that they can't use internal symbols and/or SLOT-VALUE.
8:24:13
aeth
no-defun-allowed: yes, but packages are a weak form of encapsulation because you can just do foo::bar and access the private thing even if foo:bar doesn't work
8:24:52
aeth
charlie770: you could implement OOP with closures... but CLOS (probably) isn't implemented via closures in any implementation
8:25:07
no-defun-allowed
aeth: Yes, then you write in the agreement that the client loses their keyboard and monitor if they do that.
8:37:13
aeth
What kind of application? There are some games, e.g. https://borodust.org/projects/trivial-gamekit/
8:37:33
phoe
there exists https://github.com/atlas-engineer/nyxt whose sources I have almost never read so I cannot say anything about the quality of the code there
8:38:28
aeth
The most popular application might be pgloader... which is apparently about migrating to PostgreSQL. https://github.com/dimitri/pgloader/
9:17:21
beach
Wow, this discussion reminds me of a student I once had, who moved to Bordeaux to avoid Ada, which was taught at the university of his home town. But after I questioned him, he admitted to knowing nothing about Ada at all. Disliking object-oriented programming while not knowing about encapsulation, polymorphism, or dynamic dispatch seems very similar to me.
9:18:11
beach
charlie770: I think you need to work on your basic programming skills and basic knowledge about software development tools before you can hope to start implementing an interpreter or a compiler.
9:18:21
phoe
it's even easier if you dislike the lack of knowledge itself and then project it onto whatever
9:20:53
charlie770
beach: I don't understand oop. Maybe that's why I dislike it. Maybe also because I could get away with it(using macros).
9:21:13
phoe
the best thing is to acknowledge it and move on with life while trying to fix the ignorance to the best of one's ability, no point in dwelling on it too much
9:22:45
charlie770
beach: do you think learning object-oriented-programming will make me a better programmer?
9:23:00
beach
charlie770: If you dislike things just because you don't understand them, you will be very limited in what you can do in the future.
9:23:08
dim
yeah pgloader can be used to move from Postgres to Postgres, the main use case is to have a alternative to ALTER TABLE foo ALTER COLUMN bar TYPE bigint USING processing_function(bar); but well we didn't solve all of the concurrency issues at the moment
9:23:31
beach
charlie770: Because you will then have an informed opinion about it, and you can make choices based on knowing what you are talking about.
9:23:47
beach
charlie770: That might be to avoid object-oriented programming, but at least you then know why.
9:25:17
beach
charlie770: I don't use traditional object-oriented programming, where encapsulation and abstraction go together. I much prefer CLOS-style programming, whatever you call it, where encapsulation is handled by the package system and the abstraction is done with generic functions.
9:25:41
beach
charlie770: But then, I understand both styles, and I have made my decision based on that knowledge.
9:26:22
dim
also when all you have is object oriented as the only architecture tool, I tend to dislike those programming languages (Java is the main example I can think of)
9:27:43
beach
dim: Right. For example, in order to create an anonymous function, some languages require (or used to require) that you actually create a class with a single method in it.
9:28:25
dim
beach: same with closures being only available within a class construct in Python, I guess?
9:28:38
no-defun-allowed
(And the inspirations for the former, Erlang and Smalltalk, to some extent, allow one to produce closures.)
9:29:47
beach
I also recently realized that, in some object-oriented languages, you defeat encapsulation entirely when you make a subclass. Then it is easy to, by accident, violate the original protocol.
9:30:07
dim
a friend of mine loved closures when he taught himself Clojure (the lisp inspired language in the JVM) but always though he wasn't smart enough for OOP, I showed him a class in Python is the same thing as a closure in Clojure and he was like “wow”, I hope he know realises he's smart enough ;-)
9:31:01
no-defun-allowed
charlie770: Message passing is what most people think of when they think of object-oriented programming, where objects collaborate by sending "messages" to each other.
9:34:21
no-defun-allowed
That's not quite the same as objects calling methods on each other, as messages can also be passed around as objects, allowing one to do a few things that would be tricky otherwise, such as selectively passing on messages to another object.
10:15:22
TMA
speaking of message-passing and OOP, I want to point out the power of reification. reification is an enabler for neat things. in the same vein is reification of computation environments as invented by beach here -- enabler for nifty things
10:44:35
TMA
in a sense it enables the programmer to do something that would otherwise be restricted to the compiler/system