<zxq9>Is there any introductory reference on guile's bytecode since v2? <taylanub>zxq9: I don't see documenting the bytecode being very useful; if you want to compile a language to the Guile VM, you should be better off compiling to the intermediate language I think? <zxq9>"intermediate" being guile's scheme? <taylanub>As far as I understand it, Tree-IL would be the usual choice: (info "(guile) Tree-IL") <zxq9>Is there an introduction to this? I am not familiar with Tree-IL. <taylanub>if you're using Emacs you can open that by entering that into M-: <zxq9>So far I have written lispy dsl's that reduce to scheme -- which is really easy. I'm just curious about implementation choices. <taylanub>(if you're using an Emacs IRC client you can also just put the cursor after the closing ")" and hit C-x C-e) <zxq9>Ah, there is a whole subsection on it in the manual. Never noticed it. ***sneek_ is now known as sneek
<davexunit>I'm having a problem with reduce. reduce iterates from left to right, yes? <stis>(use-modules (srfi srfi-1)) <stis>fold-right (- 3 (- 1 0)) <daviid>hello guilers! davexunit are you g-wrap familiar? <stis>first value from right is 1, hence (- 1 0) <stis>so it reduces right to left, fold does left to right <daviid>davexunit: so guile-2d you wrapped 'manually' ? <davexunit>daviid: I used the ffi for talking to C libraries. <davexunit>stis: but with reduce, there should never be 0 in there. <daviid>but nothing was auto then, reading parsing *.h, building types ... <davexunit>daviid: guile-opengl generates bindings by processing the opengl xml spec <stis>0 is the init value, you have it above in your reduce example no? <davexunit>stis: 0 is the value returned if the list is empty <davexunit>daviid: that's a good example of auto-generated bindings <davexunit>someone gave me a JSON file with the spec that they generated with llvm or something. <davexunit>I just don't get why it's doing (- 1 3) instead of (- 3 1) <stis>it moves from left to right no? <davexunit>the equivalent case with fold is (fold - 3 '(1)) <stis>(reduce-right - 0 '(3 1)) <taylanub>reduce is just fold without using the init value (except when given an empty list), thus saving one call to the function. SRFI-1 explains this well I think. <davexunit>(fold - 3 '(1)) is the same as (reduce - 0 '(3 1)) <davexunit>I know it's a different language, but in Ruby: [3,1].reduce(:-) returns 2. <taylanub>"Note: MIT Scheme and Haskell flip F's arg order for their reduce and fold functions." <daviid>davexunit: it surely is a good example. are you familiar with the guile-opengl xml spec reader? <stis>going left to right is natural to have if you have cons lists, does Ruby have that? <davexunit>for (fold - 3 '(1)), 3 is knil, and that's returned when the given list is null. <taylanub>going left to right or the other way wrt. how the list is traversed is an orthogonal question to the order of arguments in each function-call, I think? <civodul>davexunit: BTW, you had work on a Guix package for Guile-OpenGL, no? :-) <davexunit>figuring out how to deal with dynamic-link call <davexunit>I also have a nearly working notmuch package <davexunit>but I was having trouble with dtach, a program needed by the test suite. <davexunit>I wish I could get both of those done before the next release but I don't think it's going to happen. <civodul>i can help with Guile-OpenGL if you want <davexunit>civodul: okay. :) I'll find the basic recipe I had for it, or rewrite it if I no longer have it.