IRC channel logs

2015-12-27.log

back to list of logs

<davexunit>recording my desktop really destroyed the frame rate of my little demo here, but I'm sharing it anyway: a little sneak peek at "bullet hell" using Sly https://media.dthompson.us/u/davexunit/m/sly-bullet-hell-sneak-peek/
<davexunit>each bullet you see is controlled by its own "script", which is implemented using delimited continuations to yield new bullet states back to the main program
***micro` is now known as Guest56869
<saison>hi guys, I'm new to guile.. What's the right way to print out a certain number of characters from a byte vector?
<saison>if i do '(display (utf8->string buf))' it prints out everything in buf, including a bunch of uninitialized stuff.. I know how many bytes in the vector are valid.
***micro` is now known as Guest79065
<fps>saison: maybe append a \\0 before calling utf8->string?
<fps>i'm a guile noob myself though
<amz3>saison: you must convert to a string to display it?
<amz3>if so you can convert the bv into a list and then do '(list-head bv something) and convert it back to a bv then use ut8->string
<amz3>or use bytevector-copy
<ArneBab_>sneek: later tell davexunit: for recordmydesktop, try --on-the-fly-encoding
<sneek>Okay.
<ArneBab_>sneek: botsnack
<sneek>:)
<paroneayea>wingo: http://www.lispcast.com/church-vs-curry-types maybe interesting to you?
<paroneayea>basically on how different approaches to be talking past each other, but they both come from different valid mathematical type theory backgrounds
<paroneayea>relatedly interesting: http://www.ccs.neu.edu/racket/pubs/popl16-tfgnvf.pdf
<kernasi>hi
<amz3>héllo kernasi
<kernasi> https://www.gnu.org/software/mit-scheme/ <-- is guile connected with this somehow?
<kernasi>hey amz3
<amz3>IDK
<mark_weaver>kernasi: they are both GNU projects and implementations of Scheme, but otherwise they are unrelated.
<kernasi>why I ask: I'm interested in scheme and wondering what to choose; so here I am
<mark_weaver>MIT/GNU Scheme has better debugging and probably better performance on Intel. Guile has some other advantages: it has good interoperability with C, is much more portable, has many more extensions for using other libraries, more users, etc.
<mark_weaver>so it depends on what you're doing
<kernasi>interop with c is important to me
<kernasi>so I just try guile
<kernasi>thanks for the info :)
<mark_weaver>np!
<kernasi>guys, that website really is awesome
<mark_weaver>yes, we were lucky to have a talented graphic designer recently volunteer to overhaul our site. http://sirgazil.bitbucket.org/
<mkeeter>Is there any way to inject an idle function to Guile's REPL? I'd like to poll for events in the background, and the polling needs to be done from the main thread (because of OpenGL weirdness).
<mkeeter>The relevant keyword appears to be "hooks", but the "Hooks into the Guile REPL" section of the documentation is just an empty page.
<amz3>mkeeter: ask davexunit if he comes back
<amz3>s/if/when
<madsy>mkeeter: Why do you need that? Why can't you just have your Scheme code do the poll explicitly in the main thread?
<mkeeter>@madsy The main Scheme thread is just the Guile repl
<mkeeter>In the repl, I call a function that opens up an OpenGL window
<mkeeter>and then I'd like to be able to keep interacting with the repl while the window processes events
<mkeeter>but the window can only call processEvents from the main thread, which is blocked waiting for keyboard input in the repl
<jchmrt>mkeeter: maybe you could spawn another repl in a different thread with (spawn-server), see here: https://www.gnu.org/software/guile/manual/html_node/REPL-Servers.html
<mkeeter>Yeah, the easy solution is to start a busy-loop that does OpenGL polling in the main thread then put the repl into a separate thread, but that's not particularly elegant
<madsy>mkeeter: You can do what you want by connecting to your program as a REPL server
<madsy>Then the code you type in the REPL will run in a separate thread, and your window code will run in the main thread
<madsy>That is, start your script with "guile --listen", then connect to it
<mkeeter>Ah, makes sense
<madsy>If you encapsulate all the code the main thread should run into one function, you can still hotpatch that function from the REPL
<mkeeter>Although testing it out fills the screen with "ERROR: In procedure fport_fill_input: Resource temporarily unavailable"
<madsy>Maybe a guile process is already running and listening to the default port?
<madsy>If so, kill it. Or use a nonstandard port with --listen=9000 or something
<saison>can anyone help out a noob? I'm trying to write a toy client that talks to the example server here https://www.gnu.org/software/guile/manual/html_node/Internet-Socket-Examples.html
<saison> https://pastebin.mozilla.org/8855368
<saison>that's my attempt, it prints out 'hello client' but also the entire contents of the buffer, which isn't what I want
<amz3>saison: you want to truncate the bytevector?
<amz3>like you asked earlier? use bytevector-copy
<saison>amz3 sorry i did ask earlier but didn't see your reply.
<amz3>wait, it's not bytevector-copy
<amz3>I was said it's possible to split a bv using bytevector copy let me check the doc
<amz3>ah!
<amz3>it's bytevector-copy!
<amz3> https://www.gnu.org/software/guile/manual/html_node/Bytevector-Manipulation.html#index-bytevector_002dcopy_0021
<amz3>saison: ^
<amz3>saison: no problem :)
<saison>amz3 thanks :)
<amz3>saison: fyi there is a utf8->string proc https://www.gnu.org/software/guile/manual/html_node/Bytevectors-as-Strings.html#index-utf8_002d_003estring
<mkeeter>@madsy no luck, there's nothing running on that port. It works fine in a Linux VM -- could be a Mac issue?
<madsy>mkeeter: Not sure, I suppose it could be.
<madsy>Do you use a prebuilt package of guile or did you build guile from source?
<madsy>If you did the latter, you could try running the test suite
<saison>amz3 https://pastebin.mozilla.org/8855371
<saison>amz3 ^ This works now but it's kind of gross
<madsy>saison: Well, working with pure bytestreams is a bit gross. But that's what abstractions are for :)
<mkeeter>@madsy I'll try out building it from scratch
<mkeeter>"Generic instructions for configuring and compiling Guile can be found in the INSTALL file."
<mkeeter>...and there's no INSTALL file
<saison>madsy: Ok :) as long as I'm not doing anything too silly
<madsy>mkeeter: Ah, I didn't mean that building it yourself would help with the problem. I was more interested in which unit tests pass or fail.
<amz3>ACTION afk