freenode/#lisp - IRC Chatlog
Search
5:12:50
montxero
PCL was too practical for me, so I did'nt get past the first chapter. I wanted something along the lines of the paper so I started SICP with common lisp
5:13:39
montxero
ran into some problems, then someone here told me to stop nested `defuns` as that is a schemeism not a common lisp idiom
5:22:58
montxero
if I were to pa $2000 for a 2 day lisp course (where the lesson is not there ain't no shortcut), I would expect to be banging out sonnatas by the end of day 2. I should be able to write a prolog interpreter, library for implementing dependent types complete with a dsl for point free programming in lisp by the end of day 2
5:24:44
beach
montxero: There is some missing information here. First, there might be several participants, so per participant it is not much money. Second, that amount of money is peanuts to most corporations. Third, going to a course is not always meant to be a training thing, but a reward. Participants look good in the eyes of their colleagues.
5:34:04
montxero
AUD1760 per person 2 days this is not some Dave Beazely level program https://pythoncharmers.com/training/introduction-to-python/#details. I see p_l's point, and I agree that this will be great if covered by the organisation. Now I dare not check for one in common lisp can you imagine a recursively defined price tag with unwind protect when you want to back out?
5:44:19
no-defun-allowed
I'm not sure if one can thoroughly learn all that (even in Python) in two days. Maybe if each session spans most of the day, but that's not very likely.
5:45:52
verisimilitude
I read CLtL2 in the same way I read other dense technical books, across several months, reading some chapters in a day or so and spending weeks in the interim not reading the book at all. I doubt one could learn a large language in a single day.
5:46:26
verisimilitude
One could learn a good Forth in less than an hour, but Forth isn't a large language; with my limited knowledge of SQL, I suppose you could probably learn that in a day or two if you wanted.
5:47:44
montxero
p_l: charging such amount for training on using a tool/program/technology or technology is different from an introduction to programming training. A tool (from here on refers to something akin to a device not including pl) may be mstered in a relatively short period and may not be used too often. Often one only needs docs/manuals and a some tutorials to be on their way. Moreover the returns on time spent
5:47:50
montxero
on learning a tool is usually realised quicker than time spent on a programming language. A programming language brings with is certain idioms and ways of doing things that are not necessarily easily transfered to other languages
5:49:11
montxero
Since the prodcutivity of a tool can be realised quickly the upfron cost can be justified more easily
5:50:12
montxero
p_l: my point exactly, will you give a common lip for pythonistas course in 3 days?
5:51:15
montxero
they have some courses that do not seem bad, like the predictive analysis one. That seems fair enough but a in introduction to the language...
5:54:11
no-defun-allowed
[random Haskell line] see, you could be learning this instead of Common Lisp!
5:54:28
p_l
pillton: I did mention unlearning Python, didn't I? In my case it wasn't Python, but experience with Haskell helped dislodge some mental blocks I encountered with CLOS
5:56:52
pillton
p_l: I thought there was some anecdote involving Peter Seibel and Haskell and the road to PCL.
6:07:25
beach
montxero: I must have missed the beginning. What is your problem with this price for a course?
7:51:09
akater
Something I did not realize: change-class will make shared slot unbound if class C_to has no initform for it.
7:51:14
akater
Hence, when superclass has initform and subclass has not, super->sub will retain the value (even though e.g. its type check could fail)
7:51:21
akater
while subclass->super will not (even though type check would never fail in this case).
7:55:23
akater
oops, I transposed it: was talking about the case where superclass has no initform but subclass is more specific
8:03:48
hectorhonn
what are some notable libraries written in common lisp? for example, c++ has opencv
8:11:19
akater
I never used optima. From what I remember, trivia is an almost superset of optima, +enhancements.
8:12:24
shka__
hectorhonn: i think that petalisp can be really cool posterboy of cl libs because of high coolness factor
8:13:14
akater
fare even made some effort for trivia to “officially” supersede optima, as far as this is makes sense in CL.
8:16:52
akater
Does anyone actually understand LIL, besides fare? Only half joking, I never found any write-ups, or libraries which use it.
8:17:10
hectorhonn
maybe i should rephrase.. what are some notable libraries written in common lisp that are de facto libraries in that niche? for example, c++ has opencv which is de facto in the computer vision field
8:19:03
beach
hectorhonn: I suggest you avoid promoting Common Lisp unless you know in detail what you are talking about and what the competition looks like. Otherwise, you will likely get trashed and the result will not be advantageous to Common Lisp.
8:19:15
akater
I don't think there's anything de facto standard in CL, in a way which would be convincing for people who need CL to be promoted to them.
8:20:19
akater
hectorhonn: Well, I'm not sure if this could be described as “de facto standard” but there's a chance there's no alternative.
8:35:18
akater
CL is curiously hard to sell (to “people on the street”, that is). People keep saying something about parenthesis or how lists are stupid (and arrays are not).
8:36:14
akater
It's a riddle, really. I better spend time writing something cool and just telling facts about the standard and the community.
8:39:53
beach
shka__: People stick to what the belief that will make it unnecessary for them to learn something new.
8:42:02
beach
shka__: My (admittedly small) family recently had an exchange with a former colleague who thought Lisp was not used these days. When she pointed out Grammarly, ITA, Roomba, etc., the colleague immediately answered that Haskell would be better. So this professional developer assumed Common Lisp is a functional programming language. Convenient for him.
9:00:59
beach
With respect to applications, I really should get started on Clovetree (a.k.a. Gsharp version 2).
9:01:06
beach
McCLIM is way more mature now and it has facilities that weren't available at the time, in particular for using Truetype fonts.
9:01:14
beach
Now, with display resolutions no longer being a problem, I could use an existing Truetype font which would greatly simplify the code.
9:01:15
beach
It can't be an improvement to Gsharp, because I made a design mistake that I mean to fix in Clovetree.
9:02:21
beach
Together with Climaxima, we would then have two significant applications that are fairly unique.
9:02:54
dim
GuitarPro (not lisp, not Open Source, made by a local French company) has pushed the bar way far for parts editing for the guitar...
9:04:26
dim
I still believe there's an low-handing opportunity for CL in publishing “infrastructure” software rather than interactive software, maybe something that would help taming some of the Cloud offerings, dunno
9:06:40
beach
shka__: Looks can always be fixed by others. I am uniquely well placed to implement the essential data structure for making the editing experience possible.
9:07:36
beach
shka__: Sure, but Gsharp doesn't use McCLIM font rendering at all, because of the environment at our disposal some 18 years ago.
9:09:49
schjetne
beach: that's another one I have to show the product owner here. He got curious by me harping on about Common Lisp all the time, and found Common Music, so I showed him Opus Modus as well.
9:15:44
beach
schjetne: If the product owner and others are ripe, I'll be happy to come give a talk about Common Lisp, or a full-day course or something. :)
9:17:29
schjetne
I've been doing a lot of work with DSLs lately, which might be an argument to look into Common Lisp
9:18:29
schjetne
I've been using Kotlin, which has a neat DSL-building syntax, but I'm constantly bumping my head against the lack of macros: https://proandroiddev.com/writing-dsls-in-kotlin-part-1-7f5d2193f277
9:19:30
beach
So the mistake that most engravers (or score editors) make is to impose a meter on each measure. It's a mistake because it is a pain to edit then. Plus, composers are known not to respect the meter in their written music. That's why Gsharp is much faster when it comes to entering music material.
9:21:36
no-defun-allowed
Oh, I've heard about the "macros" in Kotlin before. From what I've heard, they emulate stuff like WITH-OPEN-FILE with a function that takes a function that takes the managed value, and some prologue and epilogue is handled by the "macro" writer.
9:22:56
no-defun-allowed
This, depending on how many macros you've actually used, is either a hygenic macro system (macros ≈ 0), a horrendous kludge (macros > 0, sad person) or the way Smalltalk and Ruby handle it (macros > 0, maybe not as sad of a person)
9:39:53
schjetne
It's fine for trivial things, for non-trivial cases it becomes all kinds of trouble, when you can't programatically create identifiers.
10:20:56
p_l
I'm not knowledgeable about music enough to do anything with it, but it looks like a nice example of good, end-user oriented Common Lisp applicaiont
10:22:59
p_l
also, from ELS in Cracow or London, there was a talk about some nice OpenCL-based work that was greatly optimized thanks to facilities enabled by CL
10:54:20
jmercouris
So I have a file upload form on my website, and that returns me a object like this: #<FLEXI-STREAMS::VECTOR-INPUT-STREAM {1003014B23}>
10:54:44
jmercouris
one would logically think, based on the documentation of cl-csv https://github.com/AccelerationNet/cl-csv that you would be able to read this input stream
10:56:11
jmercouris
how can I get cl-csv to actually read it? I tried flexi-streams:octets-to-string, but that requires a string
10:56:38
jmercouris
so then I did alexandria:readm-stream-content-into-string first, but then it didn't work
11:00:57
_death
the vector-input-stream is a binary stream, and make-flexi-stream can make a bivalent stream reading from it
15:20:39
beach
Since things are quiet here, ... A few hours ago in the #clim channel, I was inquiring about the possibility of implementing a "desktop environment" in Common Lisp such that it could work both on a GNU/Linux machine running X11 and Gnome and on some ultimate Lisp operating system.
15:20:48
beach
As it turns out, I am pretty ignorant about how such an environment would work. But it seems to me that the basis of such a thing would be a window manager, perhaps coupled with a workspace switcher.
15:20:53
beach
I am aware of Stumpwm, but I am not aware of a recent non-tiling window manager. As it turns out, though, my students wrote such a thing some 15 years ago, called Eclipse, but it hasn't been worked on for the past 8 or so years.
15:20:55
beach
If someone with knowledge about desktop environments would be interested in reviving Eclipse (and perhaps giving it a better name), I would encourage it. :)
15:22:49
beach
I don't know. It might very well work. But I suspect it is not entirely conforming when it comes to all the X11 conventions that a window manager must follow.
15:23:34
beach
I also don't know whether it could just replace the default window manager that I am using on Ubuntu, or what it would take to make that possible.
15:35:56
Josh_2
Any reason why I might be picking up a null character when sending data over the network?
15:36:25
Josh_2
The start of my string which is sent over the network has a #\nul and #\! at the start even though that is not present on the sending side
15:38:25
dim
beach: I was at school with Iban Hatchondo in Bordeaux in 1st year of university eons ago, but then I moved to other places… fun to see his name again ;-)
15:43:46
Josh_2
That gives me the string "\0!{\"resolution\":{\"x\":720,\"y\":1280}}" on the CL side
15:47:17
tempate
this may seem like a very stupid question, but I don't know when I should be using a macro
15:47:43
jackdaniel
tempate: when you have a boilerplate which you want to abstract into a single call
15:52:30
beach
tempate: The advice from jackdaniel is correct, but more general. A function may very well work for some boilerplate code.
15:55:07
tempate
coming from C, I don't really think in those terms, so when coding I think in terms of functions taking arguments and spitting results
15:58:10
phoe
imagine if the C compiler could generate code that looks like loop { for x from 0 to 10; for y = 2 * x; do { printf("%s %s\n", x, y); }; finally return 42; }
15:58:42
phoe
that's more or less what Lisp macros allow you to do with the syntax, since this is exactly how Lisp's LOOP macro works
16:00:38
beach
tempate: Except that Common Lisp macros are sane because they work on code as a data structure instead of text.
16:01:59
beach
tempate: You can think of functions as control abstractions, classes as data abstractions, and macros as syntactic abstractions.
16:02:24
djeis[m]
It's like if you could write C macros in C and they took a datatype more useful for manipulation than just strings.
16:02:34
phoe
C macros are interpreted by the C preprocessor and therefore have very limited abilities; Lisp macros are interpreted by the same Lisp engine that powers the rest of the system and therefore can use all of Lisp functionality to generate Lisp code.
16:03:13
phoe
that allows you to use e.g. functions, classes, other macros, to generate Lisp code inside a macro.
16:21:18
tempate
as an example, I'm trying to solve a couple exercises from L99. My current solution is https://bpaste.net/show/46ce5dc6ed84 but I have the feeling this could be done in a way better way, as the second and third functions are pretty much the same, and the last one, is looping through the list three times, which doesn't seem to be very good
16:24:36
phoe
or use LOOP's COLLECT like beach suggests if you don't want to deal with collection manually
16:26:14
tempate
yeah, it seemed I good place to use COLLECT but I wasn't too sure on how to use it, let me look at it more deeply
16:27:07
tempate
beach: still, even if I use LOOP, wouldn't I be looping through the whole sequence three time if I run the third function?
16:34:07
beach
tempate: Sure, you can combine the three functions, but that's not a question of using macros or not.
16:34:29
tempate
phoe: not sure if the default syntax should be to put the do after the if, i.e. if do, or just have the do in front of the first thing to do
16:35:08
beach
tempate: But you need slime-indentation to get the indentation of conditional loop clauses right.
16:35:19
tempate
beach: couldn't I write a macro that loops through the whole sequence and then add the inside of what to do depending on which function is running it?
16:37:43
beach
tempate: Sure, you can even write a function that does that. There are several, like MAP, MAPCAR, etc.
16:40:07
tempate
beach: as I understand it, if I run the third function, three loops are going to take place
16:40:08
beach
"a macro that loops through the whole sequence and then add the inside of what to do depending on which function is running it" seems like a good description of (LOOP FOR .. IN ...).
16:40:44
beach
tempate: Yes, when you run the third function, the other two are going to run as well.
16:42:26
beach
tempate: I think it will be hard to write any kind of abstraction that takes your three LOOP bodies and combines them so as to avoid creating intermediate lists, if that is what you mean.
16:59:33
nirved
tempate: instead of first and second you could use the loop built-in destructuring - (loop :for (count element) :in ...)
17:03:15
tempate
nirved: if you are referring to the third function, I need to sometimes return the list containing both the first and the second element, so I'm not sure if it's worth it
17:06:45
nirved
tempate: i use keywords with loop for syntax highlighting, and less symbol pollution