libera/commonlisp - IRC Chatlog
Search
7:17:43
jackdaniel
madnificent: but this comes even without such unobvious things like encryption. you assume that when you write a conforming program you are safe, but implementations have bugs and even interpret differently some parts; there may be changes inside the compiler you did not anticipate
7:18:16
pjb
madnificent: well, implementing an algorithm can be validated. In cryptography, the problem is that it's not sufficient to have a correct algorithm. The code must be written so as to minimize physical and logical side effects induced by the execution of the correct code, that could lead to leaking information about the keys or other cryptographic elements.
7:19:09
pjb
Already, running on a VM is bad, since the VM can see what's occuring. But there are solutions: white-box cryptography, where the key are encrypted, and kept encrypted when used.
7:19:53
pjb
But other statistical properties about the keys could be detected from temperature, power, speed variations (physical phenomenon outside of the direct influence of the algorithm and code).
7:20:47
pjb
Perhaps (setf x (* 2 x)) produces more heat when x is full of 1s instead of full of 0s? Perhaps (setf x (ash x 1)) produces the same heat in both cases?
7:21:11
pjb
Depends on the compiler and hardware. Algorithmically, it's the same. Both codes are correct.
7:21:56
pjb
What I'm saying is that it's better to have a compiler option to let it ensure that the code generated from both forms minimize the heat produced and execution speed variation.
7:22:12
pjb
Actually, that it's the only way to ensure that the cryptographic system requirements are met.
7:22:35
pjb
You must include in the requirement fulfillment the specific compiler and hardware, to validate the cryptographic system.
7:23:19
pjb
So, write all the cryptographic code you want, it's not up to the programmer to ensure validity of the final cryptographic system, but up to the integrator who will select the compiler and compiler options, and the hardware.
7:24:40
pjb
Of course, the designers of cryptographic algorithms can help by avoiding things like "if bit 0 of x is 1 then do-something-taking-little-time-and-energy else do-somethign-taking-a-lot-of-time-and-energy".
8:37:21
JeromeLon
Are there any active projects to make a new lisp IDE or to make alternative/radical improvements to emacs/slime? Code or variable extraction, inlining, renaming, real-time warnings, smarter completion, are all taken for granted nowadays, but are not available when using emacs. Presumable these all require the editor to have a deeper understanding of what each character means, which in turns
8:40:50
beach
This paper http://metamodular.com/incremental-parsing.pdf shows how we use READ (the Eclector version of it) to incrementally parse the buffer contents.
8:41:35
beach
Then the plan is to run the code through the first phase(s) of a compiler-like think to determine determine the role of each expression.
8:42:17
beach
From that result, we compute indentation (which I kind of know how to do, but that I haven't worked out the mechanics of yet) and highlighting information.
8:43:13
beach
Then there is the debugger part. This is what I think we should do: http://metamodular.com/SICL/sicl-debugging.pdf
9:26:48
beach
pjb: Wow, MIT LOOP is worse than what you pointed out. This is SBCL: (loop for x in '(a b c) append (cons x 'foo)) => (a b c . foo)
9:40:24
beach
pjb: (defparameter *l* '(c d)) (tailp *l* (sicl-loop:loop for l in (list '(a b) *l*) append l)) => T
9:40:34
beach
pjb: (defparameter *l* '(c d)) (tailp *l* (cl:loop for l in (list '(a b) *l*) append l)) => NIL
9:49:27
beach
In https://github.com/robert-strandh/SICL/tree/master/Code/Loop there are three files collect-clause.lisp, append-clause.lisp, and nconc-clause.lisp where I changed the methods on BODY-FORM specalized to COLLECT-FORM-CLAUSE, APPEND-FORM-CLAUSE, and NCONC-FORM-CLAUSE respectively. But there is significant duplication, and I did not change the methods specialized to the -IT- or -INTO- clauses. If someone feels like fixing the existin
9:52:10
beach
That someone could also extract the entire LOOP code to a separate repository. Then we would have a LOOP library that is much more conforming that what most implementations currently have.
10:00:40
jackdaniel
doesn't part about append fall into "undefined behavior"? the loop append is specified to exact as the function append and the latter says that arguments (except for the last one) must be proper lists, but doesn't mention what happens when they are not
10:05:55
beach
On the other hand, SBCL APPEND signals an error, and LOOP is supposed to behave as if APPEND were used.
10:07:46
jackdaniel
I'd interpret that: so if they are not proper lists, then undefined consequences follow - expecting uniform undefined consequences would be quite a requirement ;)
10:08:29
beach
It is not terribly important. What is important is that it is better to have a stricter LOOP version than a sloppier one.
10:10:09
beach
Also, I encourage people to replace the native version of LOOP by the SICL one, because it is more strict. Xach has been known to do this to check whether systems in Quicklisp are conforming.
10:10:53
beach
And I encourage maintainers of Common Lisp systems to load SICL LOOP as a replacement for the native one, unless the native one is as conforming of course.
10:17:58
beach
Anyway, time for a lunch break. I'll screen all the candidates when I get back, and make a long list sorted by experience, availability, and attitude.
10:21:39
jackdaniel
people who will replace loop of the implementation of their choosing and maintainers who will replace loop in the implementation
11:02:54
_death
beach: nice, I tried testing one of my systems with sicl-loop, and it found a nonstandard loop form, the usual (loop while ... for ...) which again filled me with knee-jerk anti-loopism and made me replace it with DO
11:10:15
skeemer__
does common lisp support having tests within the same file of the implementation such as racket ?
11:19:44
jackdaniel
the most popular seems to be fiveam, then many people hold dear lift and/or parachute
11:25:44
jackdaniel
Clojure was designed by a person with specific needs and opinions while Common Lisp standard is a result of trying to accomodate various needs of different parties
11:26:16
hayley
Cliff Click once rated using STM for side effects a "double unsmiley", though I think I might have some use for it in CL code.
11:26:20
jackdaniel
that leads to a situation that clojure as a language promotes "the right way" (whatever that means for the language) while common lisp as a language supports you in implementing whatever abstraction you like
11:49:10
hayley
Well, I used FOR NIL = ... in my least favourite module, which does something tricky with locks. Not that translating it to DO would help, but it might be a sign that something has been designed wrong.
12:25:51
hayley
Out of curiosity, has anyone considered modifying Ironclad to use the x86-64 extensions for SHA1 and SHA2 operations? I noticed that they have accelerated AES already, but I can't find much on hashing.
12:50:05
yitzi
*no-defun-allowed*: I would find an accelerated SHA2 (including digests) in its own library very useful. I know they are talking about making Ironclad more modular.
13:02:35
pjb
beach: appending non-proper-lists seems correct; it's implementation dependent anyways. #+ccl (loop for x in '(a b c) append (cons x 'foo)) #| --> (a b c . foo) |# (append '(a . b) '(c . foo)) #| ERROR: The value b is not of the expected type list. |# but indeed, append signals an error.
13:03:00
pjb
(loop for i from 1 to 2 if (oddp i) append (cons 'a 'b) else collect 'c) #| --> (a c) |# (nconc (append '(a . b)) 'c) #| --> (a . c) |#
13:03:36
pjb
hmmm collect not nconc… (append (append '(a . b)) (list 'c)) #| ERROR: The value b is not of the expected type list. |#
13:06:00
pjb
beach: but still, I think that wscl should do something about it, because in the case where we append into a variable, at each step, the last element should not be copied (I would infer that intention from the specification); this would be quite impractical.
13:08:11
beach
A suffix of the accumulated list that has been attached by APPEND is copied only when new stuff is attached.
13:19:36
beach
I no longer accept applications from potential loop maintainers for the abstractions I suggested (because I implemented them myself). But if someone wants to extract the entire module to a separate repository and work on it there, I am still interested.
13:21:11
beach
This is what the code for the APPEND clause looks like now: https://github.com/robert-strandh/SICL/blob/master/Code/Loop/append-clause.lisp
14:35:34
lisp123
Did Franz make their CLIM / Allgero Serve libraries open source? https://github.com/franzinc/clim2 for example
14:38:59
lisp123
Hmmm "AllegroServe works on all versions of Allegro Common Lisp since 6.0." --> Guess it might not be portable
16:42:47
frgo
lisp123: I do use AllegroCL Enterprise Edition currently and have been using Lispworks in the past. As you may be aware, the value (i.e. usefulness, applicability, flexibility, a.s.o) depends on the actual use cases. Whatever someone else says about a *tool* (LW and ACL are not enduser apps) like these CL implementations, may be entirely biased. I do have use cases where only ACL fits.
17:05:04
JeromeLon
sbcl newbie here. I can't get sbcl to step into a function call, it's as if any function call leaves the debugger. What am I missing?
17:07:24
JeromeLon
(declaim (optimize (speed 0) (space 0) (debug 3))) (defun f2 () (format t "hello~%")) (defun f1 () (break) (f2) (format t "a~%"))
17:08:46
JeromeLon
I am getting to "Evaluating call: (F2) With arguments: [Condition of type STEP-FORM-CONDITION]", press s, and everything else runs without any debug step
17:10:58
JeromeLon
lisp123: precisely. I was expecting to be able to [S]tep into the (f2) expression call, then to [s]tep into the format call.
17:12:23
lisp123
JeromeLon: Okay, sorry I understand what you mean and get the same. See Bike's comments above I guess
17:12:59
Bike
also, with a constant format string, sbcl is probably going to not actually call format in the compiled code... i don't know if (debug 3) disables that
17:15:20
JeromeLon
Bike: oh, right, so format is not a good one to experiment. I have a much bigger case that doesn't work, and was hoping to exhibit my issue with this minimal case using format. I'll come up with a better example and come back. Thanks!
17:25:28
JeromeLon
Yes, that was it. A lot of stuff is optimized away despite (debug 3). Adding some (setq x (+ x 42)) everywhere makes everything work.
17:43:51
lisp123
If you can figure out which mode Evil is affecting you, you can set to revert to Emacs state
17:44:38
lisp123
If you mean navigating via M-p and M-n, it seems to work well for me in normal mode
17:44:40
Arcsech
I use SLIME with evil but my solution is just: don't use the repl history so not super helpful 🤷
17:47:36
lisp123
(Common Lisp is great, but this is #commonlisp channel, so it might be a biased view ;)
17:50:01
skeemer__
lisp123, i think scheme is not approachable by beginners for real world practical projects, seemed to fragmented, except racket
17:50:57
lisp123
synbian: Yes, indeed. Lisp is the singularity of all higher level programming languages
17:51:07
synbian
i see the complete oposity skeemer__, data types on racket is too verbose and also the way the language is evolve to become some kind of java for lisps...
17:51:39
lisp123
skeemer__: Yes I found the same, I like Scheme as well (especially built in continuations), but for anything serious, Common Lisp seems to be a much better platform
17:52:21
synbian
and is, mustely because of MACROs, CL is the lisp for macros, sorry little schemer...
17:53:07
skeemer__
lisp123, i also saw that there is an idea of saving data as s-expression as a sort of small file databases... is this a lispy thing?
17:55:57
lisp123
skeemer__: I'll let someone more experienced come back to you on that. (I think there are various considerations / issues when serialising data, for example the state of the image at the time when you write the s-expressions to file vs. when you read them)
17:56:34
Arcsech
I mean, it's hella easy (in the simple case at least) because you can just `PRINT` it out and the `READ` it back in, which is enabled by the lispiness, but just writing out representations of data structures to small files like that isn't especially lispy.
17:57:09
Arcsech
But like any other language you'll hit edge cases and security concerns and it's probably best to just use sqlite from the start if you need to save files to a disk but don't really care about how that's done
17:58:42
lisp123
Its a Lisp Library that lets you add a few words to your class definitions and get them to automaically save to file
17:59:04
Arcsech
Looks weird, I'll have to check it out. I have some concerns about how that would work long-term or in a production setting but it's cool
17:59:07
lisp123
Every time you create a class instance, it writes to the data store, you can then read instances based on their properties
18:00:21
lisp123
Arcsech: I use BKNR in conjunction with XML for a "backup" solution. The authors are pretty well regarded so I think its quite robust. You could substitute SQLite for XML (but you would have to write that code yourself)
18:02:03
Arcsech
It seems like in a long-running system you'd build up enough instances that loading the dribble file (or whatever its called) would be slow. And your data set needs to fit in memory. As long as you're okay with those limitations it seems like it might be neat to use.
18:02:55
Arcsech
I'd also want to know what the implementation looks like, the naive implementation of this would be semi-likely to lose data in the event of a crash/power failure/etc