IRC channel logs

2017-07-16.log

back to list of logs

<paroneayea>hm
<cbaines>I'm seeing some weird behaviour from current-time in SRFI-19, (current-time time-monotonic) => #<time type: time-monotonic nanosecond: 500193069 second: 526052001>
<cbaines>then a second later (current-time time-monotonic) => #<time type: time-monotonic nanosecond: 500193070 second: 29900001>
<cbaines>it looks to me that the seconds field is behaving like nanoseconds, and the nanosecond field is the seconds, does anyone else get the same behaviour?
<cbaines>also, if anyone knows a simple way of timing some code, that is what I'm trying to do.
<ennoausberlin>Hello guile. After years of inactivity I want to start coding again. Scheme was recommended in some books I read. So I installed guile. Is there a good resource for web programming with guile? I read the guile manual and found the (web client) etc module but I even cant get snippets like http-get to work.
<amz3``>not really
<amz3``>ennoausberlin: do you scheme already?
<amz3``>ennoausberlin: also I recommend you install guix since many guile dependencies can be installed with ti
<amz3``>ennoausberlin: do you know scheme already?
<ennoausberlin>amz3: I have some experience with emacs lisp and I already installed guixsd as I like the idea of functional package management. I have some basic scheme understanding and I did ruby and smalltalk before
<ennoausberlin>I look for guile code examples. So far I found
<ennoausberlin>(define (fetch url) (define in (get-pure-port url))
<ennoausberlin> (define out (open-output-string)) (copy-port in out)
<ennoausberlin> (get-output-string out))
<ennoausberlin>This is racket not guile, but fetches an URL fine
<amz3``>ennoausberlin: did you look at haunt the static website generator?
<amz3``>ennoausberlin: you want to fetch a webpage?
<ennoausberlin>amz3: This was my first attempt. Just to get a feel for the web client module.
<amz3``>ennoausberlin: which version of guile did you install?
<ennoausberlin>I want to understand the low level usage before I choose a framework.
<amz3``>I mean I recommend you install guile 2.2 that's the one that has https support
<ennoausberlin>awz3: OK. Its here on GUIXSD guile 2.2.2
<amz3``>(except that it currently fails to fetch https://gnu.org)
<amz3``>then to fetch a webpage you can do the following
<amz3``>scheme@(guile-user)> (use-modules (web client))
<amz3``>scheme@(guile-user)> (http-get "https://gnu.org")
<amz3``>it might not be clear, but that returns *two* values, the first value is the response header, the second value is the body
<amz3``>except if it fails just like it fails on my side
<amz3``>ennoausberlin: does it work?
<ennoausberlin>Just a moment. I tried that before but got an error. Have to switch the computer
<ennoausberlin>,q
<ennoausberlin>OK. Call me stupid. I tried (http-get "www.gnu.org") without the leading http:// and got some cryptic (for me) error message
<ennoausberlin>amz3: BTW: Is this the right place to ask beginner questions or is it better to use a mailing list?
<amz3``>both of them works
<amz3``>here is the error I get when I try to http-get an https url http://dpaste.com/0QTHEDC
<amz3``>ennoausberlin: what do you want to know after that?
<ennoausberlin>amz3: Fine. Can you recommend a good guile setup? For now I use spacemacs with geiser installed, but my geiser setup is not working as expected
<amz3``>You will be fine
<amz3``>I don't use geiser myself
<amz3``>ennoausberlin: I recommend the rainbow-delimiter extension with a theme that properly support it
<ennoausberlin>I understand that geiser can connect my buffer with a repl, but I dont have a clue how to use it
<amz3``>ennoausberlin: don't use it.
<amz3``>ennoausberlin: if you want later, i can explain when it's useful, but if you want to do webdev, geiser won't work as it's supposed to work
<amz3``>at least not with guile framework
<amz3``>I mainly use geiser to expand macros
<amz3``>that the only thing i do with geiser, and since I seldom write macros, i never use geiser
<ennoausberlin>amz3: OK. Is it possible to create a web page like http://archives.crem-cnrs.fr/archives/items/CNRSMH_E_2004_017_001_01/
<ennoausberlin>Especially the web player
<ennoausberlin>on the right side
<amz3``>everything is possible when time permits
<amz3``>so
<amz3``>you want to write a web app
<amz3``>ennoausberlin: do you know sql?
<ennoausberlin>I guess I can generate some static websites in guile (when I am familiar with the language) but the next step would be interaction
<ennoausberlin>amz3: SQL as database query language? Yes
<amz3``>good
<ennoausberlin>I dont know how other frameworks implement interaction like drag and drop or canvas drawing. I guess at the end I have to embed some javascript. The question is how to do that with guile. I will check out haunt now and have a look at artanis also.
<amz3``>ennoausberlin: I don't recommend using artanis
<amz3``>give me 30 minutes to bootstrap a web project with sqlite, I will save it somewhere this time for future reference
<ennoausberlin>amz3: cool
<amz3``>ennoausberlin: what's you prefered git hosting provider? will gitlab do the job?
<ennoausberlin>I am at github, but everything is fine
<amz3``>i am at github too
<amz3``>let's keep it simple then
<amz3``>ennoausberlin: did you install rainbow-delimiters?
<amz3``>ennoausberlin: monokai theme works well with rainbow-delimiters but I use 'danneskjold' both of them are available from melpa
<ennoausberlin>amz3: rainbow delimiters is part of spacemacs. I can use it
<amz3``>ennoausberlin: you should read something about sxml, I don't have a readily interesting link about it
<amz3``>ennoausberlin: find something interesting about sxml prolly in the manual and paste the link please
<ennoausberlin>the themes installs right now
<amz3``>maybe solarized themes also work well with rainbow delimiters, try them
<amz3``>M-x customize-themes
<ennoausberlin>this one? https://www.gnu.org/software/guile/manual/html_node/SXML.html
<amz3``>ennoausberlin: yes... but as you see the interesting introduction is missing
<amz3``>ennoausberlin: basically sxml is xml written using scheme syntax
<ennoausberlin>amz3: sounds good. I will read more about it
<amz3``>ennoausberlin: are you familiar with quote, quasiquote and unquote?
<amz3``>those will be very useful for rendering html, that's basically how templating is done is guile
<ennoausberlin>I understand the concept but I didnt use it so far
<amz3``>ok
<amz3``>no problemo
<amz3``>I am cooking some template project for doing web
<amz3``>just a few minutes it will be ready
<ennoausberlin>amz3: Thank you for all the work.
<amz3``>I have all the pieces on my hard disk but never took the time to put it together
<ennoausberlin>Doh. Its raining. I have to save my laundry. I am back soon
<amz3``>ok
<ennoausberlin>I am back
<amz3``>sorry it's not ready yet
<amz3``>ennoausberlin: you should read about ice-9 match in the manual because that's the goto solution for working with lists
<amz3``>I recommend you bookmark this page https://www.gnu.org/software/guile/manual/html_node/Procedure-Index.html#Procedure-Index
<ennoausberlin>for regexp? OK
<amz3``>that's not regexp, it's pattern matching tho, it's works on lists
<amz3``>and other stuff it's very useful
<amz3``>nowdays many languages (like rust) grow with that feature embedded
<ennoausberlin>I see
<amz3``>it allows to *destructure* some datatypes into components and execute some control operation
<amz3``>it's somekind of advanced 'switch'
<ennoausberlin>There is an example in the manual. Looks powerful
<janneke>mwette: thanks for the headsup
<amz3``>almost done
<ennoausberlin>amz3: Do you use scheme on your day job?
<amz3``>ennoausberlin: not yet
<amz3``>done!
<amz3``>ennoausberlin: https://github.com/guilelang/guile-web
<amz3``>git clone https://github.com/guilelang/guile-web
<amz3``>ennoausberlin: you can thx davexunit because most of this won't be possible without his work
<amz3``>ennoausberlin: also you can thank yourself, because if you did not ask I would have done this little boilerplate
<ennoausberlin>Just a moment
<amz3``>anyway, just clone the repository and run: sh web.scm
<ennoausberlin>no code for module (htmlprag)
<ennoausberlin>A library is missing. Just a moment
<amz3``>this is a mistake
<amz3``>htmlprag comes from guile-lib
<amz3``>I will remove but right now I need to do something
<amz3``>bbl
<ennoausberlin>OK. Dont hurry
<amz3``>so htmlprag is a library part of guile-lib that allows to parse html
<amz3``>but it's not useful as part of the boilerplate
<amz3``>ennoausberlin: you can git pull again, and try sh web.scm
<amz3``>the readme is empty, we will work it together with your questions
<ennoausberlin>I am a little concerned to run code on my productive system. :) Anyway I see Server running @ http://localhost:8080
<ennoausberlin>Safari does not render anything
<amz3``>oh
<amz3``>that's strange
<amz3``>you should see something like: Héllo guilers
<amz3``>with a azure background
<amz3``>azure aka. blue
<ennoausberlin>I will try it on GUIXSD with icecat
<amz3``>productive system?
<ennoausberlin>amz: It works on GUIXSD. Fine. I call the computer where all my personal stuff is stored my "productive system". Its an Mac. My wife uses it sometimes. Anyway. It works on the other computer
<amz3``>ok cool
<amz3``>there is two files right now in this project
<amz3``>this is safe :)
<amz3``>there is a web/html.scm which doesn convert sxml to html string
<amz3``>and there is 'web.scm' at the root
<amz3``>this is the interesting file
<ennoausberlin>So. I will work through your code. But I have to do it later. The kids are coming soon and I have to do some household :)
<ennoausberlin>Anyway, this is a good start. And if I have questions I hope to see you here again
<ennoausberlin>Are you a student?
<amz3``>no
<amz3``>web.scm interesting stuff starts at line 609
<amz3``>I am professional (!) developer, even engineer
<amz3``>:)
<amz3``>ennoausberlin: good
<amz3``>ennoausberlin: I recommend you subscribe to the guile user mailing list and ask your question there too https://lists.gnu.org/mailman/listinfo/guile-user
<ennoausberlin>I left university 20 years ago. So my knowledge is a little outdated. Never worked as programmer but studied information science. I will subscribe today. Thank you again for your support
<ennoausberlin>See you
<amz3``>:)
<amz3``>happy_gnu: ping
<ArneBab_>paroneayea: here are the results for the fibers performance test: https://lists.gnu.org/archive/html/guile-user/2017-07/msg00041.html
<paroneayea>ArneBab_: woo woo
<paroneayea>sneek: later tell wingo so as you may have seen, I now have 8sync running entirely on top of fibers... almost! Everything works but I don't have a way to halt an actor's event loop to shut it down. I thought I had a solution with conditions, but it seems that watchers don't get removed after they "move on" by something else being selected in a choice-op. I wonder what the right solution is, and if you have thoughts?
<sneek>Will do.
<OrangeShark>hello
<amz3`>héllo OrangeShark
<OrangeShark>how are you amz3`?
<amz3`>OrangeShark: fine and you?
<OrangeShark>amz3`: I am alright, just got home and decided to check the guile mailing list. Seems your email about how to make GNU Guile more successful is getting responses again.
<amz3`>yeah
<amz3`>linas is among the few professional guile users
<amz3`>but his use case, IMO, is not the most common to say the least
<OrangeShark>yeah, such large datasets
<amz3`>yeah
<amz3`>and fwiw, my work on sotoki was related to a large dataset (50Go) and Python does not handle it very well
<amz3`>even if it seems like a very simple task
<amz3`>over a big dataset it's almost a different story
<rlb>wingo: as a heads up, guile-2.2 was rejected by the Debian ftpmasters, and I suspect, based on the comments, that the same arguments may apply to other guile versions, i.e. this may have broader implications that we(I)'ll have to pursue.
<amz3`>rlb: why was it rejected?
<rlb>amz3': Hang on - was looking for a public copy of the notice, but I'll just stick it somewhere.
<rlb> https://paste.debian.net/hidden/6bf75f35/ They also mentioned that some other authors are missing from the debian/copyright file, but those may well just be oversights on my part -- and note that I don't think this is official in the debian-legal, sense (yet), but will have to be pursued.
<rlb>Of course in the end it'll come down to whether or not all of the non-standard licenses in the tree are deemed DFSG.
<rlb>I should have some time to follow up over the next few weeks, but I suspect it could also be slow-going.
<amz3`>here is an article about debian ftpmasters https://lwn.net/Articles/381667/
<daviid>rlb: that is very surprising. the Makefile.am says: # GPLv2+ Larceny GC benchmarks by Lars Hansen et al. from
<daviid># <http://www.ccs.neu.edu/home/will/GC/sourcecode.html>.
<daviid>
<daviid>for all larceny/* files
<rlb>In the end, I'll need to address all of their concerns by some combination of adjusting the packages, and/or getting a Debian-specific legal opinion on the relevant points. Though I may be able to address some of it by just dropping files, which would be a lot simpler.
<rlb>i.e. can probably drop that specific file.
<daviid>yes indeed, it is very annoying that you'd have to 'deal' with this, building the debian package is already quite an acheivement without these headhackes
<daviid>I eleive this is an 'error', I mean it is an error/mistake at the origin (like in those who wrote, since they claim themsleves that it is GPLv2+
<daviid>rlb: another thing is this is part of guile 2.0 as well isn't it?
<daviid>the last update of the GC benchmarks is 2001
<daviid>I men the last update of the web site sorry
<daviid>yes, I confirm that this file is in debian already
<daviid>rlb: also, William Clinger copyright is everywhere is the GC larceny code, but it seems this is the only occurrence that has the text "... lawful purpose, ... must send improvements ..."
<daviid>rlb: this file has been in debian for probably more then a decade :)
<daviid>not that it justify anything of course, but in the light of this fact, all of a sudden saying 'your s/w can't be part of debian because of an infrigment of the DFSG is a bit harsh, to say hte least
<ArneBab_>amz3`: linas might not have a common usecase, but that will be the case for others, too: Guile needs a foothold in something where other tools simply fail
<ArneBab_>daviid: if that stance leads to clearing up the copyright uncertainties, it serves its purpose. Licensing is at the core of software freedom, and while (L-)GPL typically works so well that we don’t even have to think about it, problems in the licensing can have widereaching effects.
<daviid>rlb: anyway, I'm not amaintainer (as you know), but I think that the most immediate solution is to get rid of these files - (and updating the Makefile.am), I've just greped 'improvement' and it lists twobit-smaller.sch, twobit-input-long.sch and twobit.sch - while talking to maintainers (and I very much beleive they will want to solve this, as well as the guix maintainers actually, since having these are against the guix project itself
<daviid>... but one thing at a time, as I said, these are part of guile since 2.0 (at least) ...
<daviid>ArneBab_: yes, no need to teach an old mokey to make stange faces ... :):) tell me something new please :) we need to find an imediate solution for rlb to submit 2.2 to unstable, immediate is now ...
<ArneBab_>:)
<ArneBab_>removing the files sounds like something which should work
<amz3`>ArneBab_: +1 regading linas usecase
<ArneBab_>amz3`: just as a followup: my usecase is also not a common one. I’m pursuing Guile Scheme, because it allows be to move beyond the limitations of core-syntax.
<ArneBab_>I want to push where programming can go
<ArneBab_>(at least my understanding of that)
<daviid>rlb: I have access to a very fast machine, I'm now compiling without these files, and will let you know, in half an hour or so, it should be fine but better check ...
<daviid>rlb: half an hour or so because I'm compiling from the source, not the tarball...
<daviid>remacs, "... the people working on it probably wouldn't be contributing to full Emacs (or the Guile effort) anyway ..." :(
<jlicht>daviid: besides rust being notoriously difficult to bootstrap from source, what is wrong with REmacs (as a project on its own)?
<rlb>daviid: thanks, and yeah, I'll start by cleaning up the copyright, and (likely) removing those files, one way or another.
<rlb>Then see what else I can find, build a +2-1 and resubmit.
<daviid>rlb: good! will let you know in a little while (I'm running make; make check, if you wish, tomorrow I can run make distcheck if this attempt did pass of course...)
<rlb>OK, thanks - and yeah, the deb definitely takes a while to build atm (it bootstraps too). I just sped up the emacs25 build quite a bit (in 25.2+1-2), so guile-2.2 is even further out there :)
<daviid>rlb: ah so you will submit a version based on the very latest stable-2.2 branch then? that would be very very goo
<rlb>Well, the previous attempt was 2.2.2, and so that's probably what I'll stick with for now, i.e. the latest released version.
<daviid>ah too bad, there are important bugs fixed in the stable-2.2 git repo
<rlb>But I'd be fine with any important bugfixes that don't break backward compatability with 2.2.2.
<rlb>I can't recall offhand if I've already pulled any in.
<daviid>rlb: srfi-19 bugs have benn fixed
<daviid>and a readline control chars related fix prety cool as well
<daviid>and the web module add support for URI-reference
<daviid>rlb: these are the three important ones to get in the debian release :)
<rlb>daviid: OK, I'll put those on my list to look for if/when I have a chance, and feel free to mail relevant commit hashes to me (or post them here, assuming I don't miss them) if you like.
<daviid>rlb: thanks! will do, but I beleive that these three are really what matters for now
<rlb>Oh right, I just meant in general and/or if the hashes for those fixes aren't obvious.
<ArneBab_>rlb: thank you for doing the debian package!
<ArneBab_>-ing
<rlb>you're certainly welcome.
<daviid>rlb: yeah, thanks a ton to work on this!