freenode/#lisp - IRC Chatlog
Search
6:12:55
JuanDaugherty
it was already a thing, if not that much of one, when I learned smalltalk in '85
6:15:24
JuanDaugherty
yeah wiki says 88 for irc, i'm pretty sure golden hill was selling something they called CL before that
6:19:46
JuanDaugherty
surprised because you'd think that much functionality in one box (cl-containers) would get more play
6:24:29
shka1
it is not all that feature rich, but since i made it myself i find it conceptually optimal
6:26:19
JuanDaugherty
i see the virtue of it, LIL is just containers, cl-containers has stuff, the stuff I thought was useful
6:27:35
shka1
cl-containers has OK code, it's just it does not feel like it belongs to the XXI century
6:28:48
JuanDaugherty
i can't think of any computing culture where old stuff is more useful, accepted, tolerated, etc, than common lisp
6:31:20
shka1
anyway, what I really want to do with my project is to construct set of reasonable interfaces that can act as bridge
6:37:08
shka1
like this https://github.com/sirherrbatka/cl-data-structures/blob/d3566faf0e4f640ff88f490ead0d6c0ccd49c742/src/dicts/hamt/range-test.lisp#L49
6:44:50
JuanDaugherty
i do see why now, other reasons occurred and the main thing I wanted to know, that it works you answered, ty
7:06:20
beach
What's the relation? I mean Firefox is not a Common Lisp program as far as I know, and I suppose IPC means inter-process communication, and that's quite general.
7:10:16
ym
I want to get current page URL and some meta-data from firefox without StumpWM kludges, but seems like the most convenient way is to get hands dirty with JS or to use Emacs's w3, so never mind.
8:47:17
dim
thanks Norvig for PAIP now being available on GitHub, it makes linking to references from the book much easier ;-)
9:46:26
zigpaw
I wonder if there is a library that would allow easy pattern matching for function parameters in CL based on some of the parameters properties? like fnc1 (arg1 is list with length 1) <body1> ; fnc (arg1 is list with length 2) <body2>, etc...
9:50:59
TMA
zigpaw: DESTRUCTURING-BIND might be a basis for your own library, if you don't find one to your liking
9:54:18
shka
not lambda lists, but mix of MOP, compiler macros and optima should allow you to do everything in this area
10:50:03
jmercouris
e.g. (defun fish () (defun salmon () (print "I'm a salmon")) (funcall #'salmon))
10:51:39
jmercouris
and these functions defined in an flet, do they share the lexical context of the enclosing defun, for example?
10:52:51
splittist
If I understand what you mean, yes. flet and labels differ in terms of recursivity, in the way let and let* do
10:55:15
splittist
"labels is equivalent to flet except that the scope of the defined function names for labels encompasses the function definitions themselves as well as the body."
11:37:52
jdz
zigpaw: you might be interested in https://european-lisp-symposium.org/static/2016/newton.pdf
12:31:05
beach
jmercouris: Let me also add that nesting DEFUNs probably doesn't mean what you think it might.
12:31:58
beach
And it means that you redefine the inner function in the global environment every time you call the outer function.
12:34:45
beach
jmercouris: Consider the following exercise: start with doing (defun foo (x) (defun bar (y) (+ x y))) at the REPL.
12:37:20
shka
beach: i think that jmercouris meant to say that defun does not evaluate it's arguments, including &body
12:39:36
beach
But the reason for this behavior has nothing to do with the fact that DEFUN is a macro.
12:40:21
beach
It has to do with the fact that the DEFUN form has side effects in the global environment, so when it is executed in the body of another DEFUN, those side effects happen each time the outer DEFUN is invoked.
12:42:06
beach
OK, now you are confused again. Packages are no longer involved after READ has done its job.
12:43:16
beach
It's a bit more complicated because of what the Common Lisp HyperSpec has to say about top-level forms and the file compiler.
12:46:34
beach
jmercouris: The name FOO is turned into a symbol by READ, and that symbol has a package as reported by SYMBOL-PACKAGE. But all DEFUN does is to define a function in the global environment that has that symbol as its name.
12:47:28
beach
Packages do not contain functions or variables or anything other than symbols. A package is a slightly complex mapping from names of symbols (i.e. strings) to symbols.
12:52:10
beach
OK, changing the topic here. I realize that not everyone is a compiler expert here, so that I can't ask for help with Cleavir.
12:52:12
beach
But, we need to visualize intermediate code (HIR) which is a huge graph even for very modest-size functions. So it would be great if someone would write such a tool using (say) McCLIM. We need to be able so hide parts of the graph, select levels of detail, etc. Any takers?
12:53:26
beach
Yes, we are currently using GraphViz, but it is not interactive and can't be programmed to hide or expose detail.
12:54:45
beach
It must be programmable so that it understands the contents of nodes and so that the level of detail can be chosen for each node.
12:55:21
beach
The GraphViz layout algorithm is published work, and it is not too bad for modest-size graphs. And if part of the HIR graph is hidden, that algorithm would work fine I think.
12:55:48
shka
so interactive graphviz with set of protocol generic functions that can control the visible structure
12:56:31
lieven
beach: doesn't CLIM come with a graph formatter? I seem to recall the Lispworks version did.
12:57:16
jmercouris
that way, you don't have to do any of the graph programming yourself, or any of the myriad of graph operations, just add and remove nodes
12:57:34
jmercouris
neo4j comes with very good visualization suites, and it would be useful to have a graph database driver for neo4j in CL anyway
12:58:15
jmercouris
if you are interested in this approach, and in neo4j, I am extremely experienced with it
12:59:02
jmercouris
I would have suggested a different tool, but since you said it has to be dynamic, that is the best I can think of
12:59:29
jmercouris
if you are willing to sacrifice dynamically adding and removing nodes, Gephi is pretty nice
13:00:07
beach
Yeah, the graphs can be pretty big and they have both control flow and data flow information, so they can be quite messy. And it is impossible to choose a priori what part of the graph to look at. Hence the interactivity.
13:00:33
jmercouris
Oh I see, you don't mean dynamically adding or removing nodes from the graph, but dynamically querying the graph
13:01:09
beach
Right, I don't need to modify the graph. Just modify the visibility of groups of nodes and individual nodes.
13:01:22
jmercouris
I would suggest, output to a GML file https://gephi.org/users/supported-graph-formats/gml-format/ and then analyze it with any one of many programs
13:01:42
jmercouris
GML is a very easy to use format, and you can have any number of data types within it
13:04:42
beach
Well, there is the issue of choosing "data types" for different aspects of the graph of course, but that should not be too hard.
13:13:12
beach
Watching a Cytoscape tutorial, I see that it allows the user to modify the graph interactively, including the layout. That doesn't look like stuff we want.
13:24:48
beach
It makes me tired just to think about going through the documentation and tutorials of all those applications.
13:28:59
beach
jmercouris: Our graphs will contain nested functions represented by one ENTER node and one or more RETURN nodes. One thing that I would like to do is to turn such functions into a single blob and examine the details of one at a time. What Gephi functionality allows that?
13:29:49
Bike
doing that with basic blocks would be nice too. of course i imagine we'd have to annotate subgraphs ourselves, but that's no problem
13:31:11
jmercouris
so if you tag each of those blobs with some Identifier that is the same, you may have their gravity increase and they will overlap each other
13:31:13
beach
I would like to click on the enter node and have the nested function turn into a single blob.
13:32:56
beach
Like Bike says, we can easily stick different "labels" in the nodes, so that each nested function has nodes with different "labels".
13:33:36
schweers
I have a quick question on CALL-NEXT-METHOD. If I have a method which calls a helper function several times (the helper function is called from several methods, but never from anywhere else). Is this helper function allowed to use CALL-NEXT-METHOD?
13:33:51
beach
jmercouris: Two or more clicks would be fine. I just don't want to manually select the nodes to collapse.
13:35:05
beach
schweers: CALL-NEXT-METHOD will be lexically defined, so you need to pass it as an argument to your helper function, as in (helper ... #'call-next-method).
13:35:31
jmercouris
beach: I need to think about this a little bit more, because I assume you also want to view data from all of these nodes at once, right?
13:36:38
beach
jmercouris: I see. Well, most of the time, the data will be used locally, so it should be hidden as well. But there are cases when data will be shared, as when a nested function refers to a variable in its parent function.
13:38:39
jmercouris
you could grab the ID or whatever unique attribute for the node by clicking on it, and then write a query to fetch the data from that node, and the nearby nodes in the data laboratory
14:47:26
scymtym_
v0|d: if this is about getting more precise source locations for errors signaled from [compiler-] macro functions, use SB-EXT:WITH-CURRENT-SOURCE-FORM instead
16:23:37
jeosol
Is there some kind of design pattern resource somewhere for CL. Recently, I was having issues with some crazy piece of code because of completed logic, eventually used defmethods to clean it out and specialize on some parameter (eql :name) to clean it up
16:25:26
jeosol
ok, thanks housel. Most of my early info where from Keene and The CLOS Perspective books. Good reads.
16:26:19
beach
I had read Keene's books before and it kind of made sense, but CLIM II takes it much further.
16:27:05
jeosol
that would be useful then. I did Keene, the CLOS perspective (old book, but got a new copy) and latter compares CL with C++, smalltalk and others
16:28:25
jeosol
I guess I have to look at the CLIM II spec then. My code base can use some cleaning. It is heavy on inheritance and layering of objects.
16:40:11
jeosol
beach: thanks again for the link. It's a large application and so I'll learn a few things
16:40:48
jeosol
one question, this does not link all the codes. I did quick check and a see a few code snippets. Not like I want to go over everything,
16:41:42
jeosol
but just to see better ways of doing things. When I finally understand macros, I was able to get application to get my code to generate many convenience functions.
16:42:22
beach
But I recommend the specification just to understand how they organized the protocols.
16:43:04
beach
So there is a lot of "noise" in the implementation that distracts from the protocol design.
16:45:02
jeosol
if the protocols are designed well, I think the rest falls into to place, you just add the implementation details.