IRC channel logs

2015-07-14.log

back to list of logs

<nalaginrut>morning guilers~
<amz3>héllo :)
<wleslie>Hi!
<stis__>Heya!
<amz3>stis__: héllo
<amz3>I sucessfuly ran the parser
<amz3>now I'm wondering how to build an ast
<amz3>mk-token returns as a string
<amz3>I changed it to a return a list '(token-name ,token-value)
<amz3>I have to build a f-procedure to parser tokens?
<amz3>*parse
<stis__>(f-list #:a (mk-token (f-tag! "a")))
<stis__>=> '(#:a "a")
<stis__>you have f-cons as well
<amz3>I tried them, I try again
<amz3>just another question, does it support recursive grammars?
<stis__>yes, but beware of this ...
<stis__>(define fm (f-seq m (f-or mm fm)))
<stis__>in stead wrap fm in (Ds fm)
<stis__>i think that was the issue you'll get it
<stis__>when you get an infinite recurson, look fro recursive pattern and add the delayer Ds
<amz3>ok
<amz3>I am not at this point, just wondering whether it was implemented or not
<stis__>also check out the freeze ideom, it memoizes
<stis__>that can save you out of an exponential complexity
<amz3>ok
<amz3>i'm trying to build a markdown parser, it should be ok, no?
<stis__>yeah, i have a full python parser and a prolog parser. So markdown should be fine
<amz3>whre is the prolog parser?
<stis__>The prolog parser is in logic/guile-log/prolog/parser.scm
<amz3>this can be helpful :)
<stis__>it's not using the combinators as much, but you may find it interesting
<stis__>today I prefere the way I did the python parser
<amz3>I can't run the python parser, it's easier to study
<amz3>maybe I'm not up-to-date
<stis__>ok, if you want to have it running i'll try to fix it tonight.
<stis__>maybe you need guile-log head donough.
<amz3>no ok it's ok
<stis__>maybe i'm a commit behind
<amz3>I try to build something with what I have right now thx
<stis__>do that, get your hands dirty and hppy hacking
<amz3>:)
<amz3>stis__: I am trying to port the markdown parser, based on this article http://www.greghendershott.com/2013/11/markdown-parser-redesign.html
<amz3>he use some (try) procedure to do backtracking, is there an exquivalent of that in guie-log?
<stis__>guile-log is backtracking yes.
<stis__>but (f-seq! a b c) (f-or! a b c) will succeed only ones
<stis__>etc
<stis__>so in (f-or! a b c) if a succeeds then b is not tried
<amz3>how does backtracking works with f-seq! ?
<stis__>but for (f-or a b c) if a succeeds and later there is a failure and it backtracks back to this or b will be tried
<amz3>I guess I will get it by experiments
<stis__>in (f-seq! (f-or a b) c) this succeds only ones
<stis__>but in (f-set (f-or a b) c) control can go back to the f-or at backtracking
<stis__>f-set => f-seq
<stis__>note that for higher order combinators ! means cut
<amz3>by "only succeed one" you mean that it takes the first way that match
<stis__>for the lower order ones like f-tag it means mutate and save the char
<stis__>yes
<stis__>sorry f-tag! means save the char(s)
<stis__>so ! has different meanings depending if it's higher order or not
<amz3>ok
<stis__>A cool property is that you can save the parsing state return to the shell and later restore the stae and continue
<stis__>so it's all functional in the background ergo the ! in f-tag! is a little misdirected
<dsmith-work>Tuesday Greetings, Guilers
<stis__>heya: dsmith-work
<amz3>I don't do that kind of magic with simple guile programs ;)
<amz3>stis__: can you tell me why it doesn't work http://pamrel.lu/95721/
<amz3>also I can't reproduce it right now, but previously some match were repeated in the result
<amz3>here items are repeated: http://pamrel.lu/d4b85/
<amz3>whereas this gives the correct result (define f-para (ff+ (f-or! f-inline (f-list #:eol f-nl))))
<stis__>ok, i will look at it
<stis__>amz3:
<stis__>(define f-para
<stis__> (ff+ (f-or f-inline f-nl)))
<stis__>this is the suspect! the thing is that ff+ sees a match with f-nl that just transfers the old match wich lead to repetition.
<stis__>so when you build up with ff+ f-list f-cons make sure to only match tokens
<stis__>the fix is:
<stis__>the fix is:
<stis__>(define f-para
<stis__> (ff+ (f-seq! (f* f-nl) f-inline)))
<stis__>also to make everything in one list you may use
<stis__>(define f-inline
<stis__> (f-or f-text f-bold))
<stis__>but that might not be what you want.
<stis__>amz3: I will see if I can make your code working, I have an idea of what can be done
<stis__>ok! I fixed guile-log head so that your initial code should work, thanks!
<stis__>turns out that how I work with my parsers I did not trigger this issue.
<amz3>stis__: there is an error during make http://pamrel.lu/b4899/
<stis__>are you compiling head?
<stis__>I'll need to check in the new changes
<stis__>I'll about to add f-line which will insert row and column numbers in your ast
<stis__>ok, I checked in the changes. Also I added the missing file. Thanks!
<stis__>amz3: in head you will not need the initial f-nl
<amz3>ok
<amz3>sneek: bot snack
<amz3>sneek: snack
<amz3>I think that the backtracking syntax is more natural in guile-log than racket's parsec
<stis__>cool, thx.
<amz3>amazing, it works :)
<stis__>I do like the name parsec though.
<amz3>(I still have a failure during compilation
<amz3>No such file or directory: "/home/stis/src/guile-log/language/prolog/modules/boot/dcg.pl"
<amz3>Makefile:1359: recipe for target 'language/prolog/modules/sandbox.go' failed
<amz3>parsec is a cool name :)
<amz3>ACTION is pafk ie. parsec away from keyboard
<stis__>huh, hard coded paths.
<stis__>i'll try to fix this
<stis__>I think that you need to regenerate the scm files
<stis__>sorry!
<amz3>ok
<stis__>1. try rm the *.scm files in the languge/prolog/modules/*.scm | */*.scm
<stis__>2. touch language/prolog/install.scm
<stis__>and then make again
<stis__>these are prolog compilation scm files that are generated.
<stis__>the instruction above should generate them on your machine with your paths
<stis__>note the second above is languge/prolog/modules/*/*.scm
<stis__>not */*.scm
<amz3>I did: find language/prolog/modules/ -name "*.scm" | xargs rm
<amz3>then touch, then make
<amz3>** No rule to make target 'language/prolog/modules/user.scm', needed by 'language/prolog/modules/user.go'.
<stis__>touch language/prolog/install.scm ?
<stis__>aha checkout that file and do the same when you get a similar diagnostic
<amz3>ah ok
<amz3>get it
<amz3>got it
<stis__>I forgot that there was one or two pure scm file.
<stis__>darn I really need to fix this.
<amz3>what are the other?
<stis__>just compile and you will see if there exists a nother one
<amz3>It's compiling. I am asking how are generated the files? From scheme code?
<stis__>well the install.scm will generate a wrapper around a set of prolog files
<stis__>this is a scm file, that will compile the prolog file when compiled
<amz3>they are generated from prolog source?
<amz3>it's just a way to speedup the prolog compiler?
<stis__>the scheme files are generated from scheme. those file will point to prolog code and compile that code into a library funcitons
<stis__>I think that I have anout 25000 lines of prolog code here.
<stis__>It is really time to factor out the prolog code if people just are after the basic guile-log or kanren interface
<stis__>the prolog code takes maybe 20 minutes to compile and there might be memory issues etc
<amz3>it saying that language/prolog/modules/library/occurs.scm is missing, and git miss it too
<stis__>due to some of the prolog files beeing huge and the outpiut is a bit verbose atm
<amz3>several projects means more maintenance
<stis__>yeah, and you need to synchronize the versioning of tags
<stis__>ok I checked in the occurs.pl and occurs.scm
<stis__>youl get the f-line as a bonus
<amz3>what is it?
<stis__>rm the occurs.scm, touch install.scm and make
<amz3>ok I will try.
<stis__>(f-list #:tag f-line matcher) will insert (line . column)
<stis__>in the place of f-line
<amz3>I just changed my example http://pamrel.lu/38413/ the L of Lazy and L of Little dissappeared
<amz3>(also if could please help to get the combinator right to create paragraph I would be grateful)
<stis__>well when you managed to compile you will have the output http://paste.lisp.org/display/151588
<zacts>mark_weaver: davexunit: I got the little prover in the mail today
<zacts>it looks awesome
<zacts>and it even has some expressions in multi-color
<zacts>like blue for some of the answers
<mark_weaver>nice!
<dsmith-work>sneek: uptime
<dsmith-work>!uptime
<sneek> 15:58:42 up 14 days, 23:45, 0 users, load average: 0.01, 0.05, 0.10
<dsmith-work>sneek: seen rlb?
<sneek>I last saw rlb on Jul 12 at 11:09 pm UTC, saying: Are rnrs records similar in overhead to srfi-9 records in guile, or is one notably different on that front?.
<amz3>does string-match support something similar to elisp character classes?
<paroneayea>hello #guile
<mark_weaver>amz3: guile's regexp functions support POSIX regular expressions. see http://pubs.opengroup.org/onlinepubs/009696899/basedefs/xbd_chap09.html#tag_09_04
<mark_weaver>so they can include things like [[:alnum:]] for alphanumeric characters, ditto for alpha, blank, digit, graph, etc.
<amz3>thanks i bookmarked the page
***Fuuzetsu is now known as Guest47373
***Guest47373 is now known as Fuuzetsu
<amz3>ACTION likes guile-log (even superficial guile-log)
<wleslie>Stefan has done a remarkable job
<amz3>here is a little parser for a flavor of markdown I call «the little markdown» http://paste.lisp.org/display/151596
<wleslie>congratulations on creating a markdown parser with a non sexist name
<amz3>sexist? I didn't know it was a thing
<amz3>I'm not native english speaker so I don't get the jokes anyway
<amz3>:)) thanks :)