freenode/#lisp - IRC Chatlog
Search
4:09:18
phantomics
A question about SICL: what kind of support will it have for ASM generation? Anything like define-vop in SBCL?
4:10:40
beach
phantomics: Since all the stages are programmable, it should be possible to customize at will.
4:10:57
phantomics
Lets you implement functions in assembly: https://pvk.ca/Blog/2014/08/16/how-to-define-new-intrinsics-in-sbcl/
4:13:21
phantomics
I'm looking into it to optimize my project; unfortunately, it will only work under SBCL and there's no ASM generation faculty that works across implementations
4:13:43
beach
phantomics: I have not thought of a similar way in SICL. However, since code generation is done with generic functions that take a CLIENT object that can be specialized to, then code generation is very easy to customize.
4:14:35
beach
phantomics: It is also easy to define new IR instruction classes, new AST classes, and new primitive operations (primops) to use at the source level. I do that all the time.
4:18:42
beach
Since SICL uses the Cleavir compiler framework, and Cleavir was designed to be implementation independent, we designed it from the start to be extremely flexible and adaptable to different implementations.
4:20:22
beach
But I haven't given enough thought to a consistent protocol for tweaking code generation within an implementation.
4:37:15
phantomics
You can see a lot of define-vop examples in this directory: https://github.com/sbcl/sbcl/tree/master/src/compiler/x86-64
4:38:27
phantomics
You can see optimized functions for handling arithmetic, arrays, etc. It's the x86-64 specific stuff, in the neighboring directories you can see implementations for ARM, Power, RISC-V, etc.
4:40:18
pillton
I need help figuring out the noun for something. Assume X is an instance of the class C. (apply #'F X args) returns Y and (funcall (apply #'F C args) X) returns Y. Is there a noun which describes the function F?
4:41:38
pillton
The closest thing I have found is lazy evaluation but I am not sure if that is correct.
4:44:29
beach
The function F is a bit strange since it can take arguments of different "meta" levels.
4:45:15
pillton
Knowledge of the class C is important. I was wondering if Cleavir would be useful for optimising the graph generated by successive compositions e.g. (funcall (optimize-computation (apply #'G (apply #'F C args) args2))).
4:48:16
pillton
No worries. I have lost track of the time and I need to pick up kids. I'll be back in a bit.
4:48:55
lotuseater
speaking of currying and nouns, did you know, another noun for it is Schönfinkeln :)
5:54:44
janislago
but im doing this just for clarity and to give myself a readily identifiable name i suppose
5:59:54
beach
You should know that #lisp is fairly strict with staying on topic. There is #lispcafe for idle chatting.
6:00:25
janislago
was just about to mention that emacs lisp is a little weird when youre adjusted to cl
6:04:39
beach
janislago: You need to be a little bit careful with that approach. Common Lisp has several implementations that behave differently, and lots of behavior is unspecified by the standard, so you may accidentally produce non-conforming code without knowing it.
6:09:05
janislago
could you relay to them that on windows 7 and probably later versions, there is an error with attempting to access files via (load) where an error signals for "the operation completed successfully." this occurs both when running as admin and running as a normal user
6:11:06
janislago
yeah its not my first choice for programming but win7 runs incredibly well even in 2020
10:41:55
beach
Wow, that was a scary bug. In SBCL I did (make-instance 'standard-generic-function :lambda-list '(x)) and initialize-instance signaled an error that the value of the :METHOD-COMBINATION initialization argument had to be a method-combination object, but that instead it was... the STANDARD method-combination object. Restarting SBCL made the problem go away.
10:43:42
beach
The combination of bugs like this (SBCL or my code, doesn't matter much) and inadequate tools for finding the problems makes the task of development less pleasant than it could be, and certainly way more time consuming.
10:50:13
ck_
Were these types of one-off mystery bugs always around like that, or do you think these situations have become more frequent?
10:52:28
ck_
Increased project size that comes with more powerful environments and more people with access to them might be a conceivable reason
10:53:23
beach
Sure. I have no hard evidence that it is a problem with SBCL. But I couldn't guess what I could have done myself to make it happen.
10:54:16
beach
My favorite reason is to blame too complex code, due to many decades of modifications.
11:58:13
flip214
Is there a macro like DESTRUCTURING-BIND that takes an alist in instead of a plist?
12:02:51
jackdaniel
otoh alists are easier to access with functions like find (thanks to the key argument)
12:05:53
flip214
jackdaniel: not matching, just (destructuring-alist (foo bar baz) (function-returning-an-alist) ....)
12:06:29
jackdaniel
could you elaborate? (destructuring-alist (foo bar baz) '((foo bar baz)) ...) ;?
12:09:11
phoe
I understand the syntax to be like (d-a (foo bar baz) '((foo . 1) (bar . 2) (quux . 42) (foo . :one) (baz . 3)) ...)
12:17:00
flip214
well, I guess the name syntax could be extended, again in analogy to lambda parameter lists...
12:20:12
phoe
flip214: you can already get what you want with LET over ASSOC-VALUE; I guess you can write a tiny macro to abstract the syntax
12:20:43
phoe
but I don't really see the point because you will still need to provide both the variable and the alist key
12:21:11
phoe
so LET over a list of explicit ASSOC-VALUEs might still be good enough in the general case
12:23:14
flip214
phoe: but at least I don't have to write assoc, the test, etc., N times (for each binding!)
15:16:24
Kabriel
flip214: Touretzky's book gives an example macro destructuring (like I think you are talking about) on page 431.
15:19:24
Kabriel
Sometimes I use destructing in the loop macro as well, with either local variable initialization (loop with (x . y) = (first alst) ...) or stepping (loop for (x . y) in alst ...) etc.