IRC channel logs

2018-02-02.log

back to list of logs

<OrangeShark>dustyweb: we would need to get an immutable hash table implementation in guile
<rain1>isn't hash table log(n)?
<OrangeShark>rain1: immutable hash tables are log(n)
<rain1>what about a mutable one?
<OrangeShark>they are normally o(1)
<rain1>wow!
<OrangeShark>immutable ones are generally stored as a tree data structure
<OrangeShark> https://github.com/ijp/pfds is a library of immutable data structures in scheme. There is hamts, which are popular to use for immutable hash tables
<rain1>im not sure why you would want an immutable one, what if someone wanted to edited the parsed json
<OrangeShark>you can edit them, but it creates a new hash table
<OrangeShark>it might seem inefficient because you think it is copying the entire hash table, but you can actually share parts of the hash table which don't change
<daviid>for those who would not know, and spoke about immutable hash today, might be nterested to look at ijp's pdfs - https://github.com/ijp/pfds
<daviid>i'm under the impression wingo also wrote some, but if that is correct, then I lost the link (was it fash and fectors...?)
<OrangeShark>daviid: I already posted it :) There is some good papers linked in the readme if you want to learn more.
<ijp>daviid: wingo's are in guile already
<ijp>e.g. (language cps intmap)
<daviid>ijp: oh, cool!
<ijp>hidden away where no-one else will use them
<daviid>ijp: if he uses these in guile, likely they will be there for good and proper maintained .. maybe one day they are part of the API and documented ... don't know
<ijp>probably, but intmap and intset are kinda specialised
<ijp>I don't see much code that doesn't deal with (language cps) using it
<ijp>that is meant to be not in the present tense but the future one
<daviid>maybe dustyweb and davexunit could merge their (json) work and use your hamt implementation ... then we can make it part of guile-lib ...
<daviid>dreaming loudly... :)
<davexunit>guile would need a primitive immutable hash map with read syntax
<davexunit>I'm still partial to alists, because once you have the json parsed you almost always convert it into another data type anyway
<dustyweb>davexunit: the one advantage to alists IMO is
<dustyweb>sometimes it's nice to preserve the ordering as you got it
<dustyweb>well, one advantage in my use cases :)
<davexunit>:)
***ozzloy_ is now known as ozzloy
<pmikkelsen>Hi, are there any good online resources you can recommend for learning guile (or scheme in general)? I already have a strong knowladge of functional programming
<MaliRemorker>pmikkelsen: i would recommend reading Guile Reference in info format
<MaliRemorker>pmikkelsen: The Scheme, Programming Language by Kent Dybvig is a pretty good Scheme reference/learning book
<MaliRemorker>pmikkelsen: available online, i think
<MaliRemorker>pmikkelsen: and, lastly, if you have loads of time on your hands Structure and Interpretation of Computer Programs by Abelson, Sussman and Sussman
<MaliRemorker>(also available online
<MaliRemorker>)
<MaliRemorker>pmikkelsen: if you're already a seasoned coder, i'd recommend mixing Guile Reference (texinfo) with Dybvig's book
<pmikkelsen>MaliRemorker: thank you very much!
<MaliRemorker>you're welcome
<MaliRemorker>How do i extract information about the current source i'm currently reading with `read'. In subsection 'Reading Scheme Code' there is list of read-options of the Scheme reader. One of them is about recording the source expressions. How do I extract this position information?
<MaliRemorker>Also, what does the `copy' read-option actually do? Perhaps read an expression from the file without moving the pointer?
<MaliRemorker>subsection above refers to the subsection of Guile Reference
<MaliRemorker>(2.2.3)
***MaliRemo` is now known as MaliRemorker
<dsmith-work>Happy Friday, Guilers!!
<dsmith-work>MaliRemorker: https://www.gnu.org/software/guile/manual/guile.html#Source-Properties
<MaliRemorker>thanks dsmith-work
<jeko_>Hi Guilers !
<dsmith-work>jeko_: Hey hey
<jeko_>dsmith-work: Hey :)
<jeko_>Do you know if I can watch FOSDEM conf in live tomorrow?
<dsmith-work>No idea, sorry
<jeko_>Arf OK thank you ^^
<bavier>guile potluck soon?
<Labu1>hello, how can I get client addess from an <input-output: socket 6> ?
<dsmith-work>Labu1: This perhaps? https://www.gnu.org/software/guile/manual/guile.html#index-getsockname
<Labu1>hello dsmith-work in fact I try to get this information from request object in an handler given to run-server https://www.gnu.org/software/guile/docs/docs-2.0/guile-ref/Web-Server.html#Web-Server
<Labu1>I have nothing in (request-meta request)
<Labu1>if I get (request-port request) I get an <input-output: socket 6> so I thought perhaps I could get addr from ths
<Labu1>oh ok I got it
<Labu1>thx dsmith-work
<dsmith-work>Labu1: np. Tha manual is actually pretty good.