freenode/#lisp - IRC Chatlog
Search
22:33:41
pjb
casouri: for example, you could add a "replay" command that would replay the messages from a given data or criteria.
22:36:51
casouri
aeth: I was thinking about jsonrpc at first, but this approach is much cooler :) I'll see how to get it to work.
22:37:14
aeth
drmeister: I think fe[nl]ix's approach is the generally used one. e.g. I moved my game engine to static-vectors for textures and geometry when I did a large terrain test and it took a noticable load time (at least tens of seconds, if not more) to a < 1 second load time by eliminating array copying.
22:39:38
pjb
casouri: I'm running botihn in #hn ; /join #hn ; /msg botihn help ; notice that both botil and botihn are AGPL3, so you can get the sources.
22:43:38
drmeister
Why do I need static vectors though - the data won't move while the library call is writing into it.
22:44:48
aeth
drmeister: Even if you don't, the ways available are general purpose so you wind up with static or copying as your choices.
22:48:52
fe[nl]ix
drmeister: to be able to use foreign memory as a Lisp array instead of using the FFI
0:27:59
Ukari
what is the package mp in atomics, https://github.com/Shinmera/atomics/blob/master/atomics.lisp#L48? Is that multiprocessing? I got a error `Cannot find the external symbol COMPARE-AND-SWAP in #<"MP" package>`. (I use ecl
0:32:41
pjb
You should find how you can compare and swap in ecl, and #+sbcl … #+ecl … #-(or sbcl ecl) (error "Not implemented in ~A" (lisp-implementation-type))
0:39:34
Ukari
I find a defmacro compare-and-swap in the code https://gitlab.com/embeddable-common-lisp/ecl/blob/develop/src/lsp/mp.lsp#L264
1:01:51
Ukari
I notice that there actually exist a mp:compare-and-swap in ecl, https://gitlab.com/embeddable-common-lisp/ecl/issues/460
1:20:02
pjb
Ukari: possibly, since package manager will compile packages with specific options chosen not for your need, but for the need of the distribution, which are basically that the binary package should work everywhere.
1:20:47
pjb
Ukari: only gentoo gives you a little more freedom by being a source package distribution by default, and of course, the various "linux from scratch" like distributions.
1:21:14
Josh_2
I'm using Gentoo, I've compiled ecl with libatomics flag and I don't have the compare-and-swap function
1:21:29
pjb
Ukari: basically: compile all the programs you use everyday yourself, don't rely on an administrator to do it for you and millions of other users thousands of km away.
1:35:43
dxtr
So I'm trying to use READ-SEQUENCE on a usocket stream and it's blocking indefinitely - even though I'm receiving data. How come?
1:37:37
Josh_2
yeh you have to use something like this (socket-stream (socket-accept (socket-connect .. )))
4:03:10
didi`
How do I control how FORMAT's ~S and ~A will print my structure? I want ~S to print my structure as it normally does (#S(...)) but I want ~A to print the structure differently, in a more eye-candy way.
4:05:47
no-defun-allowed
"If [p-e is] true, an attempt is made to print an expression in such a way that it can be read again to produce an equal expression."
4:16:43
didi`
Hum. I wonder if there's a way to only implementing the aesthetic printing, i.e. I don't want to re-inplement the default printing because o it.
4:46:11
ggole
(defmethod print-object :around ((f foo) stream) (if (and (null *print-readably*) (null *print-escape*)) (format stream "FANCY") (call-next-method)))
4:55:23
ggole
That's probably a bit silly though, since if you wanted specific printing for foo you would just put it in the other arm of the if
6:27:21
emaczen
fiddlerwoaroof: I added some code to ensure execution in the main thread, but I still get the message from the OS saying that GNUstep is not responding. Any ideas?
6:30:06
emaczen
Well, perhaps my code does not ensure execution on the main thread, but regardless I've tried performSelectorOnMainThread:withObject:waitUntilDone: passing a NSWindow and the makeKeyAndOrderFront: selector as the arguments
7:16:23
emaczen
I just tried calling NSApplicationMain, and I don't get that OS warning anymore, but now my REPL thread is tied up
7:17:23
emaczen
No, I put something together using #/performSelectorOnMainThread:withObject:waitUntilDone:
7:22:12
emaczen
When you call my function #'execute-in-main-thread which takes a function as an argument, it redefines an objective-c method called #/runInMain that calls the function via a CFFI callback and then runs #/performSelectorOnMainThread:withObject:waitUntilDone: with an NSObject, the runInMain selector that was just defined, a null pointer and then I've tried yes and no for the last argument
7:23:42
emaczen
The function that I've been passing to #'execute-in-main-thread is typical objective-c code to create an autorelease pool, a NSApplication, and a Window
7:31:36
fiddlerwoaroof
Hmm, I'm not sure if that breaks the rule about calling into lisp from foreign threads
7:32:47
fiddlerwoaroof
"Direct calls to pthread_create (instead of MAKE-THREAD) create threads that SBCL is not aware of, these are called foreign threads. Currently, it is not possible to run Lisp code in such threads."
7:34:15
fiddlerwoaroof
I guess you're not directly calling that pthread function, but I'm a bit unsure if an objc selector that switches the thread a bit of code runs in has issues
7:38:06
emaczen
I'm going to try adding format forms to print sb-thread:*current-thread* and (sb-thread:main-thread)
8:12:47
Ukari
Josh_2, " jackdaniel: Ukari: atomic operations are in develop branch (not in 16.1.3 release)"