freenode/#lisp - IRC Chatlog
Search
7:49:18
shrdlu68
shka_: Sorry, got disconnected. I haven't tried your btrie yet, but I tried cl-container's trees and the performance was sub-par to hashtable.
8:26:55
shka_
shrdlu68: simply make node with make-bit-trie, then use setf at-bit-trie to populate it
8:59:06
shrdlu68
shka_: Am I doing it right? https://gist.github.com/shrdlu68/6a4e624f3562c2bb81474827bb59edd3
9:17:56
minion
j`ey: Cleavir: A project to create an implementation-independent compilation framework for Common Lisp. Currently Cleavir is part of SICL, but that might change in the future
9:18:43
j`ey
I see in the example it uses sbcl, so Im not sure what cleavir does before?/after? SBCL
9:18:48
beach
j`ey: Basically it is a compiler. But since every implementation has its way of compiling things, it must be possible to customize it.
9:19:27
j`ey
(cleavir-hir-interpreter:interpret-hir (cleavir-sbcl-environment::compile-cleavir '(lambda () (+ 32 10))))
9:25:39
minion
.(run-program "rm" '("-rf" "")): An error was encountered in lookup: Parse error:URI "https://www.cliki.net/.(run-program%20\"rm\"%20'(\"-rf\"%20\"\"))?source" contains illegal character #\" at position 38..
9:26:55
beach
j`ey: That is up to the implementation to decide. Currently, Cleavir first converts the Common Lisp code to an AST and then the AST to HIR (High-level Intermediate Representation). Then it runs some optimizations on that code. The rest is pretty much up to the implementation.
9:29:45
beach
The compiler book mentions MIR which is pretty standard. HIR has the interesting characteristic that all objects manipulated are Common Lisp objects. Address calculations are not exposed.
9:29:55
dim
beach: I guess you have a disassemble like function that outputs the optimized HIR? I kind of like poking into those levels of abstractions from the REPL ;-)
9:30:06
no-defun-allowed
Clang/LLVM uses an IR which is distinct from the C it consumes and the assembler it emits
9:38:42
beach
That's why I wrote the visualizer. We used Graphviz, but it was impossible to follow even a slightly complicated graph.
9:39:26
beach
Plus, it was tedious to use. Generate dot, translate it to (say) PDF, start the PDF viewer.
10:06:13
beach
j`ey: At the moment, yes. But I intend to supply highly customizable translators to MIR and machine code.
10:07:23
j`ey
a few years ago I looked at clasp quite a bit, but I've forgotten all the details now :(
10:12:34
beach
Yes, this past summer karlosz worked on a GSoC project to write a Cleavir-based compiler for CLISP.
10:15:27
j`ey
https://github.com/robert-strandh/SICL/blob/master/Code/Evaluation-and-compilation/defmacro-defmacro.lisp#L3 :D
10:28:19
makomo
curl: i don't think that's specific to racket. it's just a particular representation of horn clauses (i think)
10:29:01
makomo
horn clauses are a specific thing from logic -- why would racket have something like that built-in
10:30:02
makomo
well then, what horn clause that list represents depends on how you're representing/encoding those horn clauses within your program
10:30:06
curl
I'm supposed to implement a function which decides whether a given horn clause is satisfiable
10:33:26
beach
j`ey: It was too confusing. I imported too much stuff from the host, so I couldn't keep track. I got "no applicable method" errors instead of "unknown function" errors.
10:37:10
beach
j`ey: I am going to have lunch guests in a few minutes. I'll be back in a couple of hours.
11:01:33
no-defun-allowed
Lunch guests probably can evaluate Common Lisp in their heads. If they're beach's guests, they can even write compilers probably.
11:03:22
jackdaniel
curl: what you give us is just a list of lists. interpretation depends on the task description. if that is unclear in the assignment I think you are fully entitled to write your teacher an email with that question
11:07:31
flip214
curl: I don't understand how https://en.wikipedia.org/wiki/Horn_clause would match your list in any way.
11:13:53
makomo
curl: maybe something like: the i-th (1-based) element of the list represents a node with the identifier i. that element is a list which stores other node ids to which that node is connected to. a positive id means that the arrow is going towards that node, while a negative id means it is going away from that node
11:15:32
makomo
so, e.g. (1 2 3) would means that the 1st node is connected to: itself, the 2nd node and the 3rd node
11:16:06
makomo
curl: i don't know whether this makes sense or not though, just guessing. the assignment must say something about it, or perhaps it was explained during a lecture so you might want to review your notes
11:19:38
curl
makomo: I also thought of that, but how would that explain '((1 2 3) (-3 -1) (1)) the node (-3 -1)
11:21:17
makomo
but hm, one could do without the negative indices just by replacing them with positive indices within different nodes
11:23:00
curl
yeah the graphs directed, but (.. ) (-3 -1) (..) means the 2nd node has arrows coming from the third and first nodes
11:38:49
zigpaw
the negative nodes could be added by the teacher to just level-up the difficulty level for the students (as it doesn't make sense in a real world application, where you should strive for the simplest solution and avoid unnecessary complexity).
11:40:22
curl
(define cs3.28 '((1 -2) (-1 -3) (1 2) (-3 4) (-1 4))) means (x1 ∨ !x2) ∧ (!x1 ∨ !x3) ∧ (x1 ∨ x2) ∧ (!x3 ∨ x4) ∧ (!x1 ∨ x4)..
11:51:21
makomo
i don't know whether horn clauses and dags are related at all, but cs3.28 doesn't like it represents a dag
11:51:59
makomo
it obviously represents horn clauses, where the integers denote variables. just because both of those use lists as its representation doesn't have to mean they're conceptually related somehow
12:31:47
makomo
how come symbol macros can't compute their expansion like normal macros can? the expansion form is just taken verbatim and used in place of the symbol
12:34:09
makomo
beach: what about using dynamic variables that are part of the compiler environment, or just using it for macroexpansion-time side-effects in general?
12:34:50
Bike
if you want to have a compiler environment with different expansions of some global symbol macros, you can just shadow using symbol-macrolet.
12:36:40
makomo
the problem is, i have an additional requirement of needing to register all of the signal reads (along with writes (but that uses a special function/macro)). if i go the "macroexpansion solution" route as we discussed yesterday, i would also need my symbol macros to register such information during macroexpansion
12:37:39
Bike
i haven't been paying attention. do you have a link to an explanation of the syntax for your thing, or whatever
12:37:44
makomo
but i guess that's impossible. which means that the macroexpansion solution isn't a good choice
12:39:24
Bike
honestly i'm a little confused as to how there can be arbitrary lisp code in there tho.
12:40:25
makomo
Bike: i want to reuse stuff like conditionals, loops, etc. also, i will get macros for free to abstract away any repetitive patterns
12:41:01
makomo
scymtym: hm, i thought about that briefly but didn't fully think about it. that might work
15:59:10
Xach
This is a common source of anxiety - perhaps dist upgrades shouldn't update previously installed projects?
16:02:39
Xach
It's meant as a convenience. If you have foo-1.0 installed and the next dist provides foo-1.1, the assumption is that you want to have foo-1.1 when you update.
16:03:02
phoe
And if the update process breaks due to poor connection, I'd like to be able to resume it
16:03:20
phoe
And not have Quicklisp go "nope, everything's fine, I didn't see that connection break two seconds ago".
16:03:57
Xach
Right. It's never been very high-priority to change because it will be fetched when next needed anyway.
16:04:48
phoe
Sure thing it's self-healing because things are fetched on-demand afterwards, but if #'update-dist pulls new systems when it's run for the first time, it should also pull them when it's run for the nth time
18:02:42
mfiano
Xach: No. I mentioned I only have write access to lispgames repositories. I sent a PR to failproofshark
18:23:10
Shinmera
I have an implementation of destructuring-bind that you could adapt to do so I guess.
18:29:18
scymtym
optima/trivia support it out-of-the-box (and much more): (optima:match #(1 2 3 4) ((optima:vector* 1 b c) (list b c))) => (2 #(3 4))
18:31:00
phoe
but then I realized my case is so trivial that I'd rather write three LET clauses than complicate my code with external dependencies
18:32:23
pjb
(let ((v (vector 1 2 3))) (symbol-macrolet ((a (aref v 0)) (b (aref v 1)) (c (aref v 2))) (+ a b c))) #| --> 6 |#
18:33:27
pjb
(let ((v (vector 1 2 3))) (symbol-macrolet ((a (aref v 0)) (b (aref v 1)) (c (aref v 2))) (values (+ (incf a) (incf b) (incf c)) v))) #| --> 9 ; #(2 3 4) |#
19:05:12
whartung
so, for server programs, is it pretty common to have a high level handler-case on condition to catch any rogue conditions that wraps a handler-bind on condition to dump a stack trace?