freenode/#lisp - IRC Chatlog
Search
4:16:55
no-defun-allowed
https://matrix.org/_matrix/media/v1/download/matrix.org/VcDpibRxlVLRuDDvzEyxBMQO
4:25:17
beach
no-defun-allowed: When I lived in Auckland for a year, there were around 5 lispers within a radius defined by a 3-hour flight. Here in Europe, there are hundreds.
4:35:39
no-defun-allowed
when i lived in melbourne for 17 years, there were around 2 lispers within a radius i didn't really measure
4:47:37
drmeister
Hey - are there any lispers who use 'buildbot'? It's a Python continuous integration system. I just figured it out for building a Clasp CI system. I'm interested in comparing notes.
5:17:47
beach
MAKE-METHOD-LAMBDA says that the METHOD argument may be uninitialized. It doesn't say that about the GENERIC-FUNCTION argument, but it says that it might not be the generic function that the method will be used with, so I don't see what information MAKE-METHOD-LAMBDA could use about that generic function, other than its class.
5:19:15
beach
If I am allowed to pass an uninitialized generic function to MAKE-METHOD-LAMBDA I can solve the problem indicated by Pascal Costanza's article.
5:20:57
beach
For DEFGENERIC, the file compiler can just store the GENERIC-FUNCTION-METHOD-CLASS and the METHOD-CLASS arguments with the name of the generic function in the compile-time environment.
5:38:05
no-defun-allowed
okay bad idea time: it'd be interesting if CONSTANTLY could return multiple values
5:38:32
no-defun-allowed
so basically (defun constantly (&rest values) (lambda (&rest ignored) (multiple-value-list values)))
5:52:31
mfiano
Xach: Seems to be. For some reason library authors think it is good practice to assume transitive dependencies will always be present instead of writing a proper system definition.
5:54:18
mfiano
So that makes all 3 third-party cl-sdl2 addon libraries at fault assuming a dependency specified in cl-sdl2's :depends-on list will always be present. Impressive.
5:54:53
mfiano
Sadly I do not have commit access to repositories outside of the lispgames GitHub organization to fix that one.
5:58:21
mfiano
With cl-sdl2-ttf, it is even worse. It is directly calling trivial-garbage functions itself.
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