<sapientech>hi all, whats the best way for module A to export a procedure imported from module B? <ijp>depends on how many there are <ijp>just putting in the export list works fine for small numbers <mark_weaver>sapientech: I believe you need to use #:re-export to export bindings that were imported from elsewhere <mark_weaver>unless the number of re-exports is very large (and sometimes even then), I think it's preferable to explicitly list the exports. <spauldo>question for anyone familiar with guile-sdl2: <spauldo>I'm needing access to the SDL renderer drawing functions. I'm not seeing them anywhere, so I'm assuming they're not implemented. <spauldo>Things like SDL_RenderDrawLine() and whatnot. <spauldo>Anyway, can anyone familiar with it confirm that they're not there, or give me a pointer to what I'm missing? <amz3>I now have 855 crawled urls! woohoo! <amz3>I made a minor tweak to the program that dumps hackernews, now it iterates the API backward starting with the most recent content, so tonight I have a dump of recent discussion and stories on HN hopefully ***spauldo is now known as spauldo-afk
<rekado>I'm trying to use Guile's web server with the Fine Uploader JavaScript library. The Guile code should handle uploaded file chunks. <rekado>I cannot seem to figure out how to read the uploaded chunk from the request, though. <rekado>(read-request-body request) seems to never return <rekado>same with just (read-request request) <rekado>* (read-request (request-port request)) <rekado>ah, never mind, my code was throwing away the request body in an earlier step... <davexunit>spauldo-afk: they indeed are not implemented, yet. <davexunit>mainly because I don't use those functions. of course I'd like guile-sdl2 to provide complete bindings, so I'd be happy to see a patch that adds new wrapper procedures. <davexunit>OrangeShark: guile-commonmark doesn't support inline html right? <davexunit>I'm trying to figure out how to embed a video into a markdown post <davexunit>I can hack around that for now by abusing the ![]() image syntax and post-processing the SXML to detect videos <davexunit>that's pretty much the only thing that doesn't work with my blog migration right now. I'm very close to being able to roll out the new Haunt-powered site. guile-commonmark really saved the day here. <OrangeShark>davexunit: ya, guile-commonmark doesn't support inline html or block level html. <OrangeShark>I am thinking of adding HTML, but it won't follow the commonmark spec because they allow malformed HTML to be parsed <davexunit>OrangeShark: I think just parsing it with the xml parser that comes with guile would be fine, IMO. <davexunit>and if it's malformed the document will fail to parse. oh well. <davexunit>either that or use htmlprag, which requires adding a dependency to guile-commonmark <davexunit>like maybe having guile-commonmark read in everything between <...> as a string and then have htmlprag try to make sense of it. <OrangeShark>I believe the intention for commonmark to allow malformed HTML was to simplify parsers and to allow markdown to be written between html tags <davexunit>wait, you're supposed to detect markdown inside the html??? <davexunit>the spec makes me think otherwise: "Text between < and > that looks like an HTML tag is parsed as a raw HTML tag and will be rendered in HTML without escaping." <OrangeShark>well the thing is, you can write a lone <div> tag and then the next line have markdown, the finally a </div> on the next line <davexunit>I don't see any examples of that, but if that's really the spec then that's *terrible* <davexunit>personally, I'd be inclined to say "screw the standard" <OrangeShark>well HTML parsing says it only for parsers that output in HTML, I don't output HTML :P <davexunit>then maybe just using htmlprag on html sections is good enough <OrangeShark>I could easily just consider html blocks like other blocks where to open a block, you need an opening HTML tag, to close the block, you need a closing HTML tag <davexunit>I guess whatever is easy enough to implement but doesn't stray toooo far from the spec would be fine <OrangeShark>ya, I think that is how the original markdown does it <OrangeShark>actually it seems pretty ambiguous on how it suppose to be in markdown <davexunit>would be hard to beat the typography, given that this is the guy that wrote "practical typography" ***spauldo-afk is now known as spauldo
<spauldo>davexunit: I'll look into it over the weekend. I'm a guile noob though, so I can't guarantee my code will be useful. <davexunit>spauldo: honestly, it's less guile knowledge and more C knowledge. <davexunit>I just find the kernel interfaces for making virtualized network devices to be very hard to understand <spauldo>Heh, was wondering why I'd need kernel knowledge for guile-sdl <spauldo>it's like, "wow, I really am missing something here." <davexunit>yeah sorry I thought this was a conversation in #guix about missing container features <davexunit>spauldo: but yeah, there are *plenty* of existing bindings that you can crib from <davexunit>and hopefully write the wrappers that you need <amz3>stis: I tried to read your blog post, but I did not understand the intent <spauldo>yeah, seen those. That was plan B, but like I said, I'm new to guile and have only used C bindings from the C side. <davexunit>well if you ever feel up to the task, I welcome your patches. :) <spauldo>OK, thanks for the info - if I get time this weekend I'll add those and send you a patch. <davexunit>some functions are easy to wrap, some require dealing with new foreign data types. <spauldo>I think SDL_Rect is the only new type I'd need. Basically I just want to implement the drawing commands. I'm wanting to write a graphing system so I can visualize the stuff in my Calc II class. <ijp>spauldo: are you a CS major? they really to stop making calculus a requirement <spauldo>yeah, I'm CS. My situation is weird, though. Basically, it's not required for the degree, but I have to take discrete math from a different university, and that university has Calc II as a prereq for discrete math. <spauldo>I like math, though, so it's no big deal. <stis>amz3: document a nice design of set functionality for set's, basically it shows what operations oneneed to do in order to implement an advanced union and intersection etc <stis>show a representation and indicate why it is closed e.g. no need to have extra representations, and how to implement the union intersection complement etc <stis>It's really a well thought out design to handle extra features that comes with a key value pair in stead of a pure set <stis>amz3: I havenot seen this topic anywhere else. Anyway what about your link? <amz3>stis: it's book (with an extract) about math/geometry and language representation <amz3>stis: the math level is low but It might be of intereset to you, the first chapter is "number and sets" ***amirouche is now known as amz3`
<amz3`>did you know that ycombinator (the editor of hackernews) made favorites/bookmarks private? <amz3`>does compute a mesh from scheme instruction? or it is a trick? <amz3`>basically can you dump the code that generates the things in a format that is efficient for a real time application? <davexunit>it's a CAD tool and it seems to support many rendering methods <davexunit>you could design things to 3D print or something <dsmith-work>Looks like it generated some file that was actually rendered in blender. <amz3`>dsmith-work: where do you see that? <amz3`>davexunit: I'm wondering whether you can get the result in a format other than a picture <dsmith-work>"Ever wonder what you'd get if you cut a sphere from a Menger sponge? Here's an example designed in Ao, exported as a mesh, and rendered in Blender:" <davexunit>"In a concession to the outside world, Ao does have a few export function" <amz3`>I don't understand concession <davexunit>it's just a funny way of saying that Ao has export procedures for other tools <davexunit>"a concession to the outside world" means that he made a "compromise" (joking) to export in alternative formats <davexunit>which allowed things like rendering an Ao model with Blender for a pretty image <amz3`>It the same world in french! <davexunit>but you could also imagine this exporting in a format that a 3D printer could understand <davexunit>I'd like to try to use this because I currently don't know any CAD tools <amz3`>ah ok, I'm not much interested by 3D printer right now, I'd rather build a tree renderer from an L-system for instance <davexunit>the only thing I saw that I liked was implicitcad because it had a programmatic api, but this is even better! <amz3`>L-system are math formula that declarively describe the shape of trees and other stuff. It's somekind of factorial pattern... I don't recall the name right now of the pattern <amz3`>it's a fractal algorithm for designing fractal patterns like it trees, flower and database... <amz3`>there is some kind of fractal b-tree if i recall correctly <amz3`>talking about Ao (and Guile), the author says «From a development perspective, I can play more easily with new algorithms without a cumbersome UI.» <amz3`>that's exactly my point of view regarding Guile <davexunit>yeah, UIs can't really handle abstraction very well <amz3`>in the previous quote, the "UI" is Guile <davexunit>that's the killer feature of programming. we can give a name to something repetitive and stop doing the repetitive thing. <amz3`>davexunit: doing some inkscape has always been painful, but I don't know much about drawing programmatically <amz3`>or GIMP for that matter, a lot of repition, lake of precision... but it's a lot of knowledge to draw programmatically I think <davexunit>I've been wanting to learn a CAD tool so I can better calculate things for projects that I do at my house <amz3`>I could also 3D print a mechanical spider to crawl my house to wipe everything for me <davexunit>amz3`: yeah, programming doesn't really fit with drawing or painting <amz3`>I look for a nice nature-like fractal <davexunit>drawing and painting is good precisely because it's not procedurally generated <amz3`>davexunit: yeah you are right <davexunit>I wonder if rather than replacing + outright if it would be possible to use a generic procedure instead... <amz3`>generic procedure is GOOPS terms? <amz3`>generic procedure as in GOOPS terms? <davexunit>you can use that aspect of GOOPS without using classes and all that <djcb``>i want to use scm_shell to start a "prepared repl", i.e. with some things set up for the user <djcb``>is that possible without manipulating argv? <DeeEff[m]>you could just load somethign from the user's `~/.guile` file <amz3`>regarding #ao, I added instructions to install in a pull request. The REPL works, but you can't watch files for changes I submitted an issue <davexunit>djcb``: I'm not familiar with guile's C library, but when doing meta module stuff in Guile itself I use the 'module-use!' procedure <davexunit>after creating a module with the (undocumented!) make-fresh-user-module procedure <amz3`>(also you'll see the pullrequests for a gcc-5-... branch to fix the compilation failure) <amz3`>otherwise it seem to work :D <amz3`>REPL works I mean you can define stuff and show them <davexunit>I couldn't get it to build in Guix because cmake can't find glfw <davexunit>djcb``: editing the user's .guile would be a bad idea, IMO. <davexunit>I just don't know how to use scm_shell so I can't really say what that way is. <djcb``>what I'd like to do is start the guile repl with some modules loaded and some context initialized <DeeEff[m]>well, providing users a default ~/.guile file would be fine <DeeEff[m]>of course document the crap out of why certain things are needed <davexunit>djcb``: it's possible without any ~/.guile hacks, because I've done it, and Geiser, the emacs integration for Guile, also does it. <davexunit>I wish I just knew where it fits in with scm_shell <djcb``>so, practically, I'm using guile to access mu (the e-mail index / search engine) <djcb``>and would like to do e.g. "mu guile" and have all the libs loaded, aatabase initialized etc. <djcb``>davexunit: ah, that's a good starting point; i'll have a look at geiser <cbaines>Does anyone have any advice on whether to use vhashes or hash-tables? I have some code using hash-tables, but I'm trying to rewrite it using vhashes to make it more functional, but the equivalent of hash-set! seems to be vhash-delete, followed by vhash-cons, which is a bit ugly? <ijp>can't you just use vhash-cons without the vhash-delete <cbaines>I tried that in the repl, and it didn't work <cbaines>This also looks to be intentional, as vhash-fold* copes with multiple values per key <cbaines>Whereas, I want to ensure only having one value per key <stis>cbaines: it's possible to wrap the fold in such a way to make a fold with only unique values, you do that by using a temporary vhash of visited objects. <stis>it's a bit expensive though. <stis>you can use temporary mutation for just the fold by havig a visited field in the value of a ey value pair <cbaines>For the moment¸ I have a vhash-set function, which just does the vhash-delete and vhash-cons <stis>yah that can wro as well, the best solution depends on the usage scenario. <stis>mainly lookup and you are golden. <stis>ao is soo cool. I wish it was stable and I could have used it when doing CFD earlier in my life. <stis>lots of set theory there ;)