IRC channel logs

2014-06-28.log

back to list of logs

***petercom1and is now known as petercommand
<wingo>it seems bit-count* just doesn't do what the docs claim that it does
<wingo>....because of a typo.
<wingo>introduced in january 2005
<wingo>good times
<davexunit>ouch
<davexunit>typo in the docs or implementation?
<wingo>implementation
<taylanub>Guile needs more users (who report bugs) :P
<add^_>lol
<add^_>"good times" :-P
<janneke>how does ,break-at-source work?
<ijp>magic
<wingo>janneke: i think there is something in the manual about it
<wingo>search for something like trap-at-source-location
<janneke>whatever i do, i get either (without GEISER) ERROR, or with geiser WARNING:
<janneke>;;; WARNING (no instructions found for simulate.scm : 185)
<janneke>and sure enough, it does not break
<janneke>wingo: same difference
<janneke>WARNING, it still shows up in ,traps -- but no break when executed?
<wingo>you didn't find documentation in the manual about how traps are implemented?
<janneke>eh...i went straight to trap-at-source-location and add-trap-at-source-location
<janneke>do i need to read more?
<janneke>,break PROCEDURE "just works"
<wingo>breaking on procedures and breaking on source locations are implemented differently
<wingo>it could be you have found a bug
<wingo>does the source location you are trying to break at correspond to the start of the procedure?
<janneke>wingo: i tried many things
<janneke>including off-by-one
<janneke>full path name to the file
<janneke>path name from the load path
<wingo>i don't doubt you did; just mentioning some implementation details :)
<wingo><wingo> does the source location you are trying to break at correspond to the start of the procedure?
<wingo>^
<janneke>i tried that
<wingo>that is a question :)
<wingo>does it?
*wingo not communicating well it seems
<janneke>sorry, wingo, i don't get it :-)
<janneke>in my first tries, i used different locations than the start of a procedure
<janneke>but when i got more desperate, i tried the location of the start of a procedure
<janneke>including off-by-one (user/vs guile) line locations
<janneke>so, eh, i gues: yes: even if i use start of procedure, i do not get it to work
<wingo>ok :)
*janneke is starting to wonder if people use the debugger...
<wingo>is the procedure compiled?
<janneke>yes
<janneke>you mean, is the .go file current?
<wingo>;(use-modules (system vm program))
<wingo>er
<wingo>yeah i mean something like that
<wingo>if you (use-modules (system vm program))
<wingo>and you say (program-source <your-proc> 0)
<wingo>what do you get
<wingo>and yes that user vs guile thing regarding line numbers is irritating
<janneke>$12 = (0 "/home/janneke/vc/verum/development/language/asd/simulate.scm" 181 . 0)
<janneke>scheme@(language asd simulate)> ,break-at-source "/home/janneke/vc/verum/development/language/asd/simulate.scm" 181
<janneke>While executing meta-command:
<janneke>ERROR: No procedures found at ~a:~a. "/home/janneke/vc/verum/development/language/asd/simulate.scm" 181
<janneke>scheme@(language asd simulate)> ,break-at-source "/home/janneke/vc/verum/development/language/asd/simulate.scm" 182
<janneke>;;; WARNING (no instructions found for /home/janneke/vc/verum/development/language/asd/simulate.scm : 181)
<janneke>Trap 8: Breakpoint at /home/janneke/vc/verum/development/language/asd/simulate.scm:182.
*wingo making cherry jam
<wingo>so that 181 is in "guile" coordinates
<wingo>it corresponds to 182 in user coordinates
<janneke>yes...that all makes sense
<wingo>that guile says ;;; WARNING (no instructions found for /home/janneke/vc/verum/development/language/asd/simulate.scm : 181)
<wingo>is a bug.
<wingo>context:
<wingo>the source corresponding to the start of a procedure is the source position of the left-paren in a lambda expression
<wingo>or the left-paren of a define
<wingo>brb, jam needs stirring
<wingo>ok
<wingo>but the ,break-at-source stuff looks for source locations corresponding to individual expressions
<wingo>the first expression in that procedure probably is on some other line
<wingo>probably that code needs a special case to look at the program-source of the procedure being called, when entering procedures
<wingo>not just the source of the given instruction
<wingo>dunno, lots of details here
<wingo>and with macros one expression can have multiple sources...
<wingo>the source of the macro, and the source of all of its expansions... and guile only records one of them.
<wingo>sadness.
<janneke>np...just trying to figure things out
<janneke>when this did not work, and eg there seems no real convenient way to print local variables
<wingo>,locals ?
<janneke>sure
<janneke>...but makes me think no-one uses it. i'd expect: ,l
<wingo>hehe
<wingo>i use ,locals all the time
<janneke>and a way to automatically print them each step
<janneke>wingo: you have used gdb /gud haven't you?
<wingo>iyes
<wingo>yes
<wingo>but i've never rigged up gdb to print locals at each step
<wingo>how does one do that?
<janneke>display <some variable>
<wingo>i've only used info locals, info arguments, and bt full to get locals
<janneke>display <another variable>
<wingo>interesting
<wingo>thanks :)
<janneke>or even: gud-many-windows
<wingo>i don't use gud
<janneke>you get 6 windows...with source, frame, locals etc info
<wingo>so my yes was a half-truth it seems
<janneke>;-)
<janneke>np
<janneke>i never until now used debugging in guile -- i hate debugging
<janneke>but at my current gig, i want to introduce guile, and the others want a debugger :-)
<davexunit>the guile debugger is pretty good
<janneke>also, the namings and documentations of step and next confuse me
<janneke>davexunit: that's what i said, but i could not produce an ide (not even in emacs) up till now
<janneke>dare i say eclipse?
<wingo>:)
<janneke>*ducks*
<wingo>definitely room to improve, no doubt!
<janneke>it seems all/most is there, but some missing bits...and that makes me wonder if it's used a lot
<davexunit>the timing and profiling features are cool, I can move up/down the stack frames, inspect locals, etc. all my needs are covered
<janneke>and if i'm on the wrong track; that's all
<janneke>davexunit: ok -- yes that's more than i need
<janneke>but i'm looking into GUD integration to present some kind of debugger IDE
<janneke>and break-at-source-location is kinda necessary
<janneke>(delete/disable trap-at-source-location would be nice too)
*ijp pokes jao
<ijp>who is conveniently not here...
<wingo>you can delete and disable traps
<wingo>see ,traps
<wingo>and related commands
<davexunit>jao writes racket professionally, right?
<wingo>davexunit: clojure :)
<davexunit>oh okay
<janneke>yes...but i need to figure out a way to find the trap id from the file's source location
<davexunit>that's the lisp that business people approve of
<janneke>another stupid question...
<janneke>does anyone have a nice compilation-error-regexp-alist-alist that works with guile backtraces?
*davexunit wishes that he could get paid to write software in Guile some day...
<janneke>davexunit: that's my plan
<janneke>when i came, it was all c++, not too bad even...
<janneke>but terribly over- or mis-engineered
<janneke>guile to the rescue, hopefully
<davexunit>best of luck
<janneke>thanks
<davexunit>lisp is a tough sell, let alone scheme, let alone an implementation with a small community.
<janneke>we're a startup and had next to 60.000 loc c++
<janneke>25.000 generated...which makes it less worse, and more worse
<janneke>now we (i) have basic functionality in under 2000 loc guile
<janneke>luckily we have some very smart people, some mathematicians/scientists who like stuff like haskell
<janneke>and if i fail with guile, c++14 is almost lisp :-)
<newb-101>Help please... Installed guile-sdl, tests work but (use-modules ((sdl sdl))) reports "ERROR: no code for module (sdl sdl)"...
<ft>That's one set of parens too many.
<davexunit>yup
<newb-101>(use-modules ((sdl sdl) #:prefix SDL:) (srfi srfi-1) (srfi srfi-2)) I was assuming use-modules takes a list of bindings...
<wingo>actually (use-modules ((sdl sdl))) is equivalent to (use-modules (sdl sdl))
<wingo>usually you see the latter, but both are valid
<newb-101>anyhow, the error is the problem...
<ft>oh, okay. :)
<wingo>newb-101: it is probably related to load paths
<wingo>i guess your guile is from the system, but you built guile-sdl yourself?
<newb-101>Yes
<davexunit>is it installed in /usr/local but that isn't in your guile load path?
<wingo>so probably guile-sdl got installed in /usr/local
<wingo>right
<wingo>i suggest you do "sudo make uninstall" in the directory in which you built guile-sdl
<wingo>then make clean
<wingo>then do the ./configure as you did before -- but add "--prefix=/usr"
<wingo>that will install guile-sdl in /usr instead of /usr/local
<nanashi``>btw, is DESTDIR useless? Is it bad?
<wingo>this could over-write other things on your system, in general -- but if you didn't have guile-sdl installed before there's no worry
<newb-101>Is ubuntu package in /usr normally?
<wingo>newb-101: yes ubuntu packages are in /usr -- all of them.
<wingo>DESTDIR is mostly useless -- it's only useful when e.g. cross-compiling for ARM.
<newb-101>Thanks wingo, will give it a try...
<wingo>good luck :)
<newb-101>Excellent, use-modules now succeeds. Thanks again
<wingo>np, happy hacking
<ArneBab>janneke: could we get your company to give your text here as an official reference to guile?
<janneke>ArneBab: that would be nice, but it's waaay to early for that
<janneke>note: it's not *my* company
<ArneBab>ok :)
<ArneBab>with “your” I meant “the one you’re working at”
<janneke>if/when they "get" it and are happy, possibly....
<janneke>did i say that?
<janneke>well, i do feel very much involved
<janneke>*my* company that is consulting for this startup, is happy to give an official reference to guile ;-)
<ArneBab>ah, cool!
<ijp>We like our programming languages like we like our women, 50 years old and curvy -- Janneke's company
*taylanub gives ijp the side-glare
<wingo>boooo
<janneke>ijp: if she looks like babushka, she's mine -- programming language an woman alike
<janneke>;-)
<wingo>boo for making a sexualized environment around a tech project. boo.
<janneke>ahum
<janneke>yes
<janneke>scrap that!
<ArneBab>actually it would be nice to have a (randomly selected) quote on the website from someone who successfully uses guile.
<ArneBab>(but I’m not one to decide that…)
<ijp>"I used guile and lost 200lbs"
<ijp>if you don't ask around you don't get, but asking makes you seem desparate
<ArneBab>“I used guile and lost 97% lines of code” (60k down to 2k)
<ArneBab>well, provide a link to the one you quote and that’s beneficial both wars.
<ArneBab>wars→ways
<ArneBab>“we want to add a section with quotes from successfull guile-users. Would you like to take part?”
<ArneBab>wingo: how about igalia?
<wingo>it's mostly me using it; not much of a quote :)
<ijp>maybe we can pay for a celebrity endorsement
<ArneBab>wingo: we could select random quotes from your articles on guile ☺
<davexunit>I'm going to be renaming guile-2d now that I'm adding 3D support. someone just suggested the name "Sly". I like it.
<davexunit>complements "guile" nicely
<wingo>:)
<wingo>nice
<davexunit>I think it's a keeper.
*wingo pleased; another piece of the compiler came together
<wingo>this time reducing execution time and memory, thankfully
<wingo>combatting O(n^2) has been interesting
<davexunit>:)
<davexunit>which piece of the compiler is this?
<wingo>this is in the optimizer and backend
<wingo>you end up wanting to compute e.g. what values are available at each program point
<wingo>which is naively n^2
<wingo>because it's nlabels * nlabels
<wingo>so at first i was using a modified version of vhashes to share state
<davexunit>what is a label in this context? (apologies if I'm distracting you from work)
<wingo>that's what's currently in for type inference
<wingo>a label is like a label in C -- it identifies an expression
<davexunit>okay
<wingo>but the vhash strategy was too branchy -- lookup took too long
<wingo>and it was too much overhead for the case in which you just want to store one bit per label
<wingo>so i just implemented a persistent bitset instead -- which has some other advantages
<wingo>it seems to be the right compromise
<wingo>anyway, i have to write about this
<davexunit>I look forward to reading about it.
<wingo>it's actually the writing about this that's the forcing function -- it needs to be nice :)
<wingo>and i've failed in a number of interesting ways ;)
<wingo>which are worth explaining
<wingo>anyway, soon
<wingo>but the short story is that clojure-style data structures are great.
<davexunit>I haven't used clojure. are you referring to them being immutable or some other property?
<wingo>it's more that it shares structure
<wingo>and the particular way of dividing up the key-space into a tree whose leaves are packed arrays, which can be bit arrays or even in this case fixnums
<wingo>which is neat, representing numbers as state-sharing trees
<davexunit>interesting
<davexunit>I need to spend some time with clojure
<wingo>i've never programmed in it, but its vectors and hash-maps are nice
*wingo printed out those java files yesterday to study
<wingo>thing is in guile you can get functions with 10K labels, not too difficult
<wingo>the root function of a big module, for example
<wingo>naively that's 100M data points to store
<ijp>which reminds me, I should really clean up my hamts module and release it
<wingo>which depending on your choice of data structure could be 1GB or 100K
<wingo>ijp: indeed
<wingo>i think i'll implement something similar for integer keys -- more like AMTs than HAMTs
<wingo>as it is, this bitset is an AMT
<wingo>but with fixnums at the leaves
<wingo>and a smaller branching factor, to share more structure -- though that needs more benchmarking
*wingo doing science, this is great