freenode/#lisp - IRC Chatlog
Search
4:23:06
beach
Maybe here is the answer: http://www.chiark.greenend.org.uk/doc/sbcl-doc/html/sbcl-internals/Type-tags.html
4:26:24
beach
Unless you are working on SBCL internals, you should not have to think about tags at all.
4:27:37
anniepoo
I'm writing (cleaning up) a tool to strip out a bunch of info after compilation, to deliver a minimal size runtime object file
4:30:00
beach
A great opportunity to get back into the game. Things have changed a lot since then. Not the language, but things around it.
4:30:25
beach
Even the programming style conventions change slowly over time, just like natural languages do.
4:32:15
beach
And we have (somewhat) better tools for free implementations. Genera, of course, was a lot better than what we have now.
4:32:47
aeth
stylewarning, fiddlerwoaroof: Personally, I would just use type declarations (and related type things) to mix "static" with CL. It works very well with SBCL (with safety above 0) except for :type in slots in defclass, which are only checked with (debug 2) (I think it's when the defclass is *defined* within a (debug 2)). There are some issues here or there with other implementations, but I will document them some day and hopefully those can
4:33:09
loke`
beach: I think it's more precise to say that is was better in some respects. Not everything has gone backwards :-)
4:33:31
stylewarning
aeth: I highly disagree. That requires monomorphising all data structures, and even Common Lisp is happy to have polymorphism everywhere.
4:34:36
stylewarning
aeth: But even so, ignoring that (major) aspect, it also requires heavy declare/check-type discipline, which is fine, but it gets difficult to precisely express the types you want to express without descending into a bunch of SATISFIES types. How do you express a list of symbols, in Lisp?
4:34:44
anniepoo
I know most of the fp basics- I wrote Lisp for Apple years ago. I know clojure and I'm a Prolog maven. But yeah, everything seems to have changed.
4:35:23
aeth
stylewarning: You can use https://github.com/Bike/introspect-environment directly or use something that uses introspect-environment, but unfortunately those only have access to *declarations* and not what the implementation's type inference system infers.
4:35:36
beach
anniepoo: So one thing that has changed is that more Common Lisp programs are object-oriented these days. Using CLOS, of course.
4:35:48
stylewarning
aeth: How do you express that a variable should be bound to a value which is a list of symbols?
4:36:45
beach
stylewarning: You can use regular type expressions developed by Jim Newton and Didier Verna.
4:37:17
aeth
stylewarning: The weakness is data structures, but there are ways around it. There actually is a type syntax for cons cells, but afaik it probably is O(n). What I did was define a struct that has foo as a foo-car and itself or nil as the foo-cdr (an alternative could permit trees at the cost of not being able to O(1) check that it's a proper list)
4:38:33
stylewarning
Lisp can express a huge variety of data structures, like lists of symbols, for example.
4:38:40
anniepoo
IIRC the first time I ran into keywords :foo was when I started clojure. I don't remember them from whatever ancient version of lisp I was using at apple
4:39:41
aeth
stylewarning: :type in struct slots tends to be respected, and works very well in SBCL. But now you're mostly stuck with structs and functions/lambdas/lets. And you don't really have a good way to deal with ftypes, even in SBCL.
4:41:52
stylewarning
aeth: I think you're still overestimating the compile-time safety afforded by type annotations with SBCL for a project like building a compiler. :)
4:42:15
anniepoo
it was an internal tool for Apple - maintaining fonts was painful, I wrote a font compiler-decompiler that turned them back and forth into s-expressions
4:43:26
aeth
stylewarning: SBCL will statically type check within a compilation unit or file, and if you turn on sb-ext:*derive-function-types* (off by default because it violates the standard) it will assume that ftypes will not change even if the function is redefined and will do even more static type checking. You might have seen the former before if you redefine a function with C-c C-c and SBCL gives a type error.
4:44:00
fiddlerwoaroof
anniepoo: (don't answer if you don't want to connect identities) but, were you the run offering the prolog course on twitter?
4:46:02
anniepoo
https://cutebouncingbunnies.wordpress.com/2017/04/25/the-standard-sequence-for-prolog/
4:46:08
fiddlerwoaroof
cool, I wanted to participate, but I was too busy moving/etc. to actually do anything
4:46:31
anniepoo
send an email to anne@swi-prolog.org saying you want to be informed next time it's offered
4:46:59
aeth
stylewarning: Anyway, I don't think what's there for types is satisfactory, but it's something that hopefully will be extended in the future, particularly with non-T data structures (when I write in this style I'm basically stuck with structs and my custom metaclass), generics, and ftypes.
4:47:25
loke`
LdBeth: I downloaded Pharo and then found soem online tutorials. That's how I started looking at ST
4:49:34
fiddlerwoaroof
aeth: that's good for performance critical code but it's effectively turning Common Lisp into Pascal or Java 1.1
4:50:36
fiddlerwoaroof
The things that make Common Lisp pleasant are things like generic functions, clos and various other higher-order techniques
4:51:57
fiddlerwoaroof
(at least, CLOS and generic functions and the condition/restart system are the main reasons why it's my favorite language)
4:53:58
stylewarning
If the claim is that adding strong type decls turns parts of your program into Pascal-y code, then I agree.
4:54:44
fiddlerwoaroof
If we had a good polymorphic-type DSL, I'd never consider using anything else
4:54:45
aeth
stylewarning: Pascal-y code, but not Pascal code, because you can have length (*) not just length (0), (1), (2), ... :-)
4:58:18
aeth
fiddlerwoaroof: This is the sort of problem that would have to be solved at the implementation-level. And several implementations since CLers hate unportable code.
4:59:26
fiddlerwoaroof
You can't really get the sort of type system I want without implementing a new language anyways.
5:00:00
fiddlerwoaroof
The important thing is that it be designed, like Clojure, as a hosted language with nice interop with the host language.
5:19:42
LdBeth
This great slides makes me question about do dynamic/static type really differentiate
5:20:56
fiddlerwoaroof
alternatively you could use this: https://github.com/TeamSPoon/wam_common_lisp/ anniepoo
5:37:14
loke`
no-defun-allowed: Maxima is weird in a different way. It's what you get for being a 40 year old code pase, origianlly written in maclisp
5:40:12
loke`
That's my CLIM UI that uses Maxima to perform computation, and uses CLIM to render the maths
5:49:30
stylewarning
No, I’d love for it to. My own “syntax” is barely syntax. It’s just typesetting object construction.
5:50:06
loke`
stylewarning: My renderer uses Maxima's syntax internally. You could probably easily write a converter that makes it supprot it.
5:50:46
stylewarning
My bigger priority re Maxima is to get my perm group algebra library included and supported
6:12:44
LeoLiang
@no-defun-allowed I familiar with javascript. Compared to lisp, javascript's eval is too simple. It change lisp's quote to string value. like Function.toString. Am I right?
6:15:19
beach
LeoLiang: This channel is about Common Lisp, so you may not get good answers about JavaScript.
6:16:41
beach
LeoLiang: In a homoiconic language, you need to distinguish between code and data, hence the quote. Plus, in Lisp, if you know the beginning of an expression, you also know the end, so you only need a single marker for a quotation.
6:19:33
LdBeth
so lisp maintains a relation table for mapping symbol's literate string to pointer, and add a new entry when encounterd a new symbol
7:03:13
on_ion
i am not sure. but i always see the upper and lower quote as 'switch flipping', and knowing the end of sexp makes the sense of it. pardon my englishes
8:28:59
no-defun-allowed
it still shows up, but both arrows are emboldened, presumably cause it scans for ===> from the left and <=== from the right and the lambda list isn't escaped in any way
8:36:32
no-defun-allowed
it seems to me like passing the sexp instead of a string representation would be less painful
8:51:30
beach
dim: The input-editor of McCLIM is Drei, which is an extraction of the basic editing features of (first) Climacs.
8:52:29
dim
beach: oh make sense, so in the vision, Climacs is the editor “widget” that McCLIM uses?
8:53:21
beach
shka_: I think it is when shared-initialize is executed on the instance, but you can check that by printing something in the initform.
8:53:54
beach
dim: Emacs did it the other way around, but that's just because nothing like CLIM existed at the time.
8:56:39
jackdaniel
I have plans to replace Drei though with something less overengineered. Drei served a good purpose for Emacs clone, but it is not very good as a default editor substrate
8:58:49
beach
The listener is a bit special because it accepts Common Lisp forms, which is not typical for other applications.
8:59:23
jackdaniel
it will be possible to coerce listener to use it I suppose, but I didn't pay much thought to that
9:00:11
jackdaniel
right now listener uses clim (without drei extensions), so it doesn't matter what is baking editor substrate for it
9:02:54
beach
Are you saying we have more than one place where keyboard gestures such as C-M-f C-M-a, etc are defined?
9:03:56
jackdaniel
(to be clear, I'm not proposing drei removal, I'm proposing removing dependency between mcclim and drei in the former's core module)
9:04:43
beach
I see. I am still puzzled though that the listener is not using Drei, because that would mean that we have several places where pretty specialized gestures like that are defined.
9:06:29
jackdaniel
it is possible for drei to add some gestures to pure clim (and if they are defined solely in drei then they could be moved to core), so with a simple replacement you'd lose these gestures. that doesn't mean that listener depends on drei in any way, it just means that drei has side-effects which influence mcclim behavior.
9:07:01
jackdaniel
I don't know if they are defined elsewhere, I'm sure it is fairly easy to scope the codebase to check this out though
9:16:41
beach
I am also interested in knowing in which ways you think Drei is over-engineered, and how you would do it differently. It is a serious question. I wrote (first) Climacs, but Athas extracted the part of it that is now Drei, and I am not sure exactly what he did.
9:20:27
jackdaniel
one infuriating part is the notion of having buffer-pane mixup (for some reason drei doesn't keep notion of a pane separate from a buffer, so you can't freely operate on drei panes using clim primitives. Keep in mind, I don't remember drei code details, I'm fixing parts of it sporadically, but I remember finding quite a few assumptions like that in drei
9:21:54
jackdaniel
another thing (but this is not drei's issue per se, I'm just mentioning it since we are at gestures) is that not everyone is fond with mcclim key combinations, it would be nice to be able to switch input pane to use other gestures
9:24:52
jackdaniel
also there is modual-class metaclass which doesn't really benefit text-field in any way I can imagine (but it makes perfect sense for Emacs-like editor)
9:31:57
dim
what I mean is that given that “trick” it should be easy enough to maintain more than one keymap in the editor, right?
9:35:04
dim
so all it needs is for one of the regular contributors to use an alternative command table I guess
9:35:43
jackdaniel
that's why I've said it is not a big problem, just mentioned it since we were at gestures
9:36:28
jackdaniel
in perfect world that would be simply configurable, so the user enters McCLIM configuration screen and picks preferable editor bindings
9:37:04
dim
self-insert-command is the command that inserts a into the buffer at the current position when you hit the 'a' key, and in Emacs if you're using a read-only mode (Gnus or something) it might be something else, such as 'a runs the command gnus-summary-post-news'
10:50:09
shka_
beach: btw, don't feel preasured in any manner, but you often already have those things done. What about case study of first climacs and what needs to be redesigned for the second climacs?
10:55:04
beach
In Emacs, (first) Climacs, and other editors, Common Lisp code is parsed using regular expressions, or something with similar power.
10:57:18
beach
This technique then opens up interesting possibilities. The plan is to adapt Cleavir (which it was written to facilitate, so no big deal here) to invoke the first few passes of the compiler to analyze the code at typing speed.
10:57:37
dim
usually editors refrain from using the language's parser not because it's complex to call a READ function, but because the job is to parse incomplete forms while the user is typing them...
10:58:59
dim
I remember mostly about the speed of typing vs the speed of figuring out what you typed, not about adapting read to invalid input
11:01:25
scymtym
the support for incomplete input needs more work. it is definitely a high-priority feature
11:04:06
jackdaniel
"Thoughts on the Formalization of Program Construction" here https://european-lisp-symposium.org/static/proceedings/2018.pdf was also an interesting talk
11:10:05
heisig
I loved that talk. The author also has a website for the project: http://www.expressionsofchange.org
11:29:55
jmercouris
so, I'm running Lisp in a production setting as a webserver, and what I usually do is ssh into the box, run screen, and then start my lisp application
11:30:27
jmercouris
this however means that whenever I want to restart the server, I have to ssh onto the machine, connect to the running screen session C-d and then restart the program
11:32:41
otwieracz
jmercouris: if this is recently-dated operating system, you probably have `systemd`.
11:34:07
shrdlu68
jmercouris: Start your program with a swank listener. Then daemonize it with your system's init mechanism (probably systemd, upstart, sysv, openrc, etc.)
11:36:02
jackdaniel
jmercouris: running it from screen is hardly a practice at all, especially for a "production" setting. you need to write a service file for your application (that depends on your init system) and run it like any other daemon on it
11:36:29
jackdaniel
keep in mind, that to be able to restart it properly you need to handle certain (operating-system dependent) signals inside the application
11:37:10
jmercouris
jackdaniel: properly being a "clean" restart, instead of a kill -9, is what you mean?
11:38:21
otwieracz
jmercouris: one more question - are you delivering it as binary image (like `saves-lisp-and-die`) or running it from source?
11:38:57
jmercouris
because I would be compiling on macOS, and running on FreeBSD, not sure the SBCL kernel can do that
11:44:56
jmercouris
I'll also probably want to compile the application in the make and add a make install to put it into the path
11:46:13
jmercouris
heisig: I'm familiar with cl-launch, it's not really applicable here, unfortunately
15:46:08
beach
Sometimes, ordering something from Amazon is strange. A few years back when I ordered the book Advanced Compiler Design Implementation by Muchnick, it came with a Cover with Chinese characters on it.
15:46:09
beach
Today I received Modern Operating Systems by Banenbaum and Bos, and it has a text on the cover: Circulation of this edition outside the Indian subcontinent is UNAUTHORIZED.
15:47:01
Quike
in college i got an "international" version of a class's discrete math textbook and it turned out they just removed a chapter and otherwise it was the same
15:48:06
beach
I am convinced these books are the same no matter where I buy them. But it is strange to order from the French branch of a large international company, and have them ship me an unauthorized edition.
15:51:23
warweasle
Generally international textbooks are printed in black and white and are much cheaper.
15:55:52
jcowan
Note that "unauthorized" does not mean "illegal". Circulation of books in the U.S., if they are published by the legitimate publisher, can't be limited.
15:57:03
beach
But I assume in this case that the publisher only makes it available in India, and considers exporting it to be unauthorized.
15:58:55
fiddlerwoaroof
I believe it was the exact same book and I got the edition that was meant for distributing in China
15:59:26
shka_
Quike: copyrights belong to the author, but the remark suggests publishing rights, but publishing rights already belong to the publisher
16:00:08
Quike
Well I was thinking the publisher is doing whatever price discrimination, then another firm buys books from them in India and sells them in France.