freenode/lisp - IRC Chatlog
Search
4:54:10
jcowan
As I've said before, EQ is basically a performance hack, and it's EQL that is Lisp's identity predicate.
4:55:29
White_Flame
but even with numbers, if you have array or list indexes/lengths, those numbers are always going to be fixnum, as they can only be as big as address space anyway
7:05:47
beach
It is an interesting observation though. Is the integration with the type system based on CLASS-NAME of the class (I don't think so) or FIND-CLASS?
7:13:45
beach
AHA! The secret is that the class name must be a "proper name" (see the glossary) for it to be a type.
7:14:47
beach
That is, FIND-CLASS of SOME-SYMBOL must return a class with a CLASS-NAME of SOME-SYMBOL.
7:31:12
beach
ACTION heaves a sigh of relief since the SICL bootstrapping procedure uses classes with the same CLASS-NAME as the standard ones.
7:36:32
beach
So I think that what CLIM II did should not be necessary. They could have used symbols as names. But, as Scott McKay told me, when they wrote the CLIM II specification, CLOS implementations were not very good.
7:43:12
beach
He also told me that the way moore33 implemented presentation types for McCLIM was the way they would have wanted to use for commercial CLIM, but (again) the CLOS implementations at the time just weren't good enough. I don't know what they did instead, though.
7:47:37
beach
phoe: What makes you think that in ANSI Common Lisp, all classes must be named by symbols?
7:48:36
beach
phoe: I.e. where do you see that it is not allowed to do (make-instance 'standard-class :name '(a b c))?
7:49:07
beach
phoe: Where do you see that it is not allowed to do (make-instance 'standard-class :name '(a b c))?
7:49:31
jackdaniel
I don't understand the "In the MOP remark" -- that would mean that having MOP in ones implementation violates the spec
8:04:17
jackdaniel
does it though? I'm looking at the code now and it seems that class names are something like
8:06:42
jackdaniel
if you refer to the first paragraph "defines a presentation type whose name is .." -- I don't read it that presentation name is the same as the class name this presentation is represented with
8:13:11
jackdaniel
depends how you define a portable code. if you define it as a code which runs on an implementation which is strictly adhering to ansi standard then yes. if you take that portable code runs on existing implementations then most of them define mop
8:21:17
pjb
(defclass |the damn class of all the objects that can talk violet| (|the funny class of talkers| |colored spoken objects|) ()) …
8:22:47
pjb
and if you want lists you can always (read-from-string (format nil "(~A)" '|the damn class of all the objects that can talk violet|)) #| --> (the damn class of all the objects that can talk violet) ; 56 |#
10:15:06
phoe
it seems that the #A extension for printing arrays readably works the same across SBCL and ECL/Clasp with one difference in printing order - whether dimensions or element type comes first
10:15:51
phoe
since I am looking to implement that extension for CCL, is it also worth to try and unify the way implementations work this way, or do I just pick one of the two sides?
10:21:10
jackdaniel
how often do you read forms printed readably on one implementation into another?
10:22:34
phoe
that wouldn't be fully portable though - arrays are not guaranteed to be printable readably
10:27:36
Shinmera
the user might accidentally or purposefully stick those values into a config structure or whatever.
10:28:31
jackdaniel
I think that relying on lisp read / write functions to deserialize / serialize config is not a wise strategy
10:29:29
jackdaniel
if you need to store lisp objects then you want a library like cl-store, dumping forms into a file is more a one-time hack for devs
10:33:47
jackdaniel
ditto, cl-unicode generates its files (only once), magicl has pregenerated ffi definitions to liblapack and such
10:40:10
jackdaniel
phoe: what you've put on github is a misquote given what I said above about cl-unicode and magicl which generate code
10:40:32
phoe
11:21 < jackdaniel> how often do you read forms printed readably on one implementation into another?
10:41:02
jackdaniel
I have an impression that you read very selectively (i.e ignore what I've said later)
13:08:25
lukego
I'm defining data structures for AST nodes. I usually use DEFSTRUCT for each node type, but have the nagging feeling that I should use DEFCLASS, but can't bring myself to do that because DEFCLASS declarations always seem so wordy and redundant. Anybody relate to that feeling? Just live with it? Or is there a DEFCLASS* that I need to start using?
13:08:50
lukego
(Haven't Lisped in a while and wondering if it's finally time to get over my aversion to CLOS.)
13:09:54
Shinmera
Though if you have a well-defined set of classes that are all similar, writing a specific macro for it is just fine.
13:11:07
luis
I like defclass-star (but don't use it very often). Succinct like defstruct, flexible like defclass (obviously).
13:14:34
Shinmera
p_l: copy paste is not governed by paredit, which is useful for getting it back into a stable state without having to deactivate it.
13:15:35
luis
Paredit eliminates that silly step at the end of writing a bit of code where you make sure parenthesis match up properly. If you use electric-indent-mode you can even get rid of the make-sure-your-code-is-properly-indented step. (Although that step is pretty quick with M-q paredit-reindent-defun.)
13:15:47
p_l
Shinmera: it's also an excellent way to get it to state where it gives up counting parens. I know there's a chord to type parens disregarding paredit state, but I a) never remember it b) never got fluent enough with structural editing to gain much benefit
13:16:24
Shinmera
I pretty much only use slurp/barf/convolute in paredit. Same for Slime, my fu is really weak in general.
13:16:57
p_l
yeah, same here. Just found that electric indent and electric parens work better for me now
13:17:53
luis
Shinmera: interesting. I think what I use the most is splice (M-s), raise, (M-r) and kill (C-k and C-M-k)
13:18:02
lukego
Thanks p_l it's nice to be lisping again too :). Seems like every time I start working on a project I think "Hey I wonder if I could do this in Lisp" but usually not due to some constraint. Just now I want to make up a DSL and write a transpiler onto diverse targets and Lisp seems like a great fit.
13:18:36
Shinmera
luis: Oh yeah, splice, too. And kill I didn't even think about being a paredit thing but I use it too.
13:19:32
lukego
p_l: Yeah. Spending some time doing Smalltalk really helped to remind that I'm a Lisper at heart :)
13:20:28
lukego
and also to appreciate the value of a stable base. Pharo's GToolkit has more momentum than McCLIM but it is kind of "angular momentum" going around in circles rewriting all the code I am trying to build on :)
13:21:58
p_l
I'm kinda in market to find a good GUI library, unfortunately for reasons McCLIM is out :<
13:24:58
p_l
(might involve interposer between interface side and backend side, but then I have no idea how to augment CLIM interfaces with usable metadata)
13:26:08
beach
p_l: If you need information about CLIM and McCLIM, the best place is #clim. The nice people there would be happy to help you out with your question. You can still ask here of course.
13:26:53
p_l
beach: I tried in the past - I gave up when I figured out *I* could not describe it properly, so I was back to drawing board in terms of "how do I explain what I need" :)
13:27:36
p_l
for immediate use cases, Qt and GTK+ have hooks for accessibility defined and implemented, though I'm wary of anything from GNOME.
13:28:04
p_l
but just explaining it feels non-trivial, and if I can't explain right, I can't expect anyone to understand, right?
13:28:49
beach
lukego: As it turns out, it is unusual to want the same iniforms, initargs, readers, and writers for each slot, so the verbosity is usually needed. Unless, of course you are using your classes as simple containers with named slots.
13:29:49
beach
shka__: Except this is Common Lisp, so you don't have to program it explicitly the way you do in most other languages.
13:31:08
lukego
beach: Thanks for the comment. Could be that I'm using the same pattern over and over again not because it's appropriate but due to intellectual laziness. I'll see if I can apply some more thought and creativity to my DEFCLASS declarations and that might solve my problem :)
13:32:20
lukego
(This is some pretty nuclear grade procrastination I'm doing now. "Let's write some code. But should I re-evaluate my feelings about DEFCLASS first? Is it finally time to learn paredit?" But I'll just embrace that for now :-))
13:32:31
splittist
lukego: there was (is?) redshank, an emacs extension built on paredit that provided, amongst other things, DEFCLASS support
13:32:40
p_l
this reminds me of my confusion on pass-by-reference/pass-by-value which I need to distill somewhere into a cheatsheet
13:35:50
beach
p_l: I am sorry to hear that you have difficulties understanding CLIM. It would have been great to have you as a user.
13:36:29
p_l
But I've been trying to consider users other than myself, including blind or otherwise vision impaired
13:39:28
p_l
and unfortunately CLIM missed the development in that area, for understandable reasons, so anything that involves integrating with screenreaders for example will require fresh work, and that's where I get confused :)
13:40:04
p_l
pity I can't devote more resources for that, because I think it's pretty important area to cover in CLIM, and I would like to have more GUI options :)
13:42:11
jackdaniel
there are so many gui options, how is that it is so hard to find something satisfying to work with? :)
13:42:37
p_l
jackdaniel: because so many of them have so many caveats, and I would like to work with CL where possible
13:44:20
jackdaniel
all technology is flawed one way or another, so either you build in something and work around all quirks or you sit waiting for technology which will never come (or write your own solution which will be flawed as well)
13:45:40
jackdaniel
it is like refusing to act because world is not perfect - stance admittedly taken by some people
13:46:48
p_l
jackdaniel: yeah, that's what I am not doing, the closest thing to doing what I want *right now* is Qt, so I've been working on getting usable CommonQt setup to use on all three platforms I have at home (linux, windows, and unfortunately a mac)
13:48:28
p_l
unfortunately it feels like all code for C++ interaction in various bindings is very language specific, so I might end up writing a common lisp C++ binding generator first -_-
13:48:57
p_l
jackdaniel: EQL is nice and dandy, but I need something that isn't bound to one implementation
13:49:32
trittweiler
lukego, I prefer defstruct to defclass because the `:type`s end up in the ftype of the slot accessors which means that sbcl type-checks at compile time, and you get a sensible default print-object method by default. You can use generic functions with structures just fine (as you know). So unless I want mixins, defstruct is my preferred go-to.
13:50:03
jackdaniel
I'm sure people doesn't give a rat ass whether their application runs on (given it is performant enough and looks the same)
13:52:08
p_l
GTK means macos sucks. Yes, for internal tool its fine, so is using CCL w/ Obj-C bridge
13:52:11
jackdaniel
I've just mentioned IOS because it is a fresh thing, not to suggest it. good luck with finding your preferred technology
13:52:45
p_l
jackdaniel: In case you missed it, I've already went down the path "closest to working as I want it" :)
13:53:27
jackdaniel
you've mentioned that you are working on making it usable on a few platforms, so I inferred you are struggling with it right now
13:53:52
jackdaniel
(and then you've suggested that you want to make another pivot to QT5 when possible)
13:53:56
p_l
jackdaniel: I've had issues getting commonqt working on macOS, phoe had been a help there
13:54:14
p_l
the pivot to QT5 is for later, because let's face the fact, Qt4 is not supported anymore
13:54:32
luis
p_l: I've been thinking about how to interact with C++ too, for Qt5 too. libclang with something along the lines of dragonffi seems promising.
13:56:11
luis
I think it might be useful for generating calls to all sorts of C++-specific stuff. Invoking the compiler would take care of all sorts of stuff like preprocessor macros, templates, etc. (I think.)
14:01:18
p_l
luis: Still working on it, but generally an extension to ASDF that could spin up separate instance to run the glue code generation and compilation, + code to handle bundling the libs
14:03:04
p_l
luis: two options, as big C file (or maybe a dir of C files?) + makefile, and as ready-to-load shared object
14:03:22
p_l
the former is for cases where you need some more mangling (like embedding into one binary)
14:07:53
p_l
luis: said C blob would have the necessary interface points to do subclassing, think pre-made abstract subclasses
14:08:35
p_l
the C part is to get around the shittiness of C++ linking, and would essentially be a dump of what clang would construct packaged in a way that is consumable
14:25:09
luis
p_l: are you using rpav's c2ffi? I'm very curious, in case you can't tell. Also, have you seen <https://github.com/KDE/smokeqt/tree/Qt5v2>?
14:28:26
p_l
I haven't seen c2ffi, and somehow I missed that smokeqt repo - smoke had been badly documented across KDE pages
14:29:40
luis
p_l: c2ffi uses libclang to extract definitions. cl-autowrap (and cffi/c2cffi) then use that to generate bindings.
14:30:05
p_l
sounds like good starting point, I wouldn't mind improving existing code instead of tooting my own horn
14:37:27
luis
p_l: so, my idea was to try and emulate what dragonffi is able to do: compile C/C++ snippets at runtime and then invoke them, maybe using something like parenscript for C++. My thinking there is that this would eliminate the need for generating bindings, or exhaustive bindings, anyway. You can just call random C/C++ code and the compiler will type-
14:37:28
luis
check it for you. You raise a good point about not depending on libclang upon delivery though. I don't have an answer for that yet.
14:38:23
p_l
ebrasca: domains in what sense? Web domains? I think it's something that can be handled in handler in Hunchentoot or Clack (match on `Host` header)
14:38:56
p_l
I usually handle matching services to domains at LB and don't handle Host header in services at all
14:40:38
phoe
ebrasca: I use haproxy as my internal router that handles HTTPS. It then routes internal HTTP traffic over to Lisp services.
14:45:07
ebrasca
I like Hunchentoot , is it hard to manage more than 1 web page with diferent domain names?
14:46:48
p_l
ebrasca: I'd recommend setting separate handlers for each "application" or "website", then using an external service (for example nginx in proxy mode) to handle the frontend
14:54:29
p_l
I haven't used LXC for years, to be quite honest. For this case I'd use something closer to Docker (though podman might be better as runtime, but that's details you might not need right now) + external load balancer
14:55:08
p_l
bit hard for me to recommend because I don't know the rest of your environment and I have preferences that lean on the high-end side that I usually deal with
14:55:45
p_l
(I host something like ~250 domain, with ~1000 mappings, on single IP address, for one of my clients)
14:58:08
ebrasca
p_l: I am starting , If I manage this correctly I am going to have my first client.
14:58:16
vsync
I wonder how much time this would have saved over the years, and how much of that was convolutions out of over-preciousness
14:59:40
p_l
ebrasca: for starters, setup nginx with proxy configs (there's a lot of tutorials, and you can subcontract for a starting config ;) ) + running the sites on separate ports, maybe even as separate services (using runit or systemd to start them)
15:00:32
p_l
ebrasca: you should also consider creating a way to "poke" the application to verify it's in usable state and hook that into nginx so it can redirect to an error page if for any reason you need to take an app down
15:01:12
lukego
I've enabled `slime-company' package but so far it's only offered me completions once...
15:10:35
p_l
ebrasca: I recommend separate instances for things that are logically separate, in case you need to do something weird with them
15:23:33
phoe
What should be printed when (print-unreadable-object (nil *standard-output* :type t :identity nil)) is evaluated?
15:23:50
lukego
I'm trying to `C-)' in paredit but all Emacs is getting is plain old 0. Maybe because I'm running Emacs over ssh in a terminal? Any workaround?
15:24:45
phoe
The CLHS says this: If type is true, the output from forms is preceded by a brief description of the object's type and a space character.
15:31:56
Xach
lukego: i've had similar trouble when running through screen, but it produces a sequence of control characters that come out wrong. so i bind those codes in my .emacs to make things work.
15:32:43
lukego
Yeah `M-x view-lossage' is only showing it as a plain 0. Maybe I will use this as an excuse to not learn paredit-mode today.
15:34:14
lukego
I'm using iTerm2 on macOS and talking to Emacs via ssh and tmux. (ugh.) I'm planning to switch to Linux desktop in a few weeks so maybe I'll kick the can until then.
15:39:59
vsync
if I decrease the fill pointer of an array, then increase it again, is there any risk the elements hidden in that interval will disappear?
15:40:50
Shinmera
if anything decreasing the fill pointer and not clearing out the elements can be a memory leak.
15:41:33
Fade
lukego: I've found inconsistent results using emacs/slime over ssh to a session suspended in a terminal multiplexer. does it still happen if you take tmux out of the stack?
15:43:36
lukego
Guess I'll revisit this when I'm "linux native." I might run Emacs locally instead of via ssh then.
15:44:19
davepdotorg
FWIW, macOS and iTerm2: if I emacs -nw locally and try C-0 I just get a self-insert command on 0, so that would seem to eliminate most things along that chain.
15:46:54
lukego
Shinmera: Thanks but I'm over the whole Mac thing and looking forward to putting it behind me.
16:26:40
phoe
https://gitlab.common-lisp.net/ansi-test/ansi-test/blob/master/printer/print-structure.lsp#L22
16:27:11
phoe
This is supposed to read in the form #S(print-struct-1 :foo 1 :bar 2) with standard IO syntax