IRC channel logs

2016-09-02.log

back to list of logs

<zv>moosnat: some functions are internal and exist in an environment without any further functions being defined
<mark_weaver>zv: can you restate, more clearly, what you mean?
<zv>if it is the case that all procedures must be defined in terms of other procedures, there must exist procedures which require no further justification.
<zv>ergo
<zv>there can never be a truly empty environment
<mark_weaver>sorry, that doesn't follow
<mark_weaver>in guile, you can create an empty environment
<mark_weaver>an environment is a mapping from names to bindings. the bootstrapping argument isn't germane to the question of whether we can create an empty environment
<zv>sure, but there must be some environment frame which carries fundamental information, otherwise the environment is useless
<mark_weaver>but also, it happens to be false that all procedures must be defined in terms of other procedures.
<zv>its not only true, its been proven!
<zv>of course in a mathematical sense, which isn't exactly germane either.
<sapientech>daviid: hey there, just wondering if you could help me finish up the autoconf setup. I added everything in configure, you said that i needed to add @GUILE_PATH@ to pre-inst, and makefile
<mark_weaver>(lambda (x) x) is a procedure that's not defined in terms of other procedures
<sapientech>is there an example online that uses this? i couldn't find one
<mark_weaver>I'm not sure what proof you're referring to
<mark_weaver>(or what exactly was proven)
<sapientech>mark_weaver: hey not sure if you saw one of my questions earlier, but was wondering why you chose to do two lets instead of let*
<zv>Charles Sanders Peirce proved it all the way back in the day
<zv>and lambda of course is a procedure that is defined in terms of other procedures
<zv>what does `lambda` mean?
<zv>how does the computer know the meaning of `lambda`
<zv>obviously it is a procedure which "requires no further justication" but has indeed been programmed in terms of other procedures
<mark_weaver>well, partly there's a terminology issue here. in scheme, the word "procedure" has a specific meaning, and 'lambda' is not a procedure.
<mark_weaver>but yes, you need to have some fundamental forms, at least, to build upon.
<sapientech>not sure how its done with guile, but i was thinking lambda could simply be transformed to a gensym'd variable, and then turned into a define procedure
<mark_weaver>nonetheless, since we have first-class environments in guile, we can create an empty environment, or an environment with a very restricted set of bindings.
<zv>of course, `the-empty-environment` or whatever its called does exist
<zv>but its not truly empty
<mark_weaver>zv: yes, but we can also create a truly empty environment
<zv>that i did not know
<mark_weaver>sapientech: it's purely stylistic
<mark_weaver>using 'let*' is fine, if you prefer
<mark_weaver>sapientech: yes, you could do that. you could also arrange to bind every numeric constant (e.g. 2) into a variable reference, and arrange to bind that variable.
<mark_weaver>I'm not sure why you'd want to, though.
<mark_weaver>in guile 2.2.x, every intermediate value is given a name as part of the conversion to CPS (continuation passing style)
<mark_weaver>s/bind every/change every/
<sapientech>mark_weaver: forsure its sytlistic, just curious what your motivations where. Was it to separate the logical components, or because only one of the variables needed to reference another?
<sapientech>not a big deal, but thought it was interesting
<mark_weaver>using 'let' gives the compiler some extra freedom, because the order in which the right-hand-sides are evaluated is unspecified.
<mark_weaver>let* is a macro that expands into a series of nested 'let's, one for each variable, which is overspecifying the evaluation order.
<mark_weaver>but it's not particularly important here. but you wanted to know what was in my head, and that's it :)
<sapientech>:) thanks
<zv>mark_weaver: so is it possible to create an environment where even the primitive procedures are undefined?
<mark_weaver>zv: yes
<zv>yeah, i just tried to `(make-module)` and even lambda is undefined
<zv>is truly *nothing* defined in a raw module?
<mark_weaver>yes
<mark_weaver>however, it should be noted that at present, this cannot be used to make secure sandboxes in guile.
<zv>why not?
<mark_weaver>it's possible to forge identifiers, i.e. syntax-objects that reference arbitrary bindings from arbitrary modules
<mark_weaver>this is something we could fix in a future version of guile, but it would have to be done between major versions, because it would break the ABI
<zv>if you were, just as an example, caught in a repl in a vanilla module, how would you be able to execute anything to begin with?
<mark_weaver> https://lists.gnu.org/archive/html/guile-devel/2012-05/msg00041.html
<zv>can you call raw memory some way?
<zv>aha
<zv>ok
<zv>very clever
<zv>your post does indeed give me a procedure
<zv>+1 to mark_weaver
<mark_weaver>anyway, guile has not been designed to build secure sandboxes. it would take quite a bit of work and auditing of existing code before I would trust it for that job. better to make use of kernel features to isolate the entire guile process.
<zv>eh, like thats much better!
<mark_weaver>maybe some day we'll have it, but it will be a project :)
<zv>numerous linux capabilities are essentially 'isomorphic'
<mark_weaver>*nod*
<zv>in the sense that granting any one of them is equivalent to granting cap_sys_admin
<mark_weaver>it's a hard problem
<zv>chroot's problems have been spelled out to death
<zv>there seem to be infinite ways to break out of "true" virtualization environments, if you want to go beyond the os
<zv>so on and so on
<zv>anyway, that is a neat attack,
<zv>you mention the equivalence of the two items in your post, but i've never seen #(syntax-object ... ) before
<zv>what does it mean?
<zv>the `#(` part at least
<mark_weaver>#(a b c) is literal syntax for vectors in scheme
<mark_weaver>so it's just a vector whose first element is the symbol 'syntax-object'
<zv>and vectors are equivalent to C arrays?
<zv>so dereferencing a vector of pointers = a real function?
<zv>rather, a vector element
<mark_weaver>I'm not sure what "so dereferencing a vector of pointers = a real function?" means
<zv>i guess i'm just confused at how syntax-object can be nonexistent but then exist inside of a vector
<mark_weaver>it would take some thought to decide if they are "equivalent"
<mark_weaver>each element of a scheme vector can contain any scheme object.
<zv>what I meant there was that if vectors were just contiguous memory, you could treat the first derefernced element of any vector as a function*
<zv>just like a regular overflow
<zv>anyway, thats evidently not the case
<mark_weaver>vectors have a length that cannot change, and all references are bounds-checked.
<zv>yeah, i'm not doing a great job at communicating today
<zv>i didn't mean that "like an overflow" in the sense that you would overflow a stored instruction pointer or anything like that
<mark_weaver>it's okay, that happens to me sometimes too :)
<zv>so then how is the construction of vectors "outside" of the current environment?
<mark_weaver>how a scheme vector is stored is a purely internal issue, which is not relevant to the API
<zv>syntax-object doesn't exist in my enviroment but #(syntax-object) is
<zv>mark_weaver: no, i get that
<zv>but the scheme vector must have some "basis" for truth if it can store symbols, variables, etc
<mark_weaver>vector literals are self-quoting in scheme, so #(syntax-object) is analogous to '(syntax-object)
<zv>that "basis" being an enviroment or some such
<mark_weaver>and once you quote it, then it doesn't matter if 'syntax-object' is a binding in any environment.
<mark_weaver>then it is merely a symbol
<zv>ok, but doesn't that symbol have to have a binding to an implementation?
<zv>otherwise it's simply "not defined"
<mark_weaver>zv: I really think you should read R5RS. it's not a long document, and clearly you are interested in the fundamental concepts of scheme.
<zv>ok, i'll stop bothering you
<zv>thank you for being helpful anyway!
<mark_weaver>np!
<mark_weaver>I appreciate your interest in the finer questions, btw. given this, my suggestion to read R5RS is a sincere recommendation, and not an attempt to be rid of you. fwiw :)
<mark_weaver>I'd be glad to chat more with you on these matters after you've learned a bit more.
<zv>very neat feature of the debugger that you can "step into" another environment
<zv>ie. `scheme@(#{ g29604}#) [1]>`
<daviid>sapientech: are you here ? :) yes I can help, could you please commit the changes you made, I just pulled and it says I'm up-to-date
<amz3`>ouch! apparently my server is too low on ram to extract the urls from the dump I had to compress and download the dataset to my local machine
<amz3`>the dump is 8G of scm, compressed with xz it's 2G
<amz3>another program that leaks
<amz3>bizar
<wingo>you using guile 2.0 or 2.1.x?
<daviid>wingo: hello! thanks a ton for having fixed bug#24286
<paroneayea>greets, *
<dsmith>Happy Friday, Guilers!!
<amz3>wingo: 2.1.3
<daviid>ACTION is happy! grip-clutter and its examples finally compiled and run fine using 2.2, ouf! :) 
<amz3>:)
<amz3>both of this programs leaks
<amz3> https://github.com/amirouche/Culturia/blob/master/src/hn-step00-dump-hn-api.scm
<amz3> https://github.com/amirouche/Culturia/blob/master/src/hn-step01-extract-urls.scm
<wingo>daviid: congrats :)
<amz3>I can try to use valgrind to see where the leaks comes from
<amz3>wdyt wingo?
<wingo>no idea, i don't know what your three libraries do
<wingo>(http, json, msgpack)
<wingo>i suspect the problem is there, dunno tho
<wingo>also what does leak mean?
<wingo>your programs should finish and exit, i don't know at what point the mem consumption would be static
<daviid>wingo: tx!
<amz3>http calls the curl command to download an json
<amz3>json & msgpack are not used anymore they should be removed from the import
<amz3>after downloading the a json document as string, the string is written to disk using `write'
<amz3>the other script, step01, will 1) read the file scm string per scm string using read, turn this into a lazy stream using streams srfi-41, 2) each string is converted into json assoc 3) then there is filtering step 4) then the value associated with "url" is taken from the json and written to disk in append only mode
<amz3>I'll try valgrind tonight
<amz3>because I think with the second step, oom killer kills guile pretty quickly less than 30min with 4G of RAM
<OrangeShark>good day everyone
<ahstro>Good day OrangeShark :)
<TMA>hi, I have tried compiling current guile (from git) under cygwin and it fails to load bootstrap/ice-9/eval.go: ;;; Throw to key system-error with args ("load-thunk-from-memory" "~A" ("Invalid argument") (22))
<TMA>what is the status of cygwin support?
<amz3`>dunno
<DeeEff[m]>IIRC there's still some POSIX-y stuff that cygwin doesn't have that guile relies on. I recall someone distributing windows binaries from automated builds somewhere though
<DeeEff[m]> http://guile.mechcore.net:8080/view/All/job/GNU-Guile-stable-2.0-Windows/
<DeeEff[m]>Seems to be the link
<DeeEff[m]>even just http://guile.mechcore.net:8080/, if you don't want the jenkins nonsense
<DeeEff[m]>seems last successful one (passed all tests) was http://guile.mechcore.net:8080/view/All/job/GNU-Guile-v2.0.11-Windows/lastSuccessfulBuild/artifact/jenkins-guile-automatic-build/binaries/guile-i686-w64-mingw32-972fb41f0ce124d97f5cf64bde1075510cd21e18.zip
<DeeEff[m]>sorry for linkspam guys
<dsmith>Is anyone other than Eli trying to use Guile on windows?
<ijp>probably not
<amz3`>by leaks I mean that the program consumed memory grows without bound, but the memory is back when the program is killed
<amz3`>I'll inverstigate whether guile-json has leak
<amz3`>I mean that I will use another json library and try the program with that and see what happens
<amz3`>first thing to notice, it's that ice-9 json is much faster
<dsmith>amz3`: There is an ice-8 json module?
<dsmith>ice-9
<amz3`>dsmith: not yet, but it was posted on the dev mailing list a while back by davexunit
<amz3`>AFAIK it has issues with utf-8
<dsmith>Ah. ok.
<amz3`>in my program it works good enough there is not much failed attempt to parse json, I mean not much more than using guile-json
<amz3`>it works good enough but there is still a leak in my program
<amz3`>so it's not guile-json, except if ice-9 json is also leaking
<amz3`>I did a valgrind but it's not conclusive IMO
<amz3`>maybe it's the srfi-41 that leaks, but it's pure scheme there is no reasons for that to happen
<TMA>DeeEff[m]: thank you
<amz3`>it seems like the issue is in srfi-41
<amz3`>so let's write a test case
<amz3`>I can't reproduce the issue with a simple srfi-41 stream
<amz3`>here is the script that doesn't reproduce the issue, http://paste.debian.net/804780/
<amz3`>I'm not sure how to make it leak
<amz3`>500k urls already
<amz3`>I'll commit the new program I use, which replace streams with lambdas
<amz3`> https://github.com/amirouche/Culturia/commit/e741c6eb9924022e4d84628e8fe9e109577742f9
<DeeEff[m]>TMA: no problem
<DeeEff[m]>dsmith: I tried to use Guile on windows for a long time but ended up switching to CHICKEN Scheme almost exclusively because it was so hard (this was before Eli's efforts, mind you)
<paroneayea>sup daviid
<daviid>paroneayea: tx!
<paroneayea>daviid: was curious on your thoughts about guile-gnome using GIR and how hard it would be at this point
<paroneayea>also! I think I hit something very strange
<paroneayea>I force-killed a process running guile-gnome, and now I can't import any guile-gnome modules anymore o_O
<paroneayea>I verified, it's in my environment..
<paroneayea>I feel like this makes 0 sense and maybe I'm missing something obvious, but that's the moment I'm in.
<paroneayea>I even started up a guix environment with guile-gnome in it explicitly.
<paroneayea>maybe I should restart, which is a strange assertion to make.
<wingo>that's pretty weird :)
<paroneayea>I thought so!
<paroneayea>anyway I'm thinking, maybe if I have to make an activitypub implementation, it should maybe use guile-gnome. Would be good to try it out.
<sapientech>daviid: hey there, yeah i didnt push that commit yet :)
<sapientech>just pushed to develop
<daviid>paroneayea: I'm working on G-Golf, but don't hold your breath... [6m to a y before really usable imo]
<paroneayea>daviid: g-golf?
<daviid>paroneayea: https://savannah.gnu.org/projects/g-golf/
<paroneayea>aha
<daviid>but guile-gnome is your friend in the mean time! I don't understand your problem though
<paroneayea>daviid: I don't understand my problem either :)
<daviid>:)
<paroneayea>(it wasn't my original reason for pinging you either)
<paroneayea>I just meant to ask about GIR
<paroneayea>but then that very strange thing happened.
<paroneayea>bbiab!
<daviid>sapientech: i just pulled and your configure.ac is like you had it before we talked?