IRC channel logs

2016-04-27.log

back to list of logs

<davexunit>wingo: looks like you have a guile 2.2 fan https://news.ycombinator.com/item?id=11575198
<mejja>I guess I could have been more precise and said that the lambda calculus (rather than Scheme/Lisp) is not the foundation of computing. It seems like there are people who still think this :)
<nalaginrut>but compare to CPython and win is too easy to happy ;-P #hash
<nalaginrut>mejja: that depends on the definition of `foundation' and `computing'
<mejja>Me thinks he is trolling.. https://news.ycombinator.com/item?id=11572516
<wleslie>rain1: well there's also icc, tcc, and https://github.com/MatzeB/cparser
<wleslie>ok icc isn't free, hum
***karswell` is now known as karswell
<paroneayea>hoo boy
<paroneayea>davexunit: https://spin.atomicobject.com/2016/04/26/swift-long-compile-time/ crazy exponential type inference bug
<paroneayea>fun fun
<davexunit>paroneayea: ouch! I read on HN that it's already patched though
<paroneayea>davexunit: yeah looks like it
<jlicht>hello guile! I've been dabbling in this particular flavour of scheme the last few days, and was wondering wether the '%' prefix I see from time to time has any significance
<jlicht>Mostly talking about things like '%site-dir'
<lloda>it's a naming convention for sort-of environment variables
<jlicht>lloda: ah, I see. Thanks
<wingo>pretty weird naming convention imo :)
<jlicht>Have to admit that it does stand out in any piece of code, so in that regard I guess it is a good convention ;_
<paroneayea>huh
<paroneayea>I could reduce a lot of verbosity in the 8sync actors code by aliasing send-message to <-
<paroneayea> http://mumble.net/~jar/articles/oo-moon-weinreb.html which is apparently what older message passing lisps did
<lloda>what about ←
<davexunit>then how would you type it?
<lloda>M-x set-input-method tex \\leftarrow
<random-nick>I've heard that on the Symbolics lisp machines they aliased >= to ≥ and <= to ≤
<df_>they had big keyboards
<jlicht>lloda: awesome. Regarding emacs, I learn something oddly specific yet quite useful every day XD
<rain1>paroneayea: i was thinking about 8sync
<rain1>it's neat how it uses continuations to pause and resume a procedure
<rain1>but continuations can also be used to backtrack and retry something, does that every happen in 8sync?
<rain1>and then I was thinking how does thaht relate to threading type stuff, it sounds a bit like STM (which retries operations and rolls them back if there's a conflict)
<paroneayea>rain1: it uses delimited continuations, not full continuations, fwiw
<paroneayea>but it doesn't use them for the "retry"ing things, at least not right now
<paroneayea>I've not given much thought to it
<paroneayea>it could be worth exploring, but it could also end up in some pretty goofy things
<rain1>yeah just something thath crossed my mind :)
<paroneayea>rain1: yeah it's interesting!
<paroneayea>ArneBab: http://dustycloud.org/tmp/8sync-tutorial-part1.html updated a bunch, and thanked you for your feedback!
<paroneayea>(if you'd prefer to not be listed there, I can remove it)
<rain1>hello
<rain1>according to R7RS to import a srfi you do (srfi 3)
<rain1>but guile does (srfi srfi-3)
<rain1>what about moving over to help compatability?
<davexunit>rain1: Guile doesn't support R7RS at this time
<davexunit>(srfi srfi-3) doesn't import a srfi though
<ft>There's a r7rs-wip branch, which may or may not have something in store about that. :)
<davexunit>that's special syntax that you could use in a use-modules form
<rain1>oh that's great! I should have a look at it
<davexunit>which is unique to guile
<ft>rain1: I have not looked at that branch. I have just seen it around, with commits from mark_weaver going in. But I have no idea how far along it is.
<mark_weaver>it's been mostly done for a long time. just a few missing bits
<mark_weaver>I went through a period of uncertainty about whether we should add R7RS support to Guile, but eventually decided that we should.
<mark_weaver>supporting imports of the form (srfi 3) is one of the missing bits
<random-nick>will guile ever implement srfi 49?
<random-nick>afaik it can only be implemented by making a language on the compiler tower that compiles srfi 49 files to normal scheme
<df_>go on then!
<df_>it seems a silly question, as far as I know nobody here can tell the future
<random-nick>hmm
<random-nick>actually
<random-nick>the srfi includes a reference implementation for guile
<random-nick>srfi.schemers.org/srfi-49/srfi-49.html
<random-nick>it's a module that rewrites guile's read function with its own implementation :O
<df_>well, problem solved then?
<janneke>hmm, reminds me of wisp
<df_>ah I like wisp, saw a talk about it at fosdem
<random-nick>yeah wisp has a lot more features than i-expressions
<roelj>Is there a module for named records, like the ones used in Guix?
<random-nick>roelj: srfi-9
<random-nick>roelj: https://www.gnu.org/software/guile/manual/html_node/SRFI_002d9-Records.html#SRFI_002d9-Records
<random-nick>roelj: but guix might use GOOPS, which is a object system
<roelj>random-nick: No, I want to be able to define records by specifying both the field and the value, like in a Guix package expression (package (name "my-package-name") ...). With SRFI-9 I would end up doing (package "my package-name" ...).
<davexunit>roelj: guix has its own macro for this
<davexunit>define-record-type*
<davexunit>in (guix records) I think
<roelj>davexunit: Is there a module that does just this? Otherwise I need to add Guix as a dependency to my fairly simple program..
<davexunit>roelj: I told you the module that does it.
<davexunit>you can copy that module into your program if you want to use it.
<roelj>davexunit: Ok. thanks
<davexunit>I use a much simpler macro in Sly https://git.dthompson.us/sly.git/blob/HEAD:/sly/records.scm
<davexunit>supports default args and inheritance using a constructor procedure with keyword arguments
<davexunit>no thunked fields or the fancy syntactic constructor stuff
<roelj>Right. I see it's much simpler
<roelj>That is nice.
<davexunit>I might expand it at some point
<davexunit>I notice that I write a decent number of procedures that alter a field by adding to it in some way
<davexunit>adding a number, consing onto a list, etc.
<davexunit>so I could have some additional syntax for defining these types of setters
<cojy>how do i run guile in r6rs mode?
<wingo>meep
<mark_weaver>cojy: guile doesn't really have an "r6rs mode", except for some read and print options that you might want to tweak. the 'library' and 'import' forms are supported
<mark_weaver>hi wingo!
<mark_weaver>cojy: we want to be able to combine R6RS code with normal Guile code in a single process, and so having to choose one "mode" or the other is not so great
<cojy>oh i just cant figure out how to run this r6rs code is the thing
<cojy>like at all im not looking for a mode specifically
<cojy>for example Unbound variable: define-record-type
<random-nick> https://www.gnu.org/software/guile/manual/html_node/R6RS-Records.html#R6RS-Records
<mark_weaver>cojy: sounds like you haven't imported the relevant module, which in this case is (rnrs records syntactic)
<wingo>heya mark_weaver :)
<wingo>i have been removing the port locks on the branch
<mark_weaver>thank you, that sounds good!
<mark_weaver>I'm sorry I haven't found the time to look at the actual code, but from your descriptions it all sounds good to me
<cojy>is there an equivalent of (time ...) somewhere? its hard to google
<mark_weaver>cojy: I'm not sure what (time ...) is, so I'm not sure what an equivalent would be
<cojy>it times how long the body takes to execute
<cojy>and usually things like how much allocation and time spent in gc
<wingo>(use-modules (ice-9 time))
<wingo>(time ...)
<wingo>not the best tho
<mark_weaver>also see the ,time REPL command
<wingo>i mostly use ,time at the repl
<wingo>yeah
<mark_weaver>and ",help profile" for more
<mark_weaver>wingo: I was thinking about how to deal with the widespread habit of simply writing errors and warnings to 'stderr', which is the main case where we can't simply tell the user to handle locking at the user level.
<mark_weaver>wingo: one option would be to simply establish global mutexes for writing error messages and warning messages.
<wingo>not a bad option, though (format (current-error-port) ...) is not rare either
<mark_weaver>another option would be to move to some higher-level API for reporting errors and warnings
<paroneayea>goofy question:
<paroneayea>with catch, is there any way in the pre-unwind-handler to see if we *really* want to still catch the exception?
<paroneayea>and, if not, to simply let the exception bubble through as-is?
<wingo>paroneayea: what do you mean? :)
<paroneayea>wingo: something kinda goofy for the actor model system I'm writing
<rain1>could maybe use two catches and inspect the error in the middle?
<wingo>usually in that case i think that an inner catch overrides an outer catch-with-pre-unwind-handler
<wingo>e.g. (with-throw-handler ... (lambda () (false-if-exception (/ 1 0))) ...) will return false
<wingo>without invoking the outer pre-unwind handler
<paroneayea>right...
<paroneayea>so, in python you can do this:
<paroneayea>
<paroneayea>try:
<paroneayea> foo()
<paroneayea>except e:
<paroneayea> if do_we_still_want_to_catch_it():
<paroneayea> print("Gotcha!")
<paroneayea> else:
<paroneayea> raise
<paroneayea>the "raise" re-raises the exception as if the "except" had never been callsed
<paroneayea>called
<paroneayea>you only want to use this rarely, but there are some points where you find out you don't want to catch something based on some information you have at the time you catch it
<paroneayea>and you don't want to destroy the backtrace
<wingo>if you don't do anything in a pre-unwind handler you just let the pre-unwind handler return
<wingo>and the exception will continue to propagate
<paroneayea>wingo: oh yeah? great :)
<wingo>:)
<paroneayea>wingo: wait, won't the "handler" be invoked on catch?
<paroneayea>or is it possible to pass #f to handler or etc
<wingo>you sir need to visit the fine manual ;-) see with-throw-handler
<jlicht>most polite rtfm ever ;-)
<wingo>it's 'cause i like paroneayea :)
<paroneayea>:)
<paroneayea>wingo: I got it now. Thanks for your advice/rtfm :)
<wingo>yw :)
<roelj>I think I broke Geiser. When I C-x C-e a Scheme expression, it tries to evaluate it as Emacs Lisp (as if Geiser isn't running). I started Geiser with M-x run-geiser. Do I need to add a hook somewhere?
<civodul>roelj: does C-c C-k work in that buffer?
<roelj>civodul: Nope.. "C-c C-k is undefined"
<flurb>hi, i would like to use dynamic-link with a library in a non-standard place. I passed LD_LIBRARY_PATH to guile but dynamic-link still fails to find library
<flurb>how can dynamic-link find the library?
<jmd>My program is suffering from premature garbage collection.
<random-nick>jmd: performance wise or is non-garbage getting collected?
<lloda>flurb: you should be able to pass the full path to (dynamic-link), like (dynamic-link "/non/standard/liblib.so")
<flurb>lloda: according to the docs that's discouraged :(
<jmd>random-nick: non-garbage is getting collected.
<davexunit>jmd: how do you know this/
<jmd`>Is there a way to prevent an object getting collected?
<civodul>jmd`: anchor it to a GC root, for instance by assigning it to a global variable
<jmd`>OK thanks.
<paroneayea>huh
<paroneayea>I'm encountering an interesting case where errors seem to be uncatchable in some very particular case involving nested prompts. but I could be wrong.
<paroneayea>guile is ending with "Aborted"
<paroneayea>trying ot figure out how to reproduce
<paroneayea>the whole program seems to crash.
<paroneayea>nothing in guile's source seems to indicate it should print out "Aborted"
<paroneayea>strange.
<civodul>"Aborted" is printed by the shell; it means the thing ended with SIGABRT, aka. abort(3)
<civodul>ACTION -> zZz
<civodul>happy debugging! :-)