freenode/#lisp - IRC Chatlog
Search
14:54:35
tfb
jdz: Symbolics L & G machines were 32 + 4 tag for data, 28 + 8 tag for address. Ivory was 32 + 8 tag for data and I think the same for address
17:46:02
circ-user-81lkm
Is it possible to query a "system class" like character for its subclasses? e.g. http://www.lispworks.com/documentation/HyperSpec/Body/t_ch.htm#character has base-char and extended-char extending character. Something like (subclasses 'character) => '(base-char extended-char)?
17:47:14
Shinmera
You can't query class relationship information in CL at all, you need the MOP for that.
17:48:40
emaczen
There is even a library called closer-mop which will work on most implementations too
17:48:41
_death
types aren't necessarily classes, in particular base-char and extended-char are not classes
17:50:28
Shinmera
If you know the set of concrete types you can probe with subtypep, I guess, but not in general.
17:51:49
Bike
if you need to do it programmatically (and as i recall, you're making some kind of editor) it's implementation specific. Look through swank
17:52:17
Bike
and what you'll get is a source location, not the actual source form, which has probably been discarded
17:52:30
_death
jmercouris: there is no way in plain common lisp.. pjb has a package called ibcl which may be appropriate
17:53:00
circ-user-81lkm
Well I saw a demo somewhere of a UI that produced a class hierarchy diagram and it included character and it's subtypes but I'm not sure how it produced that
17:53:18
jmercouris
Maybe I'm just re-inventing emacs at this point, perhaps I shouldn't implement that
17:53:49
Bike
It's true, though, if you want to do editor things you could do worse than just bringing in swank rather than reimplementing it
17:54:19
jmercouris
Yeah, maybe it is pointless though, because someone can just use slime to connect to my program
17:55:16
jmercouris
I should just get slime working with my standalone executable, and avoid too many things like "jump to source" and stuff like that, I'll leave it at showing docstrings for built in help
18:07:12
sjl
jmercouris: embed swank in the browser process, let people connect to and interact with it with whatever editor they want
18:08:14
jmercouris
sjl: Yeah, I have a branch for that, I was so close to releasing it, but none of the GUI updates were making it on screen
18:10:17
jmercouris
It doesn't make sense to me how that is even possible that the updates were not happening on screen, because all of the functions that update the gui have a (on-main-thread) macro which calls them in the ccl event process
18:11:29
circ-user-81lkm
Thanks for the MOP tip - I think this is what I'm after, e.g. (closer-mop:class-direct-subclasses (find-class 'character)) => (#<BUILT-IN-CLASS STANDARD-CHAR>)
18:11:31
emaczen
What does no more immobile pages left mean? It is an error I get from SBCL and then I get sent to LDB?
18:14:14
Bike
Whether they are types with elements in them is orthogonal to whether they are classes
18:28:15
pjb
I've noticed that with the latest versions of macOS, if you try to draw in a timer, it doesn't work reliably, even though you configure the time to execute on the main thread.
19:14:51
earl-ducaine
<possibly spam> Lispinators! I'd like to do a series of blog posts on MOP that provides enough practicle information and examples to alow someone get get started using it on real world problems (something that I found to be lacking either on the Internet or in the published literature.)
19:15:06
earl-ducaine
I'm collecting feedback to guage interest and collect ideas. Feel free to reply here on IRC or post a comment to my blog post requesting the same: https://wordpress.com/view/earlducaine.wordpress.com
19:20:44
Bike
earl-ducaine: this might not be what you had in mind, but the word wrap is weird https://i.imgur.com/3U7UPFn.png
19:23:02
earl-ducaine
Damn. That's what you get for composing a Wordpress first in Emacs. Looked great on my screen with, probably because of exactly alined linebreaks.
19:24:10
Bike
earl-ducaine: i think the discussion of slots is a bit confusing. objects still 'own' slots in clos
19:24:51
Bike
it might be worthwhile to be kind of anal about the distinction between slots (parts of an object, probably anonymous in a vector) and slot definitions
19:27:22
Bike
as structuring goes i'd use examples. like some basic features someone want: persistence, observers. stuff you can implement in a simple way in a page or so while introducing mop concepts
19:31:16
Bike
AMOP isn't good as a textbook of how to use MOP because it's definitely intended as a book on developing MOP instead
19:32:05
whoman
that makes sense.. i read it the other day; was not sure if it was a preview, or a booklet/pamphlette, ..
19:32:37
whoman
but MOP is awesome! isn't it? we can defclass with not-yet-defined subclasses (forward) and...
19:33:34
whoman
...my sense of OOP is directly tied to syntax, of which CLOS looks like everything else, so i am reserving its application currently. its all just lists anyhow.
19:44:50
whoman
ok earl-ducaine i read it all. my summary: its an introduction to the MOP book, as it talks mostly about it, so i was thinking about that book, and now at the end, after reading it, i feel like i am hungrier than when i came to dinner. i would have the impression that MOP is mysterious undocumented internal assembly unsafe scariness
19:56:49
Xach
borodust: should i expect to see a difference in the scaling issue today with the latest dist update?
20:01:57
Xach
It would basically show what you've seen before - 1/4 scaling in the lower left of the window
20:09:39
Ober
Shinmera: emacs right? was looking to see if you could enable command-frequency, as very curious which slime functions I'm not making use of. you do a lot of stuff where it's not obvious to me which method you invoked
20:15:30
Shinmera
Other than that the standard paredit things, plus multiple-cursors and expand-region are commands I frequently use.
21:17:06
fourier
anyone have had any troubles with alignment/order of the fields in structs returned from C functions by cffi?
21:19:06
cgay
asarch: A lisp tutorial seems like a fine idea, even though I'm sure it's not the first. At first glance I can see some problems with the content. Are you asking because you wrote it and you want feedback or because you want to use it to learn Lisp?
21:22:11
jmercouris
tutorialspoint is good for python, for lisp though, it was terrible, practical common lisp is a really good, though ironically somewhat impractical way of learning lisp
21:22:49
jmercouris
I felt like practical common lisp neglected many practical topics, the author addresses that in one of the chapters, but I guess when you get to there, you can start learning on your own
21:23:31
fourier
there is common lisp recipes for practical topics as well as "cl cookbook" it is based on
21:25:59
jmercouris
borodust: Yeah lol, see here: http://www.gigamonkeys.com/book/conclusion-whats-next.html
21:26:12
cgay
I learned with Touretsky's Gentle Intro to Symbolic Computation, which I thought was excellent. It's very basic, but at the time I had no CS background so it worked for me.
21:28:27
fourier
dont forget pcl was from 2005 iirc, so how much practical aspects do you want from 12-years old book
21:30:08
Shinmera
Well, I mean, when it comes to "practical" things the areas one might want to have covered is almost infinite.
21:30:43
jmercouris
Yeah, practical is a very large set, I would have just liked something more cookbooky
21:35:33
_rumbler31_
I got the gist of the description of how to parallelize a process that can be described as a graph of operations, where peers can be processed simultaneously
21:36:18
jmercouris
_rumbler31_: You should take a distributed systems course, you'll learn all about different theories for proving correctness, order, etc
21:36:33
jmercouris
Also different scheduling, communication and signaling strategies to ensure correctness, even with failure etc
21:57:36
Younder
https://www.amazon.com/Purely-Functional-Structures-Chris-Okasaki/dp/0521663504 is also interesting
22:09:33
aeth
I personally find the best way to write fast CL is to use a mostly-functional style: i.e. pure functions that feed into mutable data structures. One way of getting non-consing pure functions without a lot of macro hacks is to use multiple return values, which will work for non-boxed values (obviously, within reason... 16 return values for a 4x4 matrix probably won't work well with this style).
22:10:51
aeth
I also treat a zero-body do as pure, even though technically it's just a bunch of mutating gotos. This is because do is pure in Scheme (a macro makes it tail recursion instead of mutating values and having gotos) and that do is basically identical to CL's do minus the ability to do gotos in the do body, afaik.
22:12:49
aeth
Devon: A zero-body do is a do that doesn't have a body... If you're using do in a purely functional way, you usually don't need a body (except perhaps for type declarations) because the body is for side effects.
22:14:24
aeth
The first three examples here don't have a body: http://www.lispworks.com/documentation/HyperSpec/Body/m_do_do.htm
22:15:10
aeth
Note that do uses 1+ instead of incf, so even though it's technically setting if you macroexpand it, you can pretend it's functional.
22:16:29
aeth
I think CL is more of a language for making functional languages than an actual functional language itself. You're ultimately going to be mutating, but you can hide it well and pretend you're pure.
22:17:10
aeth
Not just functional languages. CL seems like an excellent choice for implementing fifth-generation programming languages. https://en.wikipedia.org/wiki/Fifth-generation_programming_language
22:17:31
aeth
It's not surprising at all to see that article have the phrase "These types of languages were also built upon Lisp, many originating on the Lisp machine"
22:21:08
aeth
Yes, I suppose someone once used 'nil body' as an alternative to 'disembodied' and then someone with a dialect where 'nil' means 'zero' said 'zero' instead, and that's how I picked up the confusing term. 'nil body' at least still makes sense.
22:27:36
aeth
Anyway, I see Lisp as a langauge for writing declarative (including purely functional) languages, rather than a declarative language, except where the work has already been done by some included macro (usually the macros are left to libraries).
22:29:45
aeth
Imo, there's not enough magic going on in the compiler for efficient pure functional programming out of the box... unless you abuse the language, but such abuses should probably be macroified, anyway.
22:30:24
jasom
okay I remember slime being able to eval an expression and add the result as a comment like ;; => FOO
22:30:50
jasom
do I need an extension or something for it because I can't find that; just the C-u C-x C-e which prints it with no comment
22:51:16
aeth
If I'm heavily abusing symbol macros, do you think it's clear enough if I use names like 'location.x instead of 'x-location or 'location-x to abstract over where I store the x location? Definitely probably violates every style guide in existence, but 'location.x seems like the most obvious name for this syntactic shortcut to me.
22:52:11
aeth
I have to heavily abuse symbol macros because otherwise my implementation leaks because I use 2D arrays, meaning arefs everywhere. Fortunately, arefs are very similar to accessors (they are accessors?), so I can basically copy the basic layout of with-accessors
22:53:27
aeth
e.g. (setf location.x 4f0) becomes (setf (aref location entity-id +x+) 4f0) where +x+ is 0
22:54:03
aeth
I could also use the name location-x or something else, but... I don't think I can use the idiomatic (x location) because then I need to add a lot more complexity than just a symbol-macrolet
22:55:11
aeth
I also absolutely hate macros that have fake macros/functions in the body that don't even exist because you can't really do things with them that you expect, and you basically can only figure out what's going on when a syntax error pops up by doing something wrong.
22:55:55
aeth
At least with location.x or location-x it's clear that it's a symbol, and fairly obvious that something like with-accessors is going on
22:57:00
aeth
I'm trying to get this API right because I have to rework half of my code every time I change it because it's very core to my game engine.
23:19:09
whoman
i am looking at this right now, anaphoric macros: https://letoverlambda.com/index.cl/guest/chap6.html
23:22:35
aeth
Ah, interesting... with-accessors only works without problems because CL is a Lisp-2. This would have to be used with care because this would blow the stack as it infinitely expands the foo: (with-entity-accessors ((foo foo)) 42 foo)
23:24:27
aeth
republican_devil: Just about everyone uses postgresql through postmodern, afaik. And most of the rest will probably use some other SQL system with a different SQL database.
23:24:47
aeth
NoSQL would be tricky because quite a lot of them use JSON and CL's JSON support is fairly weak.
23:25:35
Shinmera
There's like six or what JSON libraries to do the parsing and serialising in literally every way imaginable.
23:25:39
aeth
JSON doesn't map well to CL, and the popular libraries' arbitrary decisions are bad, especially the most popular's, cl-json
23:25:48
whoman
aeth: check out the variable capture of anaphoric macro, may help u out now that i think of it =)
23:26:00
aeth
thinking "nil" is more "null" than "false" is quite possibly the worst way to approach it, yet cl-json does it that way.
23:27:43
aeth
Shinmera: so the most popular (by far) JSON implementation is fundamentally flawed in the way it tries to connect JSON's data types to CL's data types
23:28:07
Shinmera
aeth: So what? That doesn't make JSON support "weak". There's still all the other libraries that offer all the other options.
23:29:06
aeth
I'd call CL's regexp support weak if a fatally flawed regexp library was as popular as cl-ppcre and cl-ppcre was obscure
23:29:42
aeth
republican_devil: People follow the trends, which in 2000 would have been XML and in 2017 is now JSON... In fact, in 2017 it's remaking everything that has been done with XML, but for JSON
23:30:52
aeth
Shinmera: The problem is that you'll basically be forced to use multiple libraries that do essentially the same thing when it comes to something like JSON, since odds are one of your dependencies is using cl-json and another realized cl-json is stupid and is using one of the other 5
23:31:43
aeth
Compare this to something where there's one library (e.g. closer-mop, cl-ppcre, babel, trivial-features, trivial-gray-streams, bordeaux-threads, cffi, etc.) that dominates. Less likely to have a dependency explosion
23:31:53
Shinmera
Then that's an issue with the libraries at hand. It doesn't say anything at all about the support for JSON in and of itself.
23:32:42
Shinmera
And again, because there are different ways to do it, there's different libraries to do it. This is not the case with the other examples you mentioned (mostly) because there's very little to do differnetly.
23:34:13
Shinmera
mop, ppcre, encodings, ffi, features, threading, are all sets that are pretty well defined, and the way to implement a library for it is thus clear. The JSON mapping is not.
23:34:34
aeth
There's a different way to do babel... treat it like a portability library and e.g. use SBCL's much faster octets-to-string when on SBCL. There's many ways to do regular expressions. There's also probably many ways to do something like bt or cffi. There are different ways to handle what trivial-features does, one library I used to use used that alternative.
23:35:15
aeth
trivial-gray-streams is the only unambiguous basically-one-way-to-do-it library there that I know of. I don't know enough about closer-mop, but it might be the same way.
23:35:52
Shinmera
bt, ffi, etc. expose a min-max API and are thus also pretty clearly defined and couldn't well be done otherwise.
23:35:57
whoman
lisp libraries hmm could be treated a bit less as having an API and more of being a bunch of parts
23:38:09
aeth
Anyway, I do see it as a flaw in the CL ecosystem that there isn't a clearly correct (for most use cases) and popular JSON library... although, that might just be because a lot of people (like me) use s-expressions for data where other languages would use JSON, YAML, or XML. Still hurts interfacing with things written in other languages, though.
23:39:22
aeth
Most of the stuff at the top of this are clearly the correct library for the thing they're trying to solve, or at least correct enough to not be worth using an alternative. http://blog.quicklisp.org/2017/12/november-2017-quicklisp-download-stats.html
23:49:03
aeth
republican_devil: If you're talking about using Lisp instead of SQL where SQL would normally be used, then I think it's still technically NoSQL
23:49:06
Devon
republican_devil: I scoped out various CL JSON libs for a product I was developing, found one which was round-trip correct, IIRC I still had to hack it a bit to get it right.
23:50:39
aeth
Devon: Yes, round-trip correctness, that's the issue. It's related to also having reasonable encodings. Not having a separate '() and #f here hurts CL in a naive encoding if one wants to use lists instead of arrays.
23:51:04
aeth
jcowan_ pointed out some workarounds to JSON encoding issues in #scheme a few weeks ago, iirc
23:51:58
aeth
Devon: can you clarify? "semantic" sounds like it might be too much of a buzzword to search
23:53:33
aeth
republican_devil: I'm not aware of a portable CL-native database that has any real popularity. I wouldn't be surprised if LispWorks and/or Allegro have their own proprietary ones.
23:55:46
aeth
Some of the entity systems used by #lispgames might be seen as CL-native in-memory databases, but they would be built around being real-time, not around big data.
23:58:35
aeth
A portable database that's not in-memory would probably need some portability around mmap. Does this exist? It looks like the only name match in Quicklisp is trivial-mmap.
0:32:02
aeth
whoman: Thanks, your suggestion set me off in the right direction. I now store all the old values of the slot names in gensyms, and aref those gensyms instead of using the name directly.
0:36:36
whoman
aeth: ah cool! gensym leaves a taste in my mouth. i had been conditioned to feel that hygiene is a good thing (??) but suddenly i see that capturing variables is something i will really enjoy the taste of
0:38:17
whoman
some time last night i had two sdl2 bindings going, very unconventionally, so i am sure that was it =)
0:38:57
whoman
there she is =) --> (defmacro alambda (parms &body body) `(labels ((self ,parms ,@body)) #'self))
0:40:19
dmiles
Devon: and/or KM http://www.cs.utexas.edu/users/mfkb/km/ http://www.cs.utexas.edu/users/mfkb/km/km-overview.script
0:42:16
dmiles
ACTION is developing new Lisp to make integration of such programs Semantic Inference Engines easier with other Engine tools writtne in Prolog
0:57:20
aeth
dmiles: I think CL is small enough if you ignore CLOS and loop and use someone else's versions of those. Maybe a few other painful parts.
0:57:24
dmiles
i have two two versions one is cl-lib and the otehr https://github.com/larsbrinkhoff/emacs-cl
0:58:53
dmiles
aeth: yeah that is what i been finding (that it isnt that biug.. actualyl even clos as far as i can tell in not even as big as Epilog KM or any other lisp applicaiton
1:15:50
stylewarning
my lisp & quantum computing talk is online https://www.youtube.com/watch?v=f9vRcSAneiw
1:16:27
dmiles
of every sentence /me was actually paid once to write a neurolinguistic personal auditing program to detect souls whom do this
1:17:49
dmiles
since they may often be the most likely to do reprisal attacks against previous employers