IRC channel logs

2015-02-06.log

back to list of logs

<paroneayea>mark_weaver: though, you missed one benefit
<paroneayea>on your assessment of python and style
<paroneayea>the other one is consistency
<paroneayea>and readability
<paroneayea>it's very easy to read most python code... I can wake up at 3am with blurry eyes and generally sense what's going on just by the shape of the code
<please_help>python isn't very consistent (though it is definitely readable for the most part)
<paroneayea>hard for me to say that for most any other languages
<paroneayea>please_help: I find it's pretty consistent, and PEP-8
<paroneayea>and others help there
<paroneayea>it is true that it's not uniform
<paroneayea>different parts of the code are shaped different ways
<paroneayea>thus, programs are pretty readable by shape
<paroneayea>I agree with mark_weaver's assessment that it does constrain the programmer to certain styles
<paroneayea>and this does make it good for programmers early on
<paroneayea>but hems one in later on
<paroneayea>while I find ArneBab's wisp project pretty exciting, I think it does keep the uniformity of lisp aspect, which is both pro in most cases and maybe con in this. I'm not sure how to hit a middle ground; maybe stuff like Julia and Dylan do, but maybe they kind of bring those restrictions back in the process a little bit? I'm inexeperienced in those two, and thus it's hard for me to know :)
<please_help>a if b else c and [x for y in z if w], for instance, clash with standard syntax. There's also the whole prefix/infix/postfix mess. In python <3, there's also wannabe functions like print.
<please_help>lisp on the other hand...
<paroneayea>please_help: a if b else c does look like a mess in python
<paroneayea>list comprehensions are inconsistent in a way that adds to my readability argument above tho I think
<mark_weaver>paroneayea: I used the word "uniformity" instead of "consistency", but they are fairly close in meaning. I don't think I missed that point.
<paroneayea>print is pretty weird
<paroneayea>mark_weaver: aha, okay :)
*mark_weaver goes afk
<paroneayea>it's still a point worth noting in that circumstance I think though
<mark_weaver>actually, come to think of it, I think they mean different things, and "uniformity" is the better word to use here. consistency to me merely implies that there is no contradictions, at least when used in the logical sense.
<mark_weaver>although the word "consistency" is often used to mean "uniformity" anyway.
<mark_weaver>IMO anyway :)
<mark_weaver>okay, gotta go afk to help make dinner.
<please_help>another inconsistency in python is the lack of structures like switch/case and do-loops despite the overall design seemingly being focused on providing lots of syntactic sugar to ease readability
<nalaginrut>morning guilers~
<civodul>Hello Guilers!
<nalaginrut>heya
<Chaos`Eternal>helo
<ArneBab>mark_weaver: thank you for finding the quote! I had tried to remember its exact wording :)
<ArneBab>mark_weaver: uniformity sounds good, yes.
<wingo>good morning
<wleslie>mood worning gingo
<civodul>hello, wingo!
<ArneBab>moin moin :)
<ArneBab>paroneay`: my experience with wisp till now is that I’m only learning how to write readable code with it. My style slowly changes to adapt to the new possibilities and structures.
*wingo caught the free software flu at fosdem :)
<wingo>just now maybe recovering :P
<wingo>so i was thinking, what about a 2.2 prerelease
<wingo>it seems i broke something in the latest merge to master, like a complete idiot
<wingo>but i can fix that, update NEWS, see if it distchecks, and we can release a tarball at least
<wleslie>what are the outstanding issues? did Dave Pirotte's latest stuff get resolved? I missed most of that discussion.
<Chaos`Eternal>sound great
<ArneBab>wingo: a prerelease would be nice!
*wleslie has way too many buffers open in conkeror
<nalaginrut>wingo: could you take a look at this bug? http://lists.gnu.org/archive/html/guile-devel/2015-02/msg00000.html
<nalaginrut>I need 2.1 for lua hacking ;-)
<nalaginrut>(maybe 2.2 soon)
<wingo>ah yes
<wingo>i must have caused that recently
<wingo>yes i can fix that nalaginrut
<wleslie>was it a clean build?
<nalaginrut>wingo: thank you very much! ;-D
<wingo>wleslie: no list of serious outstanding issues that i know of
<wingo>fixing david pirotte's goops thing broken the foreign object interface, but that's fine as it hasn't been released yet in either branch...
<wingo>yeah i can't believe i borked that test and no one has complained; sorry about that!
<wleslie>I've had some compulsion to write an E implementation lately
<wleslie>I think it would be fun to E on Guile.
<wingo>so it seems to me it would be nice if we could declare some classes as having static slot allocation
<wingo>like for all subclasses of that class, instances of those subclasses have the static class's slots allocated in the same way
<wingo>it doesn't prevent diamond inheritance or mixins but you couldn't have two statically allocated classes in one CPL
<wingo>right now we have some special cases for <class>, there are more special cases in 2.0, and e.g. in guile-gnome there is a special case for <gtype-instance>
<wingo>and others
<wingo>anyway, will see about implementing that...
<wingo>you have a pretty weird nick, please_help :P
<wingo>usually names on irc are about who you are, not how you would like others to behave towards you :)
<saul>Please tell me if I understand this correctly. In the expression (use-modules (foo bar flob)) flob is the name of the module while foo and bar are merely subdirectories and hold no other significance.
<saul>So there would be a file: %site-dir/foo/bar/flob.scm
<wingo>the name of the module is the list '(foo bar flob)
<wingo>saul: if there is no currently-loaded module with that name then yes, a file is searched for; see the manual for details on that
<wingo>but if there is already a module with that name, it is used directly
<wingo>one way you can have a module but no file would be at the repl, for example
<wingo>you can (define-module (foo)) at the repl just fine
<wingo>no need for there to be a corresponding foo.scm
<wingo>for better or for worse :)
<saul>wingo, thank you for your response. The documentation for the @ form of referring to bindings in a module clarified things (wherein the :renamer procedure is a convenience and not indicative of the internal mechanism).
<wingo>np
<saul>I've been using modules for years, but it has always been in a cargo cult fashion.
<paroneayea>ArneBab: I'm definitely interested in seeing what styles come out of it :)
<wleslie>there was this one character named Unhelpful who turned out to be anything but
***wleslie_ is now known as wleslie
<daviid>hello guilers!
<wleslie>happy Saturday!
<wingo>hello daviid :)
<wingo>just wrote you a nice long mail :)
<daviid>oh thank you did not see it yet but will check now
<daviid>wingo: in the mean time, while i read, i see the line that breaks guile-gnome make check on the devel branch, on debian testing with automake 1.14.1-4 is the serial-tests option you added in configure.ac: "AM_INIT_AUTOMAKE(-Wno-portability -Wno-syntax serial-tests)". i did ask here if anyone was aware of something 'special' about debian, automake version... if you have an idea how to slove this lt me know
<daviid>if i remove the 'serial-tests' option then make check is fine on guile-gnome devel branch as well [on debian tstiong automekae 1.14...]
<wingo>daviid: dunno, works for me, and in fact using serial-tests was necessary
<wingo>i use debian with the same automake
<wingo>using serial-tests is needed due to our use of the legacy test runners; we don't use the new parallel automake tests
<daviid>yes, i understand it needed to be added, don't know why it breaks, i left that 'problem' aside for now, the thing is i don't know much about the autotools, i don't know [yet] how i can debug this problem, i'll see what i can do for now, i can tempo comment/uncomment the new/previous line and run make check to check the changes I make...
<please_help>I have an (array-contents arr)-compatible index and a (array-dimensions arr) list. I want to generate a (lambda (ik ik+1 ik+2 ... in) (list 0 0 0 ... ik ik+1 ik+2 ... in)) but the number of variables necessary is not known at write-time
<please_help>that is, so I can get an array-view for the "rest-array" of arr starting at dimension D.
<please_help>(rest-array #2f32((0 1 2) (3 4 5)) 1) ;=> (0 1 2) ; in this dummy setting
<please_help>(rest-array #2f32((0 1 2) (3 4 5)) 0) ;=> ((0 1 2) (3 4 5))
<please_help>I wanted to make a macro for it but that didn't work because '(something) gets expanded to (quote (something)) before the macro gets ahold of it
<please_help>the plan was to (lambda (eval var-lst (current-module)) body ...)
<ArneBab>paroneayea: :)
*wingo does a make distcheck just to see what happens
<paroneayea>ArneBab: one place where I think wisp would look really nice
<paroneayea>guix packaging, I suspect
<ArneBab>paroneayea: I think so, too ☺
<ArneBab>(though I would be careful with pushing it: That depends on whether Schemers would be put off by this)
<lloda`>please_help, did you see the function (from) in the solution I posted. With that (rest-array A 0) would be (from A), (rest-array A 1) would be (from A 0), (rest-array A 2) would be (from A 0 0). So (rest-array A n) = (apply from A (make-list n 0)).
<lloda`>this is a straight application of make-shared-array, it doesn't matter if your array is array-contents compatible or not
<please_help>right, I should've checked first
<please_help>sorry
<lloda`>I sent a patch to the list to extend (array-ref ...) to do this a few years a go, but people didn't like it
<lloda`>a go/ago
<please_help>why didn't they like it?
<lloda`>as I remember (I disagreed, so I might get this wrong), because you don't know if array-ref will return an element or a subarray without knowning the number of indices and the rank of the array.
<lloda`>with array-ref as it is, it always returns an element
<lloda`>and if the rank and the number of indices don't match that's just an error.
<lloda`>it works for APL, Python, etc. though :p
<lloda`>so what I'll do is propose the same patch under another name, and stop using array-ref :)
<please_help>yeah, I'd totally be behind such a patch
<lloda`>ok, I'll send a new patch for this. It will be for 2.1, so I don't know if it will be useful to you.
<lloda`>to be clear, you can still do anything with make-shared-array
<lloda`>it's just inconvenient imo
<dsmith-work>Happy Friday, Guilers!!
<civodul>yay, happy Friday!
<OrangeShark>Happy Friday!
<please_help>I made a generator macro for srfi-42 but the second syntax-rule keyword doesn't seem to register. (list-ec (:array a (subarray arr 1)) a) ;=> unbound variable: subarray
<please_help> http://paste.lisp.org/display/145682
<please_help>(index -) works, though
<daviid>wingo: just answered, very good, I think we are on the same 'track' now, I hope! have to go afk for a while, nothing to eat here, I'm starving :) bbl
<mark_weaver>please_help: you have to put the rules matching those keywords above the rules that don't.
<mark_weaver>please_help: because the example expression you just wrote here is being matched by the first rule.
<ijp>yeah, patterns are matched in order, not by most specific
<mark_weaver>basically, you should reverse those patterns, I think.
<mark_weaver>reverse the order of the rules, I mean.
<mark_weaver>ijp: well said
<please_help>doesn't seem to change anything
<mark_weaver>please_help: note that simply redefining the macro won't change any code that's already been expanded using the old version of the macro.
<please_help>new version: http://paste.lisp.org/display/145682#1
<please_help>also, swapping the (index) (subarray) and just (subarray) versions doesn't change anything either
<mark_weaver>please_help: when I try that code on your example, I get a stack overflow.
<please_help>that certainly shouldn't happen
<please_help>did I mess up somewhere? are the calls not tail enough?
<mark_weaver>ah, found one problem.
<mark_weaver>a call to :array in the template that forgets to add 'var'
<please_help>good catch
<mark_weaver>you are inconsistent in the ordering of var and (index .)
<mark_weaver>sometimes you put it one way, sometimes the other way.
<mark_weaver>we could use a macro stepper
<mark_weaver>some day :)
<mark_weaver>with those two issues fixed, it expands properly for me.
<please_help>I think that was the problem (var was meant to always be after (index) and before the array or (subarray))
<please_help>thanks
<mark_weaver>np!
*mark_weaver goes afk
<wingo>so distcheck works, i think
<wingo>that's nice
<please_help>what symbols should I use to separate syntax-rules items from items that might be actual function names?
<please_help>s/function/variable/
<davexunit>please_help: syntax-rules are hygienic, see: https://en.wikipedia.org/wiki/Hygienic_macro
<davexunit>syntax-rules macros*
<please_help>I know
<please_help>that's not what I'm talking about, exactly.
<davexunit>oh.
<please_help>Say I want to use the keyword (array-ref x) for some reason
<davexunit>hmm, sorry for misunderstanding.
<please_help>is there some convention for naming syntax-rules keywords (here: array-ref) for clarity?
<please_help>say, %:array-ref or something
<davexunit>oh, a naming convention, I see.
<davexunit>I don't think I'm well equipped to answer that. in my experience, I haven't seen such a convention.
<davexunit>but my experience is limited.
<dsmith-work>please_help: I've never seen a convention for macros
<please_help>guess I'll make up my own then
<dsmith-work>please_help: There *are* convention though (xxx! mutates, xxx? is a predicate, xxx->yyy tranforms xxx to yyy, there are more)
<please_help>I know, which is why I asked if there was anything specific for syntax-rules keywords.
<taylanub>please_help: I once heard of a convention .. I think it was ?foo
<taylanub>but haven't even seen any code using it
<please_help>I see
<mark_weaver>taylanub: riastradh uses that convention iirc
<mark_weaver>riastradh == Taylor Campbell. See http://srfi.schemers.org/srfi-46/srfi-46.html for example
<mark_weaver>but nowadays I don't see that much.
<mark_weaver>also, in case it's not clear, riastradh uses it to mark the "pattern variables", i.e. the identifiers that become bound in the pattern of a macro.
<mark_weaver>that become bound to part of the input form, I mean.
<taylanub>it might be a good habit to visually separate pattern variables; I found myself writing bugs like (let ((foo ...)) ...) before, where I expected `foo' to be bound anew when in fact it was a pattern variable bound to e.g. (bar baz), resulting in (let (((bar baz) ...)) ...)
<zacts_pi>mark_weaver: hey dude. I just got my functional differential geometry book in the mail
<zacts_pi>It's really nice
<zacts_pi>but I didn't realize how thin the book was
<zacts_pi>and it covers so much material
<mark_weaver>cool!
<zacts_pi>And I just ordered the 2nd edition of SICM
<zacts_pi>I'm also working on catching up on my caclulus and linear algebra first with the MIT ocw
<zacts_pi>and I got corresponding math books full of problems for those courses
<zacts_pi>Hey mark_weaver I found something I would like to adapt to guile
<zacts_pi>let me find the link
<zacts_pi> http://www.nostarch.com/doingmathwithpython
<zacts_pi>sussman's books and the above book, have inspired me to possibly do my own tutorials for math using guile
<zacts_pi>Or at least peer reviewed notes of my own explorations with scheme and math
<zacts_pi>and hopefully they could be useful to others
<zacts_pi>basically I think a prequil to sussman's books would be neat to prepare someone for SICM and FDG
<please_help>how large is the space overhead of stacking events in continuations?