IRC channel logs

2015-08-15.log

back to list of logs

<amz3>I got stroke by an idea
<amz3>regarding dynamic ffi, is it possible to call "C" function that has ellipsis in its definition?
<amz3>I pretty sure it does, I'll try
<davexunit>good evening, guilers
<ovidnis>evening
<daviid>with th following http://paste.lisp.org/+3ALN/1 grip-1.0.pc.in [ignore the one above], I get the following error when an app tries to check: PKG_CHECK_MODULES(grip-1.0, Grip >= 0.1.0) -> configure.ac:61: error: AC_SUBST: `grip-1.0_CFLAGS' is not a valid shell variable name
<daviid>anyone knows a bit about these .pc files maybe?
<davexunit>paroneayea: json parser: http://paste.lisp.org/display/153709
<daviid>I got the answer: PKG_CHECK_MODULES([GRIP], [grip-1.0 >= 0.1.0])
<paroneayea>davexunit: ! :D
<daviid>I deserve a beer :), both grip [toolbox] and Kisê [guile-gnome app] are now autool chained, fully compliant and with great checks!
<davexunit>daviid: that's good to hear!
<daviid>davexunit: tx, a hude work because i started from zero gnu toolchain knowledge, nice to see all the checks and make dist, make distcheck ... cool!
<daviid>paroneayea: how about a guile-gnome guix package ? :)
<paroneayea>daviid: that would be great! I don't have time at the moment, but I think it could be done without much difficulty at all!
<daviid>davexunit: also because now I can ask a non gnu savannah project for grip and a I will ask a GNU Kisê savannah page for Kisê, and have to be parient, it takes up to 3 weeks to get an answer
<daviid>paroneayea: I think so too, I also don't have tine, I want to release guile-clutter, the grip, then kisê, then update grip to have a guile-clutter-grip module, so another month or 2 , and I don't know guix [will learn but I don't know when
<daviid>and both grip and kise install go files, so for the user it really is cool as well!
<daviid>i think I have zero users now but they surely will feel happier haha
<daviid>beer time! see you folks
<amz3>what is kisê ?
<amz3>ACTION looking at json implementation
<amz3>here is kisê http://www.altosw.be/kise/news.html
<paroneayea>just tried it davexunit
<paroneayea>it works great!
<davexunit>paroneayea: w00t
<davexunit>I have the writer almost done
<davexunit>much easier
<davexunit>again, numbers are the hardest part.
<paroneayea>davexunit: the only thing I'd say is cofusing is this
<paroneayea> http://pamrel.lu/44ab7/
<paroneayea>look at ("actor" @ (...))
<paroneayea>it's an alist, so it's really ("actor" (@ (...)))
<paroneayea>it might be true that there's just no way around that though
<paroneayea>unless things were to be done sxml style, where it's not an list but a plist
<paroneayea>oh
<paroneayea>not a plist
<paroneayea>what's that called...
<paroneayea>anyway, (@ (key1 val1) (key2 val2)) as opposed to (@ (key1 . val1) (key2 . val2))
<paroneayea>but
<paroneayea>the advantage of the present I guess is that there are easy alist tools
<amz3>what's the purpose of this library? except moving to port
<paroneayea>amz3: more sxml-like, also not using hash tables
<amz3>why more sxml like?
<paroneayea>davexunit: I take back my complaint though
<paroneayea>davexunit: because even with that paste
<paroneayea>learning to look for the @
<paroneayea>it's fine
<amz3>,pp looks pretty
<davexunit>paroneayea: you found a bug
<davexunit>:)
<paroneayea>davexunit: I did?
<davexunit>I list'd where I should have cons'd
<paroneayea>:O
<amz3>on actor?
<davexunit>yeah there shouldn't be parens surrouding the pairs after the @
<davexunit>should just be (@ (foo . 1) (bar . 2))
<paroneayea>oic, yeah
<davexunit>replace (list key value) with (cons key value) in read-object
<paroneayea>davexunit: here's a test datastructure
<davexunit>and you should get the right stuff
<davexunit>I have a test.json file that I've been messing with
<paroneayea>davexunit: well, that's test code from activitystuff http://pamrel.lu/ef3d3/
<paroneayea>man, I need a better name!
<davexunit>yeah that parses right
<paroneayea> http://pamrel.lu/62013/ yeah, better!
<davexunit>I'd like to allow symbols as well as strings to be used for the keys of objects, but that doesn't play nicely with (equal? original (read-json (write-json original)))
<davexunit>so I will force strings
<amz3>paroneayea: gnomevision
<amz3>paroneayea: amazing (sic)
<amz3>I am discussing with the guys at concepnet5 I try to make them move to guile :p
<paroneayea>amz3: gnomevision?
<amz3>for the name of activitystuff
<paroneayea>amz3: oh, well it has nothing to do with gnome...
<paroneayea>I mean, a gnome client could be written!
<amz3>what about amazing, isn't amazing ?
<amz3>^^
<amz3>Man the font of rekatdo blog is awesome
<artyom-poptsov1>amz3: Updated version of the Guile Prime logo: https://memory-heap.org/owncloud/index.php/s/pU40ANQReSaFN0z
<paroneayea>amz3: link?
<paroneayea>artyom-poptsov1: loading very slowly...
<paroneayea>davexunit: request: don't use (error)
<paroneayea>davexunit: use (throw 'json-error "message") instead
<paroneayea>davexunit: (error) considered harmful, as you can't distinguish between *what* error, and you end up following this anti-pattern: http://mike.pirnat.com/2009/05/09/the-diaper-pattern-stinks/
<amz3> http://elephly.net/posts/2015-04-17-gnu-guix.html
<amz3>artyom-poptsov1: it's nice !! defintly
<artyom-poptsov1>The logo needs some polishing though, but now it is in SVG.
<artyom-poptsov1>I'm thinking about color version as well.
<artyom-poptsov1>paroneayea: I'm afraid I didn't understand your comment. Do you mean that the shared image is loading very slowly, or what?
<artyom-poptsov1>(The shared image is just rasterized version)
<amz3>maybe there is problem of conx
<davexunit>paroneayea: yeah it's temporary
<amz3>I think it will be better to (throw 'json foo everywhere)
<amz3>meh
***michel_mno_afk is now known as michel_mno
***michel_mno is now known as michel_mno_afk
<amz3>I've written two times to same import script in CPython 2.7 and guile 2.2
<amz3>CPython time:
<amz3>real25m10.779s
<amz3>user43m43.132s
<amz3>sys3m8.852s
<amz3>* Guile time:
<amz3>real96m44.606s
<amz3>user119m32.148s
<amz3>sys3m29.672s
<amz3>*********
<amz3>CPython code use "native" bindings instead of dynamic bindings but has no JIT
<wleslie>and a fairly stupid compiler (:
<amz3>and runtime ;)
<amz3>(I remove my statment, i'm not a in good position to tell actually, I'm disapointed that there is no multithread support in CPython)
<wleslie>most python people (myself included) don't want the GIL removed, for it to be useful, we'd need to adopt a less friendly memory model.
<amz3>please explain.
<wleslie>without something like the java memory model, the current semantics of multithreaded python would make it slow.
<amz3>I think pypy is trying STM
<wleslie>well yes, there are less easy ways out of this hole (:
<wleslie>Armin is trying the optimistic way, I'm trying the pessimistic way
<amz3>you work on guile memory model?
<wleslie>no, I work on pypy. I just happen to really like guile.
<wleslie>I've been working on a set of analyses that isolate (and can sometimes remove) unnecessary synchronisation.
<amz3>like PSSI? (wild guess)
<wleslie>pssi? it's basically a cfa2 may-alias analysis with a extra features
<amz3>ACTION check the features of PSSI
<amz3>Precisely Serializable Snapshot Isolation (http://www.cs.umb.edu/~poneil/PSSI_ICDE11_Numbered.pdf) Here is the abstract if you don't wish to download the pdf http://dpaste.com/1W88TNW
<amz3>it's way to implement serialisable transactions in databases
<amz3>implement/improve not sure
<wleslie>sounds interesting
<amz3>I don't know how optimistic/pessimistic.
<amz3>HTH :)
<wleslie>the problem within a general-purpose imperitive language is supremely more sophisticated. I've seen attempts with k-cfa that don't seem to do very well, and there's a lot of other disambiguation that needs to be done
<wleslie>the intention is to make the imperitive program look like a functional one to the optimiser, removing control-flow dependencies that should really be data dependencies.
<wleslie>my first attempt at a system like this was a 'sea of nodes' interpreter, about seven years ago.
<amz3>I bookmarked the search about cfa2 I'll read later maybe, it sound intersting
<wleslie>the sort of problems I had getting good alias information included the fact that sometimes you can clearly see that `x is not y` implies `x.foo is not y.foo`, but that information wasn't present in the region graph, so I'm working on the ability to collect that information.
<amz3>wleslie: where can I find the datalog implementation you use
<wleslie>that's a good question, I deleted that repo from bitbucket iirc
<wleslie>I'll see if I can grab the old repo on monday.
<amz3>thx i'd like to study it
<paroneayea>morning!
<davexunit>hey paroneayea
<paroneayea> http://til.hashrocket.com/posts/e04ffe1d76-because-javascript heh
<paroneayea>davexunit: reading your json.scm
<davexunit>paroneayea: I have made a bunch of changes since
<davexunit>fixing the number parser in particular
<paroneayea>davexunit: oh cool
<paroneayea>davexunit: I love how simple the (read-value) is btw
<davexunit>yeah, you can just dispatch based on the next character which is convenient
<paroneayea>davexunit: I notice that your json parser doesn't really care if there are commas or not ;)
<davexunit>oh shit
<paroneayea>davexunit: it still works! I guess they aren't really needed for it to function, a-la sexps
<paroneayea>pretty funny though ;)
<davexunit>will fix
<davexunit>paroneayea: improved reader and now with a working writer: http://paste.lisp.org/display/153736
<davexunit>let me know if you find issues
<davexunit>I know of at least one parsing issue
<davexunit>reading just a number doesn't work quite right
<davexunit>aaaand I just fixed that
<davexunit>mark_weaver: would the ice-9 namespace be appropriate for my json module?
<mark_weaver>davexunit: yes!
<davexunit>roger that
<paroneayea>davexunit: testing it out!
<paroneayea>davexunit: http://pamrel.lu/4957b/
<paroneayea>davexunit: works great! only complaint:
<paroneayea>I'd love to see spaces between things
<davexunit>well, it's not really for human reading
<davexunit>it would inflate the size of the generated output
<paroneayea>davexunit: likewise, a (write-json #:pretty #t) would be nice
<paroneayea>since having pretty-printed json is often useful
<paroneayea>however, it already works well
<paroneayea>davexunit: hm, I think json is kind of in-between being something human readable and not :)
<paroneayea>the spaces do inflate it, but I think there's a good reason most json libraries add them
<davexunit>I just have an emacs mode or my browser do the pretty printing
<davexunit>do they really?
<paroneayea>>>> json.dumps({"yeah": "rly"})
<paroneayea>'{"yeah": "rly"}'
<davexunit>JSON.stringify does not do this
<paroneayea>davexunit: well ok! :)
<paroneayea>davexunit: well, maybe (write-json-pretty) or equiv keyword version are the only ones that need it (plus newlines with indentation!)
<paroneayea>davexunit: but if you don't want to do that
<paroneayea>davexunit: maybe I can add it
<paroneayea>davexunit: (it's useful for me to verify the data structures I'm building in activitystuff to have the pretty print version anyway)
<davexunit>if you want to write a pretty printer, feel free. it's a lot more complicated that a simple single line printer so I don't feel like tackling it right now.
<paroneayea>davexunit: understood :)
<davexunit>and just FYI, ruby's to_json method also doesn't add any whitespace
<davexunit>I think I'm going to allow symbol keys for objects, with the caveat that using symbol keys would not satisfy (equal? json (read (write json)))
<paroneayea>(I suppose I can also still use ,pp at the repl to do this for now)
<davexunit>I can never remember, how do I run a single test file in guile's test suite?
<mark_weaver>./check-guile foo.test
<davexunit>mark_weaver: thanks!
<amz3>I find it difficult to keep lines under 80 chars :/
<amz3>right I hope some at a lot size 110-120
<amz3>oops!
<amz3>a lot of them go beyond 90
<amz3>btw binding c function with ellipsis is possible, it super neat
<amz3>I have problem, wiredtiger use char ** with NULL a terminating character as return value, is there procedure to convert the pointer to a string?
<amz3>I don't know the size of the string
<davexunit>amz3: utf8->string
<mark_weaver>pointer->string might be better here
<mark_weaver>amz3: ^^
<amz3>this won't work, I don't have the bytevector
<amz3>I have only the pointer and no size
<mark_weaver>right, so pointer->string
<davexunit>ah, yes
<mark_weaver>why char** and not char* ?
<mark_weaver>is it returning an array of strings?
<amz3>the function signature is something like `int func(void *)` void * is the return value, int is the error code
<amz3>thanks mark
<amz3>it returns a string but not as return value
<amz3>pointer->string works
<amz3>here is the documentation of the function http://source.wiredtiger.com/2.6.1/struct_w_t___c_u_r_s_o_r.html#af19f6f9d9c7fc248ab38879032620b2f
<mark_weaver>ah, okay
<davexunit>ACTION mails (ice-9 json) patch to guile-devel
<davexunit>paroneayea: here's the current version of the json module http://paste.lisp.org/display/153751
<davexunit>oops, found a procedue that I was no longer using, and the (srfi srfi-1) import is no longer needed.
<daviid>davexunit: great work!
<davexunit>daviid: thanks!
<taylanub> http://srfi.schemers.org/srfi-123/ participation in the discussion ML very welcome
<paroneayea>davexunit: \\o/