IRC channel logs

2014-03-25.log

back to list of logs

<didi>Is there some limitation in using threads and `format' to print to the current output port? I'm having various kind of errors with <http://pastebin.kde.org/pnkp2lmbv/cwhchu>. "error while printing execption", "fport_write: Bad address", garbage output...
<didi>Guile 2.0.11
<mark_weaver>didi: ports are not thread-safe in guile 2.0.x. if you want to access the same port from multiple threads, you must protect it with a mutex or similar.
<zacts>mark_weaver: so when do you think would be a good time to learn C?
<zacts>I'm starting again with guile/scheme, but eventually would be interested in systems programming like Minix 3 / HURD / Linux kernel.
<zacts>My main language goals are: guile / elisp / scheme / haskell / C.
<zacts>iirc, I remember you mentioning that you were a C programmer for a long while, but then discovered scheme, and scheme changed the way you thought about programming forever, or something like that.
<zacts>my project goals have shifted a bit, I'm totally interested in learning about and helping out with guix / guile / guile-emacs / guile-wm / guile bindings for HURD
<mark_weaver>IMO, you should start with scheme/guile
<mark_weaver>for around 30 years scheme was the first programming language taught at MIT, and I think they had the right idea there.
*zacts is reviewing his calculus for SICP. hey mark_weaver would you mind having a look at my uni's comp sci pedagogy, and let me know what you think?
<mark_weaver>it's simple enough and flexible enough that you can learn a variety of programming styles, without the concepts being obscured by syntactic/semantic complications of most other languages, and low-level legacy cruft such as the way traditional CPUs work (which is deeply ingrained in C).
<zacts> http://catalog.unm.edu//catalogs/2013-2014/courses/CS/index.html
<mark_weaver>and if you can avoid being corrupted by the dominant "object-oriented programming" craze, which is unfortunately nearly ubiquitous, that will be a major plus IMO.
<zacts>I know the uni at my location teaches a lot of java / C / and OOP.
<mark_weaver>yeah, that's not surprising.
<zacts>I'm currently at a community college.
<zacts>But, I need to make the best of what I've got, so I can then earn scholarships to another university, I hope.
<zacts>except I may be able to easily transfer to this college. http://cs.pdx.edu/
<mark_weaver>261, 341L, 357L, 361L, 362, and 375 look potentially worthwhile.
<didi>mark_weaver: oic. Thank you.
<mark_weaver>(and some higher ones)
<mark_weaver>basically, courses on data structures, algorithms, and declarative programming are probably quite useful.
<zacts>cool, thanks for the input
<mark_weaver>as for how to write programs, IMO you'd better try to learn it on your own from well chosen books.
<zacts>ok, and also working on real projects such as guix / guilemacs / emacs?
<zacts>I have the distro / tools / ports / bash / cli level of abstraction down.
<zacts>It's actual programming and comp sci I need / desire to learn
<zacts>I know for sure, I want to read SICP after Scheme and the Art of Programming.
<mark_weaver>yes, absolutely, experience working as part of a community on real-world free software projects is probably the best education you could hope for.
<zacts>so I can kind of hack my education. I can still work on these projects, while earning credit in school, and qualifying for scholarships to more artistic / SICPish schools..
<zacts>if I play the cards right.
<zacts>I do need to catch up on my calculus for SICP. It's been years since high school.
<zacts>starting this summer I'm going to be taking a ton of math classes.
<mark_weaver>although I earned a CS degree from a good school, in fact the vast majority of what I know, I learned outside of school.
<zacts>ok
<zacts>yeah, well I'm a total nerd, and not quite a hipster, I guess.
<zacts>like I could never imagine myself working at github.
<zacts>but I could imagine myself working at / owning a cafe, and doing software on the side.
<mark_weaver>you don't need to go to a school that teaches SICP. I didn't. It would have been nice, but you can learn it outside of school.
<zacts>that's encouraging
<adhoc>there are about 20 videos too
<mark_weaver>indeed
<zacts>adhoc: yes, I've seen the first set of them
<zacts>and the UCBerkeley brian harvey lectures
<mark_weaver>didn't the UCB ones teach it using a different language?
<turbofail>no, not until recently
<zacts>mark_weaver: well, they use python now. when brian harvey taught there they used scheme
<mark_weaver>ah, okay.
<zacts>I'm going to hack my education as much as possible. @ least there is a lisp/scheme user group on campus.
<zacts>but they aren't affiliated with the university
<adhoc>zacts: where is that?
<zacts> http://schemers.org/
<zacts>ABQ/Lisp/Scheme
<zacts>in fact, iirc one of the HURD guys used to live here, and worked at that Center for Advanced Research Computing here, way back in the day.
<adhoc>Albuquerque, NM, USA ?
<zacts>thomas bushnell
<adhoc>just trying to remember where that is ...
<zacts>yeah adhoc
*adhoc googles
<zacts> http://www.groklaw.net/articlebasic.php?story=20050727225542530
<zacts>^ Thomas Bushnell used to work at my uni
<zacts>I remember reading about that somewhere here.
<adhoc>nice
<mark_weaver>thomas bushnell wasn't merely one of the HURD guys, he was the original architect.
<zacts>well, with the lisp / user group + mark_weaver and fellow hackers + irc.. I'm sure that I can make a great education for myself.
<zacts>mark_weaver: oh nice!
<zacts>I wonder what happened to the school when he left..
<zacts>now we have an official microsoft sales team booth at the Student's building, and an apple store.
<zacts>but there are still a few hackers here.
<zacts>anyway, enough of my off-topic ramblings
<zacts>--
<zacts>mark_weaver: have you read godel escher bach?
<zacts>I'm thinking that would tie in nicely with SICP and guile/scheme.
<zacts>and, what do I need to know to start working on guile related projects. I mean can I work on a game or something in the meantime before/while completing SICP?
<zacts>(not including porting stuff to guix. I'm already working on that now).
<ijp>GEB is a fine book, and has aged pretty well where it talks of computers
<zacts>ijp: in what respect? It seems timeless, from the first few chapters.
<ijp>and you can do whatever you like with your time, while working on SICP. lord knows I didn't read SICP all at once
<ijp>I read it over the course of 3 years, in separate chunks
<ijp>1/2, 3, and 4/5
<zacts>ijp: oh interesting
<zacts>yeah, that's probably a good idea
<ijp>that's why it is listed under 2011 in http://shift-reset.com/books rather than the (nonexistant) 2008/9
<zacts>ijp: you have time to read all of those books AND chat on #emacs? :p
<zacts>j/k
<ijp>52 a year is easy
<ijp>I've done 17 this year already
<zacts>nice
<adhoc>how do you have the time for that?
<zacts>ijp: I'm going to be posting much more to my blog, once I get things started.
<zacts>ijp: http://zacts-blog.herokuapp.com/ <- hopefully I'll also be posting some emacs / scheme stuff within the next few months.
<adhoc>i wish i had the budget for buying that many books to read!
<zacts>and I hope to get a better hosting service
<ijp>adhoc: charity book shops are a heaven
<adhoc>ah
<adhoc>they never seem to have any books im interested in though
<adhoc>i suppose i have a lot of books i could send to them though =)
<ijp>also, I don't play video games
<zacts>ijp: maybe I'll do that also. break SICP up into chunks like that while I complete college.
<zacts>ijp: but you can indeed learn a heck of a lot by creating video games yourself.
<adhoc>ijp: yeah, good point.
<adhoc>>.>
<zacts>I have completed one scheme book. 'Simply Scheme' by brian harvey. It was nice, but kind of a toy scheme language. not the real deal.
<zacts>but the concepts are what were important I guess, but I find that I need more practice on real projects.
<ijp>zacts: as for the chat on #emacs, I'm usually doing something else at the same time
<ijp>unless I'm in a heated argument
<zacts>like understanding _what_ data abstraction is is easy. Understanding how to _design_ APIs, interfaces, etc.. is difficult.
<zacts>ijp: does SICP get into real experience like that?
<zacts>like will I learn by doing also?
<zacts>I know you make a full scheme interpreter in scheme throughout the book, and it covers a ton.
<ijp>it doesn't touch on design directly
<zacts>HDTP was too not my style
<zacts>I need more heavy reading than that.
<zacts>PLAI looks nice though..
<ijp>the gc section let it down
<ijp>(plai)
<adhoc>zacts: the videos walk you through somet the design ideas
<ijp>I haven't looked at the second version
<adhoc>i've seen the first few
<zacts>I couldn't get past the first couple of ch's of HTDP due to the format of the book
<zacts>ijp: oh, that sucks, but the rest of the book was good right?
<ijp>it's a shame really, since the gc "languages" in racket are really cool toys
<zacts>but oddly enough for some reason I do like the little schemer book
<saul>zacts, I hear that "Lisp In Small Pieces" by C. Quiennec is excellent with regard to the technical details of designing Lisp/Scheme.
<zacts>oh good to know, I'll check it out.
<ijp>funny thing about that book, Quinnec wrote two books with the initials L.I.S.P.
<ijp>Lisp in Small Pieces being LiSP
<ijp>I did not know that when I bothered my uni librarian to look the other one out of the stacks
<turbofail>huh. i totally forgot how incomplete that GC chapter was in PLAI
<ijp>turbofail: I think plai2 is better, but as I say, I haven't looked at it
<adhoc>plai2 ?
<turbofail>ah yeah, from the table of contents alone it clearly goes into more detail
<zacts>ok, well I'll read the 2nd edition of PLAI when I get around to it.
<ijp> http://cs.brown.edu/courses/cs173/2012/book/
<ijp>the original didn't go into objects either
<saul>I found Peter Michaux's Bootstrap Scheme project to be somewhat instructive, though he abandoned it before the interesting stuff (GC, macros, continuations) was implemented.
<ijp>nor nearly as much into types
<saul> http://michaux.ca/articles/scheme-from-scratch-introduction
<zacts>what do you guys think of - http://mitpress.mit.edu/books/concepts-techniques-and-models-computer-programming
<ijp>never read it
*ijp wishlists
<zacts>I may check it out from my library eventually.
<zacts>ijp: you can watch lectures for the book here http://mitpress.mit.edu/books/concepts-techniques-and-models-computer-programming
<zacts>well, it's a subset of the book.
<zacts>oops
<zacts> https://www.edx.org/course/louvainx/louvainx-louv1-01x-paradigms-computer-1203
<saul>zacts, that book looks like its based on Python (ugh!) and focuses on procedural and OO programming.
<ijp>you and I read very different descriptions
<saul>ijp, to be fair, I have not read the book (CTM) but was basing my opinion on the index and a sample chapter.
<zacts>saul: it doesn't use python, it uses Mozart/OZ
<zacts>peter norvig and brian harvey mention it as a sequil to SICP or something in the comments.
<zacts>(not an actual sequil, but a good book to read after SICP?)
<zacts>can I not spell tonight.
<zacts>sequel
<zacts>I'm a bit exausted..
<mark_weaver>zacts: if you liked the little schemer, I'd recommend getting the other two books in that series: the seasoned schemer and the reasoned schemer.
<adhoc>zacts: https://www.youtube.com/playlist?list=PLw454N-VXALSIzIe_eL5U8L4S68v2X_ak
<adhoc>Paradigms of computer programming
<adhoc>by Peter Van Roy 172 videos
<zacts>ok, I think I actually have those, I'll have to check my garage tomorrow.
<zacts>mark_weaver: neato
<mark_weaver>all three are really excellent books
<zacts>I'm reading SAOP as we speak, by the same author as the little schemer.
<zacts>Daniel P. Friedman.
<zacts>it's more of like a minime SICP I guess.
*zacts raises his pinky to his lip like Dr. Evil.
<mark_weaver>I haven't read that book, but if it's by Friedman that's a good sign :)
<zacts>So far I really like it.
<zacts>"The book is more sophisticated and complete than the Little LISPer but not as advanced as Structure and Interpretation of Computer Programs" - excerpt from the back of the book.
<saul>SAOP?
<zacts>saul - Scheme and the Art of Programming
<saul>Thanks. Offtopic: what Forth is available on Minix3?
<zacts>sual I'm not sure, but there is a minix3 channel.
<zacts>#minix
<wingo>moin
<gjanssens>Hi, I'm looking at an issue with string-append in guile 2
<gjanssens>I have created a simple code snippet to illustrate my problem: http://pastebin.com/RtyUCm5d
<gjanssens>Basically I'm trying to string-append a long list of strings
<gjanssens>The test script generates a list of one million strings
<gjanssens>And then proposes three ways to concatenate them all together
<gjanssens>Using "apply" will result in as vm-run "VM: Stack overflow" error
<gjanssens>Using "reduce-right" will as well but with a small delay
<gjanssens>"reduce" just seems to run forever, I have aborted the run after 40 minutes. At that point about 560.000 strings were appended together
<gjanssens>I don't know if it was stuck there or just slowly proceeding
<gjanssens>So I wonder how I can get this working ?
<gjanssens>Some background: I discovered this issue in GnuCash
<gjanssens>At some point that program has built a tree of strings representing a large html file
<gjanssens>To actually generate the html, all these strings are appended together
<gjanssens>This has always worked fine with guile 1.8 using the apply method
<gjanssens>But with the switch to guile 2 we are getting user reports of the above vm-run error
<gjanssens>I'm looking for a way to avoid this.
<wingo>hi
<wingo>gjanssens: there are a few things there
<wingo>the first one is to use string-concatenate to append a list of strings.
<wingo>i guess that's the short answer
<wingo>the problem with appending them pairwise is that you generate O(n^2) garbage
<wingo>string-concatenate precomputes the buffer size needed, and so it's O(n)
<wingo>using string-append would be fine but as you see it runs out of stack, and (apply string-append list) uselessly unrolls the list onto the stack for the call, only to cons it up again inside string-append -- that's why string-concatenate is better, as it takes a list directly
<wingo>you might be interested to know that we have removed the stack limit in master, but that's not really relevant to your needs, and anyway the answer is still the same -- string-concatenate
<wingo>w.r.t. guile 1.8 versus 2.0 -- in guile 1.8 all function calls would cons their arguments into a list; that was inefficient, and so in guile 2.0 argument passing happens on a stack
<wingo>but guile 1.8 did have the advantage that because it used lists, argument lengths were effectively unlimited, whereas they were limited in 2.0 by the stack size -- but that limit as I said is going away in 2.2 so we come full circle :)
<wingo>gjanssens: let me know if you need any more details
<gjanssens>wingo: string-concatenate indeed works well (and fast)
<gjanssens>thanks once more for your fast answer
<civodul>'lo Guilers!
<wingo>np
<wingo>morning civodul :)
<gjanssens>wingo: can string-concatenate also handle nested lists of strings ?
<gjanssens>currently we flatten the nested list before concatenation
<wingo>gjanssens: nope, it doesn't do that
<wingo>map over the list to flatten it beforehand, is probably the best thing
<gjanssens>gnucash is using a for-each loop to flatten the list
<gjanssens>It looks pretty efficient, so I'll just leave that as is
<wingo>you could use a string port but that has some encoding-related trickiness (see http://thread.gmane.org/gmane.lisp.guile.devel/16631/focus=16998)
<gjanssens>I think I'll just skip that. GnuCash already has its share of encoding-related nastiness... But thanks for the link
<civodul>jemarch: congrats on the new release! :-)
<jemarch>civodul: we will perpetrating interesting stuff in recutils this gsoc :)
<civodul>yeah, i saw JSON, SQLite, etc.
<jemarch>the converters?
<civodul>yes
<davexunit>what release is this?
<jemarch>well, that is what the student will be doing. But I had a related idea
<jemarch>it is nice to have sqlite2rec, rec2sqlite and so on
<jemarch>but imagine you have a database.sqlite on disk
<jemarch>and then you have a database.rec with:
<jemarch>%rec: sqlite:///path/to/database.sqlite
<jemarch>%rec: OtherStuff
<jemarch>...
<jemarch>you could access the sqlite database with recsel, recins, rec-mode, etc
<jemarch>same for mysql://url/to/sqlserver, and what not..
<jemarch>foreign record sets
<jemarch>you could mix rec data, sqlite databases, mysql databases, csv files, etc in a single .rec file
<civodul>yeah, sounds cool!
<civodul>mixing database implementations, that's fun :-)
<civodul>jemarch: oh you signed with a new public key
<jemarch>civodul: yes, I noted you were using the old one recently..
<wingo>i failed to upload guile-opengl btw, and i did send ftp-upload a mail
<wingo>dunno what happened with that recently
<jemarch>wingo: I updated mine last November and seems to work properly
<wingo>jemarch: just using savannah?
<wingo>or via adding a project
<wingo>guile-opengl is a new project and it seems you have to mail the uploaders to add that project to their config or something
<wingo>dunno
<jemarch>I sent an email to ftp-upload@gnu.org
<jemarch>huh, I do not remember what was the procedure for new projects..
<wingo>info maintain has a procedure
<wingo>i followed it
<civodul>wingo: maybe just ping them?
<civodul>it's work reasonably fast in the past
<civodul>*worked
<civodul>jemarch: "make check -j4" leads to crashes and test failures in torture/utils, FYI
<civodul>not that i want to abuse IRC as a bug tracker... ;-)
<wingo>:)
<jemarch>civodul: drop an email in bug-recutils@. Subject: -j4 fucks up testutils.sh badly
<civodul>ok!
<ArneBab_>I worked more on my notes about reusing modules as scripts: http://draketo.de/proj/py2guile/#sec-5-3-2-1
<ArneBab_>It now has a performance test of the different methods (and a rant on env… ☺)
<ArneBab_>…and a quite hacky syntax-rule for a limited replication of the python if __name__ with less typing.
<ArneBab_>(it would be pretty nice to be able to make that code production-ready, but for the time being it serves as example how far you can go with syntax-definitions in Guile Scheme)
<ArneBab_> http://draketo.de/proj/py2guile/#sec-5-3-3
<ArneBab_>One thing I still need are more things where Guile goes beyond Python.
<ArneBab_>I currently have programmable syntax and real threading. If you used it for other things which go beyond what you can do with python, it would be cool if you could write it here (I read my backlog - at least if you call my name to highlight me)
<ArneBab_>plan for guile scheme beyond Python: http://draketo.de/proj/py2guile/#sec-6
<ArneBab_>davexunit: would you like to write a few paragraphs on your experience with delimited continuations (or something else which really struck you with Guile Scheme)?
<ArneBab_>I’ll try to be back here this evening
<ArneBab_>bbl
<davexunit>ArneBab_: do you want to post this somewhere?
<davexunit>I could do it, but not right now and probably not this evenving either.
***xchg_ is now known as xchg
<jemarch>civodul: heh, looks like recutils got some competition, finally: https://github.com/harelba/q :)
<civodul>jemarch: interesting :-)
<civodul>less than 1000 lines of Python
<civodul>doesn't look as attractive as recutils, though (needless to say ;-))
<ArneBab_>davexunit: I don’t yet know how I want to use the article. Likely I’ll just publish it on my website (under GPL). Though if some journal would want to use it and give it much more reach than my small site, I’d be happy with that - as long as they allow me to additionally publish it under GPL, maybe delayed to give the journal a headstart.
<davexunit>ArneBab_: publishing a journal under GPL? Why not CC-BY-SA?
<ArneBab_>davexunit: because my whole website is under GPLv3+
<ArneBab_>(because cc by-sa does not require sharing the sources)
<wingo>so, no ia64 in debian any more. can we remove ia64 code from guile? :)
<civodul>:-)
<civodul>wingo: fine with me for 2.2!
<wingo>hehe excellent
<wingo>hoo, reading that long mingw thread
<dsmith>Hey hey
<wingo>man, mark did a great job with that mingw thread
<wingo>heya dsmith
<dsmith>wingo, (make-vector #e1e9) in test-suite/standalone/test-out-of-memory is not happy on my 32bit machine. Looks like 16777215 is the max.
<dsmith>Two releases out! Whooo!
*dsmith starts looking at sneeks box..
<wingo>dsmith: ah, indeed.
<wingo>that's pants :P
<dsmith>lol
<dsmith>Looks another sd card went south
<dsmith>mark_weaver, Looks like I need to get another sd card for sneek. (And I've got a beaglebone black on order)
<mark_weaver>dsmith: ah, good! I was wondering what was up with sneek. My RPi has also been offline for a few weeks. I haven't yet had the time to go investigate (it's not near me).
<ArneBab_>mark_weaver: which mingw thread?
<mark_weaver>ArneBab_: I don't know what you're talking about. If there's some relevant context here, I've forgotten it.
<dsmith>Probably thisL
<dsmith>wingo> man, mark did a great job with that mingw thread
<dsmith>s/L/:/
<mark_weaver>ArneBab_: I guess he's talking about the thread that starts here: http://lists.gnu.org/archive/html/guile-devel/2014-02/msg00047.html
<ArneBab_>yepp, that
<madsy>Can I make scm_shell return control to the application somehow?