IRC channel logs

2018-07-15.log

back to list of logs

<brendyn>Is it possible to do the picture language stuff from SICP in guile?
<brettgilio>brendyn: I do not see why not.
<brettgilio>If any standard is going to be compliant to SICP, it is going to be Racket, Guile, or MIT Scheme
<brendyn>brettgilio: it requires being able to print images to the screen
<brettgilio>It's been awhile since I touched SICP, but I have it on my computer. Can you give me a page number for reference?
<brettgilio>brendyn:
<brendyn>176 or so
<brendyn>It seems to just assume that I already have this picture language and functions like beside
<brettgilio>brendyn: Page 176, Chapter 2, page top reads "takes a tag and contents..."
<brettgilio>Right?
<brendyn>That's page 273 for me. I've got a revamped PDF version of SICP
<brendyn>2.2.4
<brettgilio>here, give me a phrase from the page
<brettgilio>or that works too
<brettgilio>2.2.4
<brendyn>A picture language
<brettgilio>brendyn: Got it.
<brettgilio>let me refresh myself on it really fast
<brendyn>I wouldn't mind doing it in racket but I installed racket in Guix and sicp language doesn't exist in it
<brettgilio>Dr. Racket should have a scheme standard under "older languages" or something
<brettgilio>But, I don't think you'd need to
<brettgilio>Yeah, I don't see any reason why you couldn't be able to do such manipulation in Guile. You should be able to define the picture directly from its file path.
<brettgilio>I'd give it a try
<brendyn>Don't know how to do that
<brettgilio>brendyn: What environment are you working in for Scheme?
<brendyn>Emacs, geiser with guile
<mwette>Hi all!
<rain1>hey
<stis>hello guilers!
<rain1>hi :)
<rain1>whats happening?
<EuAndreh[m]>Hi there!
<EuAndreh[m]>What's the go-to/recommended static site builder in Guile?
<EuAndreh[m]>Haunt?
<stis>rain1: not much slacking today resting after some heavy codeing of a python port ty guile
<mwette>stis: nice. So I'm practicing lang ports using javascript. How do you handle strings for your nearly-Python? Python interns strings so do you have some internning method, just use Guile strings, or something else?
<stis>i'm sloppy and use guile strings
<stis>modelling it using symbols could be done but i fear that you will get pollution when e.g. string analysing
<mwette>What about associative arrays? Do you index by string also?
<rain1>so guile can run python scripts?
<mwette>where associative arrays == Python dictionary objects == Guile hash-tables, I assume
<mwette>rain1: stis is working on it. Guile has ecmascript (aka javascript) in the distribution, and elisp also. The reference manual describes how to generate your own extension language to host in Guile.
<rain1>how did you write the parser?
<stis>mwette: yes you can idex by strings. faster to index by interned stuff though
<stis>rain1: ideomatic python works fine now, if you want the batteries you need to wait.
<stis>rain1: using stis-parser: https://gitlab.com/tampe/stis-parser
<stis>re module os sys pickle string is implemented though, more to come
<rain1>amazing, well done
<ArneBab>stis: won, I did not see that — need to play with it and maybe get some of my python tools compatible!
<ArneBab>s/won/wow/
<mwette>I'm having issue with guile running my javascript. If I type, essentially, `var a = 1', then `print(a)' in the interactive interpreter, I get expected result. But, if I put those statements in a file and run `guile --language=javascript' file.js, I get failure: the compiler can't find the top-level symbol "a".
<daviid>mwette: can you load the script, run (main ...) and then ,bt ?
<daviid>I guess not
<mwette>I will try something ... that's weird.
<mwette>in scheme mode "load" is a procedure, but after I ",L javascript", "load" is a syntax-transformer.
<mwette>You can duplicate with ",L ecmascript".
<daviid>yeah, I as suspecting this, maybe gdb or strace gives more info ... I don't know
<mwette>I tried primitive-load from javascript but then i have unresolved symbols from the file.
<daviid>how about turning the file into a script, then after #!/bin/bash you'd do exec guile --lang ... ?
<daviid>anyway, you know ths javascript 'module' needs love
<daviid>i don't think it is maintained (or maybe just 'stalled')
<mwette>This is my own javascript implentation. It lives in the example/ subdir of my nyacc distribution.
<daviid>ah, ok
<mwette>The ecmascript one is 2k lines of code w/ zero comments. But it does give me a place to look for hints. Hence, my javascript is a learning tool.
<daviid>i thought it was ijp implentation ...
<mwette>To work interactively one needs to generate a parser (or reader) that will parse one top-level construct and return. Many parsers will parse to EOF, which does not work. Also, I found that the Guile language system expects readers to return the eof-object on EOF.
<mwette>My reader outputs SXML. I then use Andy's foldts*-values to convert to tree-il.
<ArneBab>mwette: you can cheat parsing more than one construct by caching the parse result as i do it in wisp: https://bitbucket.org/ArneBab/wisp/src/7501dc0db3f8cebf49b48634719ab82b4a509a79/wisp-reader.w?#wisp-reader.w-36
<mwette> ArneBab: Thanks. I don't see a need to do that. I fixed my parser so that once the top-level production is reduced it returns. Here is the new interactive parser: http://paste.debian.net/1033820/
<ArneBab>mwette: nice!
<ArneBab>(though I must admit that I don’t understand directly from reading what it does)
<mwette>ArneBab: It implements a pushdown automata. The parser genenator generates a state machine. Either a lookahead token is absorbed and generates a state transition (shift), or the lookahead token signals a completion of a production rule (a reduction).
<mwette>ArneBab: That's how Bison parses. See https://en.wikipedia.org/wiki/Pushdown_automaton
<jralls>GnuCash has a localization problem on MSWindows in the Vietnamese locale: scm_c_eval_string("(any-form-at-all)"); asserts in utf8_to_codepoint(). A represntative stack trace may be found at https://bugs.gnucash.org/show_bug.cgi?id=796728#c19.
<jralls>Converting the string to an SCM beforehand and using scm_eval_string() doesn't help.
<mwette>.