freenode/#lisp - IRC Chatlog
Search
12:50:21
jmercouris
I could check for a file:// protocol prefix, but then the user MUST specify that
12:57:50
jackdaniel
if you want just check whether the file denoted by a pathname designator exists you may feed it to the function probe-file
13:03:11
edgar-rft
the only alternative I know would be using regular expressions what probably would be even more expensive
13:04:52
edgar-rft
where regular expressions only can check if a string *looks* like it *might* be a file path, it's not a reliable test at all
13:35:13
flip214
does anyone know any papers that describes the advantages of CL? Especially recent comparisons to other languages would be welcome, if they mention monetary advantages as well it would be even better.
13:35:57
jackdaniel
starting a flipper running common lisp requires less coins than a one running C#
13:39:33
heisig
flip214: Discussions like "should we pick language A or language B" are rarely about facts. Maybe the best chance for CL is simply to outlive all the other languages.
13:40:56
heisig
Outliving the others could actually work. CL programs have very little bit rot, and don't require a lot of maintenance. So time is on our side :)
13:43:58
flip214
heisig: yeah. I was asked about exactly these facts right now. And the half-life of other things is one of the major points in my argumentation.
13:45:50
luni
but the fact that the half life of dgemm to make an example is high does not means that people doesn't switch to python or xyz
13:48:19
heisig
flip214: Maybe you should simply gather a list of awesome CL programs that stood the test of time. Like Maxima, Screamer, CLIM, OpusModus, ACL2, ...
13:49:39
heisig
That would illustrate the point that by choosing CL as an implementation language, you have an increased chance of creating something profound and long-lasting.
13:50:54
flip214
heisig: thanks! I'm already mentioning that libraries from 1994 still work, but applications is another good point
13:58:15
heisig
flip214: You could also ask the developers of a large CL application (e.g., QPX) to share their experiences with your employer. First-hand testimony can be very convincing.
14:00:46
jmercouris
I would be careful to push such a decision on your employer, if they agree, you will be responsible for every failure
14:01:18
jmercouris
regardless of whether the responsibility is justified, and don't worry, many employees will complain and say "tHiS iS sO mUcH eAsIer In Js"
14:55:50
rpg
Anyone out there motivated to take over CL-JSON? I'd really like to see it get some of it's 6+ year old fixes applied, but I can't easily take on YA CL library.
14:58:54
aeth
probably because people just configure Lisp programs in Lisp itself, cutting a lot of the demand for something like JSON
15:02:02
pyc
hey #lisp! is there anyone here studying Practical Common Lisp or any of the other Lisp books? I would like to invite you to #lispx . Trying to form a study group to keep myself motivated and share learnings with.
15:05:45
rpg
pfdietz: I wouldn't mind if our community would stop writing libraries from scratch over and over, and would give the old ones some love instead.
15:06:26
jmercouris
I know I frequently rewrite things because I don't want to deal with contacting an old maintainer or diving into their codebase
15:08:09
Xach
rpg: I think there are some good reasons and bad reasons why people strike out on their own
15:08:46
rpg
Xach: Sure, but it's hard to argue that NIH isn't a plague on the community as a whole.
15:08:49
Xach
rpg: a bad one is "i didn't know it already existed". similarly "i knew it existed but could not tell if it solved my problem"
15:09:31
Xach
I wouldn't argue that, I get to see new utility and test libraries pop up all the time. But there are obstacles that could be removed to help the situation somewhat.
15:10:10
rpg
Stuff like JSON handling is critical for interoperation with the world of non-CL code, and the current Tower of Babel approach is ... not good.
15:10:14
jmercouris
the reason it may not seem so in other communities is because the relative size of libraries is different
15:10:19
mfiano
What about "I knew it existed, but since Lisp is so flexible it was wasier to write my own 20% solution than to unmap the projection of someone elses' mind onto my own"
15:10:31
pfdietz
I try to focus on working on existing libraries, rather than starting new ones. Sometimes that means building new tools, though.
15:10:51
rpg
I was thinking I'd like to build something that would handle JSON schema, but ... seems like it would be building on sand.
15:10:53
Xach
if you're doing work in your free time and you want to make life easy for yourself, external pleading may not help
15:12:12
pfdietz
Download stats on QL are very useful for focusing on focusing attention on most-used systems.
15:12:14
rpg
jmercouris: If you and I are both relying on CL-JSON, interested in forking it in a way that would be more accepting of patches?
15:13:45
rpg
pfdietz: Yes. There are several patches that should be applied but aren't and won't be.
15:14:56
rpg
I'd be happy just to see a fork with multiple owners who would, as time permits, review and merge PRs.
15:15:37
jmercouris
I am willing to create an organization to maintain libraries in a community fashion
15:15:57
jmercouris
we have adopted some libraries in the development of Nyxt, but we have not created an organization for it...
15:17:11
rpg
I'd sign up. I just don't want to start up a personal fork of libraries like cl-json, which would just move the same problem from point A to point B
15:17:20
aeth
The problem with the JSON libraries is that they're just completely fundamentally flawed. Many authors, for instance, seem to think that treating CL:NIL as equivalent to JSON's "null" instead of as JSON's "false" is a reasonable default, which, I mean... really? Really? NIL is false. CL doesn't have a true null.
15:17:55
aeth
The solution definitely is to NIH a proper JSON library and then, if possible, base the old libraries on the new one, to preserve the old (flawed) APIs. Like e.g. what happened with PNGs
15:17:58
pfdietz
I am inclined to participate, but I find myself short on time these days for all my side projects. So "maybe"?
15:18:15
jmercouris
Gnuxie[m]: you haven't answered my question, why do you think I should join clnoobs?
15:18:29
rpg
aeth: It isn't a solvable problem (this is why I think it would be useful to have JSON schema support) -- there's no way to tell, absent contextual information, if NIL == [] or NIL == False
15:19:26
aeth
rpg: The least surprising default would be to CONS any list to avoid the NIL issue. Otherwise you still have the ambiguity between NIL as [] or NIL as {}
15:19:56
rpg
aeth: That's a *much* bigger lift. I wouldn't sign up to do that, but I would sign up to join an organization that would take on some orphaned libraries, and take time as available to merge PRs, etc.
15:20:51
aeth
Imo, the reason nobody's using Linux on the desktop is because while Linux is great and you don't have to touch it in 10+ years after you set it up, it does require non-trivial configuration because the defaults suck.
15:20:54
rpg
aeth: I suppose. I'm more interested in adding JSON Schema support in order to end run the ontological questions like "What is NIL"?
15:20:55
pfdietz
My contributions these days tend to be "here's a widely used library with inadequate tests. Let's add some." I sometimes fix the bugs found.
15:21:44
aeth
jmercouris: My point is that most people don't change the default, so if the JSON libraries all have awful defaults, it doesn't matter that some of them can be configured properly. 99% of uses won't be proper.
15:21:46
rpg
aeth: I get it, but I think we are back in the "the better is the enemy of the good" territory, writing YA JSON Library.
15:22:28
jmercouris
maybe we can make an organization, where by default, if a library is not updated in 1 year, it gets put into community maintenance
15:22:39
rpg
If you don't work at the low level, the defaults are less of a pain point. My opinion is that there is no perfect match from JSON to CL, and searching for one is like looking for El Dorado.
15:23:00
rpg
I'm more interested in shaving the yak that is CL-JSON (and a bunch of other libraries).
15:23:54
rpg
I can't afford to rewrite everything I have that uses JSON in the hopes that something better is out there. I'd rather build some superstructure. YMMV.\
15:24:35
rpg
jmercouris: Agreed -- I'd like to set up the Home for Wayward Libraries, rather than discuss generating a new one.
15:24:49
_death
rpg: you don't need contextual information to decide to represent Lisp NIL as JSON [] (or better, {}.. #() could be []) and Lisp :FALSE as JSON false..
15:25:37
rpg
Let's fork the discussion of how to properly bridge JSON with CL to a separate process, and get back to how to do a little carpentry on libraries that need some maintenance.
15:26:27
aeth
"Note that here we have nil representing false, null, and []. This is done by examining the :type of each slot. If no type is provided, nil shall serialize as null."
15:27:28
rpg
I have to go walk dogs, I'm afraid. pfdietz jmercouris -- I'll check back in later, and am happy to do a little work to help set up the CL Library Orphanage.
15:28:47
jackdaniel
well, that is a sound strategy, do you want to let in dilletants to make orphaned libraries worse?
15:29:41
jackdaniel
well, good luck, but calling sharplispers not welcoming sounds like some personal grudge ;-)
15:30:04
rpg
I'd be happy to do this under the umbrella of sharplispers, but I have no idea how to join...
15:30:20
aeth
And in case anyone pokes me in like 10 hours to challenge what I said... You can treat NIL as null-as-the-default-value within CL, but when you're serializing to/from JSON you're interoperating with languages who have null-as-the-crappy-thing-that-breaks-the-type-system or maybe null-as-the-element-in-the-three-value-logic-system. So it's best to think of NIL as just false that happens to be the default value for a lot of things (unless wor
15:31:22
jmercouris
CL as a principle, and as a design is not based on the BDFL, so why should our libraries be distributed and maintained this way?
15:31:37
jmercouris
of course, there are other shows in town, but those don't get much community support
15:31:38
rpg
jackdaniel: OK, will do. What's the procedure for getting a library adopted by sharplispers? And what's the protocol for getting things merged?
15:31:55
_death
100% working roundtrip is a basic requirement of a json encoding/decoding library.. that some libraries that lack this are still being used is strange
15:32:32
jmercouris
For example, why can we not get packages from pjb on the official Ql Dist? Because the BDFL does not desire it, and does not like pjb
15:33:05
mfiano
pjb's stuff was on Quicklisp until it failed to build and he did not want to update it
15:33:08
jackdaniel
rpg: technically speaking anyone could spawn a repository in sharplispers, but I don't think I have an access right to add users
15:34:18
jmercouris
what is the truth, I dont' know, may never know, I do know that Xach is a single point of failure/control
15:34:24
jackdaniel
rpg: or in a matter of fact, anyone listed as owner here: https://github.com/orgs/sharplispers/people
15:36:09
aeth
_death: It's not just 100% roundtrip as the default behavior, but also interop with the other major programming languages. That's really where nil-as-null instead of nil-as-false tends to fail.
15:40:41
aeth
jmercouris: The main difference between XML and s-expressions is that XML lets you express the same thing in two ways. <foo bar="42">43</foo> vs <foo> <bar> 42 </bar> 43 </foo>
15:41:36
aeth
jmercouris: Creating a way to express the first thing in s-expressions either gives you something like (foo :bar 42 43) or (foo (:bar 42) 43) and neither are that ideal because in the first case, you have to nontrivially parse it to see if you're inside a leading plist while in the second, most tags will have () or nil as their first item
15:42:27
aeth
Otherwise, yeah, s-expression is just a more network friendly form of XML because it reduces a ton of duplication (but if you compress it, that duplication is gone)
15:43:42
aeth
Well, the sin of HTML is different. The sin of HTML is that it is permissive of errors because Netscape and IE were competing to support the most garbage websites out there.
15:46:38
aeth
It's not as off-topic as it seems because I'm probably just going to use a subset of HTML in s-expression form as the GUI for my game engine.
15:48:28
jmercouris
just 82 lines of code, specifies a listener/watcher model for updating elements on screen
15:51:41
_death
I've been wondering why format-graph-from-root in presentation method for present won't redraw when incremental-redisplay is nil (some check for output record ancestorship..) .. for now I'm using incremental-redisplay
15:51:57
aeth
technically speaking, all of these encodings are useless because ASCII/Unicode have group separator / record separator / unit separator, so you can juse use a three-tier-hierarchical, unprintable CSV-derived format for data. (but this line was 100% #lispcafe material)
16:21:17
jmercouris
yeah, it IS the portability library, but it doesn't appear to have a pure CL implementation of get-hosts-by-name
16:23:16
Bike
well, for one, clasp actually does have sb-bsd-sockets. i don't know if usocket knows that though
16:23:42
Bike
for two, those implementation systems can't really be written in CL, which is why implementations provide them as extensions
16:24:20
Bike
CL does not have functions for calling into the operating system. ergo, in "pure CL" you cannot call into the operating system
16:27:47
_death
if an implementation supported ffi but not sockets, and cffi supported that implementation, usocket could conceivably have a cffi backend, but there's no need
16:29:02
_death
you'd also need to implement this for each platform with different socket interfaces
16:29:35
Bike
yeah, if you look at the actual sb-bsd-sockets you can see lots of papering over win32 and darwin and such
16:29:57
Bike
i mean, i guess you could take it on yourself to duplicate all that work in terms of cffi instead of implementation FFIs
17:21:21
jasom
basic-binary-ipc has no non-lisp non-os provided dependencies but does not support dgram sockets
17:45:19
flip214
jmercouris: CL-INTERPOL has a reader that allows you to use #?rx(\d{1,3}. ) without double \\
18:13:08
Nilby
_death: maybe you just suggested IPv4.2 that people might actually adopt, since their regexps will be fine with it. 39 bits could be fun.
18:32:29
mfiano
Hmm, having a bit of difficulty restructuring a LOOP form to do what I want. Any takers? :)
18:36:34
Bike
i don't understand what you're going for here. x and y don't change between iterations, so fx and fy don't change, but you recompute them every time anyway?
18:36:39
mfiano
Added a comment for a monofractal (one that doesn't multiply each octave with the previous).
18:41:41
mfiano
Wonder if there's something I'm missing. Here's a Rust (gasp) version: https://github.com/Razaekel/noise-rs/blob/develop/src/noise_fns/generators/fractals/basicmulti.rs#L123-L151
18:42:55
Bike
i don't see anything analogous? if point is the equivalen to x and y, it's reduced on each iteration
18:44:35
mfiano
At least that was the intention. I was looking at a few implementations, not sure I understand this Rust one
18:45:47
mfiano
so :for fx = (* x lacunarity) :then (* fx lacunarity) is what I need for that I believe
18:47:33
mfiano
that still leaves trying to do the initial point and octave 0 sampling inside the iteration. I see the Rust version is not either, but they don't have a powerful DSL :)
18:51:51
Bike
i think the difficulty is that the first "signal" is not scaled like the later ones are.
18:53:14
mfiano
I thought this would be close, but nope: https://gist.github.com/mfiano/e480228fed81a59d6e07c8f8e792702c
18:55:24
Bike
that doesn't actually read any sources beyond the 0th one, so you definitely don't want that
18:56:54
alanz_
I want to play with the dropbox API. Is this the most up to date library for it? https://github.com/jsmpereira/cl-dropbox
18:59:18
alanz_
hmm, maybe this one: https://github.com/deadtrickster/cl-dropbox. Only seven years old, not nine
20:10:46
Nilby
I don't use slime much, but assume the color after pressing c-a-m<tab> should be indicative?
20:46:55
White_Flame
if a macro generates a macrolet body inside its output, how does one expand those again?
20:52:50
mfiano
Sounds like your macro should be broken up into functions. You're not going to be able to interactively macrostep inside a backquoted form.
21:02:50
fe[nl]ix
jasom, _death, jmercouris: anyone interested in me publishing SBCL Linux binaries with libfixposix (and maybe openssl) statically linked ?
21:06:14
White_Flame
mfiano: can't really break out macrolets like that, and it's not too huge, just a few dozens of lines total
21:06:48
mfiano
White_Flame: Does SLIME have interop with macrostep-mode like Sly does? If so then just invoke that on the top-level macro call, press <tab> to jump to the next expandable form until you reach your macrolet call, and press "e" to expand that. (Of course keybindings are probably different; don't remember if I configured sly-macrostep myself or not)
21:09:08
White_Flame
nah, e just says it's not an editable buffer, and anoter C-c Enter doesn't do anything to the macrolet inner usages
21:56:39
jackdaniel
it is the shell command executed before python in # ./shell-command && python foo.py
23:11:17
jasom
quick poll. I'm about to publish my YAML parser. cl-yaml parses "[[],false,null]" to (nil nil nil). I prefer it to parse to #(#() nil :null). My parser is configurable to do it both ways, but which should I default to?
23:12:40
jasom
Reason for my preference: I want to know which of the 3 values was in the actual YAML, so I'm only allowed to parse one value to nil. #() is an empty sequence already and I'm more likely to want to do (if boolean ...) than (if maybe-null ...) so null has to lose out and become a keyword.
23:13:31
jasom
I will provide a convenience function for parsing like cl-yaml if I don't default to the cl-yaml way
23:23:00
jasom
I don't need to be convinced the latter is better in a vaccum, I need to be convinced that it's enough better for the default to be incompatible with existing libraries
23:28:35
jasom
|3b|: if the documentation is correct then there is no way to sepcify variable arguments in defcallback
23:29:48
Bike
the va_list operators are macros and seem to usually involve some weird complicated shuffling, so lisp implementations might not wanna bother
23:30:22
jasom
It's actually fairly easy to implement for 1 ABI, but multiply that by how many ABIs are out there...
23:31:21
jasom
usually the first N values are passed identically to a function of N arguements, and then the rest are done with fancy stack tricks.
23:34:45
Nilby
many C APIs that have variable arguments, also have a version where it passes the va_list, e.g. vprintf, which I assume you could, perhaps unportably, use in a callback
23:43:03
|3b|
i guess i can try to redirect stderr to a file or something and look at the default logging there
23:43:36
Bike
could you write a little wrapper that gets an actual string with vsprintf and then passes that to the lisp callback?
23:44:09
Nilby
I think in practice you can do it, but it's not portable, so CFFI doesn't offer it. The va_list arg tend to be just as stack pointer, so with a stack pointer you can pull out the C args if you know exactly what they are.
23:44:47
|3b|
(not completely trivial since i'm not actually working at the tty on which the code is running, but not too horrible)
23:45:04
jasom
It's entirely possible that if you treat va_list as a void * you can pass it along opaquely to sprintf, but that's ugly...
23:51:22
jasom
|3b|: a quick test on x64 shows that va_list is indeed treated like a void *. Writing a quick cffi test now...
23:54:36
|3b|
ah, guess it only works when loaded as a dependency from other things that depend on osicat... i'll send some more PRs and get you to try again once it loads in a clean image for me
0:17:39
asarch
If you are in the BASH prompt and press the ↑ key, it will show the last command entered, however, in the Slime REPL, the cursor (the blink block) will go up in the buffer, how could you "emulate" the ↑ key function in Slime?
0:19:33
jasom
|3b|: for arm64 take a struct like this, and you can pass it along unmodified: https://github.com/ARM-software/abi-aa/blob/f52e1ad3f81254497a83578dc102f6aac89e52d0/aapcs64/aapcs64.rst#122the-va_list-type