freenode/#lisp - IRC Chatlog
Search
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
1:36:21
dmiles
ashkenazi are a group of less 350 jews whom decendended from some italian women whom are now over 2 million people.. but prabably quite more.. since most do not know they came from this group
1:37:47
drmeister
Hey - does anyone use dtrace? I'm trying to use it on clasp and it's not cooperating.
2:20:07
drmeister
I figured out my problem. I'm profiling our own code (Clasp Common Lisp) and I needed to start and stop profiling for a particular function.
2:22:56
drmeister
It's pretty clear that I have been undercounting the amount of time that Clasp spends running LLVM
4:17:36
loke
hooman: The neat things about CLIM is its ability to mix graphical representations of objects with text.
4:21:16
hooman
loke: ah really? i was just clicking, because ive never debugged lisp before, and i was clicking into cons cells and arrows were pointing at stuff etc
4:23:06
hooman
but i am also having the issue with graphics , from common lisp to the screen, it is not a good time with SDL =)
4:23:07
loke
hooman: Then type an expression that returns a value, say (list 1 2 (cons 3 4) 5)) press RET and you should see the resulting list in red in the REPL. Then move the cursor to the result and press C-c C-v TAB
4:23:20
hooman
i will try to play around with clim-listener as well and see if it could animate some things
5:03:26
parjanya
hi! how can "print" a standard-char as a simple string? like (print #\a) returning just "a"?
5:26:28
myrkraverk
What is the simplest way to print carriage-return in Lisp? To make an auto-updating status in a terminal, thing.
9:01:34
shrdlu68
I need a really huge octet vector and using sbcl with --dynamic-space-size seems to use swap and gobble up so much memory the system becomes unresponsive.
9:05:58
|3b|
and do you need to be able to use normal CL vector ops on it? (guessing not if you can replace it with file ops)
9:08:47
schweers
that sounds like --dynamic-space-size and a regular vector or array should do the job
9:09:08
|3b|
by N x 40 bits you mean you need that many values with at least that many bits? or a n*40 bitvector?
9:10:50
shrdlu68
Perhaps the mistake I made was to create an n-size array of elements each an array of 40bits (5 octets) rather than just one octet vector.
9:12:02
|3b|
(on 64 bit lisp, the pointer pointing to it is probably 8 bytes by itself, not including the actual array headers etc)
9:14:12
|3b|
also, you are using types arrays for the octets, right? :element-type '(unsigned-byte 8)
9:24:41
|3b|
yeah, 309319296 x 5-element octet vectors uses ~12GB, (* 5 309319296) element octet vector uses ~1.6GB
9:28:15
beach
I set *COMPILER* to be either EVAL, COMPILE, or COMPILE-FILE. But I am not sure that's the best solution.
9:31:23
|3b|
for first case, looks like ~2.4GB is the 8-byte pointers in the big array, 9.9GB is the 5-element arrays, so about 32 bytes per 5-octet array (i'm guessing 24 bytes of header + 3 bytes of padding to round data up to a whole word of space)
9:37:53
beach
dmiles: It is not a Boolean expression. It has to do with calling or not calling EVAL at compile-time, and generating or not generating code to be run at load time.
9:40:55
dmiles
it does mean though if :eval :compile or :compile-file in your case are found in *COMPILER* then to treat the code as there
9:42:25
specbot
Processing of Top Level Forms: http://www.lispworks.com/reference/HyperSpec/Body/03_bca.htm
9:43:50
beach
dmiles: When implementing a Common Lisp system, if you have a choice between doing it according to the Common Lisp HyperSpec and not doing it according to the Common Lisp HyperSpec, the first choice is always the best.
9:44:14
shrdlu68
|3b|: Didn't work, it was still gobling up memory for some reason, I've switched to CCL.
9:44:29
dmiles
i was reading eval-when and wasnt completely sure.. most of the time i match the examples
9:45:56
beach
The Common Lisp HyperSpec examples are not normative, though, and they sometimes contain errors.
9:47:03
dmiles
too bad http://www.lispworks.com/documentation/HyperSpec/Body/s_eval_w.htm#eval-when doesnt like the 3.2.3.1 section
9:52:56
pjb
shrdlu68: syscalls are way slower than function calls, which themselves are slower than inline native instructions to index an array.
9:57:23
dmiles
yep works for me to.. i was complaining that the eval-when page has great usefull links but everywhere but that page :P .. to have gotten there I would have had to stop at the top-level-forms glossary page first.. which then links to that page
10:03:18
schweers
dmiles: you’re implementing your own common lisp? for fun and education, or do you think you can do better than those implementations that are already out there?
10:06:36
dmiles
i mostly hope i can do as good as the top 40%.. i am writting it in Prolog for a few reasons.. one is to prove prolog is a general purpose programming language that makes things like creating lisp impls ultra easy. we already know it makes lisp interpretors in less lines than any other language.. but what i am interested in if it can do "as well"
10:08:48
dmiles
so the prolog sources can at the repl be evaluated or if its done in compile-file it can be compiled
10:09:42
dmiles
there are good and less developed prolog compilers for differnt platforms .. in several langauges
10:12:06
dmiles
source code shrdlu68 is at https://github.com/TeamSPoon/wam_common_lisp/tree/master/prolog/wam_cl
10:12:17
dmiles
this file https://github.com/TeamSPoon/wam_common_lisp/blob/master/prolog/wam_cl/sanity-test.lisp translated to this file: https://github.com/TeamSPoon/wam_common_lisp/blob/master/prolog/wam_cl/sanity-test.lisp.trans.pl
10:13:35
dmiles
the lisp_compile_to_prolog(pkg,..) is there more informationally like: https://github.com/TeamSPoon/wam_common_lisp/blob/master/prolog/wam_cl/sanity-test.lisp.trans.pl#L44-L59
10:15:07
dmiles
and to get the symbols interned ( packaged ) so the prolog code at https://github.com/TeamSPoon/wam_common_lisp/blob/master/prolog/wam_cl/sanity-test.lisp.trans.pl#L74-L88 can be understood
10:18:09
dmiles
to give an example of *normal* implementing of lisp in prolog, it looks like this: https://www.metalevel.at/lisprolog/lisprolog.pl