IRC channel logs


back to list of logs

<koz_>Is there a reason why SRFI-1 is so much more comprehensive in terms of what it provides than SRFI-43?
<jyc>koz_: if you have a procedure to generate the cartesian product, you could just iterate to get [24]^16 :P
<paroneayea>o/ slwebber
<slwebber>going through little schemer examples
<paroneayea>slwebber: cool
<slwebber>trouble is, I'm getting an unbound variable message when using geiser to evaluate
<paroneayea>slwebber: could you pastebin at then paste the link here?
<paroneayea>slwebber: both the code and the error would help
<slwebber>;;; <stdin>:37:0: warning: possibly unbound variable `insertR_'
<slwebber><unnamed port>:37:0: In procedure #<procedure 2f92ba0 at <current input>:37:0 ()>:
<slwebber><unnamed port>:37:0: In procedure module-lookup: Unbound variable: insertR_
<paroneayea>slwebber: is that while evaluating insertR_ ?
<paroneayea>slwebber: btw, one clear error to me is that on your cond check for (null? l)
<paroneayea>you do
<paroneayea>which evaluates the empty list
<paroneayea>whereas you just want
<paroneayea>because you're not evaluating it, just returning it
<slwebber>must be a difference in notation in the little schemer
<paroneayea>slwebber: little schemer has the same notation here
<paroneayea>you can see that the rmember?_bad you did it the right way
<slwebber>that was my implementation, that latter was the little schemers
<paroneayea>(btw, I think it's rember, not rmember)
<slwebber>they used (quote ())
<paroneayea>slwebber: so, (quote ()) is the same as '()
<paroneayea>remember that ' is a reader macro for (quote ...)
<paroneayea>slwebber: btw, some useful commands to know while working with geiser:
<paroneayea> - C-x C-e <at the end of an expression>: evaluates it
<paroneayea> - C-M-x: evaluates the whole expression, even if in the middle
<paroneayea> - C-x C-r: evaluates a highlighted "region"
<paroneayea> - C-c C-r
<paroneayea> - C-c C-b: evaluates the whole buffer
<paroneayea> - C-c C-z: switches you to a REPL, for quick testing of things
<paroneayea>slwebber: those are the commands I use most often, in case that's helpful
<slwebber>why is C-c C-z better than C-c C-a ?
<slwebber>or, when would it be useful in comparison?
<paroneayea>slwebber: oh, C-c C-a is similar, but it switches "into" the module
<paroneayea>which will have no difference for what you're doing
<paroneayea>slwebber: but imagine you were writing a bunch of modules, in a program with a lot of little libraries in it
<paroneayea>slwebber: C-c C-a will switch you into the module itself, so you can play with even the un-exported variable
<slwebber>I still haven
<paroneayea>slwebber: but it's not really of concern when you aren't writing any modules to be experted, so those commands are effectively the same for what you're doing
<slwebber>haven't grokked the distinction, though I assume it has to do with visibility
<paroneayea>slwebber: hence why your prompt says (tuile-user)
<paroneayea>slwebber: I can show you the distinction in person if that's helpful.. if you start hacking guix or writing a library for others to use, it'll be more useful to know the difference then
<paroneayea>in the meanwhile, they do the same thing for now.
<slwebber>okay, thanks
<paroneayea>slwebber: that (quote ()) thing is definitely confusing though; little schemer takes shortcuts based on type to distinguish between variables and quoted variables
<paroneayea>which is a bit unusual when you first see it
<paroneayea>and easy to miss
<paroneayea>slwebber: np
<paroneayea>hope it helps
<paroneayea>slwebber: btw, if you get stuck
<paroneayea>slwebber: ,trace (firsts '((a b c) (d e f) (g h i)))
<paroneayea>,trace ftw
<slwebber>@paroneayea oh that's useful
<slwebber>paroneayea, I'm getting used to the paren alignment conventions
<slwebber>starting to click for me
<paroneayea>slwebber: woo :)
<paroneayea>davexunit: I'm working my way through 3.3.4 of SICP now, the circuit simulator
<paroneayea>I'm getting closer to understanding Sly's SICP basis and concepts :)
<davexunit>paroneayea: :)
<davexunit>yup, it's pretty much all there!
<koz_>Is there a version of list-index that gets me the index of the *last* element satisfying pred?
<koz_>If not, what's the easiest way of doing this short of hand-rolling?
<davexunit>don't think so
<davexunit>but it would be a simple fold
<koz_>davexunit: For the index?
<davexunit>since you have to walk the entire list
<koz_>OK, I need to think a bit.
<davexunit>rather than folding, I'd probably use a named let and iterate
<koz_>davexunit: I think I figured it out. Thanks for directing me to fold!
<ransom_>davexunit, when you say "picture language", do you mean < >? do you have links that explain how lisps (or programming languages in general) might be thought of as picture languages?
<davexunit>ransom_: no, I mean the picture language that is define in SICP chapter 2
<ransom_>ooo... i like the formatting on this version
<davexunit>yes, nice typography
<davexunit>gotta go
<koz_>Well, it's time to see how Guile handles combinatorial explosion.
<koz_>As well as how well my OS handles having to constantly swap. :P
<koz_>How bad is it if the REPL spits this at me? Too many heap sections: Increase MAXHINCR or MAX_HEAP_SECTS
<koz_>OK, and my REPL is dead.
<koz_>How do I make Guile print (i.e. not using display and co) a number as a float instead of a fraction (i.e I want it to display 0.5 instead of 1/2)?
<nalaginrut>koz_: ~f
<koz_>nalaginrut: I don't quite understand what you mean.
<nalaginrut>koz_: (format #t "~f" 1/2)
<nalaginrut>just similar to format string in C
<koz_>Ah, OK. Thanks.
<nalaginrut>np ;-)
<Digit> could use more tutorials there. even just quick n dirty ones would be better than none ( / one about C )
<lloda>koz_: did you see the pointer to Knuth re: combinations? you'd use a vector not a list for those algorithms. It should be pretty fast
<lloda>I did it in C and it takes no time for 8 out of 24, at least
<lloda>scheme@(guile-user)> ,time (combination-matrix 24 8)
<lloda>$1 = [array s32 735471 8]
<lloda>;; 0.033257s real time, 0.045691s run time. 0.016172s spent in GC.
<koz_>lloda: It's OK - my main problem was that I was trying to hold the entire problem space in memory.
<koz_>Once I switched to a generate-on-demand approach, it didn't matter.
<wirrbel>how can I switch to a language that is not in guile's module set?
<wirrbel>ah probably by importing that module first
<wirrbel>so I have the language definition imported and can inspect its value
<wirrbel>but ,language mylang does not work
<wirrbel>neither does (compile '(+ 1 2) #:from 'mylang ....
<ArneBab_>you need the language spec in the path (so that guile can import (language yourlang spec)
<ArneBab_>wirrbel: for wisp I use guile -L path/to/toplevel/dir
<ArneBab_>wirrbel: you’ll have to ensure that the spec.scm is parsed before switching to the lang — after switching to it, Guile cannot read scm files till you switch back, but it can read the .go files
<nalaginrut>oh, 111 people on Nov 11
<nalaginrut>seems almost overflow...
<ArneBab_>wirrbel: see
<ArneBab_>I’m wondering whether giving a talk about wisp would be useful for FOSDEM.
<nalaginrut>ArneBab_: why not ;-)
<davexunit>ACTION thinks he found a bug in SRFI-19
<davexunit>pointed out by mthl in a bug report for haunt.
<davexunit>current-date is not handling daylight savings time correctly
<davexunit>srfi-19 has a nasty hack to handle it correctly in string->date
<davexunit>so haunt's test suite fails if you live in a place with daylight savings time
<davexunit>for testing purposes, I think we could use some sort of 'call-with-timezone' procedure.
<davexunit>yeah, (date-zone-offset (current-date)) yields a different value than (date-zone-offset (string->date "..."))
<davexunit>I'll file a bug report when I have time.
<paroneayea>why don't schemers tend to use *earmuffs*?
<paroneayea>given that schemers do use foo!, foo?, and %foo
<mark_weaver>we do
<paroneayea>mark_weaver: oh, I guess I haven't noticed it as much
<mark_weaver>if you search for ' \\*' in module/.../*.scm, you'll find many examples
<paroneayea>mark_weaver: ok thx
<cmhobbs>would guile be useful for tasks that i'd normally use bash for? sometimes i use ruby for system scripting
<cmhobbs>could you point me to some examples or some useful modules?
<amz3>cmhobbs: you can easily break your system using guile too :p
<cmhobbs>please and thanks
<cmhobbs>amz3: i'm good at that with or without guile
<davexunit>look at the POSIX stuff
<davexunit>system*, pipes, etc.
<paroneayea>hello cmhobbs !
<cmhobbs>hello paroneayea :D
<paroneayea>whew! finished entering all the code from the circuit simulator of SICP
<paroneayea>now I should do real work :)
<cmhobbs>sicp is a great book. i should finish it sometime
<mark_weaver>ACTION <3 SICP
<davexunit>paroneayea: now you basically know how Sly works
<paroneayea>davexunit: :)
<paroneayea>yeah it made a lot of things clearer
<paroneayea>davexunit: did you take that and fold in the functional aspects on your own, or is that worked in later on in section 3?
<davexunit>yeah basically that
<davexunit>I took the propagator system described a bit later
<davexunit>and sort of crippled it, if you will, by turning into a DAG rather than a graph that allows cycles.
<davexunit>and then gave it a declarative interface.
<paroneayea>ACTION nods
<davexunit>Sly at it's heart is SICP chapters 2 + 3 glued together. :)
<paroneayea>my SICP workflow is, start reading a chapter, get enough of it in my mind that I have a sense of it, watch the accompanying video lecture, then enter the code and occaaaaaasionally try some of the exercises ;)
<paroneayea>many of those exercises are too hard for me initially and i have to come back to them later when it's sunk in more
<mark_weaver>doing exercises is crucial
<cmhobbs>just asked to use guile on a smallish project at work... waiting on my team lead to respond is agonizing
<mark_weaver>and GJS agrees, fwiw. at FSF30 he told me so.
<paroneayea>mark_weaver: yeah I agree that it doesn't really sink in often until you do the exercises
<paroneayea>mark_weaver: I've found I finish more of the exercises of the previous chapter once I'm on the next one :)
<dsmith-work>Morning Greetings, Guilers
<cmhobbs>hello dsmith-work
<paroneayea>mark_weaver: because I keep the texinfo version of SICP open in emacs, and wehn I'm seeking a distraction
<mark_weaver>paroneayea: sure, as long as they get done eventually, that's the important thing :)
<paroneayea>I puzzle through one :)
<wingo>paroneayea: i think in CL they mark variables that are not just global but also "special"
<wingo>ACTION landed f64 unboxing in master
<mark_weaver>in lisp terms, "special" == dynamically-scoped
<wingo>will be interested to hear of successful compilation reports on 32-bit systems
<mark_weaver>ah, I happen to be running on i686 right now, so I can try.
<mark_weaver>(my x86_64 laptop has a hardware problem)
<paroneayea>mark_weaver: wingo: it seems more conventional to use %foo in guile-land for those
<taylan>.oO( dynamic scoping is indeed a bit "special" :P )
<paroneayea>dynamically scoped things
<davexunit>wingo: yay!
<wingo>paroneayea: there are many conventions, some conflict :)
<wingo>for example in older guile code, a % prefix indicates something that's internal in some way
<wingo>i think?
<mark_weaver>yeah, I think so too
<taylan>isn't that convention still used? in my code I'll frequently name e.g. a "low-level" record constructor %make-foo so I can call the "proper" one make-foo.
<mark_weaver>taylan: yes, I think so. I was agreeing with what wingo wrote after the ","
<davexunit>in guix, % is also used to denote certain module global variables as opposed to procedures.
<mark_weaver>the great thing about conventions is that there are so many to choose from
<taylan>heh :)
<taylan>although it doesn't seem popular, I really like naming syntax rules pattern variables <foo>. (IME, rarely conflicts with record types, and doesn't confuse even then because the purposes are so different.)
<mark_weaver>it's a fine convention, although personally I don't feel the need to mark the pattern variables in any way at all.
<mark_weaver>feels like "sigils" to me, which I'm not fond of in general.
<mark_weaver>but it's not unreasonable either
***heroux_ is now known as heroux
<mark_weaver>welcome, jeffrin!
<jeffrin>mark_weaver : thanks
<jeffrin>mark_weaver : can guile be used for data analysis ?
<mark_weaver>it's a general purpose programming language, so I don't see why not. but I don't know enough about data analysis in practice to know how well suited it is. maybe your question is too broad.
<jeffrin>mark_weaver : anyway thanks
<jeffrin>mark_weaver : is there any certificate course for guile ?
<davexunit>no, we're not the Linux Foundation ;)
<taylan>I can recommend the Guile manual if you want to self-certify :)
<davexunit>let's start the "Guile Wizard Certification Program"
<holomorph>yer a wizard
<davexunit>comes with your very own fez!
<jeffrin>iam having chest pain related
<jeffrin>anyway god knows what i should learn
<mark_weaver>one way to learn guile is simply to try to use it to write whatever programs you want to write, and ask here for help and advice as you go.
<mark_weaver>if you're new to scheme, the "Little Schemer" and "Seasoned Schemer" books are good.
<mark_weaver>if you are comfortable with calculus-level mathematics, and want to go deeper, I can heartily recommend SICP (Structure and Interpretation of Computer Programs), which was the introductory textbook for software engineering at MIT for a few decades.
<mark_weaver>(the entire book and video lectures are available online)
<mark_weaver>as for the chest pain, I can't help with that. I would consider seeking consultation from a health care professional if you have the means.
<mark_weaver>but this channel is the wrong forum for discussing health issues, obviously.
<jeffrin>mark_weaver : what are the benefits that a person gets after learning (guile,SICP) related
<mark_weaver>mind expansion :)
<jeffrin>mark_weaver : great :)
<jeffrin>mark_weaver : are the problems related in the book easy
<mark_weaver>SICP fundamentally changed the way I write programs. it introduced me to radically different approaches to programming. scheme is an exceptionally flexible language, supporting many different programming paradigms, including ones that haven't yet been invented.
<mark_weaver>no, SICP is not an easy book.
<mark_weaver>wingo: ooh, I like the new 'bootstrap' build phase.
<mark_weaver>not as sexy as the other new things, but it'll be good to reduce build time to something more reasonable :)
<paroneayea>mark_weaver: I'd also say, SICP is not a blocker even if you're very rusty on your calculus
<paroneayea>I'd studied enough calculus for what's covered but I had been very rusty on it
<paroneayea>going through SICP helped encourage re-oiling that machinery :)
<paroneayea>er, SICP is not blocked
<mark_weaver>paroneayea: yeah, I guess so. math has always come easily to me, so I don't really know what it would be like to work through SICP if I were weak at math, but I've heard that non-engineering types have trouble with SICP.
<paroneayea>I have trouble with reading symbolic math expressions
<mark_weaver>it's clearly aimed at MIT engineering freshman.
<paroneayea>though I don't have trouble with the actual concepts
<paroneayea>I really struggle deeply with reading the notation
<paroneayea>and it takes me a long time to make it through things even if I know the concepts because of it
<paroneayea>so I don't really consider myself a math'y person
<mark_weaver>paroneayea: how did you do in calculus class?
<paroneayea>mark_weaver: I was very slow but got the concepts and enjoyed it... I think it took me about 3 times as long as anyone else to work through examples. However, due to reasons unrelated to the actual class, I dropped out partway through, and I've been kicking myself for that ever since
<paroneayea>the unrealated reason was they were closing my small college's campus, which I had been fighting really hard in a movement to keep open
<paroneayea>and after we failed I fell into a deep depression
<mark_weaver>how long it takes to do the work doesn't really matter, as long as you understand the concepts.
<paroneayea>so I've had an incomplete set of calculus knowledge
<mark_weaver>of course, calculus is not fundamental to the things that SICP teaches. it's really just that many of the examples and explanations assume that the student has knowledge of calculus.
<paroneayea>mark_weaver: right
<mark_weaver>paroneayea: well, if you ever want to finish up your calculus, MIT has online courseware for it.
<paroneayea>mark_weaver: that might be a good idea!
<mark_weaver>I've worked through several MIT classes that way
<mark_weaver>some of them are very good
<mark_weaver>paroneayea: if you run into difficulties, feel free to ask me questions
<m0li>jeffrin, But if you're not computer/computist and want to start, HTDP is a good choice, then complement it with guile manual.
<jeffrin>what is HTDP ?
<mark_weaver>IMO, HTDP is not nearly as mind expanding.
<jeffrin>iam a software engineer
<mark_weaver>HTDP is probably too basic for you then.
<mark_weaver>HTDP also teaches Racket, which has diverged from Scheme.
<m0li>jeffrin, haaa ok xD no problem, mark_weaver have the reason
<mark_weaver>paroneayea: the MIT online courseware that jeffrin looks like a good start to me!
<mark_weaver>*that jeffrin linked to
<jeffrin>m0li : may be i should start with htdp
<mark_weaver>okay, you'll end up using Racket then, and maybe get stuck there..
<mark_weaver>because HTDP teaches a bunch of Racket-specific constructs.
<mark_weaver>whereas SICP teaches standard Scheme, suitable for any scheme implementation.
<mark_weaver>and SICP actually teaches many different programming paradigms, which is why Scheme is so great. HTDP doesn't do that.
<mark_weaver>but as you wish...
<m0li>mark_weaver, what he says is true, I use it because I am a beginner, but I read in parallel SICP
<mark_weaver>personally, I don't think there's much of interest in HTDP for someone who already knows how to write programs.
<m0li>It can be used as a guide, but the essentials are in SICP.
<m0li>mark_weaver, yes! :)
<mark_weaver>HTDP's strength is helping people who don't even know the basics of how to get started writing a program, like children.
<jeffrin>i have not written typical large programs
<mark_weaver>(or adults who never learned how to write a program)
<paroneayea>jeffrin: thanks! :)
<wingo>mark_weaver: it's an attempt :) would be nice to avoid expanding the optimization phases during bootstrap
<paroneayea>and thanks for the offer to help mark_weaver :)
<wingo>but for some reason i didn't manage to get that to work, should try again
<jeffrin>mark_weaver : i may come back here for support
<wingo>still, if you are building .go files already with a 32-bit system that's good
<wingo>good news i mean
<mark_weaver>wingo: so far, I've built eval.go, psyntax-pp.go, and intmap.go in bootstrap. working on intset.go now
<wingo>oh that's good then!
<wingo>dunno if you will be able to compare performance to a previous build
<wingo>the novel change of course is that all stack items are 64 bits wide
<wingo>even if SCM values are still 32 bits
<m0li>jeffrin, I support what mark_weaver says. He is right.
<mark_weaver>no, it's been a while since I used this X60, and I didn't save the old build times anyway.
<mark_weaver>(the power management circuitry in my X200 is busted)
<mark_weaver>(it refuses to charge the battery, and when I disconnect power the machine just turns off about half the time)
<wingo>ACTION afk for a while. happy hacking :)
<mark_weaver>I'm also only using 1 core to do the build
<mark_weaver>because this machine tends to overheat when I use both cores
<mark_weaver>ACTION has hardware issues :)
<jeffrin>mark_weaver : please help me even if i start with htdp and then may be move on to sicp
<mark_weaver>jeffrin: HTDP teaches a language I'm not familiar with. I don't have time to learn Racket and support you on Racket, sorry.
<mark_weaver>if you want to go that route, maybe ask on #racket
<jeffrin>mark_weaver : anyway may be i can ask questions about things other than racket
<dsmith-work>mark_weaver: Speaking of hardware, I just bought one of those VoCore things.
<jao>dsmith-work, what for?
<dsmith-work>jao: Fun.
<dsmith-work>IT's cute!
<jao>fair enough
<jao>now you have a project: embed guile in there!
<dsmith-work>It's not at roomy as a beaglebone, or a pi.
<mark_weaver>dsmith-work: wow, that's tiny!
<mark_weaver>so it doesn't require any blobs to work?
<dsmith-work>.98 by .98 inches
<dsmith-work>No blobs. As far as I know.
<dsmith-work>Its a Ralink SoC
<dsmith-work>The wireless stuff probably has some.
<dsmith-work>But I don't plan on using that.
<mark_weaver>how much RAM and flash?
<dsmith-work>Flash is 8M or 16M, RAM is 32M (from memory, will confirm)
<dsmith-work>Certainly will not be buildign natively!
<mark_weaver>heh :)
<dsmith-work>mips cpu
<dsmith-work>8M is the beta versions. 16M in production.
<dsmith-work>Yeah, 32M ram
<dsmith-work>Runs OpenWRT
<paroneayea>maybe I can make it to FOSDEM after all
<paroneayea>I've received private encouragement to go
<paroneayea>so I guess I'll see based on
<mark_weaver>maybe consider running LibreCMC instead
<paroneayea>submitted my Guix + deployment talk for now, I'll withdraw if we don't make it
<mark_weaver>paroneayea: cool!
<dsmith-work>mark_weaver: Thanks! Never saw that before.
<mark_weaver>wingo: fyi, I successfully built master on i686, and it seems to work. running "make check" now. so far, so good.
<wirrbel>when I want to implement a language using `define-language` do I have to do this in (system base language)?
<jeffrin>hello all
<amz3>héllo jeffrin
<jeffrin>amz3 : hello
<paroneayea>it's nice to see people experimenting with more ways to make sexp editing easy
<paroneayea>though I can't figure out how some of these are resolved
<paroneayea>still cool to look at though
***dje is now known as xdje