freenode/lisp - IRC Chatlog
Search
13:25:11
montaropdf
jmercouris: as I foresee it its primary use will be through a text editor to add transactions or modify data record, so you could already try it to verify it is as editor and programming language friendly as it seems as of now.
13:30:13
montaropdf
jmercouris: I was speaking about trying the file format to hold data, not coding anything that could act on the data.
13:58:44
montaropdf
BTW, any comments about the syntax consistency of the various forms/expressions described?
14:01:41
jmercouris
the only thing that comes to mind is this; the table definition need not contain sort information
14:46:32
sabrac
anyone seen an implementation of SaslPrep (https://tools.ietf.org/html/rfc7613) or StringPrep (https://tools.ietf.org/html/rfc7564) that I can look at?
14:48:08
Odin-
Isn't that a decent chunk of what needs to happen for Postmodern to support modern authentication?
14:50:01
sabrac
I have everything done except the normalization of the password - assuming I make ironclad a dependency.
14:50:44
sabrac
If the passwords and user names are ascii, everything works, but the standard requires that passwords and user names be normalized for different utf8 encodings
14:50:50
Odin-
Interesting. I've been thinking about taking a try at that side of it for a while. Don't have anything done, though.
14:53:22
sabrac
By the way, what are people's thoughts on ironclad as a dependency? Xach thinks it is a pretty big dependency but I do not want to reinvent a subset of that wheel and get it wrong
14:55:17
pfdietz
The problem isn't depending on Ironclad, it's that Ironclad solves a problem that is risky to solve (due to exposure to changes in internals of CL implementations).
14:55:34
Odin-
I'm mainly suggesting that Ironclad could do with being made more modular, rather than not using it.
15:02:03
Odin-
sabrac: There are small, but significant, differences between the RFCs you linked to and the ones referenced in the SCRAM-SHA-1 RFC.
15:03:05
sabrac
yes. The RFCs I linked to obsoleted the ones that Postgres is using. I would like to look at both
15:03:53
Odin-
As far as I can see the difference that's most likely to trip something up is that the new ones use NFC, but the older ones use NFKC.
15:09:11
sabrac
Good to know. Safer to just look at https://tools.ietf.org/html/rfc4013 and https://tools.ietf.org/html/rfc3454?
15:13:16
sabrac
You obviously are knowledgable in this space. Any implementations of NFKC you recommend I should look at?
15:23:07
Odin-
But at least having what sb-unicode appears to support available more widely would be ... useful.
17:14:34
Xach
sabrac: the ironclad issue springs more from how difficult it is to use one part without using the whole thing, and i don't always like using the whole thing because it is large and takes a long time to compile.
17:15:32
Xach
but if you were just using it for e.g. one or two hashing functions, to me that seems heavyweight
17:27:03
sabrac
functions currently needed from ironclad are: ascii-string-to-byte-array, hex-string-to-byte-array, digest-sequence, hmac-digest, make-hmac, update-hmac, integer-to-octets, octets-to-integer, pbkdf2-hash-password and whatever they depend on within ironclad
18:54:27
pjb
Josh_2: there are actually very few implementations that launch missiles at you, develop a new plague virus, or expulse nasal daemons in case of undefined behavior. You can just try stuff out at the REPL!
18:56:40
pjb
Josh_2: try: (dolist (f '("Hello~%World" "~%Hello World" "Hello~3%World" "~3%Hello World" "Hello~&World" "~&Hello World" "Hello~3&World" "~3&Hello World")) (format t "~%-------------------- ~A~%" f) (format t f))
18:58:31
markasoftware
I'm writing a Lisp function that scans through the body of a lambda to determine which lexical values and functions to put in its closure
18:59:45
markasoftware
do i need to have a special case for quote, so that I don't capture symbols inside of a quoted list?
19:01:07
Bike
i mean you'll have to handle like (find-closure-symbols '(let ((x y)) x)) => (X), not (X Y) anyway
19:03:25
Bike
so, while analyzing the body (+ x y z), you have to make sure that the x is NOT added to the free list.
19:04:38
markasoftware
It isn't any easier to do this in the lisp interpreter than it is to just write a macro, like Emacs did with lexical-let, is it?
19:05:27
markasoftware
Is it easier to implement lexical binding in C, with the interpreter? I can't imagine it would
19:34:33
pfdietz
markasoftware: you are trying to write a code walker. This is not possible in a fully portable way in Common Lisp, unfortunately. And because macros can do arbitrary computations is not possible in general to trace back to the original lambda expression.
19:35:35
pfdietz
The portability problem is because the code walker needs to maintain an env object as it goes through macrolets, and there's no standard API for doing that.
19:36:12
pfdietz
(I make the assumption here that there may be macros in the code for which you do not have the source.)
19:36:33
pfdietz
(Otherwise, you could solve the problem with an entire virtual CL implementation on top of the one you are using.)
19:56:12
aeth
pfdietz: That might actually be the easiest solution. It shouldn't be that hard to implement CL on top of CL. Maybe a 3 month project?
19:59:46
aeth
It almost certainly will have custom special forms if you expand macros past the point of the CL package, e.g. CL:LOOP. Although CL:DO usually is simple enough not to have any. And it's not required, e.g. CL:DOTIMES is usually implemented on top of CL:DO and CL:WITH-ACCESSORS usually uses CL:SYMBOL-MACROLET
20:07:02
aeth
If you run your own CL implementation on top of CL, though, you get full knowledge of any quirks as long as you don't do the laziest thing and transpile all of the source code to itself. (Some things might be unavoidable like different fixnum sizes unless you really want to slow things down, though.) It might mean slightly different behavior in edge cases inside vs. outside, though.
20:08:26
aeth
If this sounds like a ridiculous solution to code-walking, then maybe this shows why code-walkers are usually avoided!
20:14:52
jackdaniel
ecl has a walker module, but I don't know in what shape it is, I've never used it nor it has tests
20:15:10
aeth
Bike: Even if you have a working code walker, there's still the issue of when you refactor code in the usual CL way and just C-k a piece of code from a giant function so you can put it in a smaller function for cleaner code. Oops! It has a (foo bar) somewhere in those lines and foo isn't a real thing! It's just an illusion from the code walker!
20:16:13
aeth
Bike: My point is code walking functions should be recursive so if FOOBAR uses the macro, then if you spin off a BAR function, you can also use the same macro to get to the same state. e.g. maybe an HTML generator that has a code walker in embedded CL code in it
20:16:58
Bike
i don't understand your example. you're talking about cut pasting from source? how does a code walker come into it?
20:19:33
aeth
Take a (with-infix (- b + (sqrt b ^ 2 - 4 * a * c) / (2 * a)) and then say 'Oh, this is a bit messy, let's move "b ^ 2 - 4 * a * c" into its own function so the "- b -" function can share code with the "- b +" function"'. But depending on how it's written, you can't do that.
20:20:16
aeth
Quite a few code-walker macros do some sort of initial and/or final step that will be completely broken by a function f calling a function g that also uses that macro.
20:21:49
Bike
I am... not remotely certain I understand what you're talking about or what it has to do with code walkers, but not being able to cut parts of a function out willy nilly doesn't seem like a problem unique to code walking macros.
20:22:25
White_Flame
code walkers don't walk through functions anyway; whatever lexically goes on in the extracted function is opaque to the caller's environment
20:23:10
aeth
Bike: Code walking macros happen to make it particularly undiscoverable. If a macro has a fake (foo 42) I can't just M-. into it. I'll have to read a 200-line opaque macro that should've been split up into tiny functions and then I'll understand why the macro author didn't support the mode of splitting up a 200 line function into tiny functions.
20:23:27
pfdietz
What is needed is implementation support for the environment datatype, so the code walker can do the right thing on macrolet and symbol-macrolet.
20:24:31
aeth
Bike: If you make something easy to do then more people will do it, even if it's a bad thing.
20:24:36
pfdietz
At a higher level, the problem is that macros can do anything. So you can lose traceability back to your code.
20:24:47
Bike
I'm talking about implementing floats and you're like "it's pretty nasty that they're not associative" like yes sure
20:25:50
aeth
Well, you said implementation support would be nice. If I don't like floats, then I think that objecting is a valid response.
20:26:22
pfdietz
I want to solve this problem: walk a lambda and flag every cons cell in there that's a form. I don't think that's possible in general.
20:27:05
pfdietz
I can expand all macros, but that gives me all the forms in the expansion, not in the original lambda.
20:27:16
aeth
Bike: I mean, code walking has its uses, but all of the really weird macros try to do it ime
20:28:10
pfdietz
I think this sort of issue motivated some of the divergence from CL you see in Scheme family languages. Or at least, that's the impression I get.
20:28:20
White_Flame
the place where I used it, I was finding all uses of variables whose names start with "?" and creating a LET binding around the form. The reason I don't just make a LET for all of them is because it's expensive to look up the value.
20:28:39
White_Flame
but really, code walking situations are generally going to be in a limited focus, looking for very particular things
20:29:10
White_Flame
but it also does mean that simple, incomplete codewalkers suffice for those various situations & limitations
20:29:24
aeth
Bike: No feature is truly necessary. If a feature is abused more than it is legitimately used, then it isn't a good feature. Of course, maybe the reason it's abused more than it is legitimately used is because you can't get a good code walker in portable CL, so bad macros are more likely to attempt it.
20:30:14
pjb
pfdietz: I don't know what you're babbling: I can expand macrolets and symbol-macrolets perfectly well: https://termbin.com/2dkg
20:31:27
pjb
jackdaniel: 1- only sbcl has (or had) a specific special form. 2- implementations that do, should provide a macro that expand to a form that let you qualify the subforms.
20:32:01
pfdietz
Let's suppose one of your macros there calls macroexpand on something else, and passes the environment argument along to that expansion.
20:32:02
pjb
I exploit it passing it to macroexpand as is intended (there are examples in clhs macroexpand).
20:32:28
pfdietz
How did you construct that environment object in a portable way, given that it depends on the macrolets?
20:35:09
pfdietz
In this thread, we discover that we can walk code, if we have already walked it and added codewalk forms.
20:35:14
pjb
pfdietz: However we should indeed node that "The object that is bound to the environment parameter has dynamic extent." says 3.4.4 Macro Lambda Lists
20:35:16
jackdaniel
big lol presents a code walker (which makes some invalid assumption which blows on sbcl)
20:35:17
Xach
cl-arthur: http://christophe.rhodes.io/notes/blog/posts/2014/naive_vs_proper_code-walking/ has some nice info
20:36:36
aeth
My earlier point in one line: I think it's a decently common deisgn pattern to use code walkers to embed CL within some big pile of s-expressions and then have an exit point back. e.g. "(with-html (html (body (cl (dotimes (i 10) (in-html (p \"Hello\"..." but now you can't have helper functions because in-html doesn't actually exist. And of course you have the typical issues like you probably can't flet it.
20:37:56
aeth
This could actually be solved, even the helper function problem, depending on how you do the code walker's environment.
20:50:09
Bike
well "over" is an adverb so it should be capitalized, but "of" shouldn't, so therefore Let Over Lambda = LOL is bigger than Land of Lisp = LoL
20:51:09
shka_
… can we agree to not write any other lisp books that abbreviate to l o l, it is already confusing
21:29:13
cl-arthur
LdBeth: Are those 'Lisp Lore: A guide to programming the lisp machine' and 'Lisp, Lore, and Logic: An algebraic view of LISP programming, foundations and applications', or is my search failing to turn one up?
23:55:05
_death
the largest number sbcl can make into english is 999999999999999999999999999999999999999999999999999999999999999999 .. is it conforming? :)
23:59:37
nirved
_death: clisp has the same limitation, for ccl the limit seems to be 999999999999999999999999999999999