<nalaginrut>I realized that 'Artanis' is a character of StarCraftII, but it's an coincidence, since my 'artanis' is reversing of 'sinatra'... <fbs>have you used gnutls-guile? <mark_weaver>fbs: are you unhappy with guile-gnutls? do you see a way to improve it? <fbs>the documentation could be better <fbs>maybe once i figured out how it works :) <nalaginrut>fbs: though I could recommend you use guile-curl, but I do wish you could find out how to use guile-gnutls and fix it <fbs>i already figured some of it <fbs>i can connect to my ssl irc server <nalaginrut>well, I'll write a twitter proxy for chinese people, or they can't use twitter <fbs>im busy writing something to hook into the irc lib <fbs>need to write some testbenches for it <nalaginrut>maybe I could add something gnutls to my Artanis, according to your code ;-P <fbs>if you link me the repo i could take a look sometimes <nalaginrut>Artanis Productions, a movie production and licensing company owned by the estate of the late entertainer Frank Sinatra ("Artanis" is "Sinatra" spelled backwards) <fbs>might be a bit faster <nalaginrut>100 times faster I think, since I tested it against 'md5sum' <nalaginrut>anyway, I have to deal with other things, this issue is trivial <nalaginrut>fbs: it's all Scheme, right? did you put it in guildhall? <nalaginrut>I like the pure Scheme package, it's easy to install with guildhall, anyway ,we have to fix something to support C compile <ijp>there is md5 in guile-lib which is on guildhall, and in industria <ijp>crypto is slow anyway <ijp>bcrypt & others even use it as a feature <ijp>I _really_ doubt it is making a huge difference to your performance anyway <ijp>to paraphrase arthur eddington: "Performance is an idol before which the programmer tortures himself" <nalaginrut>ijp: md5 is very common things in web develop, and I tested Scheme code with 'md5sum', the difference is enough to consider a C implementation <mark_weaver>indeed, md5 is no longer to be trusted. in fact, Phil Zimmermann considered it "pretty much broken" back in 1997. <mark_weaver>beware that, depending on how you do it, there may be additional overheads in transferring the data to be hashed from Scheme to C. <mark_weaver>I don't necessarily disagree with you, btw, that using a C hash implementation might be worthwhile. I'm just not sure. <nalaginrut>mark_weaver: yes, I know md5 has problem, there's collision found by a Chinese lady <nalaginrut>anyway, it's abstracted out, so it's not big deal, I'll choose other hash algorithm <nalaginrut>mark_weaver: is there convert overhead? what if I use bytevector? <mark_weaver>if you use bytevectors, it will be fine. but is that conceptually the right data structure? <mark_weaver>it's a bad idea to use bytevectors to represent characters. <mark_weaver>in practice, how big are the things you wish to hash? <mark_weaver>don't waste your time optimizing this. it's trivial. <nalaginrut>it's no-worthy to do optimization for passwd hash <mark_weaver>if you want to hash data on the order of maybe 100 kilobytes or more, then maybe a C implementation is worth considering. <nalaginrut>mark_weaver: fbs suggest me use guile-gcrypt, since I may support other things like SSL, and md5 as well <mark_weaver>but for small stuff, like under a few kilobytes, I strongly suspect that the overhead of jumping from Scheme to C and back again will overwhelm any speed benefit you might obtain from a C hasher. <mark_weaver>beware the pitfalls of premature optimization. and remember that our intuitions are often wrong about where the costs are. profile your code, and see where the costs actually are. otherwise, keep things as clean and simple as possible. <mark_weaver>and in the context of Guile, remember that there is a cost in jumping from Scheme to C and back again. <nalaginrut>hmm, there's a question, how can I profile the server-handler, any suggestion? <nalaginrut>it works fine, and the problems are functional, not speed <nalaginrut>but it seems not so easy to profile server-handler <mark_weaver>run your server from the REPL, and then send it a large number of requests. <mark_weaver>and remember to make sure your requests are close to what real world requests would be like. profiling is worthless if the tests are not realistic. <nalaginrut>hmm...maybe the benchmark is another work, since the hash test need to post login <mark_weaver>but seriously, for hashing things like passwords or small session data, I think a Scheme hasher is not only fine, but a better idea than using C. <nalaginrut>mark_weaver: the hash is really common, I have to support ETag later <nalaginrut>since I'll design a cache mechanism for template <nalaginrut>is there any better hash method other than md5/sha? <mark_weaver>I haven't really been following these things lately, but last I heard, SHA-256 and SHA-512 are still considered reasonably good. MD5 has been considered weak for a long time, and weaknesses in SHA-1 have also been discovered. <ijp>there were worries about sha2, which is why the had the sha3 competition, but it seems to have held up over time <mark_weaver>I guess my main concern about SHA-3 is that it's too new. <ijp>"Despite the attacks that broke other somewhat similar but simpler hash algorithms in 2005 and 2006, SHA-2 has held up well and NIST considers SHA-2 to be secure and suitable for general use." <ijp>mark_weaver: right, these things take time to ripen <mark_weaver>for those who may not know, SHA-256 and SHA-512 are both in the SHA-2 family. <mark_weaver>ijp: do you know of a Scheme implementation of SHA-2? <ijp>I like the disclaimer he has <ijp>mark_weaver: as far as I know <ijp>there is an interesting js implementation of AES, that precomputes the tables on the client side <mark_weaver>to be honest, I've never really been an expert on crypto algorithms, despite my working closely with Phil Zimmermann at PGP, Inc. He told me I had a good mind for thinking about security issues, but I never much studied the algorithms themselves. <nalaginrut>ijp: out of topic, rbtree module in guildhall is not guile compatible one, it needs some fix <mark_weaver>the only one I learned the math of was RSA, at university, but that was a long time ago. <ijp>nalaginrut: the srfi 48 thing? or something else <nalaginrut>ijp: I can't remember the detail, but srfi-48 need to fix, we have it, but usage is a little different <nalaginrut>ijp: besides, when I install it, I can't load it anyway, seems it wasn't in the right place <ijp>ah right, no, that's a suffix problem <nalaginrut>mark_weaver: well, I don't think we should write these algorithm in Scheme for the web-framework, I prefer use the C lib <nalaginrut>but I'd be glad to see folks write it, and I'm happy to use it <mark_weaver>well, as ijp pointed out, industria (available in guildhall) already has SHA-2 implemented in Scheme. <ijp>okay, I've updated the pkg-list.scm for the rbtree module <ijp>I think there is still another issue with it, so I won't push just yet <mark_weaver>anyway, my advice is falling on deaf ears here, so I think I will stop talking. <nalaginrut>mark_weaver: not deaf ears, I'm on some working... ;-D *nalaginrut is designing fprm ***b4284 is now known as b4283
<DerGuteMoritz>does anyone know how the `not' match pattern works in combination with variables? <DerGuteMoritz>doesn't really make sense to bind something that doesn't match I guess :-) <wingo>download.plt-scheme.org/doc/103p1/pdf/match.pdf <wingo>^ andrew wright's paper on match <civodul>DerGuteMoritz: there's this example in match.upstream.scm: (match 1 ((not 2) #t)) <wingo>(not pat1 . . . patn ): matches if none of the subpatterns match. The subpatterns may not bind any <DerGuteMoritz>hah, the chicken implementation behaves the same but emits this: <DerGuteMoritz>Note: the following toplevel variables are referenced but unbound: *DerGuteMoritz is trying to write a beginners' introduction to match <DerGuteMoritz>too often beginners ask about it and then there is no good resource to point them to <DerGuteMoritz>and the reference alone is a bit anaemic for getting started <wingo>yeah, and you don't want to point people directly to an academic paper from 1990 <DerGuteMoritz>hmmm I might be misunderstanding how `not' with more than one pattern argument works (never used it like that before) <wingo>is else a keyword in chicken's match? <wingo>seems to be looking for 2 to be a pair... <wingo>funny, guile's optimizer folds it to #f at compile time ;) <wingo>you can use ,expand to expand at guile's repl, fwiw <wingo>it references a symbol relative to a module <wingo>@ references a symbol relative to the public interface of a module <wingo>so it's like, "pair?" as seen by (ice-9 match) <DerGuteMoritz>I once defined a function call-with-value-from-pool-in-thread <DerGuteMoritz>I think it's still number 1 in the chicken eggs identifier list <nalaginrut>((new-table 'user) #:get '(name age) #:school "Mars University") *nalaginrut is designing FPRM... <nalaginrut>==>"select name,age from user where school=\\"Mars University\\";" <nalaginrut>and one may store (new-table 'user) as a table abstract object <nalaginrut>(usr-table #:get '(name) #:age '(< 20)) ==> "select name from user where age<20;" <fbs>nalaginrut: hmm, interesting discussion <fbs>lets see if i can run a few benchmarks <add^_>I've never tried, nope. But then again, I'm not that... good yet. <add^_>experienced was the word I was looking for <add^_>Would be nice to have something like V8 but for Guile :-) <add^_>Compile to machinecode directly, amongst others <add^_>I don't think guile does that, yet. <DerGuteMoritz>but there are various scheme implementations which already do <wingo>v8 is much more than just native code tho ***serhart3 is now known as serhart
<add^_>Well, a friend implemented V8 into his graphical (VPL) project, and it seems like it almost was made for that kind of thing. <wingo>what does native code have to do with that? :) <add^_>Making a script or whatever that creates a mesh, that can be used in the project. <DerGuteMoritz>the Guile project was originally started for that very purpose! <DerGuteMoritz>as an extension / scripting language to be embedded in other applications <add^_>What have I missed in my history lesson of guile? <add^_>Well, that's fine and all. But guile is quite big. <add^_>And not really... fit for realtime heavy graphics *wingo works on v8 at $dayjob, fwiw... <add^_>I knew you were working with something that had to do with javascript, just not what ;-) <add^_>The problem with V8 was that the gl project was abandoned. But he said he could probably fix that anyway.. <add^_>So not really a problem.. On the other hand, he wont need Scheme as his second language anymore :-( <add^_>I wish I was a better programmer... And need to stop wishing and just start training/working on it. <DerGuteMoritz>can Gambit be embedded? can't find anything about that on the web <add^_>I was actually thinking of Racket when he requested Scheme, but that's not really Scheme now, is it ;-) <add^_>Nah, ultimatly I want to stick with guile. Just need to get coding and get better so I can help with stuff. <add^_>I've talked about this before, maybe I should stop bothering you with it again. :-/ <add^_>For some reason I expected mark_weaver to login and say "Yeah, good idea." :-P <add^_>I don't really think he's mean on purpose, it just seems that way. <add^_>Sorry for being away this Sunday, had promised to help a friend move. <fbs>i started rewriting the networking part <civodul>you're working on the same IRC library, right? <add^_>Your not really mistaken no. <add^_>But it was more like I added TLS support and letting him clean my ugly code up, rather than me helping him. <add^_>I don't know what to make of it <fbs>he helped me getting started with the ssl stuff <fbs>i need to clean it up, finsh up the ssl stuff, improve the parser, add nick tables for usermodes, channel modes, tests etc <add^_>fbs: civodul helped me alot btw :-) <fbs>as seperate ssl module <add^_>I didn't need to put in my password to update stuff.. <cordawyn>I'd like to get some quick guidance for a newbie :) <cordawyn>I'm porting a lib to Guile and was examining existing libs to follow some guidelines <cordawyn>I can see them randomly use either "use-modules" or "library" (for R6RS compliance, I assume) <cordawyn>or rather, should I prefer one over another? <wingo>cordawyn: so the question isn't really compliance but conformity, i think <wingo>like, which culture would you want as users of your lib? <wingo>use-modules / define-module is more normal for guil <wingo>some people prefer to use the r6rs style, but if you don't care you should only use it if your code is actually portable or otherwise uses r6rs libs i think <mark_weaver>yeah, I really view it as a matter of taste. it's like asking whether to use (for-each ... (iota n)) or to use foof-loop or SRFI-42. <mark_weaver>if you can actually write your code in portable R6RS, then that's a very good thing to do IMO. <mark_weaver>but if your code is hopelessly dependent on non-portable features, then using R6RS library syntax or Guile syntax becomes more a matter of taste. <cordawyn>so, is there some imaginary point of convergence where scheme implementations and R*RS meet in a unified API? ;) <wingo>cordawyn: not currently, unfortunately <mark_weaver>the closest thing we currently have is R6RS plus the widely-implemented SRFIs. <wingo>there is a new scheme standard coming out at some point, r7rs, which is different from r6rs <wingo>it's not as good i think but perhaps it will be more widely adopted <mark_weaver>plus things like the collection of R6RS libraries, many of which are available in guildhall. <wingo>it's something of a confusing situation for a newcomer :) <fbs>it still confuses me sometimes <cordawyn>so, is there a way to make a lib a good citizen of scheme world, while being developed (and primarily used) in Guile? <fbs>keep it r5rs when possible i guess <wingo>if you want it as part of all of scheme, you have two or three options <wingo>one is to assume that people will just have to port it <wingo>(not a terrible option fwiw) <mark_weaver>fwiw, I think that R6RS is far superior to R7RS. While it's probably true that R7RS will be supported by more scheme implementations, R6RS is supported by enough of them. If any other language had as many implementations as R6RS has, it would be considered a resounding success. <wingo>another is to not mention modules at all, and assume that people can port it by making module wrappers to your code <wingo>so people can make a guile wrapper, an r6rs wrapper, etc <wingo>but there are few programs that can be written that way <wingo>another is to choose a portable module api -- currently only 6rs <cordawyn>so, with people choosing between, say, portable API from R6RS and Guile-only code, doesn't that lead to a greater disparity between schemes (or guile and R6RS, in particular)? <fbs>is there a number->string thats adds a 0 for hexnumber? <fbs>hmm tha t makes no sense, nvm <cordawyn>I mean, that is usually percieved as "a bad thing" (tm), but maybe, not in the world of schemes? <wingo>but there is already disparity -- i mean, there is chicken and gambit and such that don't do r6rs <wingo>and the major r6rs implementations are not doing so great; dunno <wingo>plt scheme became racket and is doing much better <wingo>than they were before (and than most schemes) <wingo>so there is a bit of a diaspora but shared culture <wingo>in practice porting is not bad, and schemes with good module systems can make the necessary set of shims so they can use each other's code <cordawyn>looks like clojure is gaining momentum ;) <DerGuteMoritz>mark_weaver: interesting, can you elaborate what it is you dislike about R7RS compared to R6RS? <wingo>we use some plt code for example, and we also use alex shinn's match, etc etc <wingo>it's super-confusing at first <cordawyn>and one more question, now a bit more more "practical" ;) <mark_weaver>DerGuteMoritz: I don't have the energy to get into that discussion right now. <cordawyn>my lib has several files, few of which can be used separatly *DerGuteMoritz has no substantial opinions about either <mark_weaver>Don't get me wrong, there are things I don't like about R6RS. It's not perfect. <mark_weaver>but some of the very smartest people in the Scheme world poured their heart and soul into R6RS, and they had a better process for doing things: they split off into subgroups, each working on a subsystem, and then brought them all together. <mark_weaver>In contrast, R7RS's process was the worst that design-by-committee has to offer. On a great many votes, most of the people voting had not looked into the relevant issue in detail. <mark_weaver>on several important issues, the people who really understood the issues were outvoted by those who didn't know what they were talking about. <cordawyn>here's the question: I can see that it is (probably) common *not* to import external and internal dependencies in the modules/files of a lib, but rather bundle all those imports into one file (similar to s48-packages or something?). But what if submodules of my lib can be used separately? Do I have to declare the imports per submodule, after all? <DerGuteMoritz>maybe that kind of process only works on a scale of a specification like R5RS <mark_weaver>DerGuteMoritz: yes, absolutely the overall quality of R7RS is worse. <mark_weaver>the only benefit I can see to R7RS is that it was designed to be easy to graft onto the greatest number of existing scheme implementations possible. <mark_weaver>so almost certainly there will be a greater number of R7RS scheme implementations. <mark_weaver>R6RS, on the other hand, is a lot harder to implement. <mark_weaver>but from the users point of view, R6RS is much more complete and easy to write code for. It's much more likely to have what you need. <wingo>cordawyn: do whatever seems natural (of course); but intermodule dependencies can be problematic <DerGuteMoritz>what's an example of something that R7RS left out in comparison to R6RS? <wingo>like if your modules end up depending on other modules you release, you introduce the possibility of version skew <cordawyn>wingo: yes, I understand that, but my problem is a bit different. Let me try describing it again: <wingo>so (from my conservative pov) if you want to expose parts of your lib, publish them <wingo>and if you want to use them in some other lib, perhaps bundle them <cordawyn>for example: 1) the lib has 2 files: "lib.scm" only contains "library" declaration (with imports and exports); 2) second file "main.scm" depends on, let's say, SRFI-9, but doesn't import (use-modules) it - it is assumed that "lib.scm" imports srfi-9 and main.scm, and users do not use "main.scm" directly - only "lib.scm" <cordawyn>so "main.scm" is pulled together with lib.scm, where srfi-9 is already imported, so everyone's happy <cordawyn>but should programmer use "main.scm" directly, they'll have to figure the required imports on their own <fbs>is there extra overhead when you have import srfix in both? <mark_weaver>DerGuteMoritz: a complete exception+condition system; syntax-case macros with well-defined phase behavior; hash tables; a far more useful I/O system; a procedural record type system; a guaranteed full numeric tower; a sane definition of real numbers; useful bytevectors. I could go on and on. <cordawyn>fbs: "info guile" says there shouldn't be <davexuni`>several of those features sound very interesting. what's the procedural record type system? <mark_weaver>to be fair, the R7RS plan is to have most of this stuff, and more, as a set of optional libraries in "R7RS-large". <DerGuteMoritz>so the bytevectors in R7RS are less capable than those in R6RS? <mark_weaver>so really, it's not so much the lack of these things that bothers me. <mark_weaver>what bothers me is the fact that so many bad decisions have been made, or punted on, in the R7RS, often because most of the people voting hadn't taken the time to research the relevant issues. <DerGuteMoritz>davexuni`: I think it's a record system that's not just syntactic, i.e. you can have record types as first class values (no authority on that though) <davexuni`>oh hey, my nick is still weird from when I disconnected awhile ago. ***davexuni` is now known as davexunit
<mark_weaver>DerGuteMoritz: yes. just take a look at the bytevector section of R6RS compared with R7RS. it's no comparison. <mark_weaver>On the issues that the R6RS took on, they actually thought about things carefully, and made sure to include what programmers would really need. *DerGuteMoritz takes a look <cordawyn>wingo: scheme is dangerously liberal ;) I'll need more time to get accustomed to that. <civodul>mark_weaver: the bytevector API is really a shame, indeed <civodul>gratuitous restrictions and name changes <cordawyn>wingo: thanks for your time. I guess that's it for today :) <mark_weaver>design by committee.. let's just take a vote. many of the votes aren't even consistent with each other. and everyone is so tired that no one can be bothered to make sure the result is sane. <mark_weaver>I spend too much time trying to get some issues regarding numerics fixed in R7RS. I succeeded in getting one important thing fixed, but only after spending about 20 times as much effort as it should have taken. After that I decided I have better things to do with my time. <DerGuteMoritz>if I figure out how to turn zathura back into displaying one page at a time :-( <cky>mark_weaver: Thanks! (Re NZ contestants and decent languages. :-)) <cky>mark_weaver: And yeah, really, really sad about the Boston Marathon bombings. My wife's best friend works near that area, actually. <davexunit>my office building was on lockdown. I think I can go back tomorrow. <cky>mark_weaver: I take it you live in Boston or thereabouts? I plan to visit again for RacketCon this year, whenever that is. If you plan to attend, that'd be awesome. :-) <cky>davexunit: Yipes, I hope it'll be safe soon. <mark_weaver>A cousin of a friend of my best friend lost his leg. and his wife lost a foot. :-( <mark_weaver>they are both still having surgeries to remove bits of shrapnel all over. <davexunit>I saw some pretty terrible pictures of a man who lost both his legs below the knees. <fbs>the one in the wheelchair? <cky>I've read in the Wikipedia article that some of the victims had amputations below the knee. I know your best friend's friend's cousin and his wife will not end up having to do that. <mark_weaver>cky: yes, I live about 5 kilometers from where the bombs went off. I do radio just across the river from where the bombs went off. Three years ago I was running across the finish line where the bombs went off. *cky needs to proofread before sending. <cky>mark_weaver: I'm glad you're okay. <davexunit>it's going to be weird walking around there tomorrow. <mark_weaver>cky: Thanks. I could have easily been there myself, but this year I wasn't. <davexunit>I found out what had happened from mark_weaver <mark_weaver>of course, we have it easy here. I'm glad I don't live in any of the increasingly large number of places where US armed forces are present, or where our pilotless drones are killing people without any due process of law. <davexunit>yeah, all things considered, things are very peaceful here. <mark_weaver>I'm glad I'm not Iraqi, or Afghanistani, or Yugoslavian, or South American, etc, etc. <davexunit>fbs: yeah, relatively speaking, the boston bombings are minor. but it's exceptional because that stuff just doesn't happen here. <mark_weaver>I'm sorry to say that these recent bombings in Boston will probably be used to justify more violence against others, and more erosion of civil liberties everywhere. <fbs>time to get some tinfoilhats <cky>I hope people will handle it the way Norway handled the whole Utøya incident: with grief, but without paranoia or heavy-handed responses. <mark_weaver>The US constitution has plenty of serious flaws, but in this case it's not the problem. The problem is the US culture, which has been steadily molded for about the last century by the public relations industry, born right here in the US. <mark_weaver>those who favor war have done a far more competent job of building the foundations and media outlets to propagate their viewpoints. *DerGuteMoritz should go to bed <mark_weaver>sorry, I didn't mean to take you too seriously. I appreciate the joke. heh <DerGuteMoritz>reading the R7RS appendix about changes and incompatibilities with R5RS and R6RS <fbs>anyone with some cool elisp to quicky use make-record-type and get/setters for each element, im currently using some yasnippet <mark_weaver>fbs: you haven't given enough information for me to understand what you're doing. <fbs>(define thing (make-record-type "" f1 f2)); (define get-thing-x (record-accessor thing 'x)) <mark_weaver>fbs: is there a reason that you're not using SRFI-9 records? <fbs>is there a reason why i should? <fbs>yea ive seen it a couple of times <mark_weaver>well, they are suitable for most purposes, and much easier to use. and far more portable as well. <fbs>guess it was the first i found when i started using guile and it kinda stuck wiht me <mark_weaver>the old guile records are very low-level. we don't recommend them for new code unless you have some special needs. <fbs>hmm guess it makes sense <fbs>i should update from the .6 to the .9 manual :x <mark_weaver>indeed, we made some significant improvements, especially in the records section.