libera/#commonlisp - IRC Chatlog
Search
19:57:51
rdh
hello, i am coming back to clisp and hoping someone can help me out (i do not have to much exp with setting it up) but i have quicklisp installed and everytime i run (ql:quickload "cffi"), i get an error but when clisp offers a restart, taking the option "Retry finding system cffi after reinitializing the source-registry" cffi loads fine.
19:59:34
rdh
I do not understand what is going on. is this some thing I over looked setting up quicklisp or a bug with cffi.
20:04:11
jackdaniel
the problem is that asdf broke its api contract. you need to download upstream asdf and (load (compile-file /it/)) before loading quicklisp
20:10:42
minion
didi, memo from pjb: note that CL:ASSERT let you fix the problem: Try: (let ((list (list 1 2 3))) (assert (= 1 (length list)) (list) "should be a list of 1 element")) and select the restart that let you enter a new value for LIST.
20:11:48
jackdaniel
rdh: because they didn't release for a long time. there is also that asdf is just a program, nobody expects gcc to ship make with it
20:12:06
didi
pjb: Thanks, but in the case I was thinking, it should never happen; it's deep inside an algorithm; and there is no saving from sinking.
20:23:42
copec
Its bytecode progs are small, and even significantly faster then cpython when I did a bunch of testing with it like 10 years ago
20:29:43
jackdaniel
copec: zero, it was written from scratch. also ecl has two compilers (one is a bytecode, second is via C source code, the latter produces way faster code)
20:31:13
jackdaniel
when you call compile-file you may provide :c-file :data-file and :h-file arguments
20:33:37
copec
I was reading the other day that Haskell uses a C--, have you ever looked at that jackdaniel?
20:36:15
jackdaniel
if C-- were a traget of ECL compiler things like call/cc would be very much possible
20:36:59
copec
I just saw your mention of lisp in small pieces the other day, finally ordered a copy of that for myself
20:38:21
jackdaniel
if it can be implemented without it, then it could be implemented with it, sure ,) some structures are easier to implement with continuations. that said call/cc is not that much useful
20:38:41
jackdaniel
delimited continuations cover most of things you want to have (and are *much* easier to implement)
20:39:03
copec
I've only used call/cc for some educational dynamic programming, but never needed it for an application I was working on
20:39:14
jackdaniel
I've mentioned call/cc only to show limits of what compilation to C can achieve without hacks
20:41:37
jackdaniel
lisp in small pieces is a very valuable read if you are interested /how/ lisps could be implemented
20:42:09
jackdaniel
I've never read the dragon book, but from what I've heard half of it is about parsing
20:52:32
Bike
you can't do it for already-compiled reasons for what i imagine are similar reasons to ECL and C
20:53:30
phoe
Bike: I guess there could be a compiler switch that remembers IR representations for functions for later disassembly
20:54:56
phoe
I guess someone would want to use (disassemble #'foo :type :ir) real bad for this switch to become actually worth the time spent on implementing it
20:56:02
Bike
i only even look at llvm-ir when i'm debugging the compiler, which ideally is not something a user has to concern themselves with
20:57:41
Bike
for seeing if optimizations have been applied and other stuff, it would probably be clearest with the cleavir IR, but it's nonlinear so that's kind of tricky
21:02:49
Bike
copec: Yes, there's a cleavir.pdf that explains it, though the one in the documentation is a little outdated
21:05:31
Bike
beach is also in the middle of a major update to cleavir which will somewhat alter the IR
21:07:09
Bike
representation of handling of multiple return values and the dynamic environment, mainly
21:07:52
Bike
cleavir at the moment can't represent unwind-protect or special variable bindings so these have to be done through function calls. that will no longer be the case.
21:09:28
Bike
(unwind-protect protected forms...) macroexpands to (funwind-protect (lambda () protected) (lambda () forms...))
21:09:43
Bike
and funwind-protect is not compiled by cleavir. in clasp's case it's a C++ function using RAII.
22:07:22
stylewarning
Any thoughts on building a portable hash table library (that has a wider range of efficient custom hash functions), that isn't just a TRIVIAL-* library?
22:08:23
jmercouris
why not build a hashing library, and then a hash table library on top of your hashing library?
22:11:22
stylewarning
phoe: I've seen this; i consider it to be a bit of a cop-out solution. It solves the problem of portability (of some features: custom hash funs) but doesn't really care about efficiency, multithreadedness, etc
22:12:40
heisig
We also need a good hash table implementation for SICL, so there is some potential for collaboration :)
22:15:58
stylewarning
heisig: we have been abusing hash tables non-portably, and many of the hash tables are just sparse integer maps, so we thought we could implement a better one (famous last words) that works more efficiently and as flexibly as needed
22:17:04
stylewarning
(there's of course a separate question: is a hash table the right data structure for a sparse integer map? but that's neither here nor there. We also use tons of custom hash functions)
22:19:16
jmercouris
is hash table the right data structure for a sparse integer map... difficult question
22:19:41
stylewarning
another feature I've wanted is being able to specify key/value types for safety. Maybe that doesn't deserve to be in the hash table interface but almost all tables I create have concrete key and value types
22:19:59
stylewarning
and of course CL's HTs are designed with the opposite in mind: any kind of key and any kind of value
22:21:25
stylewarning
Why MAKE-ARRAY :element-type wasn't exactly designed for safety, and it has wackiness with upgraded types and whathaveyou, i think it's a nice design element
22:21:44
phoe
as verbose as Java is, it gets its type safety mostly right - and declaring types for hashtables is one thing that I enjoy in it
22:22:05
jmercouris
I actually really disliked that, it is a preference however, I understand it, I just didn't believe in it
22:22:48
Bike
treating it as a storage thing would be uh, weird. hash table implementation might put keys and values in the same vector...
22:23:20
stylewarning
jmercouris: so you much prefer that you supply a test function such that the hash function and test function form a reverse implication on the key types you have, and the value types are Whatever You Feel Like Whenever You Woke Up? ;)
22:23:30
phoe
even if it would be just for runtime checks, there is some value in runtime safety alone
22:23:49
jmercouris
stylewarning: the test function is only a mild implication, and it can span across types!
22:23:53
Bike
i'd say if you want safety you can define gethash+(setf gethash) analogues that have declared/checked types respectively. don't feel strongly about it though.
22:23:58
stylewarning
Bike: I'm saying I like the design element of specifying a type in the constructor, not that it directly has to do with storage. (:
22:24:11
stylewarning
jmercouris: types in Lisp are sets, and sets can be unioned, so it still is all the same
22:27:16
Bike
if you do it in the constructor and have gethash/(setf gethash) check the types there you're doing type checks based on a type only known at runtime which is gonna be a lot less performant.
22:29:20
phoe
so you seek a hashtable library which generates different code based on the compiler policy
22:29:28
Bike
unfortunately that's generally tied into impleemntation type inference stuff so it's not possible to deal with portably
22:29:42
phoe
your GETHASH might include typechecks on default safety levels and no runtime checks on (declare (optimize :yes))
22:29:56
Bike
...but if you do want to do this, maybe start with having a table library, and then we can make my shed
22:30:43
phoe
Bike: maybe that's doable portably; an implementation should be able to elide surplus checks, like, if it knows that a thing is a FOO then it doesn't need to check if it's a FOO anymore
22:33:13
Bike
maybe i should just write out a thing about why type-directed transformations might be nice but aren't very doable, since this keeps coming up
22:33:16
phoe
you'd need to try and expand into the code that will then, hopefully, be optimized by the compiler.
22:35:11
jmercouris
which means you should be able, in the worst case to kill the repl and inferior lisp
22:35:12
stylewarning
SLIME's request for input in some random buffer has caused issues in live presentations once
22:37:42
harovali
jmercouris: it's not frozen, right . Maybe it's slime in a loop which emacs cannot exit , and which eventually will exit itself
22:37:50
heisig
I see two ways to obtain typed hash tables: 1. A defstruct-like macro that generates the hash table, its type, and its accessors. 2. Painful, non-portable SBCL hacking.
22:41:34
stylewarning
heisig: i'm probably in favor of a portable intf+impl with painful SBCL hacking
22:44:57
heisig
So the portable interface would be something like (make-hash-table :key-type fixnum :value-type symbol :hash-function #'identity)?
22:45:09
phoe
stylewarning: this sounds exactly like the goal that this library that I linked above has
22:45:24
phoe
it already has some fallback stuff plus depends on implementation-defined stuff if an implementation supports these
22:46:04
phoe
mostly cause of (let ((fixnum 't) (symbol 'nil)) (make-hash-table :key-type fixnum :value-type symbol :hash-function #'identity))
22:47:24
stylewarning
heisig: tbh i'm not sure, i'll play around with an interface, maybe once I have a strawman we can mess around with it
22:50:48
jackdaniel
first I need to truly separate passes in ecl, then why not ,) however, is there any reason that having this will improve anything hash-table-access-wise?
22:52:05
phoe
a compiler will be able to warn if you try to use a non-fixnum key in the gethash, plus it'll know that the result will be (or null symbol)
22:56:33
jackdaniel
hash tables are fast *yet* slow for performance-crictical code (access-wise); the real question is that: is there any data to support thesis, that it would be worth the effort?
22:56:38
pjb
phoe: do you realize that you cannot put anything in the result of (let ((fixnum 't) (symbol 'nil)) (make-hash-table :key-type fixnum :value-type symbol :hash-function #'identity)) ?
23:10:32
phoe
it's just that shadowing CL:EQ makes me die a little inside due to the side effects of that
23:11:54
Xach
mfiano: was there a recent change to plain pngload? i reset my vcs cache and now it seems to be gone and completely replaced with pngload-fast.
23:12:07
Xach
I don't know if it's something that got jiggled around when I purged my cache or what.
23:12:42
jackdaniel
sure, it wasn't very bright though, I've personally never encountered a situation where I'd need such eq, (every (curry #'eq a) other-values) would suffice too
23:13:40
phoe
Xach: https://github.com/mfiano/pngload redirects to https://github.com/mfiano/pngload-fast
23:15:19
phoe
Xach: it seems that it got renamed completely, see https://github.com/HackerTheory/pngload/commits/master
23:15:20
Xach
There was some discussion a while ago about having them both available separately and I'm not sure what happened to break things now. whether it's a local issue or something that coincidentally happened at the same time.
23:26:16
mfiano
I was going to but you said you were going to merge the pngload-fast features into pngload with reader conditionals for implementations to have fallback support
23:27:23
mfiano
I prefer not thinking about either repo. They drain too much of my limited resources
23:41:19
harovali
does anyone know of some current tutorial or documentation to cl-pdf and cl-typesetting?
23:42:24
stylewarning
phoe: I have created the perfect overengineered macro for you: https://github.com/stylewarning/lisp-random/blob/master/associate.lisp
23:42:31
harovali
i'm reading https://github.com/mbattyani/cl-typesetting/blob/master/documentation/cl-pdf-doc.pdf which might be outdated
23:44:12
Xach
phoe: it is because of how i implemented portability. i would do it differently today.
23:45:12
Xach
mfiano: were the pngload-fast changes freshly pushed today also, even though the commits are old?
23:49:01
Xach
Ok. Well, I'm not sure how to account for what I'm seeing, but the missing pngload system breaks a bunch of stuff.
0:12:06
mfiano
Xach: The worst part is this same thing happened the last time you pinged me about it. I had this repository hard reset to a specific commit, and pushing a minor change fast-forwarded it. This is what I get for not paying attention.
0:15:55
mfiano
Repairing this is above my head right now, because I can't rebase or revert with merge commits in the tree
0:20:05
mfiano
I guess I can revert just my working tree and then make another commit. Simple enough idea. Let's see how it plays out
2:09:27
Xach
well, here are a bunch of update failures: https://gist.github.com/quicklisp/97e9df796326da8d0c75af75b91400d9
3:48:39
smokeink
(in clisp): (list :); => (:||) , is there any way to make this work in sbcl as well? illegal terminating character after a colon: #\)
3:49:51
no-defun-allowed
Yeah, I think CLISP is being lenient and you have to at least put :|| there.
3:53:03
smokeink
https://www.reddit.com/r/lisp/comments/72n6gy/the_nest_macro_ported_from_common_lisp_to_scheme/ ": as a universally accepted token denoting a self-evaluating keyword would be handy."
4:06:17
harovali
is it possible to see the coorect glyph in CL-PDF's pdf:draw-text with characters like #\U+00CD ?
4:07:40
no-defun-allowed
From memory, CL-PDF has the kerning information for some Adobe fonts, but only for the ASCII character set.
4:10:03
harovali
I think I should render those unicode strings in another library and compose that in cl-pdf, right? Is cl-typesetting that sort of library? Are there other nice options?
4:16:43
pjb
p0a: :: means you don't care whether the symbol named "BAR" is exported from the package named "FOO" or not.
4:16:58
pjb
p0a: : means that you want to get an error signaled if the symbol named "BAR" is NOT exported from the package named "FOO".
4:17:41
pjb
p0a: so basically, you should always use : and if an error occurs, it means you're messing with the internals of the package, and you should correct and limit yourself to the public, exported API.
4:18:02
smokeink
p0a: they both refer to the symbol named "BAR" from the package named "FOO" . if you want to use foo:bar then first you have to export 'bar
4:23:57
p0a
actually there's no .fasl files I'm super confused. It complains about "/home/emacs/Pictures/foo" but that string does no longer exist in my main.lisp project. I restarted the lisp image too
4:26:45
pjb
p0a: the .fasl files are stored by asdf in ~/.cache/common-lisp/. In general, you don't need to bother with them.
4:27:22
smokeink
HUNCHENTOOT:CREATE-FOLDER-DISPATCHER-AND-HANDLER is trying to access that folder, perhaps
4:28:06
pjb
p0a: CL distinguishes PATHNAMEs designating directories from pathnames designating files. #P"/home/emacs/Pictures/foo" designates a file named foo. #P"/home/emacs/Pictures/foo/" designates a directory named foo.
4:28:59
mfiano
i think you're trying to compile files rather than taking the iterative development approach
4:30:07
harovali
how do I create a new repl in slime if I accidentally closed it ? the inferior buffer is still there