Perl 6 - the future is here, just unevenly distributed

IRC log for #6macros, 2017-08-28

| Channels | #6macros index | Today | | Search | Google Search | Plain-Text | summary

All times shown according to UTC.

Time Nick Message
01:52 ilbot3 joined #6macros
02:14 Ven`` joined #6macros
05:10 masak blocks started out as first-class in 007. they were removed as terms/values exactly because I didn't want to take the Perl 6 route of having a `leave` semantics.
05:12 masak instead, blocks always acted as if they had an implicit `leave None`. this was part of what was confusing when using them -- there was a big temptation to put a block in a .map(), for example
05:13 masak it might seem stubborn of me to insist that blocks not return any value, but I was looking at languages like Perl 5 and Python and JavaScript -- even Java and C# -- for prior art. they all have only one "level" of value-returning type of code. only routines, not blocks and routines.
05:14 masak so for example https://github.com/masak/007/issues/215 aims to give us all the advantages of value-returning blocks, but using only (the semantics of) subs
05:16 masak not saying that early decision (to ban blocks from the design) needs to be protected at all costs, but I still find it superfluous and somehow against 007 aim at minimalism to have both routines/return and blocks/leave
05:19 masak and because of that, I'm willing to entertain the idea of just considering quasis to be routines and making `return` work in quasis/injections, rather than (re-)introducing the idea of blocks, introducing `leave`, and then making `leave` work in quasis/injections
05:19 masak hope that makes sense :) I do understand it's a position one can agree or disagree with
05:20 masak in the end, I'm motivated by a desire to keep the language simple. I'm not (yet) convinced that 1st-class blocks are necessary for macros and quasis
12:45 Ven`` joined #6macros
12:45 Ven`` Blocks not being first-class is not an issue, as I see it. They don't need to be.
12:46 Ven`` Some expression-oriented languages can still compile down to statement-oriented languages, say. That's why the comma operator has existed at least since C.
12:51 Ven`` The example I'd use is CoffeeScript's ability to compile down `if`s, `while`s, etc, as expressions in JS.
12:52 Ven`` Using the comma operator for sequencing, ?: for if, and the ultimate hack otherwise: an IIFE for loops.
12:52 Ven`` (which is why returning from such constructs is forbidden: "x = return 1 for a in b" yields "cannot use a pure statement in an expression")
12:53 Ven`` There's no difference between "{ foo(); if (a) bar(); else baz() }" and `(foo(), a ? bar() : baz())`
12:54 Ven`` We don't need leave. Both it and return are hacks to begin with. I probably won't get too many friends for saying that, but... Short-circuiting is not very interesting.
12:55 Ven`` WRT blocks returning values, of course, in Lisp it's not an issue, because everything is an expression.
12:58 Ven`` (and a lot of lisps don't have a `return` statement. CL has `return` but that actually only works for what they call "blocks". So it's backwards to how we have it here)
12:59 Ven`` I'm saying all this because this is apparently an area where you're ok with distancing yourself from Perl 6 so we should try to find some inspiration from other languages.
14:36 cognominal joined #6macros
17:49 vendethiel- joined #6macros
18:07 Ven joined #6macros
18:40 masak I started a repository called george-lazenby to follow to its logical conclusion the idea that everything is an expression
18:40 masak but I can't find it anymore. maybe I removed it in a fit of sanity.
18:40 masak (never got a round tuit to do anything; all it did was sit there falling behind 007's HEAD)
18:44 vendethiel- even loops? :P
18:44 vendethiel- I remember arguing with #perl6 in 2014 about loops being specialcased to not return a value
18:47 masak I don't have a pony in that race either
18:47 masak but rest assured they would return something :P
18:48 vendethiel- \o/
18:48 * masak .oO( to this day george-lazenby remains only a legend, a whisper upon the wind )
19:16 vendethiel- One thing that struck me is that it's one of the areas you're willing to deviate from Perl 6 :)

| Channels | #6macros index | Today | | Search | Google Search | Plain-Text | summary