freenode/#lisp - IRC Chatlog
Search
3:13:12
lukego
Thanks everyone for the rigorous discussion of datatype definition styles yesterday. I reread the Serapeum docs from beginning to end to try and update my mental model. For really ad-hoc internal data structures I need to experiment with DICT/MATCH and with DEFUNION.
3:18:59
lukego
Maybe DEFCLASS verses DEFCLASS-STD (etc) is a false dichotomy and really there are a lot of different contexts for defining datatypes that each call for a separate mechanism. kinda like IF and WHEN and UNLESS and so on.
3:19:54
lukego
I notice though that all this obsessing about how to define datatypes has not actually caused my broken program to start working and maybe I should try a different approach to that problem...
3:40:43
beach
I completely misunderstood the context and thought lukego and jmercouris were talking about the use of these operators in more-or-less final code, but it became clear that they meant the use in code that is highly likely to change, to be rewritten, or to be deleted entirely.
3:41:57
lukego
beach: I am feeling less provoked by your "if you don't care about X" comments when I read that as "when you are not immediately concerned about X in your present context" rather than "when you are a bad person because you don't give X due respect" :)
3:43:21
beach
lukego: Sure, that's a good interpretation in your case. Not so with many others who come here and who have no idea about elementary software engineering.
3:44:11
no-defun-allowed
fiddlerwoaroof: Yes, you're supposed to use generic functions, i.e. no defun. Cancel out the two negatives, and you have only fun.
3:44:40
lukego
it's a new revelation to me now though that there are a bunch of other macros, e.g. DEFCONSTRUCTOR from Serapeum, that actually capture the context i.e. that is something that you only use for a quick and simple local representation of immutable structures.
3:45:33
fiddlerwoaroof
And, what I've noticed, is that almost all "functional" programming languages use constructs that are OOP in CLOS's sense
3:46:08
fiddlerwoaroof
Clojure's multimethods are just a bad version of CLOS and Haskell has typeclasses everywhere, which basically are a compile-time version of generic dispatch
3:46:15
lukego
and that puts me off defclass-std as being "yet another defclass" rather than something complementary that's tailored to a more specific use case.
3:46:47
beach
fiddlerwoaroof: You must have missed the general consensus here in #lisp that you should avoid generic functions since they are bad for performance.
3:48:45
lukego
I liked splittist's comment that the rest of the world is built in Javascript these days so there's nothing particularly indulgent about using all the generics and indirections you please. Chrome has reset the bar on what is appropriate resource utilization by software and we can all rejoice in our relative thrift :)
3:49:42
fiddlerwoaroof
Like, I think it's probably hard to right a compiler for a dynamic language that comes close to V8
3:49:51
beach
lukego: Facts like that don't seem to prevent eternal discussions about performance. Not to mention the size of executables.
3:51:18
lukego
fiddlerwoaroof: so much the better :) writing slow code is contributing to computer science by stimulating compiler research, just look at javascript...
3:51:35
fiddlerwoaroof
The great thing about CL is that I find I can just write CL in most situations where I'd use FFI in Python
3:51:48
fiddlerwoaroof
Not to mention actually being able to benefit from multiple threads of executin
3:52:32
beach
The more I hear about Python (the language) the more I think it's a joke, and the more I am totally baffled why anyone would want to use it.
3:53:27
fiddlerwoaroof
Also, it's relatively quick to go from nothing to a proof of concept in Python
3:54:40
lukego
I like that "I must program as inefficiently as possible" mantra. that it's healthy mental exercise to burn CPU cycles and you should strive to do it as much as you can get away with.
3:55:56
lukego
or maybe we should fight to get our own code a respectable share of our CPU's cycles relative to e.g. Chrome and the idle loop :)
3:56:33
fiddlerwoaroof
I don't take a program seriously that doesn't pin at least one CPU core and consume 4GB of RAM
3:59:31
lukego
(also my code is working now and it's massively improved compared with the previous messy version so thanks everybody who helped me pick the right color for my bikeshed, it worked out in the end)
4:01:00
lukego
I really notice that after a break from Lisp hacking it takes a while to reabsorb all the old idioms and learn new ones. a bit like taking a break from speaking english. big languages full of nuance that are always evolving.
4:01:23
beach
I am reminded of the remarks by several students in the past when they were given a bad grade on some programs: "But it works!!!".
4:32:59
no-defun-allowed
beach: From memory, the marking system at my last university was predominantly marking what ran. Who were you teaching?
4:38:40
beach
Final year undergraduates and first year masters students. The message was always that a program that works but that is unmaintainable is useless because it must be thrown away when the requirements change, but a program that does not work but is maintainable can be made to work more easily.
4:39:10
beach
So we read the code of each program and graded (marked) it according to these criteria.
4:40:01
beach
I am totally sure that this is still the case for the masters students, because I know the person running that course very well, and we share the same values when it comes to software development.
4:43:46
beach
It was a lot of work, of course. But more to the point, this kind of grading requires the teachers to be competent in software development, and that is typically not the case when they are hired, as I have already explained. So these teachers had to invest a lot of time reading and writing code, books, and articles about software development.
4:44:48
beach
And that time was not explicitly paid. In fact, by spending that time on teaching rather than on some narrow research, their careers were often delayed.
4:47:18
fiddlerwoaroof
I've always thought that the way universities have seemed to unified research professors and teaching professors is bad for everyon
4:48:12
moon-child
fiddlerwoaroof: I think the theory, at least, is to avoid 'those who can't do teach'
4:48:46
beach
fiddlerwoaroof: Not usually. Take mathematics or the sciences (physics, chemistry). The undergraduate teaching doesn't require them to keep up, or to acquire skills from industry. The material is the same from one year to another.
4:49:23
beach
The problem is that the computer science programs accepted to take on the teaching of programming and software development.
4:49:33
lukego
I approach software development more like the way people advise writers to write. lots of drafts and rewrites and darlings and murders and so on. but desired end result is still the same as people who do things right first time.
4:50:03
beach
If they had stayed with theory, like computability, complexity theory, etc. There would be no problem.
4:50:32
lukego
I often don't even compile my first version of a program before rewriting it - just dump it out into emacs to organize my thoughts - so I really don't want to spend cycles thinking about optimization or maintainability or even syntax errors in that context.
4:51:44
fiddlerwoaroof
So, my background is mostly in the humanities (grad school and undergrad): but, my experience there was that the professors who were really good at research often weren't great to have as a teacher while the ones that you wanted to teach you often weren't the people who are famous for their ideas
4:52:50
lukego
beach: mostly just reflecting on friction in the discussion yesterday, specifically realizing that when I'm in "rough first draft that won't even compile" mode I'll naturally be at odds with your advice about how to write clean code that will pass formal review.
4:52:55
beach
fiddlerwoaroof: The problem in software development is that we have no good way to select knowledgeable teachers.
4:53:44
no-defun-allowed
(...to which I think Joe Armstrong nailed the apparent decision between performance and good design with "Make it work, then make it beautiful, then if you really, really have to, make it fast. 90 percent of the time, if you make it beautiful, it will already be fast. So really, just make it beautiful!")
4:54:11
moon-child
imo 'make it fast' is a misnomer. There is no fast code. There is slow code, and if code is slow then it bears to make it not slow
4:54:20
lukego
beach: and I guess that there are different kinds of advice about how to write good code. one kind focuses on what the result should look like - clean interfaces, etc - and the other focuses on the process - should have been rewritten at least N times and be only 1/Mth its original line count
4:55:19
fiddlerwoaroof
lukego: I generally write the code you're talking about as drafts in the repl
4:55:51
fiddlerwoaroof
After I'm fairly satisfied with a solution, I copy it into a file and generalize
4:56:07
lukego
fiddlerwoaroof: I'm becoming more extreme over the years. I can easily spend several weeks writing draft code that never compiles. I wouldn't do that in the repl
4:56:20
no-defun-allowed
Or at least, I think my "fast code" is relatively nice, because it uses the right data structures and algorithms and whatever else that quiche-eater Nicholas Wirth probably said was good.
4:57:50
lukego
maybe I'm progressing in my career towards drawing useless UML diagrams all day in some senior role at an IBM-alike.
5:00:53
fiddlerwoaroof
lukego: my career started out with Delphi and, ever since that was taken away, I've found it really annoying to write GUI software
5:18:56
fiddlerwoaroof
It's annoying to setup on a Mac and relatively unstable (at least, the Cocoa port is), but the experience of using it still is so much better than the React stuff that pays the bills
5:19:36
lukego
I'm really impressed with GToolkit for Pharo Smalltalk as a development environment. I started off using it for this project before switching to lisp
5:20:08
fiddlerwoaroof
It's something I think about every once in a while: as an industry, I've begun to think our memories are so short that we just forget everything that happened more than five years ago or so
5:20:33
fiddlerwoaroof
lukego: yeah, I've always been interested in that ecosystem, but I've found it hard to get started
5:22:27
fiddlerwoaroof
Like, I'm working on a react native application and everyone's talking about how "X doesn't work for mobile apps because of how much harder it is to deploy mobile apps than websites", completely ignoring that X was practiced when shipping an update meant shipping CDs in boxes
5:22:44
lukego
I think that my memory is becoming more of a "high-pass" filter, seems to just ignore anything that happened _less_ than five years ago and assume it's a passing fad
5:30:04
no-defun-allowed
Most of the references in the book I sometimes write are from 2010-2019 or 1990-1999. Did people just not have ideas in 2000-2009?
5:31:58
fiddlerwoaroof
XSLT and XPath get an honorable mention (both of which I actually secretly like)
5:38:36
aeth
no-defun-allowed: for programming? in the early '00s "everyone" got laid off and left the industry because of the dot-com bust.
5:39:19
aeth
you can also look at some interesting stats like enrollments in university comp sci departments.
5:39:39
no-defun-allowed
aeth: Well, mostly programming. Though if I redraw the histogram with 5-year bars, I see that 2005-2009 was strangely quiet.
5:40:25
fiddlerwoaroof
The last time Haskell was a language with a specification and multiple viable implementations :0
5:42:15
no-defun-allowed
The 90s brought about Squeak, the end of Self, the Unix-Hater's Handbook and the second edition of SICP.
5:43:04
fiddlerwoaroof
The 2000s were basically the years when Microsoft was at the height of its power, afaict
5:44:20
fiddlerwoaroof
The Unix vendors were basically irrelevant for most people, the Web was still being held back by IE6
5:48:39
fiddlerwoaroof
lukego, you just showed up in a Google search: https://github.com/lukego/blog/issues/5
6:47:41
lukego
fiddlerwoaroof: the ultimate reason that I switched from gtoolkit to lisp is for the language. in Lisp I feel free to write basically pseudocode and gradually massage/rewrite it into something the compiler understands. in smalltalk I can't even Save code that doesn't have correct syntax, isn't organized into classes, doesn't adhere to the rules about inheritance and traits, etc.
6:48:20
lukego
but I've used gtoolkit a lot in a previous project and the big problem then was that they were constantly rewriting it and it was very difficult to build from source (which i spent weeks and weeks fighting and ultimately gave up on)
6:52:06
lukego
but I think that I was unlucky with timing -- I wrote an application based on the "old gtoolkit" that they did at a university and then they immediately formed a company to develop the "new gtoolkit" and there was an awkward period there where the old version wasn't supported anymore but the new version wasn't ready to use yet
6:57:21
lukego
bringing this back to lisp -- it's actually a strength that a lot of stuff here is basically the same as it has always been. I don't spend my time trying to keep up with the ecosystem every month -- or even necessarily have to worry about what's changed in the past 10/20 years.
6:59:04
lukego
maybe I'm getting old but "stability" is a feature to me these days and pretty high on my priority list. I'm glad that Lispers don't "burn the diskpacks" every five years.
7:06:37
fiddlerwoaroof
Yeah, I really grew to appreciate that, both in CL and in working with Clojure
7:07:11
lukego
random follow up of past discussion: I'm super happy with the 1AM unit test framework. it's about 80 lines of code and just the right level of minimalism for me.
9:27:51
asarch
If I had: '(:|beer| 10 :|pizza| 4 :|tacos| 8) how could I converted to: (:beer 10 :pizza 4 :tacos 8)?
9:29:49
asarch
If that would be stored in food, doing a (getf food :|pizza|) would gives me only the value
9:30:38
no-defun-allowed
What did you use to generate that list? I am guessing some parser took every key and did (intern <key> '#:keyword)
9:30:48
beach
asarch: I think we are saying, don't create a symbol with lower-case letters in the first place.
9:31:52
asarch
That's the result of a query with CL-DBI: (dbi:fetch-all (dbi:execute (dbi:prepare *connection* "SELECT * FROM somewhere WHERE flag = ? OR updated_at > ?") (list 0 "2011-11-01")))
9:32:03
no-defun-allowed
Does cl-json do that? No, that generates alists and converts to upper kebab-case by default -- oh okay.
9:33:03
White_Flame
or probably easier but less robust would be (read-from-string (symbol-name key))
9:33:51
no-defun-allowed
An interesting result format. (n.b. I think you should stash the prepared statement somewhere, if it hasn't been folded in for the example.)
9:34:37
White_Flame
but yeah, I agree with beach. The canonical names are :|beer| etc, use that syntax
9:35:05
White_Flame
if the names all of a sudden have other cases, for some reason, or you need to re-assert into the database that those came from, you need to use the same key
9:38:53
asarch
Here in México Dell is selling this https://pasteboard.co/JVwoB5Y.jpg at the ridiculous prices of ~$1,000 USD. It would be great instead of a "normal" laptop, right?
9:40:09
asarch
I usually do with the A method, that's why I have all these functions getting data from the list with (getf food :pizza)
9:44:27
asarch
One last question: how do you get automatically the keys (:|beer| 10 :|pizza| 4 :|tacos| 8)?
9:49:17
silasfox
(mapcar #'upcase-keyword '(:|beer| 10 :|pizza| 4 :|tacos| 8)) => (:beer 10 :pizza 4 :tacos 8)
9:52:20
beach
silasfox: In particular, if the value is a keyword, that should perhaps not be altered.
9:54:09
beach
Furthermore, INTERN takes a "package designator", so you can say (intern ... "KEYWORD")
9:54:54
White_Flame
yeah, i always forget about package designators and always just grab a package quickly
10:01:07
White_Flame
beach: actually, I think it started off as more a performance thing. (find-package ...) is a function call but (symbol-package ..) just reads a slot from a read-time-interned symbol ;)
10:01:29
White_Flame
(as in, nitpicky cycles that don't really matter but dangit this is more direct :) )
10:13:49
beach
White_Flame, on the other hand, SYMBOL-PACKAGE may very well be a generic function in some implementations, and everyone knows how slow a call to a generic function can be. :)
10:48:56
fiddlerwoaroof
Rather than figure out how to interface with my OS, I've discovered it's relatively simple to write a VNC server that serves a framebuffer over the "network"
10:50:30
fiddlerwoaroof
And when I say "write a VNC server", I mean "fix a code sample I found online"
10:51:35
fiddlerwoaroof
Now, I just need to figure out how to teach McCLIM how to write to this server
10:57:11
scymtym
fiddlerwoaroof: for a McCLIM backend, you have to decide on the frame management model: should the VNC server expose some sort of virtual desktop with multiple windows ("frames" in CLIM terminology) and window management or should the VNC server correspond to a single window and always show the content of that window?
10:59:10
scymtym
this is an example of the former, that is multiple frames with decorations, etc. in a browser tab: https://techfak.de/~jmoringe/mcclim-broadway-7.ogv
11:02:57
fiddlerwoaroof
That's a cool demo, the issue I always have is the "window in window" paradigm there always feels a bit odd
11:15:47
scymtym
fiddlerwoaroof: yes, there is a websocket connection that sends input events from the javascript client to the server and sends display commands from the server to the javascript client
11:44:28
lukego
silasfox: did you just write an irc message that included newlines and indentation? is that possible? <mind-blown.gif>
12:29:23
SAL9000
lukego: "newlines" in IRC come through as multiple messages, and more than 3-4 such lines usually cause the server to rate-limit you
13:09:50
jmercouris
the questions will be created by the user to determine if a piece of text is logically sound
13:12:08
jackdaniel
it is the full automatization - you don't need to read the document to browse it
13:14:35
splittist
jmercouris: as sm2n says, this is sort of the opposite of what I understand an expert system is
13:14:41
sm2n
I don't think using automated nlp is a good idea... it suffers from similar issues as the misinformation generating processes
13:16:15
sm2n
I think the general idea is decent though, say you have a document open, maybe you could have a "pane" or something that displays a formalized logical inference tree, in natural deduction form or something
13:17:24
sm2n
https://en.wikipedia.org/wiki/Natural_deduction , though you don't need the fancy deduction
13:18:50
jmercouris
I don't think someone susceptible to 'fake news' will have the rigor to complete such an exercise
13:19:12
splittist
I'm not seeing how computers help here. Take this text: "The LaTeX sources were converted to html using the latex2html program. We fixed many of the glitches by hand, but may have missed some. When in doubt, check your copy of the original paperbound version." What is supposed to happen when I'm browsing that?
13:19:45
jmercouris
LaTeX sources were converted to html using the latex2html -> latex2html converts latex to html
13:21:50
splittist
Hmm. If I'm reading an article that says "All men are mortal. Socrates is a man. Therefore global warming is [insert conclusion here]" a big red cross appears saying "incorrect inference"?
13:23:26
sm2n
at least, that is my take, error prone automated processes should augment human reasoning, not replace it
13:35:09
jackdaniel
I am saying that I see plenty of buzzwords that are not ontopic on this channel and could be categorized as a deceptive marketing
13:40:10
jackdaniel
no, I am saying that "I see plenty of buzzwords that are not ontopic on this channel and could be categorized as a deceptive marketing"; I'll put an emphasis on the offtopic aspect of that statement