IRC channel logs


back to list of logs

***karswell` is now known as karswell
***ruste is now known as Guest62209
***random-nick is now known as slow_down
***slow_down is now known as random_nick
<ragge>hi all! guile newbie here. i'm embedding guile in a c program that is linked against libGL. i'd like to call gl c functions in libGL from scheme code that I load. how can I accomplish that? do i still need to use dynamic-link to load the library again?
<davexunit>ragge: to define Scheme procedures with C code, you should use the SCM_DEFINE macro.
<ragge>davexunit: so in that case i need to wrap all functions provided by libGL? i thought i could use some parts of the FFI (dynamic-call?) to call c functions directly
<wingo>that uses dynamic-link fwiw
<davexunit>ragge: you should just use guile-opengl then
<davexunit>you said you were embedding guile in a c application
<davexunit>which made it seem like guile-opengl was off the table for you
<davexunit>I use guile-opengl all the time
<ragge>right, i was aware of guile-opengl, which looks great, was just unsure if i could use it in this context (embedded in c application)
<davexunit>if you need the whole of the opengl api available to you from scheme, then yes.
<ragge>allright, i'll give guile-opengl a go. thanks!
<paroneayea>ragge: \\o/ welcome!
<paroneayea>always happy to see new guile users, especially ones interested in fun things like opengl :)
<paroneayea>if someone's interested in accessing an opengl library, they're probably doing something fun
<amz3>héllo #guile:
<amz3>héllo #guile!
<paroneayea>hi amz3 !
<paroneayea>I've had an interesting revelation this morning
<paroneayea>I think 8sync is doing the right thing but advertising it in the wrong direction.
<paroneayea>8sync started out as an event loop system that I later added an actor model system to
<paroneayea>but in truth, the most interesting thing about 8sync to me eventually became the actor model
<paroneayea>so currently, the philosophy is "8sync is an event loop and etc library with a nice actor model subsystem, but you don't have to use it"
<paroneayea>but instead, it should be
<paroneayea>"8sync is an actor model system, that comes with a default event loop"
<paroneayea>guile's concurrency story has changed since I started 8sync
<paroneayea>there are multiple efforts to provide an async event loop, and I doubt in the long run I'll provide something more efficient than wingo's, for instance
<paroneayea>and maybe people will want to use something like gtk too, but use it with an actor model system
<paroneayea>being able to swap out the event loop eventually may turn out to be more interesting in the long run.
<paroneayea>but at the very least, committing to the actor model as a strategy for 8sync makes 8sync's story easier to tell, documentation clearer, and also means we can provide subsystems for irc, a web server, etc, less as components you glue together yourself, but actors you can spin up pretty easily that have most of the work done for you
<paroneayea>I'm not totally sure on this, but that's what's on my mind.
<amz3>eventually my brillant idea turned not a good idea, I still need to code something but it seems like the current query language I use to query the graphdb is good enough and does not require minikaren awesomeness
<amz3>Also I figured Reasoned Schemer is about minikaren not microkanren
<amz3>the author of the book told be they are working on a new edition of the book
<davexunit>paroneayea: fibers looks really, really good. I'm hoping to use it for games to replace all of my related code.
<amz3>I am wondering what you will come up with, because I had a look at sdl event loop, and it's seems to me at least that it not possible to integrate to another event loop
<amz3>davexunit: what do you think of glfw?
<amz3>this one
<paroneayea>davexunit: yeah, and maybe 8sync eventually will too
<paroneayea>which will make the above strategy I discussed make more sense anyway.
<davexunit>amz3: it's fine.
<davexunit>amz3: sdl doesn't have an event loop.
<davexunit>you just ask sdl for pending input events and write your own loop
<davexunit>in my current experiment, there is a "channel" (to use the term from fibers) for each type of input event
<davexunit>so I can write a fiber that loops and prints out key presses like this (psuedocode):
<davexunit>(let loop ((key (key-press))) (pk 'key-pressed key) (loop (key-press)))
<davexunit>the key-press procedure will yield and be resumed when a key press actually happens.
<paroneayea>I should try writing a little game on top of 8sync + sdl
<paroneayea>to see how well actors work in that scenario
<amz3>davexunit: oh! really nice!
<davexunit>if I had infinite time... I would write a free software client to phantasy star online. there are free software server implementations out there. would be nice to have a free software cooperative online rpg.
<davexunit>one thing that I implemented in my current game scripting experiment that doesn't seem accounted for in fibers is cancellation.
<davexunit>I have a <coroutine> data type with a cancelled? flag that I can set. I wrap all continuations of that corotuine in a procedure that first checks if the coroutine has been cancelled.
<davexunit>this is so I can immediately stop, for example, an enemy AI after the enemy has been destroyed by the player.
<paroneayea>cool davexunit :)
<paroneayea>so with this perspective in place I think I'm ready to do an 8sync 0.3 release
<paroneayea>becasue there have been so many major changes in 0.3 that I think I'd like 0.4's vision to be clear:
<paroneayea>making actors center stage, and adding good documentation.
<davexunit>sounds like a good plan
<davexunit>I was reading the "guile compiler tasks" blog post again, and the "contifying prompts" optimization stood out for me.
<davexunit>I need to understand what it means more, but I'm hoping it means a reduction in allocation for programs that use prompts.
<davexunit>I haven't yet found a good way to profile a program to determine how much GC churn is because of concurrency with prompts
<janneke>got with-ellipsis running in guile-1.8 -- but 5/7 tests fail because of -- as it seems -- other missing syntax-case features
<janneke>yay, nyacc calc runs in guile-1.8
<civodul>the venerable 1.8 :-)
<sneek>civodul, you have 1 message.
<sneek>civodul, davexunit says: in the case of a web application server, I'd like a test that would hit an endpoint on the local web server to see if it still returns a 200
<civodul>davexunit: i think i need more context :-)
<janneke>civodul: 1.8 has a psyntax that's compatible with mes
<janneke>2.x's psyntax seems more eh..entangled with guile (modules and whatnot?)
<civodul>1.8's psyntax did not know about modules
<janneke>...and so i can transplant updated ice/psyntax.pp into Mes
<janneke>after having tested it with Guile :-)
<janneke>it would be very nice though to have latest 2.2 psyntax so portable i could simply use that in mes...
<janneke>yay, nyacc-c99 runs in enhanced Guile-1.8
<janneke>grr, nyacc-calc now stumbles over optargs in Mes
<janneke>and i've stolen that from Guile...weird
<janneke>must be another silly thing
<janneke>error:Syntax error in fixed argument declaration.:()