IRC channel logs

2015-11-02.log

back to list of logs

<davexunit>ACTION tinkers with syntax highlighting some more
<nalaginrut>morning guilers~
<amz3>I have a question regarding the compiler. While having a look at the output of guile javascript backend, I see that there is A LOT of nested functions
<amz3>Is this how Guile works? What is its purpose?
<amz3>1) ^
<amz3>2) How can I see the input code that is used as the basis of the transalation?
<wleslie>the nested functions are equivalent to basic blocks in the flow graph
<nalaginrut>IMO, there's no continuations in JS, so use functions instead
<ArneBab>Petit_Dejeuner`: guild gets its commands dynamically by searching the module path. Is the guild install path in your GUILE_LOAD_PATH?
<amz3>nalaginrut: hey!
<amz3>nalaginrut: it seems to me all the code is architectured to support call/cc
<amz3>otherwise, there is simpler way to go
<ArneBab>amz3: does the js backend work for nontrivial code?
<nalaginrut>IIRC, in current Guile VM, continuations are basic blocks, I don't know how the JS backend handle it. IMO functions could be a good choice, but I don't know if it's good for performance
<amz3>ArneBab: afaik there is no way to call javascript code, so it doesn't work for non trivial code
<nalaginrut>no call/cc no Scheme, and no tail-call no Scheme (say with me) ;-P
<amz3>nalaginrut: how would you do otherwise?
<amz3>:)
<ArneBab>amz3: hm, ok
<nalaginrut>amz3: dunno, maybe create new records? but seems harder
<amz3>ArneBab: new records?
<ArneBab>^ was that for nalaginrut ?
<amz3>yes
<nalaginrut>at lease in V8, the functions are inefficient if you don't init all fields in a row. It'll clone a new one then add new field if you add field later
<amz3>ArneBab: there is no ffi, it was removed in a commit without explanation https://gitlab.com/ijp/guile/commit/b70b39e4783e15861c3a02dbb609e2558bc05506
<nalaginrut>amz3: I mean new record type(as struct in C) to describe a continuation. I'm just saying, not serious ;-)
<ArneBab>stackoverflow says that three layers of nested functions have only 20% overhead: http://stackoverflow.com/a/33358317/7666
<ArneBab>^ that’s in a post which says “do inline”, but the numbers rather show that the win from that isn’t that big
<amz3>when I say nested, I was refering to closures like (function(){ function() { function() {}}}
<amz3>it's seems that it's indeed code blocks like wleslie said
<nalaginrut>well, I don't know the IR design of JS backend, so I can't review that code generation...
<amz3>that's why I want to see the IL code, I think it's comes from there
<nalaginrut>I even don't know what does these functions mean in a certain backend
<ArneBab>amz3: I just found a javascript performance test runner, that could help figuring out the impact of the design.
<ArneBab> https://jsperf.com/function-calls-direct-vs-apply-vs-call-vs-bind/86
<amz3>I love this website
<amz3>the thing is that I don't think we can change the way the code generated without loosing call/cc
<amz3>or avoid the use of the compiler tower
<ArneBab>amz3: I think the main use of the site is to check how expensive the design is
<djcb>hmmm, geiser fails to connect to guile it seems, it just hangs in access-process-output
<wleslie>to an already running guile, or one that you're starting from geiser?
<djcb>to a new guile
<wleslie>so M-x run-geiser ?
<djcb>sometimes it does work though. weird. hope I can find something a bit less vague...
<djcb>wleslie: yes indeed
<wleslie>there's a #geiser apparently
<djcb>wleslie: thanks -- i'll check when i have something substantial
<djcb>the mere act of asking seems to have fixed it for now! (and restarting emacs)
<wleslie>it knows you're onto it
<paroneayea>hello, *
<davexunit>ACTION pokes at syntax highlighter more
<davexunit>rewriting the combinator library
<amz3>what does it mean? I need spoiler :)
<davexunit>amz3: referring to what I said (I switched hosts, not sure if I missed something)
<amz3>davexunit: what are you chaging in combinator library?
<davexunit>amz3: I'm writing a lexer combinator library that avoids using SRFI-41 streams
<davexunit>such that I can use regexps and things
<davexunit>and be generally faster
<amz3>oh i see
<davexunit>I have the scheme highlighter mostly ported
<davexunit>but now I have to do the day job
<paroneayea>davexunit: if only we had the SRE SRFI!
<paroneayea>I wonder if any of the SRE implementations are fast though
<davexunit>no idea
<davexunit>but I certainly want to use them
<nalaginrut>alas, this keyword introduces side-effects easily, I believe JS needs parameters...
<nalaginrut>'this' keyword
<dsmith-work>Monday Greetings, Guilers
<nalaginrut>ACTION realized that sqlite3 is restricted too much to alter a table, but Artanis may help to do so with some steps, but this will not appear in 0.1, maybe later
<davexunit>open question: can anyone think of a couple simple things that newcomers would find useful about Guile?
<davexunit>I'm trying to come up with a proposal for a talk about GNU Guile at a local meetup that targets new or otherwise inexperienced GNU/Linux users
<davexunit>I would like to show how Guile is a good language for learning programming.
<nalaginrut>davexunit: maybe FFI could be helpful for a newcomer? To show them how to extend C lib quickly in dynamic way
<davexunit>nalaginrut: assume that the audience doesn't know C
<nalaginrut>maybe some simple game could attract them?
<davexunit>I've been asked by the organizer that a talk would be a good fit if I could "come up with one or two simple examples of what a relative novice might achieve with GNU Guile"
<davexunit>some basic automation scripts could be one thing, as opposed to writing bash.
<holomorph>yeah, scripting is one thing
<davexunit>though I haven't come up with a good concrete example
<davexunit>another thing could be writing a simple web server
<davexunit>or using Guile as a fancy calculator
<madsy>davexunit: Symbol manipulation / equation solver? :)
<davexunit>I'd keep it simpler
<daviid>davexunit: how abut a script and a hant example [2 examples]. then show them an sxml representation of an html page [surely they at least did see html mess in there life]. about the script, something which call an expensive 'something' [graphicksmagis treatment of an image, then show how this becomes easy to parallelize, using par-map, and show the timing of the execution ... ?
<davexunit>yeah, SXML might be good
<davexunit>or otherwise showing how to make a blog.
<madsy>Rip off some ideas from Scratch and implement Turtle Graphics
<madsy>That should be pretty easy to explain
<madsy>Ah.. it was from Logo, not Scratch
<daviid>davexunit: you can also grab grip, grip-clutter has some fancy and cool examples [I think :)] and all can be launched using --debug, which spawn a server ... you can create actors on the fly ... but you'd have to install the dependencies ... I wish I had a guix container with all that!
<daviid>or why not using sly ?
<davexunit>I'd like to keep it simple and try to show things in core guile only.
<davexunit>and then maybe give examples of cool programs written with guile
<ArneBab>there’s the webserver and exact math
<daviid>you can show Kisê then, among other apps, lilypond might grab their attention because music ...
<ArneBab>if you have a lilypond which works with guile 2
<daviid>i'd write a script that does an intensive task, then parallelize it and show them multicore usage before and after [using gnome system monitor for example...
<daviid>ArneBab: yes, there are versions, but I was thinking more showing app ... not doing demo, that would be difficult unles you know lilypond ....
<amz3>sneek: botsnack
<sneek>:)
<ArneBab>daviid: I’m asking, because showing a tool which doesn’t work with current versions of Guile would show a weakness.
<davexunit>lilypond is a bad example to show
<ArneBab>GNU Cash might be a good example
<rekado>today I really wanted to use SCSH. Wrote the script in Guile, but it's more verbose than it could be with SCSH.
<daviid>too complex for an intro maybe, and you'd have to know it prety well to show the power, but powerfull it is, thanks to guile precisely and most lily folks are not [at all] from s/w, and quiclky program in scheme without a clue of what is scheme before to use lily ... I think it is a good candidate for an example. but then the scripting and game are better maybe
<rekado>lilypond is more about lilypond than about Guile, IMO.
<daviid>rekado: more then half of it is written in scheme by now
<rekado>you can write engravers in Guile (and I have), but it's not easy to grasp why this is cool.
<holomorph>davexunit: this is my silly guile script <http://sprunge.us/fVba?scm> pre-ice-9 json though :p
<rekado>I just think it's not a great example because lilypond does so many useful things out of the box.
<rekado>that's what I meant above.
<holomorph>and i guess pre-web-gnutls-integration as well
<daviid>rekado: it's ok, i just think it is a good example, but hey, nice to have diff opinions of course
<daviid>actually we should mention it on our web too, I ment to write about that did not find the time yet
<amz3>the logs stalled: https://gnunet.org/bot/log/guile
<amz3>it's not up-to-date
<amz3>ArneBab: you look for an exemple of extending a software with guile?
<paroneayea>rekado: I wonder how hard it would be to package scsh with scheme48 for guix
<paroneayea>rekado: I'd like to try it, at least
<amz3>davexunit: what about a todomvc application?
<amz3>with server side rendering
<amz3>and without a real db