IRC channel logs

2017-01-24.log

back to list of logs

<daviid>sneek
<sneek>Someone once said sneek is a good boy
<daviid>sneek: later tell spk121 I'm sorry my internet connection abruptly ceased to work, then I had to leave ... but again thanks for your help!
<sneek>Okay.
<davexunit>haunt 0.2.1 released https://haunt.dthompson.us/haunt-021-released.html
<spk121>hi
<sneek>Welcome back spk121, you have 1 message.
<sneek>spk121, daviid says: I'm sorry my internet connection abruptly ceased to work, then I had to leave ... but again thanks for your help!
<davexunit>my new game library, chickadee, has a first release https://dthompson.us/projects/chickadee.html
<davexunit>ACTION goes to bed
<paroneayea>davexunit: YAY
<amz3>héllo
<OrangeShark>hello
<catonano>OrangeShark: hello ;-)
<catonano>amz3: hello ;-)
<civodul>Haunt release! \\o/
<civodul>thank you davexunit!
<davexunit>civodul: you're welcome. sorry for the long delay.
<davexunit>future releases should be easier to make.
<civodul>and Chickadee!
<civodul>cool
<civodul>i've put an item on HN :-)
<davexunit>yeah I was on a roll last night
<davexunit>oh thanks :)
<ManDay>Ah, okay there is a channel
<ManDay>I can't find "div" nor "mod" in guile - how is that possible?
<ManDay>v2.0.13
<dsmith-work>Tuesday Greetings, Guilers
<davexunit>ManDay: it's "modulo"
<davexunit>'div' and 'mod' are both procedures in (rnrs base (6)), though
<ManDay>yes they are and there isn't mention of a function "modulo" (what is the correspoding div called anyway). why are they not in guile?
<ManDay>this is slightly irritating!
<davexunit>what do you mean not a mention?
<ManDay>davexunit: r6rs specifies "div" and "mod"
<davexunit>this is all in the manual
<davexunit>modulo is in the default environment
<ManDay>why?
<davexunit>because that's the procedure that guile has provided for a long time.
<ManDay>i was under the impression that the "default environment" were to be r6rs
<davexunit>no.
<davexunit>but r6rs stuff is just an import away
<ManDay>yeah i figured that thanks
<ManDay>so i assume its common practice to load r6rs in the .guile file?
<davexunit>I haven't heard of anyone doing that but it sounds convenient if you always want an R6RS environment.
<davexunit>I activate readline support in my .guile
<ManDay>why would anyone not want an r6rs environment? Would anyone intend to *not* program according to the spec?
<ManDay>yeah me too (readline)
<davexunit>ManDay: there are many scheme specifications
<ManDay>i didn't realize that either. i that r6rs was *the* scheme spec
<davexunit>it is the 6th edition of the Scheme standard
<davexunit>there is also r7rs
<davexunit>and to make it more confusing, there's both r7rs-small, and r7rs-large
<ManDay>so I should not assume this works like for C or c++ or something like that?
<davexunit>correct
<ManDay>where the interpreter/compiler always tries to abide to the current spec
<davexunit>guile modules written in r5rs can coexist with modules written in r6rs, for example
<ManDay>so which scheme spec is the commonly used one if it's not r*rs ?
<davexunit>so, Scheme has standards, but every Scheme implementation is actually a new language in its own right.
<davexunit>Guile includes tons of features that aren't in any Scheme standard.
<davexunit>so, I write Guile Scheme programs, not Scheme programs.
<davexunit>R5RS is widely supported amongst Scheme implementations, with R6RS and R7RS less so.
<ManDay>ok, but that sounds much like one would say "I write C programs for GCC, not according to the C standard" and that isn't necessarily a good thing
<ManDay>At least in C I only use nonstandard feature only when absolutely necessary (and that has probably happend 2, 3 times in a lot of years and mostly concerned build-specific)
<ManDay>So I guess by that attitude I should stick to r*rs then?
<ManDay>But every scheme implementation eventually wants to support the maximal r*rs, right?
<ManDay>and when you say "tons of features" these are forms then and not new syntax that would interfer with r*rs libraries being loaded, right?
<davexunit>ManDay: the features I'm talking about are things that will work in Guile only
<davexunit>try to run them in Chicken and it won't work
<davexunit>you won't be able to do much using only standard Scheme
<ManDay>davexunit: Yes but will they interfer if you are writing according to r*rs?
<ManDay>davexunit: what do you mean?
<ManDay>How am I not able to do much using say r6rs?
<davexunit>ManDay: the scheme specifications leave out many things that would be necessary for complex programs
<ManDay>can you give an example please so i can follow?
<davexunit>like a POSIX interface
<davexunit>I don't know if r6rs or r7rs have anything to say about sockets, also.
<davexunit>the point I'm trying to make is that Scheme is unlike C/C++
<davexunit>there are standards, and some libraries are written to be portable using them, but there are a great many things that cannot be written in portable Scheme.
<ManDay>i see
<ManDay>i understand
<ManDay>thanks very much
<davexunit>so from a practical viewpoint, I think it's best to view each Scheme implementation as its own unique language.
<davexunit>in addition to standards, you can check out the "Scheme Requests for Implementation" documents, or SRFIs for short.
<davexunit>a bunch of things are specified there that, while not necessarily a part of any Scheme standard, are implemented by nearly every Scheme out there.
<ManDay>still, i assume these features are provided in a manner that does not interfere (i.e. they are invisible unless you know they are there)?
<davexunit>correct. if you don't make use of them, they don't do anything.
<avoine>ACTION is having fun debugging a race in fibers
<paroneayea>concurrency Who is says hard? debugging
<davexunit>haha
<paroneayea>hm, I have a case where I have a class-level cache in GOOPS
<paroneayea>but I want to wipe it out on redefinition...
<paroneayea>Presumably class-redefinition is what I want
<paroneayea>but I'm doing something wrong I guess
<ManDay>I wonder about how Guile's scheme is actually such that it's invisble unless used.
<ManDay>Doesn't a define-syntax remain in effect and possibly affects the interpretation of other forms?
<ManDay>davexunit: ^
<paroneayea> http://paste.lisp.org/display/337334
<paroneayea>ManDay: huh?
<davexunit>ManDay: guile is designed to be compatible.
<paroneayea>oh
<davexunit>so people put in effort to make sure such things don't happen.
<paroneayea>there was an above conversation I missed, ignore me
<ManDay>davexunit: but take for example (define-class) which is a transformation. If I were not to know about (define-class) and assume it doesn't exist and tried to define (define define-class (lambda ... ...))) wouldn't that interfere?
<ManDay>paroneayea: sorry, should have mentioned
<davexunit>ManDay: no
<paroneayea>ManDay: nah, my bad for not scrolling first
<ManDay>davexunit: how so?
<davexunit>first, define-class is in the (oop goops) module, you'd have to import it to get it.
<ManDay>I thought the syntax transformations take precedence over forms
<ManDay>davexunit: ah okay. yet, is there a second reason?
<davexunit>second, you can make your own syntax with that name and shadow any previous definitoin.
<davexunit>definition*
<ManDay>davexunit: yes, but what if I were to define a form instead of define-syntax?
<davexunit>what is a "form" to you?
<ManDay>that woulnd't shadow the (define-syntax)
<davexunit>again, you'd have to import (oop goops)
<ManDay>davexunit: a (define define-class (lambda (x) ...)) for example
<davexunit>which you wouldn't do if you were writing a program restricted to a particular scheme standard.
<ManDay>davexunit: okay, but you agree that if it were imported by default then it would invisibly interfer due to its "unexpected" (define-syntax), righ?
<davexunit>ManDay: remember what I said about guile being designed in a compatible way?
<ManDay>yes I do
<davexunit>also, that example doesn't pose a problem
<ManDay>I'm just saying speculatively *if* it goops were loaded by default
<davexunit>try this in your repl
<davexunit>(define-syntax-rule (foo x) (1+ x))
<davexunit>(foo 1)
<davexunit>you get 2
<davexunit>now do this after:
<davexunit>(define (foo x) (+ x 2))
<davexunit>(foo 1)
<davexunit>you get 3
<davexunit>you just shadowed the macro named 'foo' with the procedure named 'foo'
<ManDay>hm okay, i see. I was under the impression the procedure doesn't shadow the macro. sorry, beginner mistake
<davexunit>no worries.
<davexunit>hope that clears some things up.
<ManDay>ty :)
<davexunit>yw
<spk12>shadowing is fun: (define (func x) (let ((define x)) define))
<ManDay>What does it mean if ",locals" gives, in two lines: $6 = stage = (1 . 1) and stage = #<unspecified> ?
<ManDay>(I get an error one stacklevel down on (cdr stage) saying that "stage" is not the correct type)
<ManDay>also I'm not sure how to examing variables on the stack. when I just give their name on the prompt (while in the frame where they are defined) I get an error about them not being defined
<lloda`>you can use the $1 or $2 or whatever to refer to the variable (the leftmost column in the ,locals output)
<paroneayea>something I've noticed from the mit-scheme docs
<paroneayea>they use (record-type/method-name) as a convention in some places
<paroneayea>that's nice
<ManDay>lloda`: thanks, but what does it mean that stage is mentioned twice, once with and once without the $ ?
<davexunit>paroneayea: https://files.dthompson.us/chickadee-font-test.png :)
<paroneayea>davexunit: :D
<paroneayea>nice work
<davexunit>thanks :)
<davexunit>doesn't look like much I guess but now I have my own fast font renderer and don't need to rely on SDL_ttf which was always a hack anyway.
<janneke>davexunit: chickadee says `guix install -f guix'
<janneke>i also type that sometimes -- even tried it to see if it works ;-)
<janneke>looks very cool...
<paroneayea>davexunit: oh! You have your own font renderer? :O
<paroneayea>you wrote your own font renderer from scratch????!
<paroneayea>wow!
<davexunit>janneke: guix.scm, oops
<janneke>yep ;-)
<davexunit>paroneayea: it's not as fancy as it sounds.
<davexunit>basically I only render bitmap fonts, no loading .ttfs with freetype or whatever.
<davexunit>another tool can generate a bitmap from a ttf that I can load.
<paroneayea>davexunit: ahhh :)
<paroneayea>davexunit: still, cool :)
<paroneayea>nice work :)
<davexunit>it's efficient for both memory and cpu
<davexunit>thanks :)
<davexunit>ttfs can be rendered and scaled arbitrarily by rasterizing them as "signed distance field" images, which is mumbo jumbo for an image that contains some special information that allows you to render it at any scale (within reason) with nice results
<davexunit>anywho... back to work ;)
<spk12>davexunit: I've written a couple of BDF parsers over the years to use the old X11 fixed fonts as game console bitmap font sets. Kinda fun.
<davexunit>spk12: I looked into bdf but decided not to use that format
<ManDay>Can someone have a look at this please: https://paste.pound-python.org/show/c37qvNUkkSQmfvWMdm9G/ - I can't figure out how to debug this. When the program breaks, neither ,bt nor ,up and ,locals will reveal why "stage" is not a good argument to (cdr). I will check the channel logs tomorrow in case you happen to reply and I'm gone.
<ManDay>(on a side remark, I haven't quite figured out how to distinguish between variables in a higher stack frame and variables which are lexically bound in the context of a function through ,locals)
<ManDay>the error is on line 38, ofc
<daviid>spk12: you are spk121 right? :)
<spk12>daviid: usually
<daviid>spk12: I lefte a chabot message for you under that acronym, yesterday...
<spk12>daviid: mistyped and too lazy to fix it.
<spk12>daviid: saw it. No prob, happy to help.
<daviid>spk12: ah cool
<daviid>paroneayea: class-redefinition is not called here either, prob a bug...
<daviid>i find out class-slot-ref does not call slot-missing has it should:
<daviid>scheme@(guile-user)> (class-slot-ref (class-of k) 'hashy)
<daviid>oop/goops.scm:2477:18: In procedure class-slot-ref:
<daviid>oop/goops.scm:2477:18: In procedure struct-ref: Wrong type argument in position 1 (expecting struct): #f
<daviid>instead of scheme@(guile-user)> (slot-ref k 'hashy)
<daviid>ERROR: In procedure scm-error:
<daviid>ERROR: No slot with name `hashy' in object #<<klassy> 55a78ee18aa0>
<daviid>
<avoine>not really sure why but guile's pretty-print is not working with my gdb, for example:
<avoine>(gdb) frame
<avoine>#0 scm_atomic_compare_and_swap_scm (loc=0x5555557b9418, expected=0x7ffff18faba0, desired=0x304) at ../libguile/atomics-internal.h:72
<avoine>but guile-scripts is enabled:
<avoine>(gdb) info auto-load guile-scripts
<avoine>Loaded Script
<avoine>Yes /usr/local/lib/libguile-2.2.so.0.0.0-gdb.scm
<spk12>ManDay: in line 27 of your code, stage is set to unspecified because your "(if trailing ..." has no alternate. it is an (if <test> <consequent>) not a (if <test> <consequent> <alternate>)
<spk12>ManDay: and 'trailing' is #f
<avoine>found it, gdb is using guile 2.0...
<avoine>hum, gdb don't compile with guile 2.1.5 : ./guile/scm-ports.c:139:45: error: ?scm_new_port_table_entry? was not declared in this scope
<spk12>avoine: it was completely removed from master a few months ago. The commit log says "(scm_new_port_table_entry): Remove; not useful". haha