freenode/#lisp - IRC Chatlog
Search
10:16:24
|3b|
beach: in 3rd bullet list in 3.2 "...about ownership lexical variables.", missing "of"?
10:22:42
beach
I am asking because other people here also use "what" instead of "which" or "that", so I am wondering what languages might do that.
10:24:52
otwieracz
beach: Polish, unfortunately. Sorry, my native language, forigve me for this advertisement. :)
10:26:38
tazjin
I'd love to learn Russian, but it's very difficult to learn a language like that without living in the country
10:47:19
|3b|
beach: could be a bit more clear about how the 4 steps in 3.2 correspond to worklist items, in particular "the mapping" and similar in step 4 are for each of 2 output worklist items
10:51:31
pjb
tazjin: use youtube for you linguistic bath: https://www.youtube.com/channel/UCuSx-lf2ft7hPceGVNHybOw https://www.youtube.com/user/starmedia https://www.youtube.com/watch?v=K59KKnIbIaM https://www.youtube.com/channel/UC2D0dmLHKbIe9aACnlcTLPg
10:52:36
tazjin
pjb: language learning is an interactive process for me, but maybe I could find myself a community of Russian expats ;-)
11:11:50
beach
It used to be current practice to "publish" both in SIGPLAN notices (no peer review) and in a conference (with peer review).
11:13:38
beach
It's OK to include both references in case of SIGPLAN+conference. They may be slightly different, and one could be easier to get hold of.
11:16:19
Lithp
Good day Lispers.. So is it possible to have an object (B) be the slot-value of another object (A) and then modify the print-slot-value of (A) to print the values of (B) under the (A) slot when calling print-object on (A)?
11:16:50
Lithp
Maybe the meta-question is should i be putting object instances in another instances slots?
11:17:17
p_l
Lithp: there's nothing saying you shouldn't. They are just objects, like any other value
11:18:18
|3b|
ACTION isn't sure what you are asking though. do you want to modify the printing of As to show B? or somehow cause the printing to change due to containing a B without explicitly modifying the printing of As?
11:19:55
phoe
this is pretty commonly done, actually, when you want to print-unreadable-object with some details about this object
11:21:04
Lithp
Thats where my problem is arising.. print-unreadable to afile needs to be able to print the nested object
11:22:57
|3b|
just print the contents of the slot, and the print-object method for whatever is there will be used :)
11:28:28
|3b|
ebzzry: what are you trying to load? the message seems to be saying that whatever it is you are loading has a bad .asd :)
12:17:19
solene
hello, I'm stuck at something that seems simple.. I'm trying to loop over a list of values and call a macro with each value, like this example : https://zerobin.net/?ed147d5ef76b1dda#sFl8qUYx6UOztDsm6871VWCEa5pp1jFdWe8+tzkcEvc=
12:22:30
|3b|
solene: macros are expanded before it starts evaluating the loop (for example during compilation), so it can't see the value of variables inside the loop when it is expanded
12:24:51
|3b|
possibly you wanted ,(getf parameters :name) in the macro, but then it would break if you stored the parameters in a variable
12:25:46
|3b|
or maybe you just wanted a function with keyword arguments, (defun hello (&key name) (format t "hello ~a~%" name)) (loop for name in '(...) do (hello :name name))
12:26:47
solene
this example is a reduced version of a macro I use in a piece of code I wrote. It's hard to explain... but it's a "config file" for non lisp people. I found it easier to write (f name1 test-this (:param1 "hello")) instead of (f 'name1 'test-this '(list :param1 "hello")))
12:29:54
p_l
what's the current status on web frameworks? Something more complete than bare-bones HTTP handling + templates, for example seaside style?
12:31:28
pjb
so: (loop for name in '("martin" "sheley") collect (funcall (macro-function 'hello) `(hello (:name ,name)) nil)))
12:31:31
|3b|
solene: well, that example has all quoted values and no variables, which would work with your macro
12:32:48
|3b|
if you want a more complicated not-quite-lisp DSL that interacts with lisp variables, you may need to do more work in your code/macros
12:33:48
|3b|
possibly you want a functional API you can call from code that is used by the "non-lisp-user" macro
12:33:51
pjb
solene: (loop for partition in '("/" "/home/" "/var/") collect (funcall (macro-function '=>) `(=> mail disk-usage (:path ,partition :limit 90)) nil))
12:34:56
pjb
solene: when you call a function, you pass the parameters in number, type and order that are required by the function. It's the same with a macro function.
12:35:08
solene
i see, sadly it get too much complicated for non lisper. I may write a wrapper for passing a list maybe
12:37:12
|3b|
consider for example distinguishing (=> mail disk-usage (call-some-function)) from what you have, like if you wanted to look up the mount-point and usage from a DB
12:38:18
|3b|
at some point you end up adding back in the ' to distinguish which things should be evaluated or not, and are back to just having a function
12:39:25
|3b|
there is also the option of writing a macro that expands to a bunch of (=> ...) forms, if the cases where you want variables are limited enough
12:39:57
|3b|
though possibly still had to do cleanly without parsing the forms manually, for same reasons
12:40:24
pjb
solene: well no! |3b| listed the correct options: - modify your macro to evaluate arguments at run-time, or - write a macro to expand to multiple macro calls!
12:42:31
pjb
What funcall macro-function demonstrate is that a macro generates CODE. Therefore there's almost always no point in calling it at run-time.
12:43:17
pjb
Again, no point in skipping quoting. As you've seen, you want to pass the result of expressions and variables!
12:48:14
solene
I see, using a function instead of a macro would just requires using (=> 'mail 'disk-usage ) and everying would works
12:50:15
pjb
or also extend your language: (defconstant mail 'mail) (defconstant disk-usage 'disk-usage) then: (=> mail disk-usage)
13:44:17
solene
pjb, thank you for your help. I've been able to use a function instead of a macro, this makes everything easier, and so I've been able to use a &rest parameter. So (=> mail disk-usage (:path "/" :limit 90)) becomes (=> mail disk-usage :path "/" :limit 90)
13:51:21
solene
lieven, I aim at non lisper as this is a configuration file, I prefer avoid most of syntax is possible
13:52:40
solene
I'm working on a monitoring tool that check user defined things and use some user defined alerts when the check fails, it should be really easy to use
13:54:03
pjb
solene: if you aim non-lispers, perhaps you should write your own interpreter for your configuration files. As it is, I assume you use LOAD, and any lisp is available. This will be confusing to naive users when they'll enter the debugger for incorrect lisp code.
13:59:41
solene
pjb, I want that the config file allow to use code in it, and the config is really easy. It's a personal project that I share to people so it should be improved with time or if people contribute
14:00:21
solene
but at the moment, I aim at something with a relative ease of use and easy to develop (it's only 200 lines)
15:26:56
oleo
weird, all of a sudden 2Gb dynamic space size does not suffice anymore and i get into the debugger telling the control stack overflow
15:28:22
oleo
and i'm running that and when i open some .lisp file to edit in climacs, i get thrown into the debugger with that control stack stuff
15:31:23
oleo
i didn't specify control stack size, neither at compile time of my local sbcl nor at the time of making the mcclim image
15:50:19
oleo
that's all i get, and it throws into the debugger obviously cause the file doesn't get displayed actually and it all goes unresponsive at that moment, so i don't get a real backtrace either
15:50:54
oleo
when i press C-c again a debugger frame pops up but then that's only because of my interrupt
15:52:08
beach
Watching drmeister struggle with debugging, I had an idea for a great project. The GraphViz algorithms are quite well documented. An implementation in Common Lisp of those algorithms would make it possible to whip up a CLIM window with some graphs corresponding to things like ASTs, HIR instruction graphs, discriminating automata, etc.
15:53:22
beach
Currently, we have to generate a dot file, then apply GraphViz to it, and finally, start some image viewer to view it.
15:54:16
Shinmera
beach: Writing a native flow chart editor has been on my "not so far in the future" todo. I don't think I'm going to emulate graphviz, but that could be used instead too for your purposes.
15:54:42
Shinmera
Well, I already have a prototype, but it doesn't draw connections between elements nicely or know how to distribute nodes automatically.
15:54:52
beach
I was just thinking of GraphViz because it is well documented, and they did the required research.
16:00:55
Shinmera
The domain may also be different for my application (flow charts) than for graphviz (general graphs)
16:06:22
Shinmera
You could probably get pretty far by doing a primitive thing like: on split, move one line down by the height of an element and continue the other on the same line. Would just have to know at which point a loop happens so you can avoid the recursion.
16:10:34
Xach
I think Luke Gorrie uses a smalltalk environment to visualize things like that in his language development.
16:11:41
Xach
beach: I think the environment he uses lends itself to developing new visualizations. That is just a guess, though.
16:18:55
Xach
alvy ray smith has a nice set of memos and papers that are kind of about the sprite model of compositing graphics, but indirectly illustrate the power of carefully-chosen primitive data structures and operations as a solid foundation for efficient work
16:20:58
Xach
Yes...I guess the connection there is that a good foundation allows you to experiment with different layout algorithms quickly rather than a slow batch process where you are reluctant to discard the (unnecessarily) hard work that got you to an unsatisfactory solution
17:43:08
beach
It is not clear what you mean by "printing back the defclasses". There is no such thing as "a defclass". There is such a thing as "a class" and such a thing as "a DEFCLASS form".
17:43:50
beach
There are a bunch of problems with the code you pasted, and it is not clear how it is related to your question either.
17:44:12
beach
Is this the code you would like to see "printed back"? Is it code that you think might do the "printing back"?
17:44:20
pjb
Anyways, the MOP provides all the information. You can extract it and build a defclass form.
17:44:48
dmiles
i am looking to print out the defclass forms.. even if they are not perfect or complete
17:51:15
ebdreger
I mean... someone could use some MOP-fu to build a metaclass that stores * in some special location... but... why?
17:51:41
dmiles
why: at that point i wrote that I was translating some things to another language.. now that i have my class compiler working .. i am going back to grovel the defclass forms
17:53:18
ebdreger
invoke cl:defclass as appropriate, but munch on the form as you see fit from within your local DEFCLASS
17:55:06
ebdreger
(errr... dangling modifier in my wording above... "use your local DEFCLASS to munch on the form as you see fit")
17:55:42
dmiles
right now there are not classes defined in my lisp impl.. well except for a could few builtins
18:11:40
Bike
dmiles: you can use mop accessors to get information directly, rather than reproducing a defclass form.
19:11:47
Bike
i mean, you don't need defclass forms at all. if you want, like, the list of valid slot initargs, you can just get that directly.
19:13:30
dmiles
Bike: *nod* thats is exactly what my orignal code did.. but i forgot to glean out initarg and initforms
19:21:40
ebdreger
ACTION nods at Bike. Unless dmiles has need for :metaclass and specific :metaclass-option forms, it sounds like a few quick MOP queries can answer the questions.
19:32:18
dmiles
ebdreger: yep tyhat is what i did to generate https://github.com/TeamSPoon/wam_common_lisp/blob/24c112af9edb97c0a5033d35dd369f876725fa9d/prolog/wam_cl/clstructs.pl#L283-L551 (from https://github.com/TeamSPoon/wam_common_lisp/blob/24c112af9edb97c0a5033d35dd369f876725fa9d/t/reference/clisp.info )
19:34:45
dmiles
which ends up making https://github.com/TeamSPoon/wam_common_lisp/blob/master/prolog/wam_cl/ci.data
19:46:14
dmiles
not that it was too big, i just seek to define what a minimum will be for bootstrapping
20:28:47
ebdreger
dmiles: Meh. Sounds like you just want your Lisp environment to be fully reflexive. ;-)
20:31:42
dmiles
that was supposed to be a /msg to friend .. and what is funny is it applies much better for my channel history in #lisp
20:34:48
dmiles
but yeah, i am working on making sure in my impl that whatever datastructures are there that they can be viewed and altered from multiple programing paradymns (either by prolog predicates/assertions or by MOP)
20:37:52
dmiles
(as in, right now, the class system is based on what the predicates had "asserted" (which created the data at the last link))
20:59:28
jmercouris
Bike: beach said there were some issues with ironclad and you might be able to shed some light on that, do you know anything about that?
21:02:14
jmercouris
While you are here, do you know what it would take to integrate GPG into something like ironclad?
21:02:29
jmercouris
I don't know much about the technology, but I assume it's probably a big project
21:02:31
Shinmera
ironclad does some heavy macro optimisation stuff that clasp & cleavir choke on because they're pretty new compilers.
21:03:25
Bike
do you mean the actual software gpg, or just whatever it does? i don't think ironclad does foreign calls.
21:16:04
shrdlu68
jmercouris: Almost as long as the TLS 1.2 RFC. Shouldn't be too hard too implement GPG from scratch, though.
21:39:29
jasom
One should also be suspicious of ironclad for online encryption and hashing, since making algorithms with data-independent is hard, and I don't know how much effort was put into it
21:44:54
rme
crypto operations need to take the same time to complete no matter what the input data is. otherwise information can be leaked via side-channel attacks (cf. spectre)
21:48:03
shrdlu68
i.e does it take special effort to prevent side-channel attacks in CL than in, say, C?
21:48:41
aeth
Afaik SBCL should be perfectly capable of doing the same crypto that C can do, even with 64-bit integers (put them into arrays).
21:51:25
Bike
garbage collection would be one with certain algorithms, though it doesn't seem like it would usually be important
21:55:38
aeth
CL does not yet have compilers that do advanced optimizations to the degree of C compilers afaik. A lot of the time people assume optimizations that don't happen, just disassemble with (speed 3) or even disassemble with all the optimizations set in favor of speed over everything else (but safety at 1) to see a lot of optimizations that don't happen
21:58:10
aeth
e.g. this is not optimized to constantly return NIL in any implementation afaik: (defun foo () (declare (optimize (speed 3))) (dotimes (i 100) (+ 1 1)))
21:58:39
shrdlu68
Even in C, it takes special effort to prevent side-channel attacks sometimes. Blinding is one such technique.
22:00:45
shrdlu68
One could say that Ironclad's implementation of RSA is vulnerable to side-channel attacks, but all it takes to mitigate this is implement blinding. Same thing Openssl does: https://wiki.openssl.org/index.php/Manual:RSA_blinding_on(3)
22:02:11
aeth
(what I mean is constantly return NIL while skipping the loop that does nothing, both SBCL and CCL do the loop and they're considered the most optimized compilers)
22:03:23
shrdlu68
I doubt anyone is doing serious crypto in CL anyway, even the few that are are using Openssl bindings.
22:07:28
aeth
Yes, and probably 100% of the non-accidental uses of dotimes that does not fill in the optional return form
22:07:37
dmiles
heh Bike has a good point, it it should be optiizaed away, the programmer should have not written it
22:08:20
aeth
dmiles: yes, although to be fair, SBCL *does* warn me about "deleting unreachable code" a lot of the time, and with the exception of some local functions (flet or labels) it's always an error and I'm always glad to have been notified
22:09:18
Bike
the fact that it's unreachable code deletion doesn't mean that it's another case, ie that the compiler would do the same thing either way