varjag has quit [Quit: ERC (IRC client for Emacs 25.2.1)]
smurfrobot has quit [Ping timeout: 264 seconds]
<aeth>
It won't help anyone who needs it right now, but I think I'm going to try writing a JSON library when I need JSON support, which will be when I add support for glTF to my engine. https://github.com/KhronosGroup/glTF/
<aeth>
That's a model format that uses JSON
smurfrobot has joined #lisp
rawste has quit [Quit: Quitting…]
smurfrobot has quit [Ping timeout: 248 seconds]
<peterppp>
aeth, why write your own?
<aeth>
peterppp: Each JSON library has its flaws. And afaik all of them by default do not use a reasonable round-trip mapping of CL <-> JSON
<peterppp>
aha
<aeth>
e.g. cl-json's default is to go nil <-> null and nil -> false, whereas a better way of dealing with it would be nil <-> false and :null <-> null
<aeth>
Ideally, every arrow should be two-directional, except of course when more than one thing in CL becomes one thing in JSON, but even there, you should just be choosing between which two-directional thing
smurfrobot has joined #lisp
<aeth>
e.g. #() <-> [] and '(:json-list) -> [] is fine because you could easily configure it to go #() -> [] and '(:json-list) <-> [] instead. But bare lists shouldn't be supported because then you get the ambiguity of alist (should be JSON object) vs. plist (should be JSON object) vs. list (should be JSON array) vs. nil-as-empty-list (should be false, but some people could also treat this as JSON null, too)
<aeth>
cl-json and yason choose perhaps the most incorrect choice, of treating nil as null. st-json and jsown and jonathan produces [] and com.gigamonkeys.json produces {}
<aeth>
And some of these are configurable, e.g. cl-json, but defaults matter. And you shouldn't be able to do absolute nonsense like nil -> null or nil <-> null.
<aeth>
I'm surprised literally all of these fail the nil test, though.
smurfrobot has quit [Ping timeout: 248 seconds]
orivej has quit [Ping timeout: 256 seconds]
pjb has quit [Read error: Connection reset by peer]
<aeth>
Adding a keyword "tag" to a list isn't hard because you just cons on a :foo tag and then when you're dealing with it as data, take the cdr of it. So that's the approach I'll use for distinguishing alists, plists, and regular lists. But by default I'll have JSON read into hash-tables and vectors because those are unambiguous and don't need to be "tagged".
bigos_ has joined #lisp
smurfrobot has joined #lisp
pjb has joined #lisp
<aeth>
I do have a separate false instead of treating nil as false when I work with embedded programming languages within CL, such as my still-incomplete cl-scheme. But that's imo totally unnecessary for JSON when you can just not support bare lists and have a :null keyword.
<aeth>
peterppp: My advice for you if you're not going to make your own JSON parser would be to find a configurable library and configure it to actually have reasonable cl <-> json.
<aeth>
It's unfortunate that none of them have what I would consider reasonable defaults because defaults are extremely important in software, and are often neglected.
<peterppp>
hmm I wasn't going to write my own
smurfrobot has quit [Ping timeout: 252 seconds]
<aeth>
Imo, the best mapping of the difficult parts is #() <-> [] and (make-hash-table) <-> {} and nil <-> false and :null <-> null, if you're willing to work with vectors and hash tables instead of lists for the part that interfaces with JSON.
<aeth>
:false <-> false would be even more unambiguous, but is probably unnecessary as long as you don't serialize plain lists (which create the three-way ambiguity when there's an empty list)
smurfrobot has joined #lisp
<aeth>
(four-way, even)
<aeth>
If you can configure that in an existing library, you can go cl -> json -> cl or json -> cl -> json losslessly
<aeth>
(well, except the order of things can change due to the hash table)
<pjb>
Funny that you should mention it. I can guarantee you that if you change the order, this will break some components somewhere!
<aeth>
probably.
<pjb>
Of course, JSON dictionaries are not ordered, but it's a 100% certainty that some software out there expects entries in a given order.
smurfrobot has quit [Ping timeout: 272 seconds]
<aeth>
When I write my own JSON library, it'll support alists and plists prefixed with :json-object-plist and :json-object-alist and lists prefixed with :json-array. So (:json-array 1 2 3 4) -> [1, 2, 3, 4] and (:json-object-plist :foo 42 :bar 37) -> {"foo" : 42, "bar" : 37} and (:json-object-alist (:foo . 42) (bar . 37)) -> {"foo" : 42, "bar" : 37}
<aeth>
Of course, optionally reading it into alist or plist instead of hash tables in case the order needs to be kept
<aeth>
s/(bar ./(:bar ./
<aeth>
I'll probably have to also have a configuration for how keywords <-> strings is handled. By default, it'd be upcase to CL and downcase to JSON, but I'm sure some JSON is case sensitive and that won't work.
<aeth>
This is making me want to write a quick, inefficient prototype of it now.
josemanuel has quit [Quit: leaving]
<aeth>
On top of the JSON library, I might want to add some YAML support, too. There are apparently 3 YAML libraries in Quicklisp, but I don't think there were any when I was looking for one years ago. YAML is built on top of JSON. I probably don't need to deal with XML.
peterppp has quit [Ping timeout: 252 seconds]
peterppp has joined #lisp
jameser has joined #lisp
<pjb>
aeth: I already indicated the right way to do it: you need to have a model of the JSON ontology in lisp (implemented eg. with CLOS classes). Then you can provide niceties such as converting p-list or a-list to and from instances of this JSON model ("DOM"). But at least, the JSON serialization and deserialization between these ontological objects can be done with 100% fidelity and clean roundtrips.
<pjb>
And if your lisp data is not of the kind expected in an application, you can always instanciate those DOM classes to create or parse exactly the JSON you have to process.
<aeth>
And for alists and plists, no need for the overhead of CLOS objects, just make the car :json-object-plist or :json-object-alist, which is just a trivial (cons :json-object-plist some-plist) before passing it into the JSON generator. For nested JSON generation it'd be a bit trickier, though.
<pjb>
The question I ask, is whether a CL hash-table is entirely semantically equivalent to a JSON dictionary?
raphaelss has quit [Ping timeout: 240 seconds]
<pjb>
aeth: and besides, your code is full of bugs. eg. line 15 is dead wrong.
<aeth>
pjb: Yes, line 15 is wrong
<aeth>
pjb: But properly handling numbers and strings is where the real complexity is!
<aeth>
And I can handwave that away right now
<peterppp>
has anyone here set up a websocket server with clisp?
<peterppp>
but apparently the server has no way of finding out which client an incoming message came from
<peterppp>
then there's clws but the last commit was made 5 years ago
<aeth>
pjb: My current design is assuming that the CL user is going to try to generate sane JSON and that the JSON is where the potential incompatibilities are. Sanitizing the CL symbols, etc., is going to really hurt the performance, so even in the final thing, I'd leave that off by default.
<pjb>
peterppp: what's specific to clisp in your question?
<peterppp>
specific to clist..?
<peterppp>
clisp
<peterppp>
well I'm using that
<aeth>
pjb: I could replace it with a (format t "~S" string), though, and that will escape things automatically afaik. So then the issue is with edge cases in string escaping.
<pjb>
aeth: json specifies java format for floating point numbers!
<pjb>
aeth: before saying that you will write your own buggy implementation, why don't you read the specification for JSON?
<aeth>
I mean this: (format t "~S" (string-downcase (symbol-name key)))
<aeth>
(obviously the stream will be configurable in the final version)
<pjb>
we already have at least 3 different JSON libraries in quicklisp, I don't think it's worth writing yet another one.
<aeth>
pjb: The problem is that all of the JSON libraries' defaults are shit. They all fail the nil test, i.e. nil <-> something-in-json is an absurdly bad choice in all of them. And defaults matter.
<pjb>
aeth: default don't matter, if the rest is full of bugfs.
<aeth>
pjb: There are almost certainly bugs in all of them if the authors couldn't even be bothered to establish a reasonable cl <-> json mapping in the basic library design, which is the starting point of a JSON library, not some detail to work out later.
<peterppp>
pjb, is this for websockets? I can't tell
<pjb>
peterppp: this is the clisp function to find the IP of the client connected to a socket.
<pjb>
aeth: See above what I said about a JSOM DOM.
<pjb>
peterppp: to find the socket object you will have to navigate thru all the layers…
<aeth>
pjb: That could perhaps produce a cleaner result, but not a faster result. I need JSON support to read in 3D model formats that at least partially use JSON because JSON's trendy at the moment. So I will sacrifice some good design for performance, which seems to be the norm for game engines.
fikka has quit [Ping timeout: 260 seconds]
<pjb>
Oh, in that case I can understand the want for a specific implementation.
<aeth>
My personal design considerations are (1) a better cl <-> json mapping and (2) better performance
<peterppp>
maybe I can modify the library so that an object representing the socket is passed to the message handler
<pjb>
Just serialize directly your model, no need to go thru even lisp generic data structures.
<aeth>
It'll be primarily used for the JSON part of reading/writing glTF for now
<aeth>
So it'll probably have a bunch of optimizations that only make sense for glTF and any other JSON-based model formats that I happen to add support for later
<aeth>
At the moment, I'm going to handle .obj models and glTF models for import/export, in addition to a binary internal 3D format.
<aeth>
For textures, I'm just going to handle PNG because there's a good library for that and I don't have to write my own.
<pjb>
aeth: but if you write floating points, take into account the format specified for json floating point numbers!
<aeth>
The only other media format I think I'll have to support is sound... and I'm not going to even deal with sound yet. I'll probably need to support Opus and OGG Theora and maybe flac.
<aeth>
And the only other data format I'm going to mess with is an s-expressions-as-data format, which is fairly easy.
<whoman>
aeth, why not patch up an existing json lib ?
smurfrobot has joined #lisp
<aeth>
whoman: (1) their defaults are bad, (2) they usually focus on flexibility over performance
<whoman>
thanks for the link to glTF btw, seems cool
<whoman>
aeth, ah =)
<aeth>
whoman: I want reasonable defaults and if I control the library, I can cheat and patch the library to meet all of the performance requirements necessary for the particular glTF JSON that I will be dealing with
<aeth>
And I really hope that between OBJ and glTF I don't have to support any other import/export for models... because there are so many 3D model portability formats. More than a dozen.
<aeth>
The older ones tend to use XML because that was trendy at the time. The newer ones tend to use JSON because that's trendy now.
<whoman>
minus the obligatory quotes and semicolons , its a fairly nice generic syntax format
<whoman>
used to basically design software in that syntax anyhow back in the day in C/c++/objc lands
* whoman
loves NSDictionary also. which is also QuakeEd level editor map format and original DoomEd BSP format ........ so maybe a bit biased
sabrac has joined #lisp
<sabrac>
Hello all
smurfrobot has quit [Ping timeout: 252 seconds]
<whoman>
hi one
<aeth>
whoman: An id tech 3 (or perhaps earlier) asset importer would be cool. There are a lot of cool maps, etc., in id tech 3. That would be a much lower priority thing to do.
<aeth>
Because, really, "can it run Doom?" should apply to game engines, too. :-p
<sabrac>
Does anyone know who pulled together the unicode data files for cl-l10n-cldr?
sz0 has joined #lisp
peterppp has quit [Ping timeout: 248 seconds]
<aeth>
pjb: Does JSON require a more formal specification than the diagrams on its website? I've always just used the diagrams. https://json.org/
<aeth>
It doesn't stand out much, I have never noticed it before.
<aeth>
oh, good, it's mostly just those diagrams.
<pjb>
aeth: the diagrams are formal enough for the syntax; remains some elements of the semantics, but since it's a data representation language, there's not too much of it. (like meaning of order in various places, what about duplicates, etc)
<aeth>
great
<|3b|>
sabrac: looks like it is just data files from unicode.org with an asd file so ql can download it. http://cldr.unicode.org/
<aeth>
So what I'm probably going to do is support: data s-expressions (.sxp), json (going to write this with the glTF support in mind), and maybe yaml. For 2D, just PNG for now (fortunately, I don't need to write this, at least for reading PNG files). For 3D, OBJ and glTF (requires JSON). For audio, probably Opus and Ogg Theora and *maybe* Flac. And everything else will be internal custom formats.
<aeth>
Hopefully that's sufficient enough and external conversion tools can handle the rest.
<sabrac>
|3b| yes, that is what it looks like. Just wondering who did it. I like to give credit where credit is due.
smurfrobot has quit [Ping timeout: 248 seconds]
mlius has quit [Ping timeout: 272 seconds]
smurfrobot has joined #lisp
bigos_ has quit [Quit: Leaving]
d4ryus2 has joined #lisp
d4ryus1 has quit [Ping timeout: 248 seconds]
smurfrobot has quit [Ping timeout: 264 seconds]
mlius has joined #lisp
smurfrobot has joined #lisp
mlius has quit [Ping timeout: 272 seconds]
rumbler31 has quit [Remote host closed the connection]
rumbler31 has joined #lisp
smurfrobot has quit [Ping timeout: 256 seconds]
Tobbi has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
EvW has quit [Ping timeout: 265 seconds]
<Xach_>
sabrac: Attila Lendvai did it
<Xach_>
aka attila_lendvai
smurfrobot has joined #lisp
<sabrac>
<Xach> Thank you
moei has quit [Read error: Connection reset by peer]
moei has joined #lisp
smurfrobot has quit [Ping timeout: 248 seconds]
rumbler31 has quit []
mson has joined #lisp
smurfrobot has joined #lisp
rumbler31 has joined #lisp
smurfrobot has quit [Read error: Connection reset by peer]
smurfrobot has joined #lisp
smurfrobot has quit [Read error: Connection reset by peer]
smurfrobot has joined #lisp
smurfrobot has quit [Ping timeout: 248 seconds]
smurfrobot has joined #lisp
jmercouris has joined #lisp
smurfrob_ has joined #lisp
smurfrobot has quit [Ping timeout: 268 seconds]
fikka has joined #lisp
smurfrob_ has quit [Ping timeout: 252 seconds]
fikka has quit [Ping timeout: 252 seconds]
damke_ has joined #lisp
damke has quit [Ping timeout: 264 seconds]
test1600 has joined #lisp
jmercouris has quit [Remote host closed the connection]
j0nd0e` has joined #lisp
jameser_ has joined #lisp
smurfrobot has joined #lisp
j0nd0e` has quit [Remote host closed the connection]
jameser has quit [Ping timeout: 272 seconds]
smurfrobot has quit [Ping timeout: 240 seconds]
smurfrobot has joined #lisp
dieggsy has joined #lisp
smurfrobot has quit [Ping timeout: 268 seconds]
smurfrobot has joined #lisp
smurfrobot has quit [Read error: Connection reset by peer]
smurfrobot has joined #lisp
smurfrobot has quit [Read error: Connection reset by peer]
smurfrobot has joined #lisp
damke has joined #lisp
smurfrobot has quit [Ping timeout: 260 seconds]
damke_ has quit [Ping timeout: 264 seconds]
moei has quit [Read error: Connection reset by peer]
moei has joined #lisp
<beach>
Good morning everyone!
damke has quit [Ping timeout: 264 seconds]
pierpa has quit [Quit: Page closed]
jameser_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jameser has joined #lisp
schoppenhauer has quit [Ping timeout: 248 seconds]
makomo has quit [Ping timeout: 256 seconds]
schoppenhauer has joined #lisp
damke has joined #lisp
EvW1 has joined #lisp
mlius has joined #lisp
smurfrobot has joined #lisp
mlius has quit [Ping timeout: 256 seconds]
smurfrobot has quit [Ping timeout: 264 seconds]
smurfrobot has joined #lisp
smurfrobot has quit [Ping timeout: 252 seconds]
<dmiles>
whould this be adequate semantically? (defmacro pushnew (item place &rest rest) `(unless (member ,item ,place ,@rest) (push ,item ,place)))
<beach>
No.
<dmiles>
i am looking at where everyone else passes in an environment.. that is required isnt it?
<beach>
Consider (pushnew (incf *special*) place)
<beach>
Here, INCF will be evaluated twice.
<dmiles>
oh oops
<beach>
Read the book On Lisp. It discusses this issue.
<dmiles>
i guess i have to gensym and do it right
dddddd has quit [Remote host closed the connection]
<beach>
In this case, you probably also need to use GET-SETF-EXPANDER.
<Bike>
"Can't specify the actual keywords [in the macro lambda list] since, apparently, non-constant keywords should be accepted." is an interesting if only tangentially related comment
<Bike>
i've been wondering how &key works with compiler macros...
<dmiles>
i see how it is related
Devon has quit [Ping timeout: 248 seconds]
<dmiles>
what makes me slightly crazy is that the package that keys go into or come from is so random
<beach>
Bike: Where is that remark from?
<Bike>
the comment in the sbcl implementation of pushnew in the pastebin.
<beach>
Ah, OK.
<beach>
Compiler macros are very tricky.
<Bike>
non constant keyword arguments are tricky too
<dmiles>
sorry SICLS didnt fit into the grep :(
orivej has joined #lisp
<Bike>
well, it also uses get setf expansion
<dmiles>
i kinda liek how specializations happen in SICL .. i might end up using that simular trick
<dmiles>
(the |member test=eql key=other|)
<beach>
That code might be obsolete.
<beach>
Are you looking at the sequence functions?
<dmiles>
well that specialization methodolgy seemed to be happening all over the place
<dmiles>
that was in ./reference/SICL/Code/Cons-high/cons-high.lisp
<beach>
That code is also obsolete. :)
<dmiles>
oh and in ./reference/SICL/Code/Cons/pushnew-defmacro
<beach>
OK, that one is not obsolete.
EvW1 has quit [Ping timeout: 265 seconds]
schoppenhauer has quit [Ping timeout: 256 seconds]
smurfrobot has joined #lisp
schoppenhauer has joined #lisp
smurfrobot has quit [Ping timeout: 248 seconds]
<dmiles>
i keep meaning to ask.. is there ever a time that "(eval-when (:compile-toplevel :load-toplevel :execute) t)" would not be t?
<pjb>
good question.
sz0 has quit [Quit: Connection closed for inactivity]
<pjb>
dmiles: it would depend whether the eval-when is a toplevel form or not.
<pjb>
if it's a toplevel form then it always return T, but since it's a toplevel form, this T is just "compiled-in".
<dmiles>
ok so when inside a defun its compiled-in as t (since it contains :execute) i can get rid of eval-when wrapper?
<pjb>
well, no, it's not exact.
<pjb>
If you compile-file it, as a toplevel form, then it returns nil.
<dmiles>
more like: ok so when inside a defun its compiled-in as t. Next since it contains :execute, i can get rid of eval-when wrapper?
sz0 has joined #lisp
heurist` has joined #lisp
<dmiles>
oh i was reading it as ? (eval-when (:compile-toplevel :load-toplevel :execute) (eval-when (:execute) t))
turkja has joined #lisp
<dmiles>
oops
<pjb>
yes, but eval-when preserve toplevel-ness.
<pjb>
So the above is equivalent to the body.
<dmiles>
that helps.. thank you
<pjb>
If you compile-file or load the compiled file then a toplevel (eval-when (:compile-toplevel :load-toplevel :execute) t) returns t (but as I said, it wouldn't matter); If you load the source file, then it would return t too. If it wasn't a toplevel form, then in the first two cases, it would return nil.
heurist has quit [Ping timeout: 252 seconds]
<dmiles>
i'll have to test the: (defun is-it-t () (eval-when (:compile-toplevel :load-toplevel :execute) t))
<Bike>
at non top level that eval when is just progn
<dmiles>
so that wont be differnt if loaded the file file with #'is-it-t or compiled it?
<Bike>
nope
<Bike>
(defmacro eval-when ((&rest when) &body body) (if (or (member 'eval when) (member ':execute when)) `(progn ,@body) nil)) for non top level
dieggsy has quit [Read error: Connection reset by peer]
<dmiles>
pjb: thank you i kept putting off writting that thiny
<dmiles>
thingy .. though it answers all my questions :P
zooey has joined #lisp
_whitelogger has joined #lisp
asarch has quit [Quit: Leaving]
Devon has joined #lisp
LiamH has quit [Quit: Leaving.]
mson has quit [Quit: Connection closed for inactivity]
Devon has quit [Ping timeout: 252 seconds]
damke_ has joined #lisp
damke has quit [Ping timeout: 264 seconds]
fikka has joined #lisp
j0nd1e has joined #lisp
rm8 has joined #lisp
rm8 has quit [Client Quit]
eazar001 has joined #lisp
fikka has quit [Ping timeout: 268 seconds]
xrash has joined #lisp
rippa has joined #lisp
akr has left #lisp ["User left"]
epony has quit [Read error: Connection reset by peer]
FareTower has joined #lisp
wigust has joined #lisp
smurfrobot has joined #lisp
Devon has joined #lisp
<cryptomarauder>
merry christmas everybody
attila_lendvai has quit [Read error: Connection reset by peer]
smurfrobot has quit [Ping timeout: 252 seconds]
<Zhivago>
Is that cultural appropriation?
<cryptomarauder>
I don't think that far into it
<Zhivago>
I'll put it down with a side order of white privilege.
attila_lendvai has joined #lisp
attila_lendvai has joined #lisp
<JuanDaugherty>
fist up festivus!
Devon has quit [Ping timeout: 256 seconds]
epony has joined #lisp
<JuanDaugherty>
'cultural appropriation' is when you hijack somebody else's
<JuanDaugherty>
usually after taking their land and stuff
<JuanDaugherty>
impose your own absurd belief system, etc
<Zhivago>
Pretty sure Christmas qualifies, then.
<beach>
Is it possible to implement the #= and ## reader macros portably? For standard objects, it is possible to use the MOP to traverse them, but what about structs?
mishoo_ has joined #lisp
<Zhivago>
Why do you need traversal for #= and #=#?
<Zhivago>
Wouldn't those take effect at the surface of the syntax of the constructing expression, as they are reader macros?
<cryptomarauder>
when you're far from your loved ones, especially your children, you'll not preocupy about priviledge so much in those moments. Rather christmas becomes something that you wish you could enjoy simply because it's an excuse to step out of the drudgery of apathy and disconnect we generally share most days. To me it's a good thing to practice even if you don't consider yourself a religious person. I for one am not religious.
<cryptomarauder>
I just say merry christmas becasue I hope you guys don't have to live far from your loved ones like I do. Just this.
<beach>
Zhivago: Consider #1=#(1 2 #1#). When you build the vector, you have to stick in a temporary object that you then fix up later, once the vector is built.
<beach>
Zhivago: Now, consider the same scenario for a standard object or a struct.
<beach>
I guess the same problem happens when you have to deal with instances of custom subclasses of CLASS.
Tko has joined #lisp
Tko has quit [Client Quit]
<beach>
Zhivago: Do you see the problem?
<Zhivago>
Yep.
Tko has joined #lisp
<beach>
I guess for maximum portability, I could write the fixup routine as a generic function, and have the implementation specialize on their own classes.
<Zhivago>
If you can change the evaluation semantics to include proxies it should be straight-forward.
<beach>
That sounds complicated, though.
smurfrobot has joined #lisp
<Zhivago>
I'm trying to remember if load-time-value has the same fundamental problem.
<beach>
I can't see why it would.
<Zhivago>
crypto: Fair enough. My recommendation would be to just skip the drudgery bit in the first place.
<Zhivago>
Ah, it has an opt-out clause -- but other than that it looks like it has the same sub-structural issues.
<beach>
I don't see it.
<Zhivago>
It's implementation defined regarding what happens it you evaluate one twice.
smurfrobot has quit [Ping timeout: 272 seconds]
smurfrobot has joined #lisp
epony has quit [Quit: QUIT]
smurfrobot has quit [Ping timeout: 265 seconds]
smurfrobot has joined #lisp
raphaelss has joined #lisp
smurfrobot has quit [Read error: Connection reset by peer]
smurfrobot has joined #lisp
smurfrobot has quit [Ping timeout: 248 seconds]
Devon has joined #lisp
smurfrobot has joined #lisp
Amplituhedron has joined #lisp
Devon has quit [Ping timeout: 260 seconds]
smurfrobot has quit [Ping timeout: 248 seconds]
fikka has joined #lisp
mlius has joined #lisp
fikka has quit [Ping timeout: 252 seconds]
nika_ has joined #lisp
Bike has quit [Ping timeout: 260 seconds]
sz0 has quit [Quit: Connection closed for inactivity]
safe has quit [Read error: Connection reset by peer]
wigust has quit [Ping timeout: 272 seconds]
wigust has joined #lisp
lerax` has quit [Remote host closed the connection]
jameser has quit [Ping timeout: 268 seconds]
Devon has joined #lisp
Devon has quit [Ping timeout: 265 seconds]
alexmlw has joined #lisp
smurfrobot has joined #lisp
damke has joined #lisp
damke_ has quit [Ping timeout: 264 seconds]
shka has joined #lisp
orivej has quit [Ping timeout: 248 seconds]
smurfrobot has quit [Remote host closed the connection]
smurfrobot has joined #lisp
Karl_Dscc has joined #lisp
Karl_Dscc has quit [Remote host closed the connection]
smurfrobot has quit [Ping timeout: 256 seconds]
d4ryus2 is now known as d4ryus
<ym>
beach, you want portable ring buffers?
<beach>
I don't know. Do I?
<ym>
I do.
<ym>
And I think there should be standard extension for such things.
<ym>
Ring buffers, self-balancing binary trees, etc.
<ym>
They also could be optimized very well.
Devon has joined #lisp
fikka has joined #lisp
<beach>
What do you mean by a "standard extension"?
<ym>
ANSI Common Lisp Standard extension.
<ym>
Evolution.
<ym>
We need more math in standard.
<shka>
we don't
<ym>
Ok, I want.
<JuanDaugherty>
you want haskell
<shka>
what stops you from writing it yourself?
<beach>
ym: I am sorry to hear that.
fikka has quit [Ping timeout: 248 seconds]
Devon has quit [Ping timeout: 248 seconds]
<ym>
I don't want haskell.
<ym>
Well, I could just write my own ring buffers, for example.
<beach>
JuanDaugherty: Does Haskell even have a standard?
<ym>
And that's how I can make it by myself.
<ym>
But I can't extend standard myself.
<shka>
ym: excellent idea, you may contribute to cl-data-structures for instance
<shka>
:P
<JuanDaugherty>
beach, it does but not ANSI
<JuanDaugherty>
haskell98, etc
<beach>
JuanDaugherty: Who published the standard?
<shka>
ym: asdf is not standard for instance!
<shka>
neither quicklisp
<ym>
shka, do you see how optimized ring buffers can be implemented on top of existing standard?
<JuanDaugherty>
microsoft apparently
<shka>
but if it is useful, it can become de facto standard
<shka>
ym: why not?
<shka>
i don't see a problem
<shka>
you have vectors, you have bitwise operations/modulo
<ym>
I can see how it can work as sbcl extension, but on top of existing vectors, for example, this won't be nor portable, nor optimized.
<shka>
vectors are porbable
<shka>
*portable
<ym>
#1=#(1 2 #1#) is not.
<shka>
that is supposed to be optimized ring buffer? :P
<ym>
This is ring buffer.
<Shinmera>
No, that's a vector with three elements, the third of which is a vector.
<ym>
Isn't the third is an address of this vector?
<shka>
ym: i don't see why you even need syntax like this for ring buffer
<Shinmera>
There are no addresses in Lisp
<shka>
(make-ring-buffer 1 2) works fine
<beach>
ym: It looks like you completely misunderstood what I was illustrating.
<shka>
and is more readable
<ym>
I'm talking about lower level.
<ym>
Lack of addressing in standard doesn't mean there is no addressing in compilers.
<beach>
ym: In what way is #1=#(1 2 #1#) not portable?
<shka>
ym: more importantly: there is NOTHING that prevents you from writing optimized ring buffers in common lisp
<ym>
Uh, I see, hash-sign is in hyperspec.
<beach>
*sigh*
<ym>
I thought it's kind of sbcl trick.
<ym>
Ok, sorry my dummyness.
<shka>
common lisp has more low level elements in the standard you may expect anyway
<shka>
ym: i think you misunderstood "high level language" idea
<ym>
I think I don't.
<shka>
anyway
<shka>
ym: when you find something in math department that can't be library let us know
<Shinmera>
lack of float infinities is one thing that has bothered me
kajo has quit [Ping timeout: 265 seconds]
nika_ has quit []
kajo has joined #lisp
heurist`_ has joined #lisp
<ym>
I got what bothered me. I want lisp machine reimplemented for FPGA board and able to self-modification. In that way I could build "hardware"-optimized ring buffers.
j0nd1e` has joined #lisp
<shka>
i wonder how that is supposed to look like…
<ym>
There is attempts to port MIT-CADR on modern FPGA-boards.
<ym>
So it's about LispOS.
heurist` has quit [Ping timeout: 248 seconds]
<beach>
ym: What would be the point of such a port.
<beach>
It would be way slower than an implementation on stock hardware.
<ym>
What do you mean by "slower"?
<beach>
As in "less fast". As in slower execution.
<ym>
In real-time on modern development boards in money-cost context, yes.
j0nd1e has quit [Ping timeout: 240 seconds]
pyx has joined #lisp
pyx has quit [Client Quit]
<ym>
But having self-modifiable lisp machine is owesome in many ways.
<FareTower>
ym: with two FPGA chips, you could have a duo-processor where one updates the other at a time.
<FareTower>
ym: at the opposite end, you could have the Green Arrays processor.
vertigo has quit [Ping timeout: 268 seconds]
<ym>
FareTower, when you have self-modifiable lisp-machine, you could whatever you want.
<shka>
…
<ym>
Or many such machines could be implemented with 9p support and distribute computing power via network for example.
Joreji has quit [Remote host closed the connection]
damke has joined #lisp
versatile has joined #lisp
Joreji has joined #lisp
FareTower has quit [Ping timeout: 248 seconds]
versatile has quit [Quit: WeeChat 1.4]
vlatkoB has joined #lisp
versatile has joined #lisp
nirved has joined #lisp
fikka has joined #lisp
<shka>
gosh, i am so glad that flexichain is available
fikka has quit [Ping timeout: 265 seconds]
<beach>
Glad you like it.
<shka>
i actually starting to write my own implementation of double ended queue before i reminded myself that there is very decent implementation just lying around
Devon has joined #lisp
python476 has joined #lisp
Devon has quit [Ping timeout: 240 seconds]
markong has joined #lisp
raphaelss has quit [Ping timeout: 265 seconds]
raphaelss has joined #lisp
smurfrobot has joined #lisp
dddddd has joined #lisp
<beach>
It is quite well tested, yes.
smurfrobot has quit [Remote host closed the connection]
<shka>
it saves time
mlius has quit [Ping timeout: 252 seconds]
<loke>
shka: If you need a red-black tree, watch out though. Out of the ones I tried (3 different ones?) none of them were correct.
<loke>
I ported one myself from a reference implementation, and for the longest time it too had a bug (typo on my part), but now I think it's stable.
<loke>
It's currently not on QL though :-(
<shka>
well, perhaps i should add into cl-ds?
<TMA>
red-black trees are notorious for being easy to get wrong, especially when deletion is involved
Guest73432 has joined #lisp
poorbean has joined #lisp
<loke>
TMA: True. I was runnin gbroken implementations for months without really noticing the issue, other than random errors at times that I attributed to a broken red-black implementation. Finally, I added code to record every single addition and removal to the tree and stored it in a log so that I could replay it to prove there was a problem.
<loke>
Then run for days until I had a way to reproduce.
poorbean has left #lisp [#lisp]
yeticry has quit [Ping timeout: 264 seconds]
<loke>
I then utterly failed to fix it, because I didn't understand the implementation. So, I deicded to port my own, it worked... Until it didn't. Rinse and repeat and this time I was abel to fix the bug, which was a simple transcription error.
<loke>
But now it's run for well over a year without a single problem, on a heavily modified tree, so I think it works.
<loke>
If anyone wants to adapt it into their own library so it can make its way to QL, I'd be pleased.
<loke>
The one in cl-containers is broken by the way. I have a test case to prove it.
kajo has quit [Quit: WeeChat 2.0]
<makomo>
when you redefine a function that was previously loaded using Quicklisp in SLIME, how does it know which package it came from (and which definition to update) if you're not in that particular package (i.e. the current package is CL-USER)?
<beach>
makomo: It looks at (in-package ...) at the beginning of the file.
mlius has joined #lisp
<makomo>
i guess it keeps track of which file the eval came from?
<loke>
makomo: SBCL tracks where a function was defined, and SLIME (SWANK, actually) uses that information for code navigation.
<makomo>
ahh
<makomo>
loke: hm yeah, but how does it know i don't want to maybe make a new function with the same name but in a different package
<loke>
I believe Beach has a much better way to handle this in second climacs.
<TMA>
My RB-tree was ok until deletion, after spending a whole day debugging that I have made an AVL tree instead in about an hour
<beach>
loke: Except that I haven't finished it yet.
<makomo>
what beach seems to make the most sense
<makomo>
said*
<loke>
beach: true, but we're academics here, aren't we?
<loke>
(at least I like to pretend I am)
<beach>
Sure, that's fine.
<loke>
shka: what is cl-ds?
<loke>
TMA: I'd like mine to become available on QL. It's currently part of my own container library, but I'm considering extracting it out into its own library.
<shka>
my fullish attempt at data structure package
makomo has quit [Ping timeout: 265 seconds]
Devon has quit [Ping timeout: 272 seconds]
<loke>
shka: Is it on QL?
<shka>
not yet
<loke>
shka: I'd love to see my red-black implementation on there.
<shka>
i had to figure out iteration method and algorithm interface
<loke>
I don't think the world need my container library. The red-black tree is the only newish part of it anyway
<shka>
but i think that i nailed it
<loke>
shka: If you look at the code from line 302 and below, there is the code that adapts it for my container library. That's the only code you'd need to rewrite:
<shka>
anyway, I wanted something that allow me to write code with R dplyr style group-by
<shka>
and all that jazz
peterppp has joined #lisp
<shka>
as a result i spent awful lot of time on interface design
Tko has quit [Ping timeout: 248 seconds]
wxie has joined #lisp
kajo has joined #lisp
python476 has quit [Ping timeout: 268 seconds]
Th30n has joined #lisp
smurfrobot has joined #lisp
Devon has joined #lisp
smurfrobot has quit [Remote host closed the connection]
smurfrobot has joined #lisp
jameser has joined #lisp
ft has quit [Quit: leaving]
ft has joined #lisp
turkja has quit [Ping timeout: 248 seconds]
turkja has joined #lisp
versatile is now known as Murii
<dmiles>
oh crud this " (defmacro incf (place &optional (delta-form 1)) `(setf ,place (+ ,place ,delta-form)))" is broken in "(incf (aref *vector* (incf *special*))) " ?
<beach>
dmiles: I think I told you that.
<beach>
You are evaluating the subforms of the place twice.
<shka>
dmiles: once-only my friend!
<dmiles>
*nod* i just noticed it was laying arround .. i decided to search for such mistakes
yeticry has quit [Quit: leaving]
yeticry has joined #lisp
attila_lendvai has quit [Quit: Leaving.]
smurfrobot has quit [Remote host closed the connection]
wxie has quit [Quit: Bye.]
Amplituhedron has quit [Ping timeout: 240 seconds]
jameser has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
smurfrobot has joined #lisp
kajo has quit [Read error: Connection reset by peer]
daniel-s has joined #lisp
smurfrobot has quit [Remote host closed the connection]
attila_lendvai has joined #lisp
Th30n has quit [Remote host closed the connection]
varjag has joined #lisp
smurfrobot has joined #lisp
smurfrobot has quit [Remote host closed the connection]
smurfrobot has joined #lisp
daniel-s has quit [Ping timeout: 256 seconds]
smurfrobot has quit [Remote host closed the connection]
kajo has joined #lisp
smurfrobot has joined #lisp
wigust has quit [Ping timeout: 264 seconds]
turkja has quit [Ping timeout: 260 seconds]
FreeBirdLjj has joined #lisp
smurfrobot has quit [Ping timeout: 248 seconds]
FreeBirdLjj has quit [Ping timeout: 240 seconds]
FreeBirdLjj has joined #lisp
Karl_Dscc has joined #lisp
groovy2shoes has quit [Ping timeout: 265 seconds]
wigust has joined #lisp
groovy2shoes has joined #lisp
tankfeeder has joined #lisp
smurfrobot has joined #lisp
beach` has joined #lisp
beach has quit [Disconnected by services]
beach` is now known as beach
smurfrobot has quit [Ping timeout: 265 seconds]
<_death>
no, once-only is not the answer there..
<_death>
for incf you can just use define-modify-macro, but in general you want get-setf-expansion
<beach>
I keep forgetting about DEFINE-MODIFY-MACRO.
<dmiles>
heh i was just griping to myself no one seems to make a define-modify-macro
<dmiles>
(they do though.. but often dont trust it)
<dmiles>
(will use it for incf/decf but if it gets complicated they reather write it out all by hand)
smurfrobot has joined #lisp
<_death>
there's also defsetf/define-setf-expander, which are used even less
<dmiles>
*nod* i sorta even lumped define-setf-expander into the underutilized category but hadnt get to straight defsetfs
attila_lendvai has quit [Ping timeout: 272 seconds]
<dmiles>
hadnt gotten to teh defsetfs.. the defsetfs probly make the best of setf expanders
<pfdietz>
As I recall, ansi-tests has tests that things like INCF don't evaluate things more than once, and also in the right order.
smurfrobot has quit [Ping timeout: 252 seconds]
DeadTrickster has joined #lisp
<dmiles>
looking at some REF POP etc they do start out as if somone macroexpand-1 on define-modify-macro then finish it out
<dmiles>
REF/REMF
Karl_Dscc has quit [Remote host closed the connection]
attila_lendvai has joined #lisp
shka has quit [Remote host closed the connection]
shka has joined #lisp
smurfrobot has joined #lisp
smurfrobot has quit [Ping timeout: 248 seconds]
attila_lendvai has quit [Quit: Leaving.]
Poeticide is now known as Poeticode
smurfrobot has joined #lisp
asarch has joined #lisp
smurfrob_ has joined #lisp
smurfrobot has quit [Ping timeout: 263 seconds]
xrash has quit [Ping timeout: 256 seconds]
Murii is now known as verstaile
verstaile is now known as versatile
smurfrob_ has quit [Ping timeout: 272 seconds]
versatile has quit [Ping timeout: 248 seconds]
FreeBirdLjj has quit [Remote host closed the connection]
mlius has quit [Ping timeout: 248 seconds]
SaganMan has joined #lisp
smurfrobot has joined #lisp
mlius has joined #lisp
dddddd has quit [Remote host closed the connection]
lerax has quit [Remote host closed the connection]
QualityAddict has quit [Remote host closed the connection]
QualityAddict has joined #lisp
QualityAddict has quit [Remote host closed the connection]
QualityAddict has joined #lisp
Tobbi has joined #lisp
<asarch>
1) Can you define a function inside the body of a function? 2) If yes, how? 3) Can you return a function a la JavaScript: function point() {... return () => {}};?
<beach>
Since I don't know JavaScript, I don't know whether this is an answer to question number 3.
<|3b|>
you can also use LAMBDA to create a function without naming it
<Shinmera>
3 is just (defun point () (lambda ()))
<beach>
That looks kind of useless.
<beach>
asarch: Did you faint?
<beach>
asarch: It is customary to provide some kind of feedback, indicating at least that you received the message, and even better to tell us whether you understood it.
makomo has joined #lisp
Karl_Dscc has joined #lisp
Karl_Dscc has quit [Remote host closed the connection]
eazar001 has quit [Quit: WeeChat 2.0.1]
gigetoo has quit [Ping timeout: 248 seconds]
smurfrobot has quit [Remote host closed the connection]
JuanDaugherty has quit [Quit: Ex Chat]
varjag has quit [Ping timeout: 248 seconds]
<pjb>
beach: let's assume overdose of tequila. (for asarch).
<beach>
Sure, that could be.
Th30n has joined #lisp
<Th30n>
Hello and merry Christmas everyone!
<beach>
Hello Th30n. Same to you.
<Th30n>
I've come to bring presents... erm I mean, ask questions with lisp related problems :)
<Th30n>
For anyone testing qt, qt-libs and qtools on Windows. Did smoke generation somehow break? It appears that calls for QString related stuff aren't wrapped. All calls to QT API which requires coercion from lisp string to qstring fail.
<Th30n>
This is probably a "present" for Shinmera :(
tankfeeder has left #lisp [#lisp]
gigetoo has joined #lisp
orivej has quit [Ping timeout: 264 seconds]
rumbler31 has quit []
rumbler31 has joined #lisp
kajo has quit [Read error: Connection reset by peer]
<peterppp>
stupid question: how do I make the regexp package available?
<peterppp>
in clisp
smurfrobot has joined #lisp
<beach>
(ql:quickload "cl-ppcre") I would assume
<beach>
Unless you mean some other system for handling regular expressions.
<peterppp>
on gnu clisp it works, but I normally use sbcl
<pjb>
You asked about clisp.
<peterppp>
ah
<beach>
I am confused.
<peterppp>
my bad...
smurfrobot has joined #lisp
<peterppp>
I didn't know that 'clisp' refers to the gnu lisp implementation as is the case apparently?
alecigne has joined #lisp
<peterppp>
I'm bloody new to lisp, sorry
<pjb>
Common Lisp is COMMON-LISP or CL.
<peterppp>
ahh
<peterppp>
just started out reading paul graham's book the other day
<pjb>
cl-ppcre as indicated above is the common library for most implementations.
<pjb>
Paul Graham used clisp.
<peterppp>
aha
<|3b|>
"clisp" refers to /a/ gnu CL implementation, they have more than one :)
<pjb>
Then he got multi-millionnaire, so he started to write his own lisp named arc, and implemented ycombinator.com with it, and is in the way of becoming billionaire by helping startups.
<pjb>
Yes, there's also gcl, another GNU Common Lisp implementation (eventually).
<_death>
maybe one day he'll go broke and return to writing Lisp books ;)
<p_l>
_death: not sure if good idea, though ;)
smurfrobot has quit [Ping timeout: 264 seconds]
<p_l>
his approach was very opinionated and idiosyncratic, and it shows in Arc :)
<_death>
p_l: so what? I like both his books
<p_l>
Haven't read ANSI CL, towards which most of the complaints are given.
<p_l>
On Lisp is interesting but in the end I never had time nor need for it
<peterppp>
_death, thanks! it'll be great to have that available while I go through the book
<_death>
peterppp: have fun.. ACL was my first Lisp book as well.. do all the exercises, preferably in emacs with slime
<peterppp>
_death, I'm doing them with emacs but have yet to use slime
<peterppp>
gonna do that now
<_death>
peterppp: great :)
nimiux has joined #lisp
QualityAddict has quit [Remote host closed the connection]
<pfdietz>
The Common Lisp spec is quite readable as well.
<alecigne>
Is there some kind of "C for Lisp programmers" book or ressource out there? Maybe knowing Common Lisp is enough to dive in C
<Bike>
i suppose it might help you get a clearer idea of C's scoping, which is badly explained by the average tutorial
<Bike>
but otherwise there aren't a lot of similarities
<alecigne>
Bike: so in your opinion there is no good way to capitalize on my CL knowledge to learn it more easily, the "programming" knowledge by itself is enough
<Bike>
just understanding the basics of programming, you know, the machine does what you tell it too but in a really specific way, what syntax is, stuff like that, is most of what you need to learn a programming language, and passed that the returns diminish pretty fast, imo
<beach>
alecigne: The programming style is completely different, unless you do what I do if I have to program applications in C, namely do everything with pointers and stick the Boehm GC in your application.
<Bike>
what you tell it to*
<_death>
best to learn each language on its own terms.. after you do that, you can move to comparisons and critique
makomo has quit [Ping timeout: 264 seconds]
<alecigne>
Thank you
rumbler31 has quit [Remote host closed the connection]
rumbler31 has joined #lisp
smurfrobot has joined #lisp
vlatkoB has quit [Remote host closed the connection]
orivej has joined #lisp
smurfrobot has quit [Ping timeout: 268 seconds]
EvW has joined #lisp
smurfrobot has joined #lisp
<Shinmera>
Th30n: Nothing has changed about it on Windows in recent weeks, so I wouldn't know about it breaking either.
<Shinmera>
Th30n: The smoke bindings in particular have not changed at all in forever.
smurfrobot has quit [Ping timeout: 252 seconds]
damke_ has joined #lisp
<Th30n>
Shinmera: Thanks for the reply. Yes I was going through that, it's rather weird.
damke has quit [Ping timeout: 264 seconds]
<Th30n>
Shinmera: Basically the problem is, if I try to do to something like (q+:make-qstring "bla") it fails to compile, complains about the function missing. Same thing with (q+:qstring-from-utf-8 "blah"). On the other hand (q+:qfiledialog-get-open-file-name window "blah") crashes when trying to marshal the string to qstring. SBCL reports an error - exception code 0xE06D7363, which signifies that an exception is thrown in C++ code.
alecigne has left #lisp ["ERC (IRC client for Emacs 25.2.2)"]
<Shinmera>
Th30n: The Qstring methods are not exported on purpose -- that hasn't changed.
<Shinmera>
However, strings should be properly converted to and fro.
<Shinmera>
automatically, that is
d4ryus has quit [Quit: WeeChat 2.0]
<Shinmera>
As for the error, that's outside my realm and a CommonQt issue rather than a Qtools one
<Shinmera>
How old is your SBCL, out of curiosity?
<Th30n>
Shinmera: auto conversion used to work. Perhaps it may even be related to cffi, because the call does end up in the C function which returns a QString.
<Th30n>
SBCL is 1.4.2
<Th30n>
(things work as expected on Linux)
<Shinmera>
Hunh. I can't get out of bed to confirm this right now.
<Th30n>
Shinmera: Yeah, no problem, don't bother. It's Christmas, you deserve at least some break :)
<Shinmera>
But if you can open an issue ticket with a minimal snippet to reproduce on https://github.com/commonqt/commonqt/issues I can see what I can do myself (probably not much) or if I can bother Stas about it.
<Th30n>
Ok
makomo has joined #lisp
marutk has joined #lisp
<Shinmera>
Thanks
asarch has joined #lisp
<asarch>
Sorry, I ran out of power
<asarch>
Thank you beach
<asarch>
Thank you very much :-)
<asarch>
I usually don't drink Tequila.
<asarch>
Mezcal is better from the place I am (Oaxaca, México)
<antoszka>
I'd love some good Mezcal. Any export brands you can recommend?
<asarch>
BTW, merry christmas to all of you o/
<asarch>
Brand?! I would like to suggest a trip to Santiago Matatlán, Oaxaca, México
<antoszka>
Well, I'd love a trip, but won't be able to affort one anytime soon. I love the cuisine too (as much as I know it). Really a place I want to visit. Let's take this off channel to #lispcafe.
<Shinmera>
pjb: With Maiden it would be something like (loop with c = (find-channel "#lisp" (consumer "freenode" *core*)) for u in (users c) do (reply c "~a: Merry Christmas!" (username u)))
attila_lendvai has joined #lisp
attila_lendvai has joined #lisp
attila_lendvai has quit [Changing host]
QualityAddict has joined #lisp
<aeth>
Use abstractions! It should be something like this: (do-users (user (users freenode "#lisp")) (message-user user "Merry Christmas!"))
wigust_ has joined #lisp
wigust has quit [Ping timeout: 252 seconds]
peterppp has quit [Ping timeout: 248 seconds]
<_death>
maybe lp:pmapc..
DeadTrickster has joined #lisp
smurfrobot has quit [Remote host closed the connection]
varjag has joined #lisp
rumbler31 has quit [Remote host closed the connection]
EvW has quit [Remote host closed the connection]
EvW1 has joined #lisp
terpri has quit [Ping timeout: 272 seconds]
python476 has joined #lisp
Joreji has quit [Ping timeout: 268 seconds]
resttime has joined #lisp
Tobbi has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
wigust_ has quit [Ping timeout: 240 seconds]
mishoo_ has quit [Ping timeout: 248 seconds]
mlius has quit [Ping timeout: 248 seconds]
<resttime>
Is there a simple virtual machine with its own "byte code" written in Common Lisp out there?
<resttime>
I'm hoping to read some source code to understand stuff
smurfrobot has joined #lisp
itruslove has quit [Remote host closed the connection]
giraffe has quit [Remote host closed the connection]
pierpa has joined #lisp
makomo has quit [Ping timeout: 252 seconds]
smurfrobot has quit [Ping timeout: 264 seconds]
shka has quit [Ping timeout: 264 seconds]
mlius has joined #lisp
iambrj has quit [Ping timeout: 248 seconds]
grumble has quit [Remote host closed the connection]
nirved has quit [Quit: Leaving]
grumble has joined #lisp
zaquest has quit [Read error: Connection reset by peer]