freenode/#lisp - IRC Chatlog
Search
18:17:43
foojin
pjb: Yes, that way I could hopefully understand the issue from a mathematical perspective.
18:17:46
foojin
I'm also interested in learning type theory to gain some insight into what I (for a long time) thought is true: that all of mathematics has a computational content to it.
18:21:19
foojin
Come to think of it, mathematics has already reached a level of complexity which can only be tackled by clever abstraction, so people _have to_ be clever about adding more to it.
18:24:27
foojin
But it doesn't help to harness the power of computers, to save oneself from mediocrity of not being able to intervene in, say, the process of interpreting someone's minified Javascript.
18:29:41
foojin
So I don't really know what to do in such a situation. BTW sorry for being off-topic and (possibly) being a nuisance.
18:33:12
foojin
The point is, even after learning enough to be able to fix broken stuff around me, it still feels like I'm not flying above the surface, but merely crawling out of an underground cave. It takes time just to stay afloat.
18:35:48
foojin
shka_: Yes, for a long time I thought that JS is actually a decent language. Not anymore, not after reading about its coercion rules and having stuff break silently because of _syntax errors_.
18:55:15
foojin
fe[nl]ix: I'm going to install Gentoo for that very reason, but the last time I tried to switch I couldn't find a way to make emerge print dependencies in a sane way.
19:01:45
foojin
Digging around in ebuilds just to understand why it installs X along with Y isn't fun. I think a package manager should do it for me, so I'll try it for real when I get around to patching it.
19:04:52
foojin
By the way, what do you guys think about Guix? It looks like someone finally tries to make a "uniform" (configuration language-wise) distro for people who aren't afraid of programming.
19:14:12
foojin
fe[nl]ix: The worst thing is that it's most likely true. "A distro for people with an \"optimal\" amount of free time to make it work like they want" looks like an unattainable ideal.
19:23:19
foojin
And that brings me to the main question: how to balance mediocrity (lack of control) and theoretical enlightment with perfect tuning and doing boring stuff like reading someone's C code / autoconf output / minified JS?
19:59:35
foojin
fe[nl]ix: Seems like the way to go. The question of having the right to do so is best asked somewhere else anyways.
19:59:38
foojin
Sorry for exploding all over the place with something completely unrelated to the topic.
20:01:23
foojin
If I didn't make everyone sick already, I have a programming language-related question that I've been pondering for a while.
21:17:00
foojin
What features can make programs written in a (hopefully not hypothetical) language easier to extend, given that
21:17:16
foojin
(3) the extensions should take advantage of further upstream improvements by augmenting existing things, not reimplementing them.
21:18:29
foojin
According to the history of Emacs, Stallman admitted to having used dynamic scoping for this very reason.
21:21:49
TMA
foojin: treat every interaction between parts of a system as an extension point; do not use the extension points internally
21:22:08
foojin
Lexical scoping is immensely useful, but anyone, who "fixed" a chunk of closure-heavy JS with a so-called "userscript", would surely admit to having had a hard time working around them.
21:23:35
phoe
CLOS itself is insanely extensible with its BEFORE/AROUND/AFTER methods and ability to define subclasses and new methods on same generics
21:24:29
TMA
foojin: a concrete representation of my advice is: use CLOS, but do not use :before, :around or :after methods yourself to let them be available as the extension points
21:33:06
foojin
phoe, TMA: I've heard a lot about CLOS and MOP, they're the main reasons (besides Scheme's lack of libraries) I once again picked up "On Lisp". But what about a more "fundamental" data type, functions?
21:33:59
foojin
What do you think about an operator that creates a function F as if it was defined where another function G (given as a value) is (yes, it will impede compilation and possibly hold onto objects that no one will ever use).
21:35:48
foojin
That could solve the problem of people stashing too much stuff inside closures, making their functions "unwrappable".
21:39:17
foojin
Bike: That is, in the same lexical context, to make it possible to replicate any closure.
21:40:06
Bike
so it would require having the point at which any function is defined have its entire lexical environment saved along with the function?
21:41:38
foojin
Nothing. I do think that CLOS is a more proncipled and general solution, so the last question isn't related to that.
21:41:48
phoe
instead of saving all the state in a lexical closure, save that state in a CLOS instance and use methods instead of functions
21:42:16
phoe
the "fundamental" data type that you describe will give you more PITA than a CLOS-oriented approach.
21:50:33
foojin
phoe: I see. That seems to even take care of what's in scope, so that whatever the original author used would still be available for the extension code.
21:52:44
MichaelRaskin
foojin: well, if you are ready to do partial recompilation, and to use a powerful enough code walker…
21:54:11
foojin
phoe: And the original author would have to deal with "undercomposition", if someone's extension requires their code to expose a particular point.
21:54:16
aeth
Nearly every time I started out with my own defgeneric/defmethod (as opposed to defining some method to fit someone else's API) I wound up converting it into a defun later.
21:55:39
aeth
(I'm obviously excluding the methods that are generated automatically in defclass, of course)
21:56:24
Bike
i thought you were going to talk about method combinations or something, not the part everyone uses
21:56:46
MichaelRaskin
A tool that allows to traverse the code after it has been written, and maybe even make some changes
22:01:07
Bike
i don't think "i thought i needed methods, but actually i didn't" is a very interesting story
22:01:26
Bike
like if nothing else you should elaborate on the particular circumstances or something
22:01:54
foojin
MichaelRaskin: So it's a interface which can be used by the program to modify itself, relying on the compiler to keep everything available?
22:02:20
foojin
MichaelRaskin: Or did you mean a particular kind of editor that people use interactively?
22:03:04
aeth
Bike: Idk, I think a lot of modern styles (some of which Lisp could do before CLOS even existed) could probably be described as "post-OOP" styles.
22:03:30
MichaelRaskin
Bike: full semantics is not really needed for a code walker, but understanding the general Lisp code structure is a must
22:04:23
aeth
Bike: If anything, I think we might be at the point where OOP is underused in places where it could be used, as a reaction to its earlier overuse.
22:05:47
aeth
Most of the "big" hype in languages these days seems to be people trying to copy and paste Haskell into JavaScript or the JVM.
22:07:11
aeth
Bike: It's not a contradiction because I was talking about my own personal overuse of a CLOS feature before, and now I'm talking about what trends I've observed in programming language hype.
22:08:00
MichaelRaskin
foojin: I would imagine — in Lisp terms — a custom readtable that leads to every form being wrapped in a macro that expands to what was originally written (by default)
22:08:27
MichaelRaskin
But then a user can request some override or ask to inject some code somewhere
22:13:42
MichaelRaskin
And in the repository, there is an example of the crazy wrap-everything trick
22:25:18
foojin
I see. It basically allows one to run arbitrary queries against the source code, check assumptions ... like Coccinelle, which kernel folks use, but for Lisp?
22:27:51
foojin
BTW I wanted to learn Coccinelle to hack on tmux, but there's not much in the way of resources besides a language grammar and kernel-related checks.
22:29:01
foojin
I thought it would make reasoning about C easier, but it turned out to be a PITA in its own right.
22:32:52
MichaelRaskin
(also, it expands most macros, so old indentation is not always even applicable)
22:33:39
Bike
foojin: in lisp we don't usually deal with source code as text/character sequences. metaiconicity and all that shit
22:34:53
MichaelRaskin
I guess some tools from SICL or Second Climacs (primarily by Robert Strandh) could be applied, those do care about text-code correspondence
22:37:20
foojin
Bike: It would come in handy to automatically enforce guidelines, like those used in kernel development. Is it a good idea to make additional context information available for cases like this?
22:41:07
foojin
Say, the indentation level and type, like ((spaces 2) (tabs 3) (spaces 1)). If it's too granular, provide functions to assemble a textual representation based on those cues.
22:43:44
foojin
It would work just fine as-is, for checking code before trying to commit it, but large-scale refactoring would leave a mess instead of formatted code.
22:45:28
Bike
you're thinking in terms of text. text is pretty much a separate question from what a code walker does.
22:45:44
aeth
Comments are the real problem. Most CL code can be restored with *print-case* set to :downcase
22:46:53
aeth
And if you use fancier features so that isn't true then you probably already violate good style
22:49:59
foojin
aeth: In other words it's not a problem, since there is such a thing as _the style_, which this *print-case* is aware of and everyone is encouraged to use?
22:50:31
Bike
not so much as there's a "the style", as that you can write a program that prints code as text in whatever style you want
22:51:16
aeth
Well, my original point is that you can theoretically restore everything but comments easily
22:54:48
foojin
Bike: Which in turn could make use of the code walker to distinguish forms based on their meaning. I didn't think of that.
22:55:37
Bike
beach has a lot of stuff in mind for a really smart editor that uses that kind of knowhow
23:00:27
foojin
Come to think of it, there are actually people out there who make Emacs parse all those programming languages, probably reimplementing sizable chunks of existing parsers.
23:01:07
foojin
I'm still uncomfortable with paredit just reindenting the whole thing after an operation. The author even admits to the shortcomings of this approach in a comment before paredit-convolute-sexp.
23:14:35
foojin
By the way, why do Lispers use ^L in their programs, if not to take advantage of Emacs' narowing/moving functions?
23:28:43
foojin
p_l: I almost thought the reason would be to use it with some kind of tool that expects it. Maybe in Elisp world this is about consistency, seeing as it's used in Paredit, which doesn't seem too old.
23:29:29
p_l
foojin: ^L predates GNU Emacs, and afaik by itself gets hooked into "next/prev-page" commands
0:01:02
DemolitionMan
please how can I encode rfc3339 date time into nanoseconds integer 64? hanks for helo
0:44:18
MichaelRaskin
Of course, nanoseconds eat quite a bit of bits. But 64-bit number should still be able to represent entire 21st century. And 22nd too, if unsigned
0:54:07
MichaelRaskin
I mean, Unix time also doesn't run out in 2038, it's just that some systems store it in a way with not enough space for the next digit
1:22:53
Fare
MichaelRaskin, the problem with nanosecond encoding of something defined up to one-second adjustments is... what happen at leap seconds?
1:24:01
Fare
(That said... it's the time encoding I use in Gerbil's clan/utils/date.ss so who am I to cast any stone?)
5:55:38
loke
;; Compute points to plot for each element of FUN. ;; If no plottable points are found, return immediately from $PLOT2D.
6:00:20
loke
Maxima is really old code, and it's still maintained to support every Lis under the sun. They still maintain GCL compatibility.