freenode/lisp - IRC Chatlog
Search
14:39:13
drmeister
beach: In your approach to fast GF dispatch - what needs to be considered in a multithreaded environment? (1) Generic function call-history needs to be updated atomically. (2) The funcallable-instance function needs to be updated so that it reflects the most recent generic-function call history?
14:40:16
drmeister
This was my big motivator for incorporating multi-threading into Clasp now - the fast GF dispatch issues.
14:59:02
drmeister
froggey: Hello - and you were able to run the DOOM C source code through it and the product runs?
15:09:00
froggey
I wrote a new SDL backend, which doom links against. the SDL backend bolts on to some graphics syscalls provided by the runtime
15:09:46
froggey
and the runtime implements graphics using either mezzano's native gui or lispbuilder-sdl on other implementations
15:10:29
froggey
libsdl - https://www.libsdl.org/ a C library that provides a basic platform independent graphics api
15:12:16
froggey
the translator (the program that converts LLVM bitcode files to CL source) is written in C++ because I wanted to use LLVM's C++ API. I found the C API is missing bits and pieces
15:13:10
drmeister
So you read bitcode and then iterate through the functions/basic-blocks/instructions and write out CL?
15:16:18
drmeister
In terms of the level of difficulty of supporting it vs generating CL for the rest of llvm-IR?
15:17:09
froggey
I'm not sure it's possible to implement DWARF-style unwinding directly, but there's an LLVM pass for converting invoke instructions to calls to setjmp/longjmp
15:18:30
froggey
to get exceptions working I think I'd have to make it run that pass, implement whatever runtime requirements that pass has, and get libc++abi running
15:19:29
froggey
those would be the major tasks, I probably missed something & haven't looked into the details
15:22:45
pjb
There's a difference between signed-byte and integer however; signed-byte is a type, while integer is a system-class.
15:23:58
drmeister
https://docs.google.com/document/d/1Bub1bV_IIDZDhdld-zTULE2Sv0KNbOXk33KOW8o0aR4/edit#heading=h.whtnf7s9ugr9
15:24:26
froggey
drmeister: whoops, it was written by the PNaCl people, not emscripten. afaik it's part of their llvm fork and not in the main llvm repo
15:24:52
froggey
https://chromium.googlesource.com/native_client/pnacl-llvm/+/master/lib/Transforms/NaCl/PNaClSjLjEH.cpp
15:41:34
froggey
it's a bit complicated. were you thinking of using it for something? I can't think of any use for a transform like that aside from weird llvm backends
15:49:36
drmeister
No - I'm interested in learning more about how people deal with C++ exception handling in different contexts. It's a less central feature of C++ and it's complicated and so it doesn't get much support.
15:56:24
fsmunoz
Is anyone using gmane for mailing lists hosted by common-lisp.net? I received a 550 Reverse DNS verification failed and I'm trying to see if it's something on my end.
17:22:56
gigamonkey
nyef: Yeah, they were DEFPARSER and DEFTERM. I eventually found my way to the font-lock-add-keywords gorp and added a custom rule. Maybe I can figure out something more clever than that later.
18:21:39
phoe
cheryllium: "Of course, Common Lisp is not designed to accommodate multiprocessing, and it would take more than uniting of the function and value namespaces to allow Common Lisp to seriously support multiprocessing."
18:30:16
Bike
it, of course, did take more work than namespaces or whatever, you need locks and shit
18:34:17
shrdlu68_
I've finally gotten cl-tls to a semblance of a working ssl implementation. Still a lot of work to do: https://github.com/shrdlu68/cl-tls
18:36:11
shrdlu68_
Since it's still in early dev, there's bound to be bugs and quirky behavior. Let me know.
18:45:39
trocado
I'm running some time-intensive functions and I notice that sbcl only takes up 25% cpu... Any ideias on how to make it use more?
18:48:43
phoe
Bike: https://www.howtogeek.com/wp-content/uploads/2013/08/cpu-and-memory-usage-in-task-manager.png
18:51:40
jurov
if you can split the problem into 4 or more datasets that can be ran concurrently, do that
18:54:27
Bike
you think about what parts of your program are actually required to be sequential, and set it up so that the expensive stuff that isn't can run nonsequentially.
18:57:10
trocado
at first glance the time-consuming parts must be sequential, it seems... it's analysis on a large data-set
19:29:38
cheryllium
I'm stumped. ASDF cannot find a .asd file in the current working directory, can anyone suggest what to try to debug this?
19:31:36
cheryllium
I guess I shouldn't have assumed it would fall back to cwd if it wasn't found in the paths
19:36:57
cheryllium
I did actually... but was intimidated by it (this is entirely my problem, of course)
19:37:29
cheryllium
this is the page I ended up on, I wasn't sure which part was relevant to me: https://common-lisp.net/project/asdf/asdf.html#Controlling-where-ASDF-searches-for-systems
19:42:01
Grue`
read this instead https://common-lisp.net/project/asdf/asdf.html#Configuring-ASDF-to-find-your-systems
19:42:27
Grue`
just make it search under :tree and never worry about it not finding your systems again
19:45:09
cheryllium
Grue`: It says "In earlier versions of ASDF, the system source registry was configured using a global variable, asdf:*central-registry*"
19:58:23
jcarr
I'm having trouble getting asdf working. My current directory (as #P"./") is in the *central-registry*
19:58:50
jcarr
I have the .asd file, and two lisp files, they're all in the same directory (my current one)
20:01:55
jcarr
There's some extras in here but my *central-registry* is (#P"./" "./" "." #P"/home/xxx/quicklisp/quicklisp/")
20:06:35
jcarr
;;;; scss.asd (asdf:defsystem #:scss :description "Scss compiler in common lisp" :author "... <...@gmail.com>" :license "MIT" :depends-on (#:smug) :serial t :components ((:file "package") (:file "scss")))
20:06:52
PuercoPop
jcarr: I don't think it is a good idea to put #P"./" into the ASDF central-registry.
20:08:13
shrdlu68
jcarr: Create a soft link to your project directory within a direcotyr that is in *central-registry*
20:09:29
PuercoPop
they linked you the ADSF manual. Basically (:tree "/path/to/theparent/dir/of/all/the/other/folders") or (:directory "/home/puercopop/.emacs.d/site-lisp/sly/slynk/")
20:12:01
PuercoPop
or if you prefer to use the deprecated central-register write the absolute path instead instead of a relative one.
20:25:58
Grue`
jcarr: https://common-lisp.net/project/asdf/asdf.html#Configuring-ASDF-to-find-your-systems
20:37:35
cheryllium
what would you say is the easiest way to remove a list of keys from an alist? (as in, given a list of keys and an alist, return that alist with all entries matching those keys removed)
20:38:00
cheryllium
I found the remove functions for lists, was wondering if there is something specialized for alists however since they are so common?
20:38:59
cheryllium
To "show my effort" i suppose, I found this answer: http://stackoverflow.com/questions/8703479/common-lisp-remove-a-pair-in-an-alist-via-setq-and-assoc
20:39:23
cheryllium
The only difference here is I have a list of keys I want to filter out, so to speak
20:40:09
cheryllium
(er - just the remove part of that answer i mean, I know not to use setf and I don't wish to destroy/overwrite the original list)
20:42:39
mazoe
what’s the format magic to print a readable keyword? (e.g. (format t “~A” :bla) prints “BLA” and I want “:bla”)
20:42:51
Bike
for multiple i'd do (loop for pair in alist unless (find (car pair) keys-to-remove) collect pair)
20:52:13
cheryllium
not to prematurely optimize but does that match up performance-wise as well, do you know?
20:52:48
Grue`
if you want to optimize, make bad-keys a hash-table or something (if you have a lot of bad keys)
20:53:12
cheryllium
also, I'm now getting an error "The function STREAM is undefined" but I thought this was a built-in function?
20:55:32
cheryllium
ah.. I assumed it was to create a stream for i/o, for instance when calling with-open-file
20:57:02
cheryllium
I guess my question is, how to take a filename and create a stream object from it?
21:11:59
phoe
everyone - mazoe is the amazing guy today, for he created a mapping between symbols in the CL package and their respective CLHS and *CLUS* pages
21:54:19
phoe
pjb: there was this article of yours methinks where you showed how to run a LISP 1.5 theorem prover on modern Common Lisp
22:10:22
phoe
minion: memo for mazoe: https://www.informatimago.com/develop/lisp/com/informatimago/small-cl-pgms/wang.html
23:34:21
cheryllium
What's the easiest way to copy a file without using a library? (I could read from the file and write to the output location using with-open-file, but I'm wondering if there's a better/easier way.)
23:39:38
aeth
pjb: Unrelated to that particular action, but what's generally wrong with libraries are the lack of: (1) performance, (2) documentation, (3) anything else that comes with polish
23:41:39
pillton
cheryllium: I would probably use uiop since it provides other file/directory operators which aren't provided by the standard.
23:41:45
aeth
Suzuran: Well, other languages have things sort of like a library library. Framework ecosystems that are basically subecosystems within the language ecosystem.
23:42:11
pjb
No, the real problem with libraries is that they're NIH. Hence cesarum: My very own library invented here! (and also, since I've been programming in CL since 1996, it has some anteriority ;-) ).
23:42:15
Suzuran
I feel like I should say something about synergies here, but I feel like I should be shot for it.
23:42:54
aeth
pjb: But I can understand why people would NIH if they need performance, or documentation, or a reasonable architecture, etc.
23:42:55
pjb
and I note that Faré implemented his own uiop library instead of using cesarum (or even alexandria).
23:42:56
cheryllium
I'm not /opposed/ to using a library, I simply asked if there was a way to do it without one. Copying a file seems like a common enough operation that maybe the language had a nice built-in way to do it.
23:43:28
pjb
cheryllium: amongst (apropos "COPY-FILE"), there's a high probability to find an implementation dependent one.
23:43:43
aeth
pjb: A lot of libraries are things written naively in CLOS, last updated 8 years ago in the custom (i.e. court-untested) LLGPL license, with absolutely no documentation but the source code. This is only a slight exaggeration.
23:44:22
cheryllium
Okay, thank you. I was not trying to start any sort of war here, sorry if it was a sensitive topic for you.
23:45:03
pjb
cheryllium: for years people have been complaining for the lack of CL libraries… so yes, it's rather sensitive to put it that way.
23:45:42
cheryllium
What, really? But CL has so many libraries for everything, I can't fathom that being a real complaint. I usually hear "lack of documentation" as the main complaint :P
23:46:03
edgar-rft
cheryllium: use WITH-OPEN-FILE to open the source and the destination file, and a binary-stream to copy all bytes from the source to the destination. No library needed for that.
23:46:07
aeth
cheryllium: CL has 8 libraries for everything, each solving a different 60% of the problem ime.
23:46:18
cheryllium
I usually run into the opposite problem where there are too many libraries and I don't know which to pick!
23:46:26
pjb
Just type M-. on any result of (apropos "COPY-FILE") and copy-and-paste the code into your own library ;-)
23:46:57
cheryllium
But as a coder in general I do try to avoid libraries for things I only need to do once because it adds an extra dependency.
23:47:26
pjb
cheryllium: most of those libraries are already dependencies (of other libraries you are using).
23:48:02
pjb
Again, the mere fact that (apropos "COPY-FILE") gives me 6 different functions NAMED copy-file in the current scratchpad repl, demonstrates it!
23:48:16
aeth
alexandria and uiop and more specific libraries like bordeaux-threads, etc., cover portability issues and missing features. Expect to use them.
23:50:04
aeth
As an example of a missing feature, higher order functions without partial application leads to a lot of unnecessary lambda boilerplate, but alexandria's curry and rcurry fix this.
23:50:18
aeth
Alexandria also has some iteration constructs and types that really ought to be in the language itself.
23:51:28
cheryllium
Oh Alexandria has curry implemented? I will have to pass that along. I know someone who tried to write a curry macro, he was frustrated by the lack of it in CL
23:52:18
cheryllium
I'll do some reading on UIOP, I haven't used it before but it sounds very useful, maybe essential
23:52:32
pjb
(defun curry (f &rest largs) (lambda (&rest rargs) (apply f (append largs rargs)))) (mapcar (curry '+ 2) '(1 2 3)) #| --> (3 4 5) |#
23:53:45
aeth
curry and rcurry have functions and compiler macros. I'm assuming the latter are much better, where possible.
23:54:14
cheryllium
I believe that's what my friend ended up with too, I think he may have started out writing a macro but realized at some point that a function was sufficient.
23:58:16
cheryllium
I'm reading and it says UIOP comes with ASDF - If that's the case, how should I refer to UIOP functions? Do they exist in the asdf namespace then?
23:58:59
cheryllium
Do I need to (require :uiop)? (I guess that's the source of my confusion- does requiring asdf take care of that?)
0:41:03
aeth
pillton: That's not a good convention, though, because most internet domains don't have hyphens, but when you have a multiple word package, you should use hyphens.
0:41:31
aeth
pillton: So either you reserve a mostly useless extra domain with the hyphen in there or you basically violate CL conventions by running multiple words together hyphenless
0:42:20
pillton
Yeah. I hate reversed internet domain name. That was the only place I could find which encourage dots.
0:42:43
pillton
Sorry.. I could find, in the time I allocated for the search, which encouraged dots.
0:45:51
PuercoPop
cheryllium: no need to requirement, you can use them from the uiop package, which just rexports all symbols from the the uiop/* packages
0:46:54
PuercoPop
however if you are going to submit the project to quicklisp, you'd have to declare uiop as a dependency
0:47:05
pillton
aeth: I can't remember what encourage me to use dots. It has been 10 years since I asked the question.
0:54:36
Suzuran
Hey, is the sense of (> x y) supposed to be backwards of what you would expect? (T if Y is bigger than X)
0:58:34
aeth
Try the case where (= x y) so you can see if you accidentally negated it (i.e. <= instead of >) or accidentally reversed the comparison somewhere (i.e. < instead of >)