IRC channel logs

2013-03-29.log

back to list of logs

<jaaso>I think gdk module name is (gnome gw gdk)
<jaaso>Oh my bad, all gdk function is available without importing (gnome gdk)
*civodul aims for +2 green on Hydra
<Chaos`Eternal>greetings
<Chaos`Eternal>I have a problem about command line options,
<Chaos`Eternal>I have a list like this, ((info) (title "helloworld") (some thing_else))
<Chaos`Eternal>and I want to generate cmdline options like this: --info --title=helloworld --some=thing_else
<Chaos`Eternal>does guile already have such libs?
<mark_weaver>Chaos`Eternal: it's trivial. I'd use (ice-9 match) to match the elements of your list, and do something like: (map (lambda (elem) (match elem ((key) (format #t "--~a" key)) ((key val) (format #t "--~a=~a" key val)))) lst)
<mark_weaver>sorry, those #t args to format should be #f
<mark_weaver>e.g. (map (lambda (elem) (match elem ((key) (format #f "--~a" key)) ((key val) (format #f "--~a=~a" key val)))) '((info) (title "helloworld") (some thing_else))) => ("--info" "--title=helloworld" "--some=thing_else")
<mark_weaver>and then use 'system*' to run the command, so that you don't have to worry about escaping shell metacharacters.
<mark_weaver>or 'open-pipe*' from (ice-9 popen)
<Chaos`Eternal>great!
<mark_weaver>:)
<Chaos`Eternal>i will use scsh syntaxes
<Chaos`Eternal>thanks a lot
<mark_weaver>you're welcome. happy hacking!
<nalaginrut>morning guilers~
<mark_weaver>hi nalaginrut!
<nalaginrut>mark_weaver: heya~
<nalaginrut>mark_weaver: as my research, your online time is 20+ hours on average, so any newcomer could call you 'bot' ;-D
<Chaos`Eternal>will guile support python-style HERE-STRING ?
<mark_weaver>hehe
<Chaos`Eternal>for example, """ a string don't need to escape " would be more easier to use"""
<mark_weaver>Chaos`Eternal: sorry, we don't have such a thing.
<Chaos`Eternal>sure, we don't have it now
<Chaos`Eternal>i just ask: will we have?
<mark_weaver>I don't know, why don't you post about it to guile-devel? I wouldn't be opposed to such a thing.
<mark_weaver>note that Guile's reader is extensible, so you could add such a syntax yourself.
<mark_weaver>see 'read-hash-extend' in the manual
<mark_weaver>but admittedly it would be much more convenient if it were built-in by default.
<mark_weaver>the thing is, we don't usually try to find better solutions than embedding large strings within the source code. for example, for generating HTML templates, we use SXML.
<mark_weaver>s/we don't usually/we usually/
<mark_weaver>I suspect that's the main reason there hasn't been a lot of pressure to add such a thing.
<mark_weaver>Chaos`Eternal: out of curiosity, what were you planning to use a HERE-STRING for?
<Chaos`Eternal>embed SQL
<mark_weaver>have you looked as SSQL? http://www.more-magic.net/posts/lispy-dsl-ssql.html
<Chaos`Eternal>hmm, slightly different
<mark_weaver>admittedly, we don't yet have such a thing implemented, but I think that's a better solution to work toward.
<Chaos`Eternal>my job is test performance of SQLs which written by my customers, from oracle, db2 etc
<mark_weaver>composing SQL as strings has many problems and potential security holes.
<Chaos`Eternal>so, i need to copy and paste them
<mark_weaver>*nod*
<Chaos`Eternal>that's different life
<Chaos`Eternal>I hate the SQLs they write...
<Chaos`Eternal>ugly, unclean, and hard to maintain
<Chaos`Eternal>but i need to live with them
<mark_weaver>understood.
<mark_weaver>how bad would it be to put the SQL code in a separate file from your Guile source code?
<Chaos`Eternal>I use scsh scripts to automate the test process
<Chaos`Eternal>and using separate file makes the script more complex to maintain
<Chaos`Eternal>my life is now looks like this:
<cky>I think it'd be fun to write a new reader entirely. :-P
<Chaos`Eternal>(psql "some SQL ")
<cky>I want to write one just for the lulz.
<Chaos`Eternal>and psql is (define (psql sql) (run (psql) (<< ,sql)))
<Chaos`Eternal>scsh style
<mark_weaver>I agree that a HERE-STRING feature would be useful, but in the meantime, I'm not sure why it would be problematic to define a little procedure that reads a file with SQL snippets along with the name of the database to pass them to (possibly along with some parameters). seems like it would be pretty straightforward.
<mark_weaver>the syntax could be as simple as: use 'read-line' to read one line at a time from a file. lines beginning with ==== are header lines that describe what procedure to call and the initial arguments. and then everything that follows until the next ==== line is the string that gets passed as the last argument.
<mark_weaver>it would be super easy to write such a procedure.
<nalaginrut>for SQL, I have my own way to handle it, rather than cook any string https://github.com/NalaGinrut/artanis/blob/master/artanis/ssql.scm
<nalaginrut>And IMO, users should never face SQL/SSQL in any time, there should be an ORM or FPRM(I'm designing it)
<mark_weaver>alternatively, you could use 'read-hash-extend' to extend Guile's reader, and then use that custom syntax in your code.. but you'd have to install the extension before loading your code.
<nalaginrut>SQL thing should be kept low-level, to avoid some security issue
<mark_weaver>nalaginrut: nice! although this won't help Chaos`Eternal because he's been given by the SQL code (as a string) by someone else.
<nalaginrut>well, I see~
<Chaos`Eternal>the ssql is great!
<Chaos`Eternal>i must admit
<nalaginrut>;-) but you'll never use it directly, unless been a developer of it
<mark_weaver>nalaginrut: but I agree wholeheartedly that SQL should be a low-level detail. user code should deal with higher-level data structures like SXML or SSQL.
<nalaginrut>you should is CLASS or closure to handle a table or database things
<Chaos`Eternal>nalaginrut, will you develop a orm like SQLAlchemy ?
<nalaginrut>s/should/need
<nalaginrut>Chaos`Eternal: I'll write an ORM, it's in my TODO, but lispy guys may like a FPRM which is not anywhere but in my mind
<nalaginrut>so I'm dealing with FPRM
<nalaginrut>but ORM also need, could be an alternative
<Chaos`Eternal>any released files?
<nalaginrut>both will appear in Artanis
<nalaginrut>it's in progress
<nalaginrut>no release, since SSQL is the prerequisite for them all
<nalaginrut>I'm working on SSQL
<nalaginrut>mark_weaver: but for ORM, I wonder how many guys willing to use GOOPS...lispers seems don't like OO, let alone Guile specific GOOPS...
<mark_weaver>Chaos`Eternal: I'm cooking up a little code for you to add python-style here-strings to the guile reader
<nalaginrut>ah~that's cool
<nalaginrut>besides, I found 'format' in Guile is very powerful
<Chaos`Eternal>mark_weaver, what would be great!
<Chaos`Eternal>mark_weaver, what would be great!
<Chaos`Eternal>mark_weaver, what would be great!
<Chaos`Eternal>many thanks
<Chaos`Eternal>sorry for repeating...
<cky>Wow, that's the first time I've seen someone from 1.0.0.0/8.
<cky>Impressive!
<mark_weaver>Chaos`Eternal: http://codepad.org/KRe0Vhx1
<mark_weaver>Chaos`Eternal: just load that module, and then your reader will support #"""here-string""" syntax
<mark_weaver>(you must put # immediately before the initial """)
<mark_weaver>any code you load or compile after loading that module will support that syntax
<Chaos`Eternal>i can't express my thanks to you
<Chaos`Eternal>greaaaaaat
<mark_weaver>Chaos`Eternal: :)
<Chaos`Eternal>i will merge that into guile-scsh
<wigs>cky: oh right, thats me
<wigs>apparently that means I am should be located in asia–pacific region, which is accurate :-)
<mark_weaver>note that everything between the two """ delimiters will be taken literally. that module doesn't support any escapes whatsoever. though it could be easily extended in that direction if desired.
<mark_weaver>Chaos`Eternal: ^
<mark_weaver>I've forgotten the details of Python """ syntax.
<nalaginrut>wigs: I wrote my style SSQL with macro, covers most of SQLs now, but for FPRM, I have no any clue...
<Chaos`Eternal>let me check
<wigs>nalaginrut: what is FPRM?
<nalaginrut>wigs: well, a concept of replace OO to FP way in RM
<Chaos`Eternal>mark_weaver, in python's """ , escape is still effective
<mark_weaver>Chaos`Eternal: if you want escapes, they can be added by adding another clause to the 'match'. just remember that 'chars' will be the most recently read chars in reverse.
<mark_weaver>if you have a particular escape that you want, I can add support for it to show you the idea.
<mark_weaver>but in this SQL case, I'd guess that you want to avoid escapes so that you don't have to worry about the possibility of the SQL code containing such an escape.
<Chaos`Eternal>just special chars sequence, like
<Chaos`Eternal>\\t \\r
<Chaos`Eternal>\\n
<Chaos`Eternal>\\0
<Chaos`Eternal>hmm
<mark_weaver>do you actually want that for this SQL thing?
<Chaos`Eternal>but no escaping is ok for sql
<Chaos`Eternal>enough for me now
<Chaos`Eternal>i will try to understand your code first
<Chaos`Eternal>thanks again
<mark_weaver>Chaos`Eternal: here's a version that supports the escapes you listed (\\t, \\r, \\n, \\0), to give you an idea of how to do it: http://codepad.org/vBlo3jEN
<mark_weaver>Chaos`Eternal: but again, for the SQL thing you probably want no escapes.
<mark_weaver>I'm sure this code could be made more elegant, but I didn't spend much time trying to make it so.
<nalaginrut>mark_weaver: is there any possible to keep src-code in the *.go, so that people can read the src in the REPL?
<nalaginrut>of course, it could be stripped
<Chaos`Eternal>mark_weaver, great
<nalaginrut>mark_weaver: just like R
<cky>nalaginrut: You probably don't want to really hold on to the source, but rather just the filename and line/col information.
<wigs>(and last-modified time)
<nalaginrut>cky: yes, it's an idea, but if just keep the filename and line/col, sometimes we just have *.go files without any *.scm
<cky>wigs: Well, that's already done.
<cky>wigs: .go files are subject to a staleness check when loaded.
<wigs>oh yes :-)
<nalaginrut>hmm...maybe it's not a problem, if there's no src-file, it doen't show the src, well, nice idea
<mark_weaver>I guess the filename/line/col information is already stored in the .go file, or else the backtraces wouldn't be able to show that information.
<mark_weaver>and with that information, you can extract the source code from the source file.
<nalaginrut>a new question, I can confirm the begin of the function in src file, but how to confirm the end?
<mark_weaver>I don't know off-hand how to do it. I'd have to look into it. wingo would probably know off the top of his head, since he wrote most of that stuff.
<mark_weaver>nalaginrut: why not just use 'read'?
<wigs>indeed
<wigs>‘read’ will leave the port position just after the expression ends
<nalaginrut>mark_weaver: seems a cool idea too, I'll try a prototype
<mark_weaver>nalaginrut: cool!
<nalaginrut>yes, read then pretty-print, it's amazing result!
<wigs>nalaginrut: close enough, but will lose comments
<mark_weaver>well, actually I would recommend showing the raw characters from the file.. and use 'read' only to find the end.
<nalaginrut>maybe there's some hook for read to keep comments?
<mark_weaver>no, but even if there was, there's plenty of other information that would get lost.
<nalaginrut>read could be used to show the code only
<mark_weaver>pretty-print is not as good as a human at choosing a good format.
<cky>wigs: I dare say comments are unimportant, since Guile uses docstrings not doc comments.
<mark_weaver>also, if the code uses something like curly-infix, that will get lost.
<mark_weaver>cky: I'm stunned by that statement.
<cky>mark_weaver: Well, comments are useful, yes, but for a "print source of this function", surely it can't be that big of a deal.
<cky>Who knows. Maybe write a custom reader that creates comment nodes (a la XML) when comments are encountered.
<nalaginrut>well, I checked out R, seems it don't provide comments
<cky>Of course, unlike XML, Scheme has three kinds of comments.
<nalaginrut>and yes, I think docstring is enough for Scheme, especially enough for guile
<mark_weaver>nalaginrut: anyway, I'd much rather have something that hooks into emacs and has it open the right source file and leave my cursor at the procedure.
<mark_weaver>nalaginrut: but I know that you prefer to find solutions outside of emacs.
<cky>And Guile has a fourth kind (#! !#).
<nalaginrut>mark_weaver: well, emacs hack out of my idea, I'm not so familiar with emacs program
<nalaginrut>seems I've been a REPL fans ;-P
<wigs>nalaginrut: I think you would have fun writing a super-repl for guile
<wigs>ala. ipython or drracket
<mark_weaver>Geiser already has all the needed infrastructure. It would be very helpful to extend it in this way.
<nalaginrut>hah~I do really want a super-repl, but Guile's REPL is cool, I think it's no need to write a new one
<nalaginrut>mark_weaver: yes, I agree with Geiser, but I'm not familiar with Emacs programming
<mark_weaver>*nod*
<nalaginrut>and most of time, I try my idea in REPL, but paint my art in Emacs
<mark_weaver>I never learned elisp very much either. I'm waiting for guile-emacs to mature :)
<nalaginrut>me too
<wigs>oh
<nalaginrut>well, back to my question, do you guys think the src in REPL without comments is cool?
<mark_weaver>I'd much prefer to see the contents of the original string in the source file.
<wigs>indeed
<wigs>and its not at all difficult to do
<nalaginrut>(module-filename (current-module)) ==> #f hmm...
<nalaginrut>how can I get filename col/row of a function?
<wigs>nalaginrut: look up how the backtrace does it
<mark_weaver>I want to see the comments, and the programmer-chosen indentation, and, if curly-infix (or sweet expressions or custom read syntax) is used, I want to see what the programmer thought was the best presentation.
<wigs>mark_weaver: right, otherwise its not really the _source_ but some pre-parsed, re-formatted interpretation of that
<mark_weaver>nalaginrut: ask wingo :)
<cky>Fair enough.
<cky>If the starting column is non-zero, you'll have to left-fill the first line. ;-)
<mark_weaver>I could figure it out, but it's more efficient to just ask wingo :)
<cky>Otherwise, things won't line up, and we can't have that. ;-)
<nalaginrut>no matter read way or get string from src-file way, both could be provided
<wigs>cky: I would go the other way
<nalaginrut>add an option is OK
<nalaginrut>but I'll find how the get the src info first...
*nalaginrut reading backtrace...
<wigs>de-fill the remaining lines _maybe_
<wigs>cky: mark_weaver: congrats on recent srfi-41 merge
<wigs>its been, too long
<mark_weaver>wigs: the problem with the other way is that there might actually be non-spaces in the columns to the left.. if there's an embedded string, or some fancy syntax (e.g. sweet expressions)
<cky>wigs: Thanks!
<wigs>mark_weaver: true
<wigs>last minute changes are probably right, imo
<mark_weaver>wigs: thanks. I've long wanted srfi-41. cky did most of the work of course :)
<wigs>^ srfi-41
<mark_weaver>nalaginrut: also, you'd probably want to keep all of the comments preceeding the actual procedure.
<cky>mark_weaver: What if it's the first procedure and you're getting all the legalese boilerplate above? ;-)
<wigs>hm
<mark_weaver>cky: heh. well, it's messy, I admit.
<mark_weaver>this is why opening the file in an editor is nicer.
<mark_weaver>I don't know, just an idea.
<cky>Yeah.
<mark_weaver>in any proper scheme module, there's a module declaration below the boilerplate.
<mark_weaver>but admittedly sometimes there is a huge comment within a file that doesn't directly relate to the procedure below it.
<cky>Yeah.
<nalaginrut>mark_weaver: keep all of the comments maybe little hard, how to parse it?
<nalaginrut>some comments may have newline include
<cky>I think getting the comments _above_ the procedure is tricky. But getting the comments inside the procedure is doable.
<cky>After all, you're just getting the starting position, doing a read to ascertain the ending position, and grabbing everything in between.
<mark_weaver>nalaginrut: the easy way would be to 'read' the file from the beginning until you found a datum whose source location information matches the procedure you're looking for (or below it). then start from the position of the file before you did that 'read'.
<cky>True, that.
<nalaginrut>ok, that's cool, but I'll find a way to implement read way prototype first
<mark_weaver>'read' always stops immediately after the end of the thing you read. the whitespace and comments between two datums is read by the latter 'read'.
<mark_weaver>note that there's a complication when the procedure in question was not defined at top-level.
<nalaginrut>there's less docstring in system vm code, so I have to read the src
<mark_weaver>so in general, you may have to look at the source location information of sublists within a top-level datum.
<nalaginrut>program-sources for any given symbo is '()
<mark_weaver>a procedure might even be some 'lambda' within a larger expression, and in that case it may be more helpful to see the full context. (another reason why I'd rather it open it in emacs :)
<nalaginrut>is the a wrong way? I need to get source, and there're source:file source:row
<nalaginrut>how to get source?
<mark_weaver>nalaginrut: that's right. we can't record source location information for any symbol or immediate value.
<nalaginrut>so what's the right way to get the 'source'?
<mark_weaver>nalaginrut: we record source location information for all non-immediate datums however, including lists.
<nalaginrut>the procedure 'read' is non-immediate I think
<nalaginrut>(program-sources read) ==> '()
<mark_weaver>read is defined in C code.
<mark_weaver>try it on a procedure defined in Scheme.
<mark_weaver>(it would be nice if we recorded source location information of procedures defined in C code using our snarfing macros, but currently that's not implemented)
<nalaginrut>oh~nice
<mark_weaver>ideally, geiser would be able to send us to the source code of any procedure, like emacs can do.
<nalaginrut>but program-sources seems returned all the positions appeared the proc
<mark_weaver>I'd *really* like that.
<mark_weaver>nalaginrut: I don't understand that sentence.
<nalaginrut>(program-sources read-line) returned many things
<nalaginrut>read-line in (ice-9 rdelim)
<nalaginrut>how can I confirm which is the definition of it
<mark_weaver>nalaginrut: you want the first one.
<mark_weaver>nalaginrut: that's a list of mappings between the offset in the VM bytecode and the associated line/col in the file
<mark_weaver>e.g. (source:line (car (program-sources read-line)))
<mark_weaver>I confess that I'm making some guesses here. wingo is the person to ask.
<mark_weaver>I don't have time to research this myself.
<Chaos`Eternal>mark_weaver, I have tried your code, it works fine.
<Chaos`Eternal>and I want to put them in my guile-scsh code,
<Chaos`Eternal>shall I use GPLv3 ?
<Chaos`Eternal>and shall I name you as author?
<mark_weaver>Chaos`Eternal: I consider that code too trivial to care what happens to it, but I hope you will use either GPLv3 or LGPLv3 for your code.
<mark_weaver>GPLv3 is certainly preferable for most code, IMO.
<Chaos`Eternal> https://gitorious.org/guile-scsh/guile-scsh/blobs/master/scsh/here-strings.scm
<Chaos`Eternal>there it is
<mark_weaver>Chaos`Eternal: I'm afraid that code has a bug. it'll turn \\\\n into \\n and then into newline.
<Chaos`Eternal>really....
<mark_weaver>the simple matching logic doesn't gracefully handle the case where an escape can produce one of the components of an escape sequence.
<ijp>is it just me or has scsh been a coder trap? :P
<ijp>seems someone gets sucked into it every few years, and we don't hear from them again
<ijp>(also, good morning)
<mark_weaver>more generally, it seems to me that the value of a special """ syntax to avoid escaping " is undermined somewhat by having to escape \\
<mark_weaver>hi ijp
<mark_weaver>granted, it seems to be popular in the python world.
<cky>Maybe we want Perl-style here-docs. :-P
<mark_weaver>but if you have to worry about escaping \\, then why not handle escaping " while you're at it?
<cky><<foo = interpolated (\\ and $ are special); <'foo' = non-interpolated (no characters are special); <-foo = strip leading spaces
<cky>(IIRC)
<cky>Oops, <<'foo' and <<-foo of course.
<mark_weaver>maybe we should follow racket's lead: http://en.wikipedia.org/wiki/Here_document#Racket
<mark_weaver>looks sane to me.
<cky>I really do miss writing Perl some days. ;-) Compare and contrast: http://www.go-hero.net/jam/10/name/cky http://www.go-hero.net/jam/11/name/cky
<cky>That's awesome.
<Chaos`Eternal>mark_weaver, i will strip \\\\
<mark_weaver>Chaos`Eternal: why are any of these escapes needed?
<mark_weaver>I think you should remove them all.
<mark_weaver>I can hardly imagine a case where they would be useful.
<mark_weaver>on the other hand, it's easy to imagine cases where they will munge your string in bad ways.
<ijp>nalaginrut: I think wingo suggested keeping gzipped source in the file when we move to elf
<mark_weaver>cky: I used to use perl quite a bit, but every time I tried to go beyond a low level of complexity, I found the results too gross to bear. I'm glad to have left perl behind.
<nalaginrut>ijp: well, seems no easy to parse from gzipped src, my idea is, if there's relative .scm for the .go, REPL could show it, if no, no
<nalaginrut>that's easier
<ijp>I don't see how it is fundamentally more difficult
<nalaginrut>and for an user who just need *.go, he may don't want to read the src
<ijp>yes, you need to extract if first, but other than that, it is the same process
<cky>mark_weaver: Hehehehe (re too gross to bear).
<Chaos`Eternal>forget perl...
<ijp>and it isn't like users read .go files in the first place
<cky>nalaginrut: I presume these blobs would just live in a .guile_src section or something.
<cky>since with ELF you can have sections for everything. :-)
<Chaos`Eternal>mark_weaver, i'll keep them unless i make sure they are useless.
<cky>You can have one section per function, if you so wanted.
<nalaginrut>well, I got an idea, if we have gzipped src, we may extract them to one specified path, that avoid to choose the path in %load-path
<mark_weaver>I like Racket's here strings. I think maybe I'll propose adding this to Guile's reader.
<nalaginrut>but since the gzipped src haven't provided now...
<mark_weaver>Chaos`Eternal: okay, then please remove my name.
<Chaos`Eternal>hmm... i surrender.
<nalaginrut>cky: but guys may need comments
<nalaginrut>cky: ok, I agree with .guile_src
<nalaginrut>and could use "guild strip" to remove it
<nalaginrut>hey, why not just provide src string in .guile_src section? Why use gzipped wrapped way?
<nalaginrut>if guys think it's too big, just strip it
<mark_weaver>Chaos`Eternal: better yet, how about I write a new module that implements Racket's here strings.. because I will propose adding those to Guile's core reader, and then you won't have to carry it in your own code anymore.
<mark_weaver>Chaos`Eternal: they are, IMO, a superior design.
<mark_weaver>it might even be part of Guile 2.0.8, due to be released next week.
<nalaginrut>I enjoyed 2.0.8- so long a time, that I just consider the superb 2.1.x ...
<ijp>mark_weaver: I think you are pushing it a bit here :)
<mark_weaver>ijp: what is your opinion?
<Chaos`Eternal>really???
<Chaos`Eternal>wow...
<Chaos`Eternal>great!
<ijp>mark_weaver: I'm talking about the timing, not the design
<mark_weaver>I can't promise anything. Maybe it will be blocked. ijp's response makes me wonder.
<mark_weaver>I'm just one contributor, but IMO it would be a good addition.
<nalaginrut>well, just kidding I thing ;0)
<mark_weaver>ijp: you think that this is a decision that should be mulled over for a few months?
<nalaginrut>think
<ijp>mark_weaver: if anyone can get this done in a week, it's probably you.
<mark_weaver>oh, it's fairly trivial to implement.
<mark_weaver>the only question is whether it will be nak'd for some reason.
<ijp>but I'm concerned about touching the reader in general
<ijp>fortunately, I'll be away this weekend, and so unable to comment :)
<nalaginrut>is there any given way to seek in lines?
<nalaginrut>if I want to move the pointer of port to xxx line
<ijp>I don't think so
<mark_weaver>nalaginrut: call 'read-line' n times :)
<nalaginrut>well, there's ugly way: (define (seek-lines n) (for-each read-line (iota n)))
<ijp>well, that
<ijp>nalaginrut: that won't work as expected
<ijp>since you are passing an integer for the port to read-line
<nalaginrut>ah year
<nalaginrut>yeah~done
<nalaginrut>maybe add a command to REPL?
<nalaginrut>just read way done, I don't think I should be hurry for 2.0.8
<ijp>adding new repl commands isn't documented (I think), but it isn't hard to do
<nalaginrut>yes, I've ever hacked the REPL command for printing backtrace in level number rather than "|||..."
<nalaginrut>the problem is I don't have an idea to parse a procedure src with all its comments
<nalaginrut>comments inline is easy, but our comments seems no format
*ijp makes a note to document them when he gets back from emacsconf
<wigs>nalaginrut: dont parse it; if you get this far, you have used ‘read’ to find the end so just print _exactly_ from start to end
<wigs>forget the output from ‘read’
<nalaginrut>I've done with 'read' way, it's fine
<nalaginrut>but there's no comments
<nalaginrut>well, that's cool for me, but...
<wigs>but?
<mark_weaver>Chaos`Eternal: here's an implementation of Racket here-strings for Guile: http://codepad.org/bzmxC71T
<nalaginrut>but not all guys like that
*cky looks
<mark_weaver>The syntax is described here: http://en.wikipedia.org/wiki/Here_document#Racket
<cky>mark_weaver: Is there a way to make the readtable look ahead to find <<?
<cky>mark_weaver: so that you could use #<foobar> for something else?
<wigs>nalaginrut: it is only a little bit extra to get the result everyone likes, with comments etc.
<nalaginrut>agreed ;-P
<mark_weaver>cky: not with read-hash-extend. but I can make that work in guile's core reader, and will do so.
<cky>*nods*
<nalaginrut>well, a new problem, how can I confirm the path from %load-path? iterate them all?
<ijp>I know we have other things whose print representation begins with #<
<ijp>but are any of them readable?
<cky>ijp: Currently, no. But with proper lookahead, it's theoretically possible.
<mark_weaver>ijp: no, I can see from read.c that #< isn't handled except for read-hash-extend.
<ijp>and (string eol) won't work if the eol is \\r\\n
<cky>mark_weaver: Also, delimiter, not delimeter. The root word being "limit". :-)
<ijp>i.e. windows
<mark_weaver>cky: indeed, thanks.
<mark_weaver>ijp: I know. I thought of that too. Unfortunately 'read-line' returns only a character for the EOL.
<nalaginrut>alright, I iterate them all
<ijp>mark_weaver: that's odd
<mark_weaver>yeah, it seems wrong.
<ijp>sometimes I want to go back in time and shake the people who were working on guile very roughly
<cky>ijp: You mean, not all the world's a GNU? ;-)
<ijp>I felt that way the other day, when I learned just how old the q module is
<cky>ijp: You should so port Racket's data/queue to Guile, then!
<cky>ijp: I almost, almost did, when I was implementing srfi-41.
<mark_weaver>ijp: yes, I often feel that way myself. the (ice-9 popen) module comes to mind, but it's far from the only example.
<ijp>well, now that we have a second streams module, the argument for a second queue module is a little better
<cky>ijp: We might get a second promise module, too, depending on how things go. :-P
<cky>ijp: mark_weaver has roped me into writing a SRFI (which I might polish over this weekend).
<ijp>for those of you who didn't rush out and read ice-9/q.scm ";;; "queue.scm" Queues/Stacks for Scheme ;;; Written by Andrew Wilcox (awilcox@astro.psu.edu) on April 1, _1992_."
<mark_weaver>or maybe we should just fix the core promises to be good.
<cky>mark_weaver: That, too. But that would change the size of the promise data structure.
<cky>mark_weaver: And I thought we were against changing the size of anything.
<mark_weaver>is the promise data structure public?
*cky does not know.
<ijp>though I note it was an April 1st module, so...
<ijp>I thought promises where Scheme anyway
<ijp>hmm, apparently not
<mark_weaver>well, I mean to make the core promises more like srfi-45 (except with support for multiple values)
<mark_weaver>i.e. add lazy and eager to the core, and make them have good iterative behavior.
<cky>Indeed.
<cky>Lemme peek at promise.c and see what it involves.
<mark_weaver>cky: it would still be good for it to be a SRFI though.
<cky>:-)
<nalaginrut>yeah...rough code...
<mark_weaver>ijp: regarding queues: yes, please, let's have a sane queue module.
<mark_weaver>ijp: I nominate you for that task, if you're willing :)
<mark_weaver>s/willing/interested/
<nalaginrut>should I close the port each time I got src?
<cky>I wonder if I still have my copy of the ported Racket data/queue.
<nalaginrut>I mean src-file port
<cky>I might have nuked it when I decided it was unnecessary.
<nalaginrut>or maybe let it be GCed
<mark_weaver>nalaginrut: yes, you should make sure to close ports explicitly
<nalaginrut>ok
<nalaginrut>I'll show a rough prototype to ya
<mark_weaver>file descriptors are scarce; we cannot afford to wait for them to be GCed.
<mark_weaver>also, leaving files open has bad effects like preventing unmounts and deletions.
<mark_weaver>nalaginrut: you already have something working?
<mark_weaver>sneek: later tell Chaos`Eternal here's an implementation of Racket here-strings for Guile: http://codepad.org/bzmxC71T the syntax is described here: http://en.wikipedia.org/wiki/Here_document#Racket
<sneek>Got it.
<mark_weaver>hi civodul!
<civodul>Hello Guilers! :-)
<mark_weaver>civodul: what would you think of adding support for Racket here-strings to Guile's core reader? the syntax is described here: http://en.wikipedia.org/wiki/Here_document#Racket
<Chaos`Eternal>mark_weaver, i read that
<sneek>Welcome back Chaos`Eternal, you have 1 message.
<sneek>Chaos`Eternal, mark_weaver says: here's an implementation of Racket here-strings for Guile: http://codepad.org/bzmxC71T the syntax is described here: http://en.wikipedia.org/wiki/Here_document#Racket
<mark_weaver>(or if you want the canonical docs: http://docs.racket-lang.org/reference/reader.html#%28part._parse-string%29 )
<nalaginrut>mark_weaver: don't compete with me~ I've already done a rough
<mark_weaver>nalaginrut: nice!
<nalaginrut>where's the pastbin site? I'll show you a prototype to play
<Chaos`Eternal>but i'd say, i prefer #""" rather than racket's way, it's too perlish
<nalaginrut>it works now
<mark_weaver>nalaginrut: codepad.org is the one I've been using. not sure whether it's the best choice, but works well for me.
<cky>nalaginrut: I use Gist. :-)
<cky>(But I also have a CodePad account too.)
<cky>mark_weaver: I should take a stab at implementing SRFI 45 promises inside promises.c.
<mark_weaver>cky: codepad account? what does that get you? I don't have an account, and yet I can paste to it anyway.
<cky>mark_weaver: You can easily find your previous pastes, for example.
<mark_weaver>ah
<civodul>mark_weaver: blech!
<civodul>i don't like it :-)
<Chaos`Eternal>imaging, some one use here-string write document string
<cky>Lol.
<civodul>though there's a need
<Chaos`Eternal>racket style will make the code ugly...
<civodul>Skrib{e,ilo} have their own syntax
<civodul>Scribble also
<mark_weaver>civodul: do you have a suggested here-string syntax?
<nalaginrut>cky: I see, both of us like gist, but it seems most of guys here don't use it
<mark_weaver>Chaos`Eternal: the thing I don't like about """ style is that if you want to quote something that has """ in it, you're out of luck.
<cky>mark_weaver++
<mark_weaver>I like a method that allows you to quote *anything* without any kind of escapes.
<nalaginrut> http://codepad.org/IdsF2SGF
<nalaginrut>just try (print-src any)
<Chaos`Eternal>mark_weaver, right, so keep both ways?
<cky>Chaos`Eternal: No.
<cky>One is enough.
<nalaginrut>this rough implementation didn't handle the module isn't any file, say, defined in the REPL
<Chaos`Eternal>never say enough...
<mark_weaver>nalaginrut: very nice! :)
<cky>mark_weaver: Does anybody use Guile's make-promise? Right now it's documented as the procedural form of delay, but to implement SRFI 45, it needs to be the procedural form of lazy, instead.
<nalaginrut>but how to handle (print-src print-src) ?
<mark_weaver>nalaginrut: 'skip-lines' could be written more elegantly though.
<nalaginrut>which is defined in the REPL
<ijp>IIRC the original paper on racket's scribble syntax suggests "how easy is it to use this language to write about itself" as a metric of sorts for escape sequences
<nalaginrut>mark_weaver: yeah, that's shame...
<Chaos`Eternal>and, racket style introduces too many choices..
<cky>mark_weaver: Granted, it's easy to make make-promise work as currently, and just wrap the given procedure with an eager.
<Chaos`Eternal>people will be bored to thing what sting to use after #<<
<ijp>that's an odd argument
<Chaos`Eternal>as old days shell scripting and perl scripting
<Chaos`Eternal>s/thing/think/
<cky>i.e., (make-promise foo) => (make-new-promise (compose eager foo))
<cky>Not quite sure how to compose at the C code level, but never say never.
<mark_weaver>cky: eager needs to be syntax, in order to handle multiple values nicely.
<mark_weaver>cky: make-promise seems more fundamental to me anyway. I suspect eager should be built on top of something like Guile's core make-promise, not the other way around.
<cky>Correct, but you can still have a (private) C-level eager-like thing to handle current uses of make-promise.
<cky>Well, see, make-promise currently contains a thunk that returns the delayed result. This is not compatible with SRFI 45.
<cky>In SRFI 45, the thunk should return a promise.
<cky>(Either an eager or lazy one.)
<nalaginrut>I found even the proc defined in the REPL has a line/column, is there any way to get the src from REPL?
<mark_weaver>Chaos`Eternal: just use """ after the #<< and then it'll look kind of like what you want :)
<mark_weaver>Chaos`Eternal: that flexibility that you don't like is precisely what let's it quote *any* text.
<mark_weaver>Chaos`Eternal: try quoting a Python script with the """ syntax, for example. You can't do it.
<mark_weaver>Chaos`Eternal: that's a bad design.
<cky>mark_weaver: I can repurpose SCM_PROMISE_COMPUTED_P to mean eager (if true) or lazy (if false), and SCM_PROMISE_DATA to be either the eager value or the lazy thunk. That way it won't expand the data structure size of the promise.
<cky>mark_weaver: But the thunk still needs to return a promise, not the value.
<nalaginrut>well, any answer to my problem?
<mark_weaver>cky: I haven't looked at the code, and I don't have time to right now, so I can't help.
<wigs>nalaginrut: noone here knows about repl internals really, so you have to read the source
<cky>mark_weaver: No worries. I'll play with it some over the weekend, if I have time.
<mark_weaver>nalaginrut: I think you're out of luck for procedures typed at the REPL.
<mark_weaver>nalaginrut: the REPL uses 'read', and loses the original string.
<cky>mark_weaver: If we're lucky, it might even get done around the same time as your in-core here-strings. :-)
<mark_weaver>hehe
<mark_weaver>well, civodul seems opposed, so it probably won't happen anyway.
<cky>I don't think he's opposed per se, just that he finds the syntax distasteful while acknowledging a need for such a thing.
<Chaos`Eternal>mark_weaver, ok, i surrender again
<cky>Chaos`Eternal: You can't argue with mark_weaver, he usually wins. ;-)
<mark_weaver>haha
<Chaos`Eternal>but i really hate that...
<wigs>so assume the winning position more often d:
<mark_weaver>cky: regarding promises, we can't change the ABI in 2.0. that means that any C code that used the public macros in promises.h must continue to work with a new version of guile 2.0.x
<mark_weaver>cky: so maybe it won't be possible. if it is possible at all, it will have to be done cleverly.
<cky>mark_weaver: That could make things very tricky, since it's hard to audit for such uses in modules.
<cky>Chaos`Eternal: What wigs said. I mean, I'm pretty sure that mark_weaver is Triple Nine Society material. ;-)
<mark_weaver>cky: we have to assume the worst. we must assume that there's code out there that uses all of these macros.
<cky>Yeah.
<nalaginrut>I found even the proc defined in the REPL has a line/column, is there any way to get the src from REPL?
<nalaginrut>what's the meaning of source:line to a REPL-defined thing?
<nalaginrut>I guess I can still get the src from somewhere
<nalaginrut>well, any answer to my problem?
<wigs>nalaginrut: that line/column is _probably_ just related to stdin stream, which is not kept around
<mark_weaver>cky: What is Triple Nine Society ?
<mark_weaver>oh, just did a web search.
<nalaginrut>wigs: so there's no way to get the src of a REPL defined proc?
<cky>mark_weaver: Like Mensa, but hardcore.
<ijp>sounds a little snobbish
<mark_weaver>you are too kind, really.
<cky>mark_weaver: I mean it, but thanks. :-)
<wigs>nalaginrut: I would not think so, not at present.
<nalaginrut>so should I ignore that? just provide the defined in file procs
<mark_weaver>I hang around MIT, where there are lots of people much quicker than I am.
<cky>ijp: There are snobs, but not everyone in Mensa are snobs. (I can't speak about TNS since I'm not a member there.)
<wigs>nalaginrut: sure
<nalaginrut>mark_weaver: hmm...I dream to go to MIT, but it's far away from me now
<cky>ijp: For me, Mensa is just another social circle, like #guile.
<mark_weaver>nalaginrut: it can't be helped. at the REPL, not only are the original characters lost, but I'm pretty sure the sexpr is lost too.
<ijp>I came to the conclusion a while back that no good would come of me learning my actual IQ
<cky>mark_weaver: I can believe it, and probably many of those people would say the same about you.
<mark_weaver>IQ is kind of a dumb concept anyway.
<nalaginrut>cky: you joined Triple Nine Society?
<mark_weaver>there are many different kinds of intelligence. I'm strong in many areas, but weak in many others.
<nalaginrut>mark_weaver: OK, so I could drop REPL defined things for print-src
<cky>mark_weaver: Actually, that's why Mensa allows you to qualify from many different tests (and you only need to pass one). These tests test different kinds of intelligences.
<mark_weaver>nalaginrut: I think the source typed at the repl is lost.
<nalaginrut>but what should I print, if it's REPL defined
<nalaginrut>"Procedures defined in REPL can't show src!" ?
<nalaginrut>seems too weak...
<wigs>#f
<cky>mark_weaver: The test I did was totally visual and language-free. I guess my strength is in visual/spatial stuff. :-P
<nalaginrut>wigs: well, it's unfriendly for users
<cky>mark_weaver: There is a language-based test, and there's an analogies-based one (though, I'm not sure if Mensa accepts that one), etc.
<wigs>nalaginrut: perhaps, though to me it just suggests there is no such information
<mark_weaver>to focus too much on the question of "how intelligent am I?" or "how intelligent are you" is not a good thing. let's just work together to make the world better.
<ijp>that was my thinking
<wigs>nalaginrut: anyway, the specifics of the not-available response is not important, people will get the idea
<cky>nalaginrut: I haven't done a real proper IQ test, so I can't say whether I qualify for TNS. I have done the Mensa test (which is an IQ test, but they won't tell you your actual score).
<nalaginrut>cky: was ?
<mark_weaver>In my experience, it's unhealthy to have too weak an ego, but it's also unhealthy to have too strong an ego.
<cky>mark_weaver: Indeed.
<mark_weaver>I've suffered from both of those problems in the past.
<mark_weaver>at different times.
<cky>mark_weaver: I'm not a fan of the snobs in Mensa either. I'm just there to have fun, nothing more.
<nalaginrut>wigs: OK, it's done
<cky>nalaginrut: I don't understand your question.
<civodul>mark_weaver: actually i think it's more the term "here document" that scares me
<civodul>and the <<EOF syntax
<civodul>but the general idea of having a "text-preferred" syntax seems good
<nalaginrut>cky: "that was your thinking", I think it's about " let's just work together to make the world better."
<mark_weaver>civodul: I don't care that much about the details. I'd just like to have something that lets us include an arbitrary string without escapes.
<nalaginrut> http://codepad.org/fu7Sb83Y Now it works better
<mark_weaver>civodul: if you have a suggested syntax, I'm open to ideas
<cky>nalaginrut: "that was my thinking" was ijp's comment.
<civodul>mark_weaver: let's open the discussion for 2.0.9 or so
<nalaginrut>oops, panic, halt, looped...
<mark_weaver>civodul: okay
<civodul>hey, look: we have a new green bullet! http://hydra.nixos.org/jobset/gnu/guile-2-0
<civodul>(FreeBSD + threads)
<cky>:-D
<mark_weaver>yay! :)
<nalaginrut>civodul: can we add epoll/kqueue in a (ice-9 linux) and (ice-9 bsd)
<civodul>nalaginrut: there's (ice-9 poll) already, but hmm, that's just poll(2) right?
<cky>It is.
<civodul>ok
<civodul>well
<nalaginrut>civodul: it's poll
<cky>I thought wingo did some stuff with epoll.
<cky>But, not sure where that went.
<civodul>yeah, possible
<civodul>we'd have to check with wingo
<wigs>cky: web-ethreads or something
<wigs>?
<cky>Ah.
<civodul>yes
<nalaginrut>cky: wingo left ethread/nio things for a while...
<civodul>if it's possible to have an an thing abstraction over both epoll and kqeue, the better
<civodul>*kqueue
<civodul>*thin
<civodul>pff
<cky>Sure, I'll see how Java does it and port the abstraction here. ;-)
<wigs>right, and that probably requires a bit of work to get right
<nalaginrut>civodul: well, I did wrote such thing in Ragnarok, but I don't know if it's proper for Guile core
<cky>(in the same way I want to port Java's ConcurrentHashMap to Guile once Guile has atomics.)
<civodul>aah, atomics
<nalaginrut>yeah
<mark_weaver>good night all!
*mark_weaver --> zzz
<cky>Moi aussi.
<nalaginrut>night
***adu_ is now known as adu
<janneke>anyone using geiser?
<janneke>,break (@ (schikkers music-layout) move-cursor-to-y-range)
<janneke>While executing meta-command:
<janneke>ERROR: In procedure #<procedure 44be820 ()>: Unbound variable: ((schikkers music-layout) move-cursor-to-y-range #t)
*janneke tears hair again
*civodul is a happy Geiser user
<adu>hi janneke
<civodul>janneke: the error does not relate to Geiser
<janneke>hi adu :)
<janneke>civodul: ah, good. shows what a newbie i am!
<civodul>apparently the variable is unbound
<civodul>:-)
<civodul>is it the right module? the right name? is it exported?
<janneke>so my question is: how to set a breakpoint to a method in a module?
<civodul>you did it correctly
<janneke>civodul: yes
<janneke>ah!
<janneke>hmm
*civodul notices that this is undocumented
<janneke>what if there was a syntax error and i did a reload?
<civodul>reload-module?
<janneke>,import (schikkers music-layout) again
<janneke>...strangely, it gave no error when there was a syntax error. hmm
<wigs>janneke: to actually reload you must use ‘(reload-module (resolve-module '(schikkers music-layout)))’
<wigs>or erm, ,reload
<janneke>wigs civodul thanks!
<janneke>Trap 0: Breakpoint at #<<generic> move-cursor-to-y-range (1)>.
*janneke dances
<janneke>hmm, now i get no source in the other window...
<janneke>isn't also: ,up supposed to do that?
<civodul>,up is like "up" in GDB: it shows the stack frame above
<civodul> http://docs.racket-lang.org/math/ <- is SciGuile late?
<ijp>soegaard originally did some of that for Ikarus, I think
<civodul>ok
<janneke>civodul: yes... and in GUD you get the matching source in the other window
*janneke thought geiser is a sort of GUD without the "GU"
<ijp>it's more like th U without the G or D
<ijp>since it doesn't do anything special for the debugger (I think), but it works the same for Racket
<civodul>yes
<civodul>i actually rarely use the debugger in Scheme
<civodul>although i do implement bugs
<civodul>weird
<mark_weaver>hehe
<janneke>:-)
<mark_weaver>I mostly use 'pk' myself, I confess.
<ijp>I use the debugger, but not as much as I could or should
<civodul>yeah, 'pk' is the thing
<janneke>ijp: i'm sure i saw matching source in another emacs window?
<janneke>was /me dreaming?
<ijp>the latter I expect
<janneke>blast
*ijp attempts to summon jao
<janneke>:-)
<mark_weaver>'pk' is undocumented though.
<janneke>is anyone hooking geiser or guile debugger up with gud?
<taylanub>What's pk ?
<civodul>ah ah! it's a secret debugging tool that only wizards know!
<ijp>taylanub: basically (define (pk . v) (write v) (newline) (apply values v))
<civodul>it's hidden in boot-9.scm
<ijp>it does handle multiple return values, right?
<mark_weaver>taylanub: in prints all of its arguments to the console and then returns the last one. very useful for wrapping around expressions in your code, usually prefixed by some symbols and/or relevant variables, and it helps you see what's going on as your code runs.
*ijp goes check
<civodul>ijp: not quite, it returns (last args)
<ijp>ah
<ijp>I would have expected (car args)
<civodul>it's convenient this way, because you can do (pk 'foo bar)
<ijp>good point
<taylanub>What does "pk" stand for ? Print .. ?
<mark_weaver>taylanub: "peek" I think
<taylanub>Heh, OK.
<mark_weaver>taylanub: if you use 'paredit', it's super easy to wrap them around bits of code and/or remove them.
<mark_weaver>paredit was a bit painful to learn, but I'm *so* glad I took the time. it has revolutionized my scheme editing.
<mark_weaver>civodul: regarding http://docs.racket-lang.org/math/, yeah, I need to get cracking on some of this stuff :)
<taylanub>I learned paredit before doing much Lisp hacking so it wasn't very hard. I think every Lisp introduction should mention it, and how s-expressions aren't necessarily worse than other syntax. (Many people find them superior, AFAIK. I do, certainly.)
<mark_weaver>I think you'll get no disagreement in this channel :)
<mark_weaver>I'm probably the outlier in thinking that curly-infix might be worthwhile to use in a few places here and there.
<ijp>a while back, I had an idea to do a (language linear) for linear programs, so you could drop them right into guile programs
<mark_weaver>I'm not so sure about sweet expressions though.
<taylanub>I also think SRFI-105 might be useful, but not anything beyond it. Curly braces still are a form of parentheses so they should go well with paredit.
<ijp>but I have so little need for it, it's hard to convince myself to write it
<mark_weaver>taylanub: I agree. speaking of which, I should probably make a version of paredit that deals with curly-infix and a few other aspects of guile syntax that regularly trip me up (like backslash at the end of the line)
<mark_weaver>s/trip me up/trip paredit up/
<mark_weaver>civodul: are you sure that @var is the right thing for scheme variable names? the texinfo docs say "Use the `@var' command to indicate metasyntactic variables. A "metasyntactic variable" is something that stands for another piece of text. For example, you should use a metasyntactic variable in the documentation of a function to describe the arguments that are passed to that function.
<mark_weaver>civodul: notably, it goes on to say: "Do not use `@var' for the names of particular variables in programming languages. These are specific names from a program, so `@code' is correct for them (*note code::)."
<mark_weaver>I think that's pretty clear.
<mark_weaver>"For example, the Emacs Lisp variable `texinfo-tex-command' is not a metasyntactic variable; it is properly formatted using `@code'."
<mark_weaver>(section 9.1.7 of texinfo manual)
<mark_weaver>therefore, I think 4a0821a8d5cfff50fef8c119a0d76355b6126009 should be reverted.
<mark_weaver>though I agree that I should have used @defvr
<mark_weaver>I'll go ahead and do those things now.
*mark_weaver looks into building guile against GMP 4.2
<civodul>mark_weaver: ooh, interesting; i had always thought otherwise
<civodul>so yes, you can revert the @var part (but keep the @defvr)
<mark_weaver>doing so now..
<civodul>great
<mark_weaver>yeah, it's a fine point. I didn't realize it until recently.
<civodul>and i thought i knew Texinfo...
<civodul>yeah
<civodul>it's great to see that the details have been thought out
<mark_weaver>indeed :)
<mark_weaver>civodul: well, stable-2.0 seems to build against GMP-4.2 and even pass numbers.test. I'm trying again with your GMP 5 fix reverted, just to make sure my test is good.
<mark_weaver>*GMP <5 fix, I should say
<civodul>ok
<mark_weaver>indeed, my test fails without the GMP <5 fix, so my test seems to be good. So we're all good for GMP 4.2.
<mark_weaver>okay, now on to rethinking the ports stuff...
<mark_weaver>(a job that I've been procrastinating :)
<mark_weaver>civodul: any thoughts on what syntax to use for augmenting %load-compiled-path from the command line?
<civodul>mark_weaver: "guile -I"?
<mark_weaver>civodul: do you think it deserves a single-character option?
<civodul>possibly, yes
<civodul>esp. if we want it to be usable from shebangs (which would be nice)
<mark_weaver>*nod*
<mark_weaver>well, okay.
<mark_weaver>I confess to thinking that our shebang support is fundamentally broken, and that we should think up a new mechanism.
<mark_weaver>but that's a post-2.0.8 item for sure :)
<mark_weaver>civodul: what about "guile -C"? dunno.
<mark_weaver>I don't care that much. I'm not good at coming up with names.
<civodul>yeah, why not
<mark_weaver>okay, I'll cook up a patch and post it for comments.
<mark_weaver>thanks!
***sneek_ is now known as sneek
<civodul>sneek: later tell wingo Python uses futures for I/O: http://lwn.net/SubscriberLink/544522/d195cfa20c302914/
<sneek>Got it.
<davexunit>are futures and promises synonyms?
<ijp>not quite
<ijp>the intent of a promise is to delay a computation, and it may never be computed
<ijp>futures are for fine grained parallelism, and the intent is that they will be computed
<ijp>the api is very similar though
<davexunit>ah okay. thanks for the explanation.
<ijp>see you guys sunday/monday
<mark_weaver>davexunit: promises are single-threaded. they are not computed until the first time they are forced, and they are forced in the same thread.
<mark_weaver>davexunit: so 'force' actually does the computation before returning.
<mark_weaver>with futures, the computation typically starts immediately is typically done in another thread.
<mark_weaver>s/is/and is/
<mark_weaver>I confess I'm a bit fuzzy on the details, because I usually avoid threads.
<davexunit>mark_weaver: thanks! I also avoid threads to avoid headaches.
***adu_ is now known as adu
<civodul>futures = threads - headaches
<civodul>that's the idea :-)
<mark_weaver>*nod* but only if you avoid all mutation, including things like promises or streams.
<mark_weaver>anyway, gotta go offline for a while. ttyl!
<dsmith-work>Happy Friday, Guilers!!
<waxysubs`>greetings dsmith-work!
<mark_weaver>oops, that was me, accidentally typing from my logger :)
*sneek waves at waxysubs`
<mark_weaver>my logger is just Emacs/ERC running within a screen :)
<dsmith-work>heh
<mark_weaver>because I couldn't be bothered to research a better solution.
<dsmith-work>There are several bots that are just erc, iirc
<mark_weaver>one of these days, I'd like to set up a bot with a Guile 2 REPL for this channel.
<dsmith-work>Off Topic: Anyone here ever mess with the Linux PPS system?
<dsmith-work>mark_weaver: Yes, I looked into adding that to sneek at one point, but it was just too scary.
<civodul>hey dsmith-work, happy Friday!
<mark_weaver>dsmith-work: I was thinking of running all the REPLs within a VM running civodul's boot-to-guile :)
<mark_weaver>one process per REPL, using rlimit to control resource usage.
<civodul>sledgehammer ;-)
<mark_weaver>indeed :)
<dsmith-work>mark_weaver: I like it.
<mark_weaver>not ideal, for sure, but until we have a decent sandbox :)
<dsmith-work>THough I don't think I can do that on sneeks box
<dsmith-work>Being a very weak 300MHz mipsel thing
<dsmith-work>sneek: uname
<dsmith-work>hmm.
<dsmith-work>, uname
<dsmith-work>sneek: version
<sneek>Sneeky bot running on Guile version 2.0.5.90-c0580 using bobot++ 2.3.0-darcs
<mark_weaver>dsmith-work: how much RAM does it have?
<dsmith-work>Hmm. 250Meg ?
<dsmith-work>Maybe 64?
<mark_weaver>yeah, that might be an issue
<dsmith-work>I don't remember
<dsmith-work>And I can't ssh in anymore.
<mark_weaver>64 megs? wow. yeah, too weak for this crazy idea.
<dsmith-work>I remember having to add swap to build stuff at one point.
<mark_weaver>the first patches I wrote for guile were written on a Psion 5MX with 36 MHz ARM processor and 24 megs of RAM.
<mark_weaver>(the main feature of that computer being its super low power consumption, so it could be used for long periods while camped out in the woods)
<mark_weaver>I could use it for an entire week on 2 AA batteries.
<mark_weaver>also, it's monochrome display that can be read easily in bright sunlight.
<mark_weaver>s/it's/its/
<mark_weaver>Nice little machine. Too bad there's nothing like it today. http://en.wikipedia.org/wiki/Psion_Series_5
<dsmith-work>2 AA's! Nice
<dsmith-work>And here is sneeks box. A qube2 http://en.wikipedia.org/wiki/Cobalt_Qube
<dsmith-work>I also have a qube 3 (which is intel), but I havn't taked the time to put a modern Debian on it.
<dsmith-work>taked! Sheesh
<mark_weaver>hehe, I'm sometimes shocked by the number of typos I produce on irc.
*dsmith-work enabels flyspell-mode
<mark_weaver>I suppose at this point you could do better with a $35 Raspberry PI :)
<mark_weaver>actually, I have one that's currently only being used to access the serial port on my server.
<dsmith-work>Nice thing is, it's only about 35Watts. I even took the fan out, so it's quiet.
<dsmith-work>But a raspberry-pi would be even more efficient.
<mark_weaver>not bad for such a big box
<mark_weaver>(and such an old one)
<dsmith-work>I ran netbsd on it for a while, until Debian started working nicely.
<mark_weaver>maybe that's the solution. just run the REPL's on a raspberry pi.
<mark_weaver>I used to run netbsd. for many years, starting with the very first released derived from 386BSD (which I ran before netbsd came out)
<dsmith-work>The only really painful thing is building Guile (and dependencies) takes a whole weekend.
<dsmith-work>Was that the one from Dr. Dobbs?
<mark_weaver>no
<mark_weaver>or at least I was not aware of any association between 386BSD and Dr Dobbs.
<mark_weaver> http://en.wikipedia.org/wiki/386BSD
<mark_weaver>dsmith-work: why don't you just run Debian wheezy? it's quite stable.
<dsmith-work>Yuah, Jolitz
<dsmith-work>mark_weaver: On what?
<mark_weaver>on whatever box takes all weekend to build guile.
<dsmith-work>Hmm. I haven't upgraded in a while.
<mark_weaver>on wheezy, the dependencies are all built already. (it's a good idea to build a newer Boehm GC, but that's a fast build)
<dsmith-work>Not sure how good the mipsel support is. I'll check it out.
<dsmith-work>I think it was unistring that took forever.
<mark_weaver>dsmith-work: mipsel support is reasonably good, although it uses the O32 ABI.
<mark_weaver>what are you running on it now?
<dsmith-work>The qube has no keyboard or mouse. Just a little character LCD display and 4 buttons.
<dsmith-work>When it's not working, it's hard to fix.
<mark_weaver>*nod*
<dsmith-work>IT's running Debian, but I forget what release.
<mark_weaver>my server, an old Sun Netra T1, also has no console or keyboard. I have to access it via the serial port only.
<dsmith-work>Well, serial is plenty.
<mark_weaver>does the qube have a serial port?
<dsmith-work>Yes it does.
<dsmith-work>But it's used for a modem, usually.
<mark_weaver> http://cyrius.com/debian/cobalt/install.html
<dsmith-work>yep
<dsmith-work>mark_weaver: I had a Sun 3 for a while.
<dsmith-work>Upgraded it to 12M of ram.
<mark_weaver>hehe
<dsmith-work>It wouldn't run obsd
<dsmith-work>I put netbsd on it.
<dsmith-work>When obsd booted, the image size was so large that it ate into the display memory.
<mark_weaver>the first unix box I used was the SPARCStation 1
<dsmith-work>And of course when something updated the display, it corrupted the kernel image, crashing it.
<mark_weaver>ouch!
<dsmith-work>IT was cool. You could actually watch the kernel on the bitmapped display. For a while.
<mark_weaver>The first computer I ever used, the TRS-80 Model 1: http://en.wikipedia.org/wiki/TRS-80
<mark_weaver>dsmith-work: that's pretty crazy :)
<dsmith-work>There was a local dial up "public access unix" that I talked to on my C64. That machine was a TRS80 Model 16.
<dsmith-work>Ah the memories.
<mark_weaver>nice. I had a bunch of friends with C64s and Vic 20s, but I had an Apple ][ plus.
<dsmith-work>First thing I did was make a custom termcap entry to get my C64 cursor keys to work.
<mark_weaver>hehe
<dsmith-work>That would be around 1983-1984
<mark_weaver>so you got started on unix a lot earlier than I did. I didn't use unix until 1988 when I went to university.
<mark_weaver>until then I was stuck on MacOS
<mark_weaver>man, we're showing our age :)
<dsmith-work>heh
<dsmith-work>It wasn't until early '90's before I touched a real unix machine through.
<mark_weaver>when did you start running unix on your own machines?
<dsmith-work>Hmm.
<dsmith-work>About Linux 1.0.8
<dsmith-work>On 496sx
<dsmith-work>486
<dsmith-work>The first thing I did on that machine was hack the soundcard driver to enable the cdrom so I could install from cd instead of floppies.
<dsmith-work>Slackware
<dsmith-work>I remember I ran a grep on the files on the cdrom looking for a package, and it took a long time.
<dsmith-work>And then I ran another grep, and it was like instant.
<dsmith-work>Because linux cached the files.
<dsmith-work>that was IT!
<dsmith-work>!uname
<sneek>Linux blueboy 2.6.32-5-r5k-cobalt #1 Wed Jun 15 00:53:04 UTC 2011 mips GNU/Linux
<dsmith-work>!uptime
<sneek> 18:37:38 up 45 days, 21:44, 0 users, load average: 0.57, 0.49, 0.46