IRC channel logs

2016-03-29.log

back to list of logs

<rain1>can guile serve as node.js replacement?
<paroneayea>rain1: you mean, an asynchronous network programming environment / a nonblocking event loop? :)
<rain1>yeah!
<paroneayea>rain1: that's what wingo and I were talking about re: the 8sync / ethreads conversation
<paroneayea>so, we're both working on things related to that
<rain1>oh great!
<ArneBab_>paroneayea: I’d like to have typed Guile of functions which helps native code generation.
<rain1>possible bug in guile?
<rain1>a.scm: (define a 1)
<rain1>b.scm: (import "a.scm") (display a) (newline)
<rain1>guile -l b.scm
<rain1>a.scm: (define a 2)
<rain1>guile -l b.scm
<rain1>prints 1 both times
<rain1>sorry (include "a.scm") (display a) (newline)
<civodul>(limited) pattern matching in C++: http://www.stroustrup.com/OOPSLA-typeswitch-draft.pdf
<civodul>(with some name-dropping at the end ;-))
<mthl>civodul: :)
<rekado>with "match" how can I both bind the outer expression *and* match an inner expression?
<rekado>this is my pattern: (('package ('name name) . rest))
<rekado>I want to bind both "name" as well as the whole expression
<rekado>(this is just a sub pattern of a larger pattern)
<davexunit>(and ('package ('name name) . rest) whole-exp)
<davexunit>maybe?
<rekado>davexunit: thanks, this seems to work!
<davexunit>yw
<dsmith-work>(Appropriate Time) Greetings, Guilers
<civodul>wingo: insightful post on flat wage
<civodul>gave me food for thought
<mark_weaver>wingo: when I was sysadmin at the FSF many years ago, everyone received the same hourly wage, and that had been the practice from the beginning.
<mark_weaver>sadly, they abandoned that after I left
<civodul>oh
<mark_weaver>the executive director at the time decided that his time was worth more
<davexunit>mark_weaver: without going into detail, there has been some internal conflict about this subject.
<davexunit>I support a flat wage.
<mark_weaver>of course RMS has always voluntarily accepted 0 pay from the FSF
<mark_weaver>which I have enormous respect for
<davexunit>on the positive side, the FSF is unionized.
<mark_weaver>as he put it once, as soon as the FSF started making enough money from sales of books and software tapes to pay one person, RMS had to decide whether that first paid employee should be him or not.
<mark_weaver>but he said that he knew that RMS would be willing to work for nothing, so it would be better to hire someone else instead, so there would be two people working there instead of one.
<civodul>one still needs housing and food, though
<mark_weaver>well, this is a paraphrase. he said it better, and it was kind of amusing how he put it
<mark_weaver>that's true, he was fortunate to be in a position where those things were essentially donated to him from other sources
<civodul>yeah
<mark_weaver>and now he supports himself by asking money for giving talks
<mark_weaver>davexunit: yeah, I was at the FSF recently and caught wind of some of that conflict
<mark_weaver>I strongly support everyone getting the same hourly wage
<mark_weaver>with the possible exception of dangerous or extremely unpleasant work receiving a higher wage
<mark_weaver>but of course, in our society, it's usually the other way around, with those jobs getting paid less
<mark_weaver>because the people who do those jobs are essentially considered "disposable"
<df_>ideally those jobs would be done by robots
<df_>unless there are people that actually *want* to do them (which I suppose is possible in the dangerous case)
<davexunit>the pay grades have caused problems that could have been avoided if everyone was just paid the same.
<mark_weaver>the former executive director who initiated the process of eliminating the equal-pay-for-everyone had a wife who strongly desired a higher standard of living.
<mark_weaver>to me, it's a sad story
<fhmgufs>Hi! Sorry for interrupting your discussion:
<fhmgufs>What's a tuple?
<fhmgufs>I mean in Scheme.
<mark_weaver>scheme has no such concept
<mark_weaver>the closest analogue is the list
<mark_weaver>and the second closest is the vector
<fhmgufs>So, if Schemers talk about "tuples", what do they mean?
<davexunit>we often call some forms of lists tuples around here. the most common thing would be the lists you see in the 'inputs', 'native-inputs', and 'propagated-inputs' fields of packages
<fhmgufs>Ok, thanks.
<davexunit>things like ("python" python)
<mark_weaver>okay, I have to go afk
<mark_weaver>happy hacking, all!
<davexunit>bye mark_weaver
<paroneayea>mark_weaver: interesting
***holomorp1 is now known as holomorph
<davexunit>emacs has joined guile on the shiny new website bandwagon https://www.gnu.org/software/emacs/
<holomorph>ACTION barfs
<davexunit>big improvement over what was there before
<df_>woah
<df_>feels wrong somehow
<janneke>"discover emacs in video" 1st example: paredit :-D
<davexunit>yay
<holomorph>transcodes of youtube videos /o\\
<davexunit>better than directing people to youtube
<davexunit>which would use a nonfree video player
<jmd>davexunit: Today, youtube can be viewed without proprietary codecs.
<davexunit>jmd: but not without proprietary javascript
<davexunit>you can use a tool like youtube-dl to watch youtube videos without using their web player, but the nonfree JS is why the Emacs web page doesn't embed youtube videos.
<jmd>Would it not be possible for emacs to download a video in the background, and then play it back? It would give the same impression, albeit with delay.
<davexunit>that sounds much more complicated than just taking the video and hosting it elsewhere
<janneke>M-x view-tutorial #x would be nice ;-)
<jmd>davexunit: Well it would amount to the same thing, but wouldn't require petabytes of storage.
<davexunit>what?
<davexunit>there are 3 videos on the emacs home page
<paroneayea>the new emacs site is pretty nice!
<paroneayea>I hope they can put up themed screenshots though :)
<fhmgufs>daviid: I noticed that some procedures of guile-gnome (e.g. gtk-tree-path-new-from-string) take the same argument twice.
<fhmgufs>Is there a special reason for that?
<fhmgufs>Although it works as expected if I give both arguments with the same value, it doesn't look very nice.
<daviid>fhmgufs: didn't know that, never used it myself, but it is a [minor] bug
<daviid>fhmgufs: you said some, what are the others?
<fhmgufs>Wait, I can't remember, there was one more...
<fhmgufs>daviid: No, sorry. It's just this one.
<daviid>ok
<fhmgufs>I remembered asking something like that before.
<fhmgufs>But it was the same one.
<fhmgufs>It was here: https://gnunet.org/bot/log/guile/2016-03-20#T967142
<wingo>moo
<fhmgufs>ACTION likes mooing peoples
<daviid>wingo: hello. I can figure out why you added custom def for gtk_tree_path_new_from_string, here http://git.savannah.gnu.org/cgit/guile-gnome.git/tree/gtk/gnome/overrides/gtk-customs.defs line 720: it just does not make sence to me :) it seems to me that the h2def is good enough http://git.savannah.gnu.org/cgit/guile-gnome.git/tree/defs/gnome/defs/gtk.defs line 23105
<wingo>daviid: no idea, looks to me like the generated one in the gtk.defs is missing a parameter
<wingo>but i can't tell
<daviid>wingo: what would be missing? here https://developer.gnome.org/gtk2/2.24/GtkTreeModel.html#gtk-tree-path-new-from-string
<wingo>no idea :) could be it's a bug, dunno
<daviid>wingo: it's ok, thanks. I'll comment the custom def and test
<daviid>wingo: bye the way, if you could release guile-cairo, it would be awesome :)
<wingo>good idea :) doing something else this evening but a good reminder :)
<wingo>so it turns out bytevector output ports always take the slow write path
<wingo>ACTION popcorn
<civodul>wingo: force utf8!
<civodul>it often boil downs to that ;-)
<madmax96>Hey, is there an atomic `compare-and-swap` procedure in guile? I've been looking and can't seem to find one. Could I use the FFI and get one using a native procedure?
<wingo>civodul: binary output ports don't have a setvbuf impl so no write is inline
<wingo>madmax96: sadly this doesn't exist (yet?)
<madmax96>Both Clang and GCC implement __sync_bool_compare_and_swap(). I can just FFI to this. It would be **really** nice if the virtual machine had this functionality, though. Maybe a weekend project is in order...
<rain1>what would it do ?
<rain1>if it's to set! variables, what about just calling into a new procedure with args swapped instead?
<daviid>rain1: https://en.wikipedia.org/wiki/Compare-and-swap
<madmax96>rain1: It can't be implemented as a function because you can't gaurantee in a multi-threaded environment the compare-and-swap operation is atomic. It has to be done w/o interuption or the state changing
<rain1>oh my bad, suggestion can't be used here then
<wingo>madmax96: to my mind the missing concept is "place" -- you can make it work with the ffi for some data types, but would you want it to apply to scheme values?
<wingo>and if so to what kind of object
<wingo>we need an atomic reference type with its own associated operations
<wingo>cas being one of them
<wingo>imo anyway
<madmax96>I have limited experience with the guile FFI, but from my understanding couldn't I use scm->pointer and have that protected? I'm struggling to see how it's possible to implement an atomic reference type w/o compare and swap. even using a technique like MVCC. I could be wrong on this one though
<wingo>you couldn't do it in scheme, it would need to be in c or in the vm or via the ffi
<madmax96>To clarify, FFI'ing out to a compare and swap operation, and using it on arbitrary scheme data types via scm->pointer.
<rain1>I'm just curious what sort of concurrency stuff are you making?
<rain1>compare-and-swap looks like a nice elegant primitive to build things on
<wingo>so you're on the right track, i would just consider it maybe more reliable to have a dedicated data type for atomic references
<wingo>which are always set / read / swapped / etc atomically
<madmax96>rain1: I want to implement Clojure's primitives for Guile
<wingo>otherwise it's too easy to e.g. read, but without a barrier so perhaps some invariants you need are not being held
<rain1>madmax96, sounds lke a cool project! I'll look up the clojure thing..
<madmax96>I think that Hickey used Java's Atomic type as his basis, and then expanded with MVCC and built the other primitives with that as a backbone
<rain1>Hickey is amazing: )
<madmax96>rain1: I'm a fan. I really admire the generalization of lists, vectors, etc. into sequences and the consistent polymorphic functions that operate on them. It just sucks that Clojure spits out Java stacktraces and lein's startup time makes it unattractive to hacking
<rain1>ACTION I am just reading this http://clojure-doc.org/articles/language/concurrency_and_parallelism.html
<rain1>madmax96, it took me a good few years to realize it but yeah :D
<rain1>so the define an 'atom' type which is basically a vector of size 1
<cojy>its really useful
<cojy>lots of things like memoization macros actually break with threads
<rain1>I guess anything with '!' in it breaks with threads? :)
<cojy>i think that depends but it's usually like, with memoization you have to do two things at once
<cojy>check if it's set yet, and then set it if it isn't
<cojy>vector-set! and set-car! are often atomic
<wingo>madmax96: you might be interested in https://wingolog.org/pub/fector.scm
<wingo>and https://wingolog.org/pub/fash.scm
<wingo>missing a proper implementation of the atomic reference type there, but oh well