freenode/#lisp - IRC Chatlog
Search
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
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.