IRC channel logs

2016-09-07.log

back to list of logs

<sapientech>OrangeShark: yeah looking forward to seeing what it can do/what can be improved
<davexunit>yes please send patches
<sapientech>davexunit: most def
<davexunit>there's certainly much to improve upon, and I don't have much time!
***jason` is now known as turbofail
<jmd>Does (file-exists? "/foo") return true if "/foo" is a directory?
<jmd>(Yes, I did look up file-exists? in the manual before asking this question)
<brendyn>jmd: Yes, I just tested it
<brendyn>jmd: Open up a terminal and run guile
<brendyn>then type (file-exists? ".") (file-exists? "Desktop") (file-exists? "stnzrstdaret")
<brendyn>Or something like that. Works for me.
<jmd>Yeah, I did that too. And got the same results.
<jmd>I was hoping that someone knowledgeable however could shed some light on exactly what is meant by "file" in this context. For example, what if it is a symlink? Will it test the existence of the link dest or what?
<jmd>Of course I could look in the Guile source too ...
<amz3>héllo #guile
<wleslie>greetings!
<wingo>fibers is coming along :) just need the ability for a scheduler to stop when there's nothing left to do and i can finally write tests
<wingo>channels seem to be working tho, as are cross-kernel-thread communications between fibers on different schedulers
<amz31>neat!
<mikebelanger>hi guys I'm looking at this article, and it looks like it can interpret javascript: https://wingolog.org/archives/2009/02/22/ecmascript-for-guile
<mikebelanger>Which is pretty awesome, because I'm looking for some kind of lisp-to-javascript ideas, without all the Java-overhead associated with Clojure.
<mikebelanger>But I can't seem to find a lot of projects using Guile to compile down to Javascript. Am I missing something, or can Guile compile a javascript file relatively easily? I'm cool with writing DOM helper functions or whatever.
<davexunit>mikebelanger: the purpose of ecmascript on guile is not to compile guile to javascript, but to run javascript on the guile vm
<mikebelanger>davexunit: Right -- and I'm wondering, what's to stop someone from writing functions/macros to compile Guile back to Javascript? Or is it just impractical?
<mikebelanger>I suspect there's a reason no one has tried compiling down to Javascript, I just can't figure out the reason
<davexunit>ijp has written the beginnings of a guile->js compiler
<davexunit>it's certainly possible to do, but it's a lot of work
<amz3>bad news is that a big part of the work ijp has done is offline
<mikebelanger>davexunit: you're referring to here? https://gitlab.com/ijp/guile/commits/compile-to-js2
<mikebelanger>amz3: why is a lot of it offline?
<amz3>mikebelanger: I don't know why
<amz3>sure it's a very interesting project, I would be one of the first to test it and give feedback if that's the trouble
<amz3>TBH I tried the link you provided I even found a revision where things were kind of working
<amz3>I fixed some cosmetic bug and that is all, I have basically zero knowledge of guile compiler
<amz3>to share some more xp, I've done a similar work with Python (compile Python to Javascript) and it's a lot of work
<amz3>I think scheme would be simpler to translate but you still need to know which are the basic vm op for doing the translations
<amz3>AFAIK there is no such documentation, it's only in the source code somewhere
<OrangeShark>Does anyone use the ecmascript language on guile? I don't recall seeing anyone actually use it.
<paroneayea>OrangeShark: it's a demo
<OrangeShark>ah okay, so probably more serious work needs to be done to make it more usable in general?
<mikebelanger>amz3: right - makes sense. Javascript has such a chaotic syntax too, it would take quite a bit of work.
<amz3>mikebelanger: no that is not the difficult part
<amz3>scheme->javascript is easier than javascript->scheme IMO
<amz3>you only have to parse scheme, that is done by the vm somewhere
<mikebelanger>amz3: What's the difficult part then? Especially if Guile can already understand ECMAscript, which is more or less a standardized version of Javascript
<paroneayea>there is a scheme->javascript branch that ijp started last year
<amz3>mikebelanger: for me, it's knowing which vm op to implement in javascript
<paroneayea>it might be nice also to look at how feasible it is to do scheme->webassembly
<davexunit>mikebelanger: there are many primitive operations that need to be implemented in javascript
<davexunit>how does one implement dynamic-wind in javascript, for example.
<amz3>after i release culturia 0.1 I'll have a look again at scheme->javascript
<amz3>(or libgit bindings)
<OrangeShark>amz3: then work on guile version of github? :P
<amz3>OrangeShark: yeah!
<mikebelanger>davexunit: amz3: cool, thanks for the responses. I knew there was a good reason I didn't see anything like this!
<amz3>mikebelanger: that said there is a scheme interpreter written in javascript
<davexunit>I personally would love to be able to run my guile programs in a browser
<mikebelanger>I've been using Clojure(script), but there's just so much configuration/overhead associated with it.
<OrangeShark>amz3: probably the steps that need to be done is libgit2 bindings, gitweb replacement, a bunch of web related libraries, github replacement
<mikebelanger>amz3: Yeah I see there's stuff like https://github.com/biwascheme/biwascheme? Looks cool.
<amz3>mikebelanger: yes
<amz3>OrangeShark: yes
<OrangeShark>mikebelanger: here is a couple more https://github.com/jashkenas/coffeescript/wiki/list-of-languages-that-compile-to-js#scheme-like
<OrangeShark>I think I have also seen parenscript popular with some common lisp lispers
<mikebelanger>OrangeShark: thanks lots of good resources there
<ijp>I can't really work on guile->js until winter, either
<codemac>wingo: for fibers, I'd like to help contribute tests. Any example projects / tests that are formatted well for you?
<amz3>... I can't paste stuff in my REPL
<amz3>I finally got the point where my graph library is useable
<amz3>have a look at http://hyperdev.fr/notes/a-graph-based-movie-recommender-engine-using-guile-scheme.html
<amz3>they are still quirks tho...
<amz3>it's adapted from another article using Java
<amz3>ACTION goes to sleep
<zv>hey guys, i was wondering if anyone had a better/cleaner idea to pull a string pair out of a list of string->value pairs
<zv>right now I"m doing: https://github.com/zv/weechat-gateway-replacer/blob/master/nick-converter.scm#L40-L45
<zv>e.g to extract "NETWORK"-"freenode" '(("THING" "thong") ("VERSION" "1.0219") ("CTKNET" "921") ("NETWORK" "freenode") ("CHANS" "1928"))
<zv>it appears alist operations dont work here
<zv>actually i'm getting that as one big string and then splitting
<paroneayea>:D
<civodul`>sneek: later tell amz3 nice post on the graph db!
<sneek>Okay.
<paroneayea> https://identi.ca/cwebber/image/GzS2oISVSsWm3u5UvCYHFg
<paroneayea>or directly, http://dustycloud.org/gfx/goodies/soci-el-2016-09-07.png and relevant mockup http://dustycloud.org/misc/soci-el-mockup.txt
<paroneayea>the future of the federated social web will have an emacs interface :)
<civodul`>paroneayea: now, *that* is fun!
<civodul`>"the Emacs of social networking"
<paroneayea>civodul`: HAHA
<paroneayea>oh man
<civodul`>looks pretty cool
<civodul`>it's good to see formal W3C work on this too
<paroneayea>that should be a conference talk submission title for me, huh
<civodul`>:-)
<paroneayea>civodul`: yeah
<paroneayea>too bad we're running out of time D:
<civodul>re funding?
<paroneayea>nope
<paroneayea>social working group charter runs out in end of 2016
<civodul>oh i see
<paroneayea>I have until then to get this spec to recommendation status
<civodul>stressful, i imagine
<paroneayea>which is why I've dropped the ball on everything except activitypub / pubstrate / soci-el
<paroneayea>I can only work on the standard and its implementations
<civodul>yeah, i understand!
<paroneayea>but! for the sanity and future of the intarwebs!
<paroneayea>and hey, the proto implementation being in guile is still leading to some nice things
<paroneayea>I'm fleshing out a lot of web utilities :)
<civodul>heheh, i know that feeling ;-)
<civodul>server side?
<paroneayea>yes
<civodul>heh
<paroneayea>civodul: I now have signed cookie based sessions, and I have a forms library
<paroneayea>similar to WTForms in python
<paroneayea>but without all the mutation :)
<civodul>that sounds super cool
<paroneayea>it does use goops though, since generic methods is great there
<civodul>ok
<civodul>why "though"? ;-)
<paroneayea>because I feel like you don't like GOOPS civodul! :)
<civodul>i think i've said it too much and now people feel compelled to justify why they use it
<civodul>terrible!
<paroneayea>I know you used to love it and it feels like you don't love it anymore! ;)
<paroneayea>hehe
<civodul>that's fine
<civodul>:-)
<paroneayea>I actually really like using GOOPs sometimes :)
<civodul>that's what matters :-)
<paroneayea>anyway
<paroneayea>lots more to do
<paroneayea>but in-between panic attacks, I am getting a lot done ;)
<civodul>awesome
<paroneayea>back to it! thanks for the chat, it helped my confidence civodul :)
<paroneayea>I suspect I'll have at least 2 users of the emacs of social networking at least :)
<civodul>i'd be happy to beta-test!
<paroneayea>:)
<paroneayea>civodul: I'll take you up on it when I get it to that point :)
<paroneayea>and make guix packages :)
<paroneayea>that's one way to probably get an initial beta audience...
<civodul>heheh :-)
<paroneayea>it'll be way easier to do guix packages now that I'm not relying on all that python malarky ;)
<paroneayea>back to it for real...
<OrangeShark>that looks pretty cool :)
<rekado>zv: (and=> (assoc-ref the-big-alist "NETWORK") car)
<rekado>zv: this works for me.
<mark_weaver>rekado: I didn't read the entire log, but there _are_ environment variables that openssl consults, iirc.
<mark_weaver>specifically SSL_CERT_DIR and SSL_CERT_FILE
<mark_weaver>however, there are none that are supported by GnuTLS iirc. GnuTLS needs a more complex (though probably better) setup to enable per-user CA certificate stores, which is something that Fedora does iirc. this is all from vague memories of me investigating this issue long ago. there's a thread on guix-devel about it years ago.
<mark_weaver>bah, wrong channel, sorry.
<spauldo>I got a question regarding style. I'm writing up a basic mathematical vector library, but I want to be able to create vectors in both polar and component form. I need to be able to distinguish between the two.
<spauldo>Right now, the vectors are just lists, but there's no way programmatically to tell the difference between (x y) and (magnitude direction).
<spauldo>I can throw a symbol in there as a third value in the list to designate, but I'd like to know if that's the common way of doing things.
<mark_weaver>spauldo: for a classical scheme approach, see section 2.4 of SICP <https://www.mitpress.mit.edu/sicp/full-text/book/book-Z-H-17.html#%_sec_2.4>
<random-nick>have you considered using records?
<spauldo>Basically, what's the idiomatic scheme way of adding type information?
<mark_weaver>spauldo: but nowadays, most modern schemers would probably use records instead, yeah.
<spauldo>I haven't considered records... I'll check into that.
<mark_weaver>we usually prefer SRFI-9 records unless there's a need for something else.
<spauldo>most of my early scheme knowhow came from the SICP videos, so I tend to default to lists for everything. I probably need to read more scheme code.
<OrangeShark>spauldo: you can also look into GOOPs, specifically generic functions
<spauldo>thanks for the SICP link - that's right on topic for what I'm wanting to do.
<mark_weaver>np!
<spauldo>I've never looked much at GOOPS, records, or really any of the other data structures because I mostly just use scheme for numerical problems. I ran into a problem where FORTRAN wasn't giving me answers. Guile hasn't failed me yet.
<spauldo>the numerical tower is the killer feature as far as I'm concerned.
<ijp>we look forward to failing you soon
<mark_weaver>lol
<spauldo>I look forward to finally learning enough math to be able to stump scheme :)
<ijp>according to riastradh, I made some flippant remark that scheme should support integration, but I think scmutils can do that
<ijp>well, often enough anyway
<mark_weaver>scmutils certainly supports numerical integration.
<mark_weaver>I don't know about symbolic integration, but I don't remember seeing it in scmutils the last time I looked (years ago)
<spauldo>I watched the SICP video where they implemented symbolic integration, but haven't had time to try any of that. I've been thinking of trying out Maxima.
<ijp>I remember differentiation, but not integration
<mark_weaver>I've used Maxima extensively in the past, and even contributed to it. it has a pretty good symbolic integrator.
<ijp>symbolic integration is much harder than symbolic differentiation
<mark_weaver>indeed.
<spauldo>maybe it was just differentiation... I was paying more attention to the whole skeleton system than the actual rules
<ijp>it's why I can buy a book called "inside interesting integrals" but not "diving deep with delightful derivatives"
<mark_weaver>I've even occasionally thought about implementing just enough Common Lisp on top of Guile to allow it to run Maxima.
<ijp>spauldo: it may interest you to know that symbolic differentation was essentially the reason mccarthy created lisp
<ijp>[citation needed]
<ijp>I think it's a single digit AI lab report
<mark_weaver>Maxima's ancestor Macsyma was originally written in Maclisp iirc, and although it has since come to use a few Common Lisp features, most of the code uses only old Lisp features.
<spauldo>really? I knew he was wanting to do stuff with lamda calculus, but I assumed it was for number theory or something.
<ijp>aim 10, I was close
<mark_weaver>the lambda calculus is much older than lisp
<spauldo>my school doesn't give me access to any journals.
<ijp>ftp://publications.ai.mit.edu/ai-publications/pdf/AIM-010.pdf
<spauldo>not because they don't have access to them, but because I can't get my advisor to get off his butt and hunt down the account information
<mark_weaver>it's okay, the MIT AI memos are publicly available
<spauldo>oh, I think I've seen these before, but I forgot about them. Good deal, that's getting bookmarked. Thanks for the link.
<spauldo>this is interesting. It looks like early versions of LISP had commas between list items.
<ijp>there used to be M-expressions and S-expressions
<ijp>at least in theory, I don't think M-expressions were ever implemented in LISP
<mark_weaver>iirc, the original plan was that S-expressions would just be an intermediate form in the lisp implementation
<mark_weaver>there have been many proposals over the years for a nicer form for use by humans, but they have all failed to catch on.
<spauldo>I've seen at least one of those. A guy came up with what is basically lisp without parentheses. Then he proceeded to try to teach various CS concepts using it. I tried to follow along, but the lack of parens was driving me nuts.
<spauldo>guess it's all about what you're used to.
<ijp>and humans can get used to pretty much everything
<ijp>even apl
<spauldo>I spend a good portion of my day using greek letters and various mathematical symbols, so APL probably wouldn't be too hard to get used to.
<ijp>my analysis lecturer had a habit of using weird symbols like "car" and "tree" and a heart on valentines day
<spauldo>another reason I jumped ship from fortran - it's nice to use thetas and phis instead of having to type them out
<ijp>and I shit you not when I say I've used greek, korean and futhark in the same piece of mathematics
<ijp>at some point I should have just given up and used words like a grown up
<spauldo>you could always just do it all in korean. You're not likely to run out of characters there.
<ijp>I could, but it was only halfway through I realised I needed another script
<spauldo>IIRC the average Japanese adult knows about 5000 kanji symbols, and I think korean uses more or less the same set of symbols
<ijp>not really
<ijp>south korea hasn't renounced all use of chinese characters, like norht korea has, but they have an alphabet called hangul