IRC channel logs

2017-05-05.log

back to list of logs

<nalaginrut>interesting, get-string-all set the port encoding to iso8859-1 in default
<sneek>Welcome back nalaginrut, you have 1 message.
<sneek>nalaginrut, amz3 says: we did not do a release yet, but issues are welcome
<nalaginrut>so (call-with-input-file "t.t" (lambda (port) (set-port-encoding! port "utf-8") (get-string-all port))))) is preferred
<nalaginrut>and put (setlocale LC_ALL "zh_CN.UTF-8") doesn't help at all
<codemac>Is there any way to evaluate something in the current lexical scope? It seems that (include FILE) and (primitive-eval (read (open-file FILE "r"))) both don't seem to be able to see a variable from a let around them.
<nalaginrut>codemac: maybe you need local-eval ?
<nalaginrut>codemac: https://www.gnu.org/software/guile/manual/html_node/Local-Evaluation.html
<codemac>oooh didn't know that existed. Let me look at the documentation and get back to you, thank you for the pointer!
<codemac>I'm making a rather dumb templating/code generation tool with guile meant to emulate iMatix's GSL, so using eval for the first time with any significance in guile
<codemac>ok, that prints the same error, maybe I have a dumber bug
<codemac>can I run guile to drop to the repl on error?
<nalaginrut>codemac: if you want to implement HTML template system or similar, you may take a look at Artanis
<nalaginrut>codemac: https://gitlab.com/NalaGinrut/artanis/blob/master/artanis/tpl.scm
<nalaginrut>codemac: feedbacks are welcome ;-)
<codemac>It's meant to be more general than HTML, but I will check out artanis
<nikita1>hi all guilers!
<nalaginrut>codemac: I think the skill could inspire you
<nalaginrut>nikita1: I was sick yesterday, I'm going to fix cookie issue and release today
<nikita1>nalaginrut: get well!
<nikita1>do anybody know a fuzzly-logic enginge for scheme?
<nikita1>nalaginrut: for now, Artanis has become stable enough :)
<nalaginrut>nikita1: I'm glad to hear so, the first stable release is ready
<nikita1>but it stops for any exception... still..
<nikita1>(actually not any, but for db related)
<nikita1>i.e. if db connection is stable -- it is stable.
<nalaginrut>hmm...it depends on guile-dbi, Artanis only convert requests to format a sql string
<nalaginrut>the so-called relational mapping
<nalaginrut>maybe, I guess
<nalaginrut>Artanis become larger, that I can't remember everything
<nalaginrut>anyway, the road map is, 0.2 will be stable and has new server core, 0.3 will have a convenient package manager for contributions, I can't do everything myself
<nikita1>nalaginrut: I'm trying to get into internals of artanis to be able to help.
<codemac>nalaginrut: wow this is perfect! Really great code to lok through. Thank you!
<nalaginrut>codemac: ;-)
<nalaginrut>nikita1: I'll write the internals as a chapter in the manual, and this paper describe the basic ideas https://gitlab.com/NalaGinrut/artanis/blob/gh-pages/research/scheme16/art2016.pdf
<nalaginrut>The complete Artanis will be based on websocket, although it's not ready yet. The new server core is the key prerequisite
<nalaginrut>there's only a preliminary prototype when I wrote this paper, now I'm trying to migrate the idea to Artanis
<brendyn>amz3: Could you teach me how you got chickadee working? Did you edit chickadee/guix.scm ?
<nalaginrut>alas, I need another paper to describe the architecture of Artanis in details...
<saikyun>is there any documentation on creating a build script for a guile application? e.g. I have some libraries that needs to be built or downloaded before my script can run. I've only used "built in" package managers such as npm or cargo before.
<nalaginrut>saikyun: there's guildhall project
<saikyun>nalaginrut: is it used? :) I've seen some projects use make and autoconf I guess? is that the common way to do it? sorry if my questions are below newbish, haha, I really have no clue
<saikyun>to clarify; what I would like is to distribute a game I've written using guile in a way that makes it as easy as possible for people to download it an run it on supported devices. preferably just opening a binary or a script and it builds the required parts (maybe I could even bundle guile?) and then runs it. I have no idea if this is reasonable, haha, so I can live with people having to get guile themselves and just building the
<saikyun>libraries (in this case just sdl2) when starting the game
<nalaginrut>saikyun: I have to say guildhall is not in the position which it should be, I think it needs more love and contribution. But it is supposed to be the npm or cpan for Guile
<rekado>ACTION cannot see the channel logs…
<rekado>saikyun: there’s Guix potluck
<rekado>(maybe that’s been mentioned already)
<saikyun>nalaginrut: all right, I'll check it out :)
<saikyun>rekado: what's that?
<rekado>saikyun: it’s *very* new. Here’s some information: https://guix-potluck.org/
<rekado>saikyun: wingo has introduced it on the mailing lists a couple of days/weeks ago
<rekado>actually, it’s *so* new that it’s not been merged into Guix yet, but it soon will be.
<nikita1> Has anybody tried Guix on *BSD?
<saikyun>rekado: all right, thanks, I'll look on that too
<rekado>nikita1: it would need to be ported and all you’d get is GNU on top of a BSD kernel.
<amz3>brendyn: Yes, let's do this this afternoon or this week end
<brendyn>amz3: roger
<nalaginrut>nikita1: could you give me a cookie-ref test case?
<nalaginrut>nikita1: could you try the latest commit? it doesn't fix, but it fixed the error printing to find out the reason
***pksadiq__ is now known as pksadiq
<nikita1>nalaginrut: just a moment ...
<nikita1>nalaginrut: posted into the ticket
<nikita1>you expect a list of cookie objects, but actually there is only one (scalar)
<nikita1>nalaginrut: why cookie-ref takes 'cookie' as a list?
<nikita1>nalaginrut: may be a problem but definitely a typo: sometimes (in cookie.scm) you have npv key name instead of nvp
<nikita1>(new-cookie)
<nalaginrut>nikita1: fixed now
<nikita1>nalaginrut: Thanks! works normallt
<amz3>here is the "demo" I was talking about http://exploration.hyperdev.fr/
<amz3>all the frontend is done in Scheme, and the backend in Guile
<amz3>brendyn: so, what is your host system and command did you try?
<brendyn>I'm on parabola with guix installed ontop and I ran guix environment -l guix.scm; ./bootstrap; ./configure
<brendyn>The file then instructs to run guix build -f guix.scm, but that doesn't work because the definition is ill defined; (source #2)
<brendyn>#f
<amz3>brendyn: I did as you 'guix environment --pure -l guix.scm' so with --pure
<brendyn>ok
<brendyn>Which doesn't make much difference
<amz3>it's installing new stuff for some reason, maybe I did a guix pull
<amz3>can you paste the error you have?
<OrangeShark>brendyn: don't think you can do guix build -f guix.scm because it doesn't actually have a dev snapshot
<brendyn>yeah well I can't even run that with --pure since guix isn't available in that subshell
<OrangeShark>the file was likely copied from another project where there was a value for source
<amz3>brendyn: here is patch for guix.scm
<amz3>with that you compile the correct version of guile-sdl and then you can run make
<amz3>this is done inside the environment spawned with --pure, --pure works much better on my install that the other ones
<amz3>the one without --pure
<amz3>maybe it's just me
<amz3> http://dpaste.com/186HPVD
<amz3>brendyn: ^
<brendyn>you would need --ad-hoc guix
<amz3>I don't use ad-hoc
<amz3>ad-hoc is for the case where you want to install the package defined in guix.scm in this case we only want to build the dependencies
<brendyn>Ok so you just delete that definition and make it guile-sdl2
<amz3>I also installed manually guile-opengl
<amz3>yes
<brendyn>configure: error: required guile module not found: (gl)
<amz3>add --ad-hoc guile-opengl to the envrionement command
<brendyn>and guile its self it seems
<brendyn>and autoreconf...
<amz3>remove the --pure flag then and retry
<amz3>I don't recall precisely how i've done
<amz3>like it seems...
<brendyn>I think i did have it built at one point
<amz3>I think that I did not use the environment command at all and did
<brendyn>configure: checking for guile 2.2
<brendyn>configure: error:
<brendyn>No Guile development packages were found.
<amz3>exit the environent and use 'guix pacakge -f guix.scm"
<amz3>and 'guix package -i guile@2.2 guile-opengl'
<amz3>and then retry the configure script
<brendyn>Same error
<brendyn>Maybe your patch is making things worse ;p
<amz3>I have a nvidia card, so I need to use the following command to exec http://imgur.com/a/p8PPA
<brendyn>running `make' now
<brendyn>So once you get it running, how do you start hacking with it?
<brendyn>I see lines!
<brendyn>sprite.scm fails
<amz3> https://asciinema.org/a/1yywx4vcnszyxjqj87sagd1ee
<amz3>brendyn: I did not try with chickadee, but for the previous iteration using sly, I created a file next to sprites.scm and that used the same command to execute the file using pre-inst-env
<brendyn>I think dave said you run chickadee and then connect up to it somehow to issue commands
<amz3>I don't code like that, I don't know how to do it
<amz3>live coding
<amz3>I don't do that
<brendyn>Seems like the bees knees though
<amz3>I do always start and stop the app, to know what happens
<amz3>it's hot reloading in javascript and it's very nice
<amz3>it's called*
<OrangeShark>brendyn: might involve a REPL server, see https://www.gnu.org/software/guile/manual/html_node/REPL-Servers.html#REPL-Servers
<brendyn>Right
<brendyn>It's rather daunting trying to figure out how to program like this, not understanding anything
<OrangeShark>(begin (run-server (make-unix-domain-server-socket)) (start-code ...))
<brendyn>chichadee.scm does not reference (system repl server)
<OrangeShark>you have to launch your own
<davexunit>yeah chickadee does not launch a repl for you
<davexunit>the way to do this is to use the cooperative repl server
<davexunit>(use-modules (system repl coop-server))
<amz3>brendyn: you can not understand how every works, are just sudomakemyasandwitch otherwise :)
<davexunit>brendyn: here's a minimal example of hooking up a repl to chickadee's game loop (untested): http://paste.lisp.org/display/345864
<amz3>brendyn: you can not understand how everything works, or just 'sudo make mye a sandwich' otherwise :)
<davexunit>it's important to use the cooperative repl server and not the regular repl server.
<brendyn>ERROR: In procedure add-hook!: Wrong type argument in position 2: #<procedure 7f318e26c210 at examples/my.scm:12:10 ()>
<davexunit>brendyn: yeah sorry, add an arg to the lambda for the update hook
<davexunit>(lambda (dt) (poll-coop-rel-server repl))
<davexunit>the update hook is passed the timestep
<brendyn>Did you put the typos in as a test?
<davexunit>no
<davexunit>I just didn't test the code
<davexunit>I'm at my work computer
<davexunit>was just typing from memory something that approximated working code :)
<brendyn>I have a running window now, displaying a black square using 80% CPU. this is fun
<davexunit>the game loop ticks at 60hz and doesn't sleep so yeah it will use up a core
<davexunit>see the examples directory in the chickadee repo for example code
<davexunit>sprite.scm being the simplest
<brendyn>sprite.scm failed to load for me
<brendyn>chickadee/render/texture.scm:215:21: Throw to key `sdl-error' with args `("load-image" "failed to load image: ~a: ~A" "images/chickadee.png" "Couldn't open images/chickadee.png")'.
<brendyn>but lines.scm works
<davexunit>brendyn: did you run the example from the examples directory?
<davexunit>you need to do that
<brendyn>I just figured that out
<davexunit>cool
<amz3>brendyn: so how did you solve your issue?
<OrangeShark> https://blog.rust-lang.org/2017/05/05/libz-blitz.html An interesting post about rust's ecosystem related to libraries and how they plan on improving it
***random-nickname is now known as random-nick