IRC channel logs

2013-04-19.log

back to list of logs

<civodul>Fulax: you can still send it to bug-guile
<Fulax>civodul: done already :)
<civodul>ah, great :-)
<Fulax>#14230
<Fulax>ahah, last commit on -1.8 branch was my bug report about stack growing direction
<civodul>you're the de facto 1.8 maintainer ;-)
<Fulax>I thought I was only a bigloo maintainer
<Fulax>well, I just fix build-time issue :-)
<civodul>heheh
<Fulax>I can move to understanding guile-readline now
***fangism is now known as fangism-hongry
<nalaginrut>morning guilers~
<CaptainLex>Morning
<nalaginrut>CaptainLex: heya
<CaptainLex>nalaginrut: Hello! I'm new here
<nalaginrut>CaptainLex: welcome~
<CaptainLex>I popped by because I was having trouble configuring the git codebase, but I ended up solving the problem some other way :P
<CaptainLex>And thank you!
<mark_weaver>hi CaptainLex!
<CaptainLex>Why hello again mark_weaver!
<mark_weaver>Feel free to ask questions and we'll try to help.
<CaptainLex>Thanks :)
<mark_weaver>what was the "other way" that you solved the problem?
<CaptainLex>I found a community package of 2.0 for my distro :P
<mark_weaver>what version is it?
<mark_weaver>what distro?
<CaptainLex>2.0.9, and arch
<mark_weaver>cool
<CaptainLex>I'm picky enough that most off-the-shelf distros bother me, but not nearly experienced enough to be an independent arch user :P
<mark_weaver>heh
<mark_weaver>well, 2.0.9 is very fresh. released just last week.
<CaptainLex>Oh, wow, that dude is on the ball, then!
<CaptainLex>I was trying to get Guix to build, and I wasn't sure if it was because it wanted 2.0.x exactly or because 2.1 wasn't putting the right PATH info into the system
<mark_weaver>I think guix's configure script looks for 2.0.x exactly.
<CaptainLex>Okay, good to know
<mark_weaver>so if you build guile from git, it's best to use the stable-2.0 branch.
<CaptainLex>Also good to know, thanks :)
<mark_weaver>actually, since 2.0 was released, we've been doing most of our work directly on the stable-2.0 branch. master actually lags behind a bit. so for most purposes, stable-2.0 is a better place to be right now.
<CaptainLex>Interesting
<CaptainLex>So in addition to trying to get on Guix's GSoC train, I'm going to be doing some work with a professor in the fall
<CaptainLex>It he that told me about Guile in the first place
<nalaginrut>I'm glad to know that Arch has 2.0.9 now
<CaptainLex>It's in the AUR, under guile2, if you're looking for it
<CaptainLex>And although we've basically agreed we'll be doing something in Guile, we don't really know what
<CaptainLex>I'm just interested in functional programming in applications design
<mark_weaver>who's the prof, and where?
<CaptainLex>Carl Sturtivant at the University of Minnesota
*mark_weaver does some internet searches :)
<dsmith>Hey hey
<mark_weaver>hi dsmith!
<mark_weaver>CaptainLex: do you have any prior experience with functional programming languages?
<CaptainLex>Not in any very large projects, but my school's intro CSci course is taught in Scheme (for which I am forever grateful!)
<mark_weaver>I'm envious! I didn't discover Scheme until many years out of university.
<CaptainLex>I daresay I might never have discovered it! But I lucked out. SICP was our course textbook :)
<CaptainLex>(not the whole thing, of course!)
<mark_weaver>That was going to be my next question. SICP was also the book that made me fall in love with Scheme. It took many years, but it led to a revolution in the way I write programs.
<CaptainLex>I look forward to that moment for me!
<CaptainLex>In addition to Scheme, I've started learning Haskell
<mark_weaver>it wasn't a moment, but involved a long transitional period.
<CaptainLex>But I haven't tackled anything but some of 99p, so I could hardly call that experience :P
<mark_weaver>Yeah, I learned Haskell too, and fell it love with it for a while.
<CaptainLex>But we always return to our roots, eh?
<mark_weaver>I'm still deeply impressed with it of course.
<mark_weaver>well, my roots are more in the C realm.
<mark_weaver>it's more that I found it too much work, and sometimes too constraining.
<CaptainLex>Hmmmm, intriguing
<mark_weaver>also, I've become accustomed to scheme's extensibility, due to its powerful hygienic macros and uniform syntax.
<CaptainLex>My conception (purely cultural and uninformed) was that Haskell was the more robust language, better-suited to larger projects (I am interested in videogame development) whereas Scheme was better suited to more conventional software projects.
<mark_weaver>I try to draw inspiration from haskell in the scheme programs I write.
<mark_weaver>robust is a bit vague
<mark_weaver>in some ways, I find Haskell to be an almost perfect language for writing beautiful perfect programs.
<mark_weaver>it has made a lasting and deep impression on me.
<mark_weaver>However, Haskell, like most other languages, is really optimized for a single programming style, and other styles can be somewhat awkward to express.
<mark_weaver>Haskell does not have an extensible syntax.
<mark_weaver>Scheme can support almost any programming style, including styles that have not yet been invented.
<dsmith>Yes, that was dissapointing to me.
<CaptainLex>I definitely agree about the uninformity in Syntax being a great thing; I have no knowledge of these hygienic macros of which you speak
<mark_weaver>Haskell's type system is a fixed system for proving things about programs written in it.
*dsmith had a go a learning haskell every now and then
<dsmith>has
<dsmith>s/had a go a/has a go at/
<mark_weaver>it is an extremely flexible and precise system for proving things that you need to prove in order to guarantee robustness and detect common errors at compile time.
<mark_weaver>however, it is continually evolving, and as it evolves, it requires changes to the core language itself.
<mark_weaver>and if you are writing a program that could use proofs that don't fit in its type system, you need to modify the compiler to do it.
<mark_weaver>Scheme provides the tools needed to support these kinds of proof systems, but more flexibly.
<mark_weaver>it's telling that the language Scheme has not changed much in a very long time. The things that require core changes to most other languages are simply new libraries in Scheme.
<mark_weaver>my two cents anyway. that's why I've found my home in Scheme land even though I acknowledge that there's a lot of work to be done to bring Scheme up to the level of Haskell in many respects.
<dsmith>mark_weaver, I think that's a direct consequence of keeping it simple, yet powerful.
<mark_weaver>If you want to see a demonstration of how flexible scheme is, get a copy of "The Reasoned Schemer".
<CaptainLex>That's the companion book to the Problems book The Seasoned Schemer, yes?
<Nafai>I lean more towards wanting a static type system these days, so I prefer Haskell. But the simplicity of Scheme brings it a close second in my interest. But because of practicality and laziness, most of my coding is either Python, Shell Script, or Emacs Lisp.
<mark_weaver>it describes a very elegant logic programming system, without cuts, written in Scheme syntax. and at the end, the implementation of that language on top of scheme is written in just a few pages (the core of which fits on just one page)
<CaptainLex>Nafai: I too have a preference for static typing
<CaptainLex>mark_weaver: That sounds like a good read!
<mark_weaver>it's a beautiful book.
<mark_weaver>and yes, it's a companion book to the seasoned schemer in some ways.. same style, same artwork. but in some ways totally different because it's teaching almost a different language.
<mark_weaver>but it's not a different language. it can be freely mixed with more traditional scheme code.
<mark_weaver>it's really just a set of hygienic macros.
<mark_weaver>static typing can be done in the Scheme universe. Typed Racket shows one way to do it.
<mark_weaver>there's nothing that prevents it. A modern Scheme such as Guile or Racket allows that sort of thing to be added as libraries as well.
<mark_weaver>the main issue is that since Schemers are a small and fractured community, we have not made as much progress in these areas as has been done elsewhere.
<mark_weaver>in a sense, we are cursed by how easy it is to do all these things. so easy that instead of coming together around a single proposal, everyone does their own thing :)
<CaptainLex>Haha
<mark_weaver>As much as I like to draw people into the Guile fold, I must say that you should also take a look at Racket. Especially for those who like static type systems, and prefer more static languages in general, Racket might be more to your taste.
<mark_weaver>My preferences are more on the dynamic end of the spectrum, and that's part of the reason I prefer Guile. But Racket is a very beautiful and polished system.
<mark_weaver>as for why I prefer more dynamic languages, I'm reminded of some lines written by Alan Perlis in the Foreward of SICP: "Pascal is for building pyramids -- imposing, breathtaking, static structures built by armies pushing heavy blocks into place. Lisp is for building organisms -- imposing, breathtaking, dynamic structures built by squads fitting fluctuating myriads of simpler organisms into place."
<CaptainLex>Interesting. My bias against dynamic typing is mostly just based in experience with hippy-dippy languages like Python
<mark_weaver>Yeah, Python is a deeply flawed language.
<CaptainLex>:D
<CaptainLex>Remember how I said my Intro CSci class was in Scheme?
<CaptainLex>The university just replaced it with a Python-based classed. Luckily, Scheme is still in the required sequence, it's just not first
<mark_weaver>it's so sad that MIT's introductory computer programming course recently switched from SICP to a new course based on Python.
<CaptainLex>That is sad! That's even worse than it happening at my school!
<mark_weaver>Indeed. SICP's birth place has given in to the pressures of popularity.
<Nafai>Back when I was at university, it was C++, but I think they had switched to Java by the time I left.
<mark_weaver>Same here. C++, and Java after I left.
<Nafai>If you took the undergrad AI course from one of the profs, you had to learn CL, but others that taught it used Java. It was interesting how much more the CL-based class did than the Java class.
<Nafai>Scheme was briefly touched on in the PL class.
<Nafai>Sadly, that's all. :(
<Nafai>I'm interested in Guile as a Scheme implementation primarily because of the work bipt and others are doing about getting Emacs running with the Guile VM.
<mark_weaver>more than just the languages: I grew up surrounded by the "object-oriented programming" craze. I guess it never left. I'm proud to say that I *never* bought into the idea that everything should be written in that style. Some things, yes. But not everything.
<CaptainLex>I'm attracted to it by Guix and the Guile-scsh port
<mark_weaver>yeah, Guile-Emacs is going to be very exciting. I love emacs but I'd much rather write Scheme than elisp.
<CaptainLex>A lot of OOP philosophy really appeals to me, but it's just the spoonful of sugar to help the imperative go down
<mark_weaver>One of these days, I'd like to take a shot at writing a Haskell front end for Guile.
<Nafai>mark_weaver: that would be...intriguing
<mark_weaver>I think it's a fundamental mistake to trade pure information for smart objects that operate on themselves. Information is a far more flexible and powerful concept. Information can be copied, cached. You can copy information from one system to another. You can't really do that with objects. you can try to pretend, but it's smoke and mirrors.
<mark_weaver>consider this choice: would you rather have a book in plain text (or HTML) format, or a black box computer program that will read the book to you when asked?
<mark_weaver>the latter could do any number of things you don't want. it could report to its master when and how often you read the book.
<mark_weaver>it could refuse to read you the book.
<mark_weaver>it could read you the book slightly differently each time.
<mark_weaver>it could decide one day to demand payment in order to read the book.
<mark_weaver>from the point of view of a publisher, a black box that reads you the book is far more flexible.
<mark_weaver>from the point of view of the reader, pure information in a standard format is far more flexible and preferable.
<mark_weaver>having said all this, smart objects have their uses. I use them sometimes myself.
<Nafai>I've grown less a fan of OOP as the years go on.
<CaptainLex>OOP is a good way of organizing imperative code; I've been working with some code written by a programmer who got his degree in the '70s, and all the attributes associated with his characters (it's a game) are stored in a bunch of arrays :P
<mark_weaver>I agree that OOP makes sense for modelling reactive objects in games.
<mark_weaver>more generally, for modelling reactive physical objects.
<mark_weaver>modern GUIs fall into that category as well, since they try to mimic physical objects to some extent.
<Nafai>It's been way too long since I've written any code; I suppose I should find something to work on. :(
<mark_weaver>Nafai: have you done any fun work lately?
<Nafai>not really, I've been dealing with health issues
<mark_weaver>:-(
<Nafai>but I'm starting to get better, so I have more energy
<mark_weaver>I remember when I was 8 or 9 years old, in school, the teacher asked us all what we would want if we could have only one thing, or something to that effect. and everyone gave answers like "a race car" and stuff like that. and after we had all answered, the teacher gave her answer "my health".
<Nafai>yeah, you don't realize how important it is until you don't have it
<mark_weaver>that memory always stuck with me. I'm getting just old enough that I'm starting to really appreciate how important it is. more than anything else really.
<Nafai>I haven't had a job for almost 3 years now
<Nafai>mark_weaver: what do you do for your day job?
<mark_weaver>well, I'm glad to hear that you're starting to get better.
<Nafai>thanks.
<mark_weaver>I haven't had a paid job in about 12 years myself, but that's just because I decided a long time ago that I'd rather live 1 year in freedom than to live another 40 or 50 years following orders for most of my waking hours.
<mark_weaver>I've taken a stand against wage slavery.
<Nafai>I admit the prospect of going back to a "9-5" sounds somewhat unappealing to me
<mark_weaver>The last paid job I had was working for the Richard Stallman at the FSF. Before that, I was the second full-time programmer hired by Phil Zimmermann at PGP Inc.
<Nafai>wow, nice.
<Nafai>working for RMS would be...interesting.
<Nafai>even if you agreed with him ideologically
<mark_weaver>Most people say that, but he and I got along very well. I found him very inspirational to be around actually.
<Nafai>The one time I've seen him speak in person he was quite inspirational; he had quite the RDF. :)
<mark_weaver>RDF?
<Nafai>Reality Distortion Field; what people often attributed to Steve Jobs
<mark_weaver>ah right.
<mark_weaver>never heard that term applied to RMS though.
<CaptainLex>Haha
<CaptainLex>My prof (not the one I mentioned earlier) said rms spoke at the my uni a few years ago
<mark_weaver>I met Steve Jobs when I was 18. I was an early NeXT developer, and during the training course there was a dinner with him in attendance.
<CaptainLex>they took him out to dinner afterwards, and he brought his laptop
<mark_weaver>I was the youngest person there by far, and Steve Jobs was at another table with an empty chair next to him. The guys at my table put me to up go over at sit next to him, which I did.
<CaptainLex>Nice!
<mark_weaver>so I sat down and chatted him up for a little while. Everyone else at the table looked like high powered asian businessmen types. No one else said a word to me.
<mark_weaver>He said "This kid is only 18 years old! and then he said to me 'Make sure to get a girlfriend and get plenty of sex'".
<CaptainLex>That is such a Steve Jobs thing to say
<CaptainLex>(if Pirates of Silicon Valley didn't lie to me!)
<mark_weaver>he sent one of his employees over to offer me a job, but I was at university at the time and turned it down.
<mark_weaver>RMS brought his laptop. The Yeeloong I presume?
<CaptainLex>One would imagine.
<mark_weaver>did he work at his laptop at the restaurant?
<mark_weaver>(I'm trying to figure out why it was notable that he brought his laptop)
<CaptainLex>The story is told as though he did, since he was described as ignoring the staff, but it wasn't explicitly stated
<CaptainLex>The person I'd like to meet, though, is the Woz
<mark_weaver>Heh. Yeah, I have infinitely more respect for Wozniak than for Jobs.
<Nafai>me too
<mark_weaver>I had more respect for Jobs in earlier years, but my impression of him went way downhill during his second stint at
<mark_weaver>Apple.
<Nafai>he seemed hypocritical
<mark_weaver>(never as much as for Woz though)
<mark_weaver>I can't forgive Jobs for presiding over the policies surrounding the iPhone and iPad. Never before on a popular general purpose computing platform has the manufacturer claimed veto power over what programs you can run on your computer. Apple is on the leading edge of taking away the rights of computer users.
<CaptainLex>Steve Jobs had been going down that road for ages
<CaptainLex>I saw a NeXT computer promo video where he's like
<CaptainLex>"Today you need to check you email and browse the web; well, with a NeXT computer that's really simple!"
<mark_weaver>yeah, I guess he's always had that tendency.
<CaptainLex>And it's like "Steve Jobs, you make software. Own up to it and start letting it run on other hardware"
<CaptainLex>But I agree 100% about his iOS policies being untenable
<CaptainLex>It's basically the polar opposite of fsf
<mark_weaver>yeah, I don't think it's an exaggeration to say that in his later years he was the most powerful force against freedom for computer users in the world.
<mark_weaver>it's tragic that someone with such profound brilliance chose to use his gifts in that way.
<mark_weaver>and when I was a kid he was practically one of my heros.
<mark_weaver>*heroes
<CaptainLex>I will say I was glad he gave legitimacy to my distaste for Apple products
<CaptainLex>:(
<mark_weaver>well, it's well past time for me to sleep. nice chatting with you!
*mark_weaver --> zzz
<CaptainLex>It is bed-time also for me
<CaptainLex>Good night!
<civodul>Hello Guilers!
<ijp>morning
<nalaginrut>morning
<wingo>moin
<civodul>howdy wingo
<DerGuteMoritz>update on the chicken hacking event in cologne: http://lists.nongnu.org/archive/html/chicken-users/2013-04/msg00063.html
<civodul>DerGuteMoritz: nice post about 'match'!
<civodul>i discovered '=>' :-)
<fbs>where?
<DerGuteMoritz>civodul: hey, thank you :-)
<DerGuteMoritz>fbs: http://ceaude.twoticketsplease.de/articles/an-introduction-to-lispy-pattern-matching.html
<fbs>ah nice
<DerGuteMoritz>I even included Guile this time :-)
<DerGuteMoritz>mainly because I used geiser for constructing the examples during writing
<add^_>DerGuteMoritz: Nice :-D
<DerGuteMoritz>add^_: thanks
<CaptainLex>I'm writing a multithreaded recursive directory traverser in C for my operating systems class
<CaptainLex>And I wish I was doing it in Scheme :P
<CaptainLex>As it stands, I have to traverse each directory twice, the first time to the count the number of directories so I can correctly allocate the array I'd need to join the threads after they've all been spawned
<CaptainLex>If this were Scheme, I could just pop another tid onto a list every time I spawned one *rolls eyes*
<ijp>so make a C linked list type?
<CaptainLex>Oh man, wait. You're right. I mean, I knew about linked lists, but I didn't want to bother with the development overhead (done is better than perfect in this class, afterall)
<CaptainLex>But then I realized I'm already working in structs, so I just add a next pointer!
<CaptainLex>So thank you, ijp!
<ijp>no problem
<dsmith-work>Happy Friday, Guilers!!
<ijp>happy friday
<fbs>party!
<DerGuteMoritz>every C programm grows a hand-rolled linked list at some point!
<DerGuteMoritz>-m
*add^_ dances to the "music"
<DerGuteMoritz>oh yeah, happy friday!
<add^_>Happy Friday to you all!
<DerGuteMoritz>anyone in here intending to participate in http://lispinsmallprojects.org/?
<CaptainLex>Hmmmm
<CaptainLex>sound pretty interesting!
<DerGuteMoritz>yeah!
<CaptainLex>I think I will do that, as a matter of fact!
<DerGuteMoritz>we need to make sure Scheme isn't underrepresented :-)
<CaptainLex>Although I have been wanting to see about Android Clojure development
<DerGuteMoritz>still not there yet AFAIK
<DerGuteMoritz>the runtime generates too much garbage for dvm to cope or something
<CaptainLex>Mmmmm
<CaptainLex>Too bad
<CaptainLex>The Clojure GSoC page had an android project suggestion
<DerGuteMoritz>I'm fairly sure there will be an abundance of clojure projects in that contest
<DerGuteMoritz>so I will stick to Scheme there :-)
<dsmith-work>Hmm. They consider Scheme not a lisp
<ijp>ditto for clojure
<dsmith-work>Hmm. Maybe I reasd that wrong.
<CaptainLex>"Although Lisp is a philosophy, it's safe to stick with Common Lisp, Clojure/ClojureScript or Scheme."
<ijp>Oh, I was talking about CLers in general
<CaptainLex>Though they accurately identify Haskell, Erlang, and SmallTalk (???) as different languages
<dsmith-work>Nevermind
<DerGuteMoritz>ah, that old chestnut again :-)
<DerGuteMoritz>what is lisp? baby don't hurt me
<dsmith-work>I read a ',' after Scheme...
<dsmith-work>"Clojure/ClojureScript or Scheme. Haskell, Erlang and Smalltalk are NOT Lisps."
<CaptainLex>Hahaha oh my, that's a problematic misreading! :D
<fbs>is it normal for guile to just die if you write to a socket without connecting?
<fbs>scheme@(guile-user)> (define s (socket PF_INET SOCK_STREAM 0))
<fbs>scheme@(guile-user)> (display "test" s)
<ijp>no
<ijp>I get ERROR: In procedure fport_write: Broken pipe
<fbs>hmm
<ijp>which isn't great, but is better than silent death
<fbs>guile-1.8 also seems to do it
<fbs>would it be guile, or some c lib?
<ijp>I dunno, did you build with networking disabled?
<fbs>networkign works fine
<ijp>(or your distro)
<fbs>i can connect to netcat
<add^_>fbs, apparently I have the same problem when I run that..
<fbs>i first had (if (connected? x) (do connect stuff, set connected?)) and couldnt figure out why my code just died
<fbs>thats how i foudn the 'bug'
<fbs>(and having mega lag)
<add^_>I don't understand why ijp get an error message while we don't
<fbs>i think its also doing that in c
<ijp>guile from source? from a distro? which distro?
<add^_>stable-2.0 git
<add^_>2.0.9.6-e006d
<fbs>2.0.9 tag from the repo on debian mixed
<add^_>ubuntu 12.04 both 32bit and 64bit (Got the same problem on both)
<ijp>well, I'm currently on a branch off of master, so maybe it is fixed on one and not the other, but I find it hard to believe
<dsmith-work>What would you expect to happen when trying to write to an unconencted socket? C or Scheme?
<add^_>An error?
<fbs>this c code i have here seems to die the same way as guile, while it should produce a 'error writing to socket'
<fbs> http://s.drk.sc/QHbPJM
<fbs>if i start netcat it works fine, and with the error it give a connection refused. but without both i just stops without segv
<fbs>add^_: can you try http://s.drk.sc/QHbPJM
<add^_>What are you expecting?
*add^_ reads the code
<fbs>to die without error when you dont have 'nc -l port'
<add^_>Then your expections are met
<fbs>so its the same bug
<fbs>and not guile related
<add^_>eerr
<add^_>Wait a moment
<add^_>Without nc -l port it crashes, that's what you thought right?
<add^_>wanted*
<fbs>yea
<add^_>ok
<add^_>Then we know
<fbs>the code does n=write..., if (n<0) error("ERROR writing to socket");
<add^_>I got confused
<fbs>but I dont get the error
<add^_>Nope
<fbs>guess it works fine on ijps system
<add^_>yeah
<ijp>ERROR writing to socket: Broken pipe
<fbs>:)
<add^_>heh
<fbs>where do i check for bugreport on this?
<ijp>good question
<ijp>stack overflow?
<ijp>(that was a reference to http://stackoverflow.com/questions/14495636/strange-multiplication-behavior-in-guile-scheme-interpreter )
<fbs>ijp: whats your glibc version?
<fbs>strace gives me the broken pipe stuff
<fbs>--- SIGPIPE (Broken pipe) @ 0 (0) ---
<fbs>+++ killed by SIGPIPE +++
<dsmith-work>EPIPE fd is connected to a pipe or socket whose reading end is closed. When this happens the writing process will also receive a SIGPIPE signal. (Thus, the write return value is seen only if the program catches, blocks or ignores this signal.)
<dsmith-work>
<add^_>oh
<dsmith-work>From the write(2) manpage
<mark_weaver>To handle this more gracefully, do: (sigaction SIGPIPE SIG_IGN)
<mark_weaver>that's already done in a couple of places in the tree, e.g. in 'http-open' of (web server http) and 'run-server' of (system repl server)
<ijp>fbs: 2.14.90
<fbs>hmm that seems to wokr mark_weaver
<mark_weaver>it is well documented that SIGPIPE will be sent to a process that tries to write to a pipe or socket whose reading end is closed.
<mark_weaver>so if you don't install a signal handler (to configure it to ignore the signal), then it'll die.
<mark_weaver>s/to/or/
<fbs>so some default somewhere changed which causes different behaviour?
<cordawyn>hello, guilers!
<cordawyn>I have to create a hash table where I can supply a compare-proc and hash-proc
<cordawyn>I can see that Guile can create a hash table with "fixed" (default) compare-proc only
<cordawyn>that is, I cannot specify my own
<cordawyn>there's however "make-hashtable" in R6RS that seems just the thing I need
<cordawyn>perhaps, there's some undocumented API for that in Guile? ;-)
<cordawyn>(R6RS: "make-hashtable hash-function equiv")
<ijp>a lot of the time, I just use r6rs hashtables anyway, since I find the api nicer
<cordawyn>ok, perhaps I'll have to go with that as well
<ijp>srfi 69 does it like this as well, I think
<ijp>let's see
<ijp>hashx-ref
<ijp>that takes a hash function, and an equality function
<ijp>quite ugly, but that seems to be what srfi 69, and thus (rnrs hashtables) are using under the hood
<mark_weaver>fbs: on my system, guile from git master behaves the same way. I'm not sure why it's different for ijp. maybe he's doing something in his .guile that sets the SIGPIPE signal handler or something.
<ijp>it happens for fbs's C example too
<cordawyn>isn't "hashx-ref" a key look-up function?
<ijp>cordawyn: there are a set of procedures with hashx- as a prefix, they should all take those extra arguments
<mark_weaver>I agree that the R6RS hash table API is nicer.
<ijp>mark_weaver: twice the overhead though :/
<ijp>some person who uses this all the time should really fix that
<mark_weaver>the old Guile hash tables work differently: you specify the equality function hash predicate on every lookup. they are not properties of the hash table itself.
*ijp looks from side to side
<ijp>used to be those procedures worked on vectors too
<mark_weaver>s/equality function hash predicate/equality predicate and hash function/
<cordawyn>mark_weaver: apparently, this is what hashx-ref does. Quite unexpected API
<cordawyn>for me, that is ;)
<mark_weaver>yeah, I agree that it's not very nice. as ijp said, they used to work on bare vectors too.
<mark_weaver>they can only work on bare vectors if you provide the predicate every time.
<mark_weaver>it's not nice, but it's historical baggage.. the good news is that guile has other hash table APIs as well, and you're encouraged to use them. no reason to use the old historical stuff.
<mark_weaver>R6RS and SRFI 69 are both good choices.
<cordawyn>I've been reading the docs no them, but as I said, none seems to provide API where I can specify equiv and hash procs
<cordawyn>except R6RS
<mark_weaver>so use R6RS
<cordawyn>I think I can bear the overhead for now, if that's an issue with R6RS as you say
<cordawyn>perhaps once I'm better at Guile, will contribute improved hashtable API ;-)
<mark_weaver>do you have an idea that's better than the R6RS hash table API?
<ijp>like I say, srfi 69 works this way too
<ijp>(rnrs hashtables) is mostly a wrapper of that
<ijp>some of the code in srfi-69.scm is quite silly
<cordawyn>ijp: if you're suggesting hashx-ref, then I'll have to refactor quite a bunch of code here. I'd rather keep the noise to a minimum.
<ijp>I am not talking about hashx-ref
<ijp>I am talking about srfi 69 hashtables
<cordawyn>oh, sorry
<cordawyn>let me look it up
<mark_weaver>cordawyn: http://srfi.schemers.org/srfi-69/srfi-69.html
<mark_weaver>in SRFI-69, 'make-hash-table' takes as optional arguments the equality predicate and hash function.
<cordawyn>cool! Looks good enough
<mark_weaver>so just (use-modules (srfi srfi-69)) and then you'll be using the nicer SRFI-69 API.
<mark_weaver>(or #:use-module (srfi srfi-69) from within a 'define-module' form)
<cordawyn>right
<cordawyn>thanks, guys!
<mark_weaver>you're welcome!
<cordawyn>I probably missed SRFI-69, because "Hash Tables" chapter doesn't mention it.
<mark_weaver>we might want to consider making SRFI-69 and/or R6RS hash tables more prominent in the manual, similarly to how we make SRFI-9 more prominent.
<ijp>mark_weaver: did you have a look at that ibm problem I posted?
<mark_weaver>cordawyn: yeah, sorry about that. I think we need to update our manual to deemphasize some of these older historical APIs and point people to the newer ones.
<cordawyn>so much references to look-up for every single feature ;-)
<mark_weaver>ijp: yes, I wrote a program to find all the solutions and sent it in.
<ijp>program?
<ijp>I did it on paper
<mark_weaver>sure, I could have done that. but I wanted to find all the solutions, not just one :)
<ijp>though I caved after one :)
<mark_weaver>caved after one? what do you mean?
<ijp>I mean, I could have went for more, but I was satisfied
<mark_weaver>well, there were 840 of them :)
<ijp>let's see if I can find the piece of paper I wrote it on...
<mark_weaver>well, if you discount the trivial reorderings of the terms, I guess only 70
<ijp>okay found it
<ijp>anyway, my name is up on their site now, so I am using that to annoy the person on #emacs who pointed me to the problem in the first place :)
***fangism-hongry is now known as fangism
<Nafai>afternoon
<mark_weaver>Hi Nafai!
<mark_weaver>things are pretty crazy over here in boston town now.
<mark_weaver>last night an MIT police officer was shot and killed by one of two people presumed to be responsible for the bombing.
<mark_weaver>(based on video footage of them before the bombings)
<mark_weaver>and since early this morning, several towns in this area have been locked down. everyone is told to stay at home. one of the suspects is dead and there's a massive man hunt for the other one, who is thought to be trapped within an enclosed area right now.
<add^_>:-/
<mark_weaver> http://www.bostonglobe.com/metro/2013/04/18/mit-police-officer-hit-gunfire-cambridge-police-dispatcher-says/4UeCClOVeLr8PHLvDa99zK/story.html
<CaptainLex>mark_weaver: I didn't know you were in Boston! I heard about how intense it was over there.
<mark_weaver>I'm a volunteer at MIT's radio station, which is only a few hundred yards from where the shooting took place.
<mark_weaver>I left the radio station less than an hour before all hell broke loose.
<ijp`>“This kid is obviously going down fighting,” the official said. “You can rest assured the cops are looking for a fight right now.”. That's a curious way of putting it
<mark_weaver>the MIT police officer was shot just outside the building that RMS's MIT office is in.
***ijp` is now known as ijp
<Nafai>mark_weaver: sure sounds scary over there :(
<mark_weaver>here's a dumb headline: "It doesn’t matter why they hate us, they just do".
<mark_weaver>of course it freaking matters why!
<DerGuteMoritz>and "us", yeah ;-)
<CaptainLex>Hahahah
<ijp>they hate our freedoms, _obviously_
<DerGuteMoritz>glad to hear you're fine mark_weaver
<Nafai>and all we stand for!
<DerGuteMoritz>Freedom [tm]
<mark_weaver>let's not think, let's just bomb the country they came from. that's the time honored US solution.
<mark_weaver>which in this case is Chechnya, as if they weren't having enough problems already.
<CaptainLex>So I have a Guiley question. Why does it give me these weak warnings where other languages would give compiler errors? e.g. "possibly unbound variable"
<CaptainLex>Not complaining, just wondering
<mark_weaver>because it's a dynamic system. the variable might exist by the time the code is executed.
<ijp>CaptainLex: suppose the variable were defined in C?
<CaptainLex>Mmmmmmm
<CaptainLex>This makes much sense
<CaptainLex>And is a little terrifying :P
<mark_weaver>there's more than one way to define a variable. you can do it with a standard 'define'. or you can use something more low level like 'module-add!'.
<mark_weaver>'define' is something the compiler can see for sure. but it's less flexible. 'module-add!' could be executed from anywhere at any time.
<ijp>CaptainLex: as a fully-paid up member of the League for Static Scoping, I generally agree, but it is somewhat necessary here
<ijp>(League may not actually exist, terms and conditions apply)
<mark_weaver>obviously it's best to avoid the low-level ways of mucking with modules whenever possible, but sometimes those low-level interfaces allow you to do things that would otherwise be impossible.
<mark_weaver>even Haskell has back doors like unsafePerformIO
<CaptainLex>Time for work!
<CaptainLex>Stay safe, mark_weaver!
<CaptainLex>And everyone else, of course!
<mark_weaver>okay, happy hacking!
<mark_weaver>though I'm about to return to the radio station at MIT to air the news.
<mark_weaver>and maybe Democracy Now if no one else shows up after me.
*ijp goes back to debugging the lua parser
<ijp>ech, I'm an idiot
<ijp>this parser just doesn't fit in with guile's conventions at all
<mark_weaver>which conventions do you mean?
<ijp>the compiler expects to be able to repeatedly call the appropriate read function, eventually getting an eof
<mark_weaver>and how does the read procedure violate that?
<ijp>it always returns a (possibly empty) sequence
<mark_weaver>so it always reads the entire file?
<ijp>yes
<ijp>now, I thought I had fixed that
<ijp>but I was having some problems
<ijp>turns out, the parser is created afresh on each call to read-lua, which means any any lookahead state is lost, and I can't turn back the lexer
<ijp>so, now I need to fix that
<mark_weaver>an easy fix might be to use 'unread-char' or 'unread-string'.
<ijp>well, the lexer isn't the problem, it's the parser
<mark_weaver>also, if it's more convenient, it might be okay to have it always return an entire sequence.. as long as it returns EOF on the next call.
<mark_weaver>and as long as the compiler expects the entire sequence.
<ijp>mark_weaver: that doesn't work out nicely at the repl
<mark_weaver>ah, true.
<ijp>so, I'll need to add unread functionality to the lexer, and then use it in the parser
<mark_weaver>hmm.. that sounds kind of gross.
<mark_weaver>you'll lose source location information as well.
<mark_weaver>also, I'm not sure that will work well at the repl either.
<mark_weaver>you can't very well have it wait for the first token on the next line that you haven't typed yet.
<ijp>the other thing would be to add this state into 'read-lua', but that sounds gross to me too
<ijp>since calling read-lua on two different ports would then have silly effects
<mark_weaver>I don't know enough about the syntax of lua to know whether this token lookahead is truly needed.
<Nafai>ijp: you're writing a lua front-end for Guile?
<mark_weaver>before you even consider storing the lookahead information anywhere, we need to evaluate this question:
<ijp>Nafai: no, I am fixing a lua front-end for guile
<mark_weaver>if it needs to lookahead one full token, then how can this possibly work at the REPL?
<ijp>mark_weaver: well, like js there is a terminator
<ijp>so you can stop when you get a semicolon
<mark_weaver>so at the REPL you need to type semicolon, but in a file you don't have to?
<ijp>well, you can have them in files, but it's not normal style
<ijp>(as far as I know)
<mark_weaver>what happens if you don't type a semicolon in the REPL?
<mark_weaver>(at the lua repl)
<ijp>nothing
<mark_weaver>does it wait for more tokens on a continuation line before evaluating?
<ijp>yes
<mark_weaver>okay, then I think maybe the right approach is to return from the reader only when you see a semicolon at the toplevel expression.
<mark_weaver>basically, read-lua should return however much would be read at the repl before evaluating.
<mark_weaver>(I think)
<mark_weaver>so in general, that might be more than one top-level expression, so it should always return a sequence.
<mark_weaver>and the compiler should expect that.
<mark_weaver>(i.e. the compiler accepts sequences, not single expressions)
<mark_weaver>does that make sense?
<mark_weaver>the repl is the most constraining case, so we need to decide behavior based on that. and clearly, one 'read-lua' call should correspond to one REPL prompt.
<ijp>can we have separate readers for files and the repl? this would greatly simplify things
<mark_weaver>what would it simplify? why wouldn't the repl reader work on files?
<ijp>mark_weaver: because otherwise we are saying that all lua top level expressions should end with semi-colons
<ijp>and they don't
<mark_weaver>that's not what I'm saying.
<mark_weaver>I'm saying that if a top level expression does not end with a semi-colon, then multiple top-level expressions will be returned by a single call to 'read-lua'.
<mark_weaver>it sounds like that's what happens at the lua repl, right?
<mark_weaver>at a lua repl, what happens if you type multiple expressions on multiple lines, without semicolons?
<ijp>some strange error
<mark_weaver>what's an example of a lua expression that can be typed at the repl?
<mark_weaver>(I want to try it myself)
<ijp>anyway, I think I get what you mean
<mark_weaver>for me, typing "print 'Hello World!'" is evaluated after pressing return, even without a semicolon.
<ijp>in guile?
<mark_weaver>no, in lua 5.2.1
<ijp>oh right, yeah
<mark_weaver>what's an example of multi-line input that gives the "strange error" ?
<ijp>well, I'm not quite sure what to tell you, because my repo is in a very dirty state
<mark_weaver>my questions are about the behavior of the non-guile lua.
<ijp>okay, then I have no issue with that
<mark_weaver>I'm having trouble getting the information I need here, so I'm going to stop trying. I don't know if the advice I've given is appropriate or not. good luck.
<mark_weaver>apologies if I've been annoying.. just trying to help.