IRC channel logs

2014-10-16.log

back to list of logs

<paroneayea>it really ruffles my featuers that neither srfi-9 nor GOOPS have quite the constructor I want, though oddly both of them have part of the constructor I want
<paroneayea>it looks like guix's define-record-type* sugar is what I want
<paroneayea>or something
<paroneayea>I think what I really want is
<paroneayea>(define-record-type* <task-context>
<paroneayea> (constructor foo . bar) ;; define* style args here
<paroneayea> )
<paroneayea>there's no way to do positional args in goops without a manual constructor, no way to do keyword args in srfi-9 without a manual constructor
<paroneayea>unless I'm wrong
<paroneayea>not quite http://this-plt-life.tumblr.com/post/36425232996/when-i-try-to-structure-data-in-scheme though :)
<davexunit>paroneayea: yeah, you've gotta write keyword arg constructors yourself.
<davexunit>in practice, I find that most of the time I want the simple constructor created by define-record-type
<davexunit>guix's define-record-type* is very nice, though.
<davexunit>but you have to be okay with the syntax choices.
<davexunit>(field value) rather than #:field value
<paroneayea>man, I really want the define* style though!
<davexunit>yeah
<davexunit>paroneayea: is the problem that you find yourself defining this type of constructor frequently?
<paroneayea>davexunit: sort of... I find myself missing that kind of constructor from other languages and then doing without it and wishing I weren't :)
***karswell` is now known as karswell
<civodul>Howdy Guilers!
<tadni>civodul: Early, morning. o/
<nalaginrut>afternoon guys
<tadni>nalaginrut: Were you in AU?
<nalaginrut>no I'm in China
<tadni>Ah, okay.
<nalaginrut>I think there's something wrong with syntax-transfomer in master, but I haven't found a way to reproduce it
<nalaginrut>seems some evaluation was done too hurry when compile syntax-transform
<nalaginrut>when I change them to functions, the problem is gone
<lloda`>how about adding to http://www.gnu.org/software/guile/manual/html_node/Foreign-Types.html#Foreign-Types
<lloda`>f64 c64 f32 c32?
<lloda`>and have procedures that take these types also accept symbols
<wingo>they're values so that they can alias each other
<lloda`>but '* is not a value
<wingo>yes, it's a special case
<lloda`>well then, having f64 c64 f32 c32?
<wingo>thing is f64 is the same as double
<wingo>on all platforms
<wingo>(define f64 double)
<wingo>c64 isn't actually a primitive type, for the purposes of ffi
<ijp>afternoon
<wingo>heya ijp
<lloda`>so I say that (system foreign) define f64, not me
<wingo>lloda`: as an alias to double? sure, though perhaps "float64" would be more coherent with "int32" and the like
<wingo>(system foreign) isn't a good high-level ffi -- there's room for a better system on top of it i think
<wingo>dunno tho
<wingo>native compilation would be nice; currently the ffi's overhead is not negligible
<davexunit>what's c32?
<lloda`>f64 is the srfi4 name, it's a pain that they differ, but float64 would be ok
<lloda`>a complex made up of two floats
<lloda`>^davexunit
<davexunit>thanks
<lloda`>so why not make c64 a primitive type, for the purposes of ffi
<ijp>not that there is any plan to use something other than libgc, but I occasionally worry about the procedures we have for dealing with pointers in the ffi
<wingo>lloda`: it's not primitive for anything in guile
<wingo>see module/srfi/srfi-4/gnu.scm
<lloda`>well no reason for that, really. I remember the srfi-4 gnu change and I didn't like it, because it's a defect in SRFI-4 itself not to support c64 the same as f64.
<wingo>it's better represented as an array type imo, which is a pointer
<lloda`>... I disagree, C99 has _Complex, Fortran has complex, they can be used just as primitive types
<wingo>lloda`: why not create a simple ffi layer above (system foreign) that understands c64?
<lloda`>if we move Guile to C99, complex comes free, there's no need for layers
<wingo>c99 also has time_t, would you propose adding that too?
<wingo>( i think it does anyway, perhaps i'm wrong)
<lloda`>no, but complex is a primitive type in Guile, it is a primitive type in C99, no reason do everything per the byte
<lloda`>(and we could declare vars after the start of {, I'd go to C99 just for that :p)
<lloda`>hello civodul, what do you think about moving Guile to C99
<taylanub>lloda`: with "after the start of {" do you mean after the first non-variable declaration statement? (or what are the precise rules?..)
<lloda`>'intermingled declarations and code' says the wiki
<dsmith-work>Moning Greetings, Guilers
<lloda`>hello
<lloda`> http://en.wikipedia.org/wiki/C99
<lloda`>you can also do for (int x = ...
<civodul>lloda`: if it's just to have variable decls after statements, that doesn't seem really compelling to me :-)
***Profpats1 is now known as Profpatsch
<saul>How do I install the Sqlite3 bindings (https://gitorious.org/guile-sqlite3) to my system? Is it as simple as copying the .scm to my sitedir?
<saul>* .scm file
<lloda`>civodul: my immediate motivation is simplifying the support of complex
<davexunit>saul: you should follow the usual steps for software that uses the gnu build system.
<davexunit>autreconf -vif && ./configure && make && make install
<davexunit>(modify as needed)
<saul>davexunit, but I don't see an autogen.sh or configure in the source tree.
<saul>davexunit, I see now. autoreconf will create the configure file.
<davexunit>yes
<davexunit>configure.ac and Makefile.am are the files that will be used to generate configure and Makefile.
<saul>davexunit, thank you.
<davexunit>yw
<davexunit>happy hacking
<civodul>lloda`: ok, i mean i'm not against it, but there needs to be a motivation
<civodul>but yeah, 1999 was 15 years ago, so yeah
<civodul>if you post patches that use C99 features, that won't be a blocker, as far as i'm concerned
<lloda`>thanks, that's good to hear
<wingo>what about patches that use c++ features? :)
*wingo troll
<civodul>:-)
<lloda`>I'd say yes for C++, myself :p
<wingo>i think me too, but i don't have an immediate need for it
<wingo>next time i get irritated with things i can send a mail and see what people think -- it needs discussion :)
<Chaos`Eternal>is there any solution like xslt but for generic sexp ?
<Chaos`Eternal>because sexp like ((M pc) (a (b c))) are not sxml
<Chaos`Eternal>so that it can not be processed by xslt
<ArneBab>mark_wea`: are you here right now?
<mark_weaver>I'm against using C++ (which I think is an abomination), but I agree that we should rely on C99 in 2.2.
*wingo likes templates :)
<wingo>it's functional programming! :)
<mark_weaver>the language is too complex, and an ABI nightmare
<wingo>it's definitely too complex, you have to choose a subset
<wingo>abi is not as bad as it used to be tho, and you can still expose a c api if that's your desire
<wingo>you can also provide a stable abi but it requires more thought than c
<wingo>anyway, don't mean to make a serious argument for it now :)
<mark_weaver>lloda`: what was the "SRFI-4 gnu change" that you didn't like?
<wingo>mark_weaver: i think moving make-c64vector etc out to (srfi srfi-4 gnu) from (srfi srfi-4)
<wingo>which i think happened in 2.0
<wingo>i.e. before 2.0
<mark_weaver>ah, okay.
<mark_weaver>well, I agree that (srfi srfi-4) should only include the actual SRFI-4 API, and our extensions should go in (srfi srfi-4 gnu)
<ArneBab>mark_weaver: I think I now finished the wisp parser which directly uses (read). The REPL works.
<mark_weaver>ArneBab: cool! I'm surprised you didn't need something that reads non-whitespace things (comments, reader directives, etc).
<ArneBab>mark_weaver: I hope that these work…
<mark_weaver>we should probably add such a thing, to facilitate building things like wisp or SRFI-110
*mark_weaver goes afk
<ArneBab>mark_weaver: is it OK to just concatenate the top-level expressions with begin?
<ArneBab>or should I build a temporary list and then yield each top-level statement to the reader on its own?
<ArneBab>#!curly-infix
<ArneBab>write {1 + 2}
<ArneBab>^ works!
*ArneBab is happy
<ArneBab>automagic stuff ☺
<ArneBab> https://bitbucket.org/ArneBab/wisp/downloads/wisp-0.6.6.tar.gz
<ArneBab>tar xf wisp-0.6.6.tar.gz; cd wisp-0.6.6; ./configure; make; guile -L . --language=wisp
<azathoth99>guile for web apps
<azathoth99>interesting
<azathoth99>good performance too?
<azathoth99> http://wingolog.org/archives/2012/03/08/an-in-depth-look-at-the-performance-of-guiles-web-server
<azathoth99>hmmmm
<davexunit>azathoth99: performance seems to be okay.
<davexunit>I haven't written anything particularly performance intensive, though.
<azathoth99>how is the experience of programming scheme on the web
<azathoth99>anything that does a dynamic query like say a job website?
<azathoth99>could it talk to paypal etc for e commerce?
<davexunit>it feels pretty awesome.
<davexunit>if you wrote the bindings, yeah.
<azathoth99>how did you learn scheme?
<azathoth99> sicp?
<azathoth99>was there a lot of web stuff to learn to use the guile web server?
<davexunit>I learned scheme by reading the guile manual, the little schemer, and SICP.
<davexunit>I happen to do web development professionally, so it wasn't very hard for me to read what the docs had to say about the web modules and get hacking.
<davexunit>I'm currently writing a web application called guix-web: https://gitorious.org/guix-web/guix-web
<davexunit>the server-side of which is written in guile.
<azathoth99>ah
<azathoth99>see I never did web dev b4
<azathoth99>css is greek to me
<azathoth99>I know 4 html tags and can make static pages with images code or links
<azathoth99>is about it
<azathoth99>lol