|
6macros: discussing the finer points of Perl 6 macros, Qtrees, and how to stay sane | irclog: irclog.perlgeek.de/6macros/today Set by moderator on 2 March 2015. |
|||
|
00:15
vendethiel joined
01:04
vendethiel joined
02:48
ilbot3 joined
|
|||
| moderator | 6macros: discussing the finer points of Perl 6 macros, Qtrees, and how to stay sane | irclog: irclog.perlgeek.de/6macros/today | ||
|
02:51
vendethiel joined
07:46
Ven joined
07:52
Ven joined
08:00
Ven joined
08:11
Ven joined
|
|||
| Ven | github.com/manastech/crystal/issue...t-77960457 | 08:19 | |
| crystal's solution to the problem :) | |||
| masak | (a) no explicit declarations, eww | 08:31 | |
| (b) pretty sure it'd work much the same in Perl 6 -- a variable declared in a macro argument expression survives to the end of its block | 08:33 | ||
| that's even consistent with hygiene if you ask me. | |||
| Ven | yeah, it's ruby-like :-) | ||
| and yes, that's what I'd expect | |||
| masak | the things are just thunks being passed around, and thunks are allowed to leak declarations. it's kind of their main feature, actually. | ||
| Ven | my point was -- the only way for a variable to "escape" the macro's scope is if they were supplied as a parameter | 08:34 | |
| masak | cf. `$cond1 && my $result = $cond2` | ||
| Perl 6 rides the waves by being very, *very* clear about what runs when. | 08:35 | ||
| like, if there's a sub declaration inside an if block, I don't have to worry about whether that's kosher or not. | 08:36 | ||
| er, that example is too easy. | |||
| let's say a class declaration inside an if block. | 08:37 | ||
| Ven | Right... | 09:03 | |
| which bite me at times :P | |||
| " _-o_ _<**>_ _&_ : LTy -> LTy -> LTy" now that's some extreme parsing rules we don't have... | |||
| masak | I have no idea how to read that. | 09:17 | |
| oh, and in other news: | |||
| this morning I was toying with the idea of introducing a simple object system/syntax into 007. | |||
| something like this: `my employee = new { has age; has name; method report() { say(name ~ ": " ~ str(age)) } };` | 09:18 | ||
| Ven | _-o_ _<**>_ _&_ | 09:29 | |
| that's basically something in agda | |||
| means you can invoke as "foo -o another param <**> and another & there" | 09:30 | ||
| just like "if then else" is definable in agda as | |||
| "if_then_else : forall {A} : Bool -> A -> A -> A; if True then val else _ = val; if False then _ else val = val" | 09:31 | ||
| (I'm not caring about multiverses here) | |||
| mixfix parsing is pretty crazy... | |||
| masak | as seen in github.com/masak/007/issues/18 :) | 09:37 | |
| Ven | pretty much so :-) | 09:47 | |
| it's more complicated in agda's case, tho | |||
| like, I can define _[_] for array subscripting in agda | |||
| there are no categories | |||
| www.cse.chalmers.se/~nad/publicatio...mixfix.pdf if you're interested. I think I've linked it earlier | 09:48 | ||
| oh, I've linked it in said thread! | |||
| Wow, my meory is so bad | |||
| masak | ;) | 09:50 | |
| Ven | I should either stop doing so many things at once or start sleeping a bit more, I guess. | 09:51 | |
| Ven goes back to his PHP and Java | |||
|
10:50
Ven joined
11:06
vendethiel joined
12:22
vendethiel joined
13:03
vendethiel joined
|
|||
| Ven | "Philosophically, Smalltalk's objects have much in common with the monads of Leibniz" | 13:24 | |
| now that's interesting.. | |||
| masak | yes! | 13:25 | |
| I never fully grokked Leibniz' monads, I confess. | 13:26 | ||
| Ven | what the fuck, sfr... | ||
| Ven sighs | |||
| masak | something about "the smallest unit of consciousness/awareness" | ||
| which does sound like Alan Kay objects, actually. or actors. | |||
| Ven | I didn't spend that much time with leibniz, but what I got was interesting. the arrows and such | ||
| masak | didn't know Leibniz had arrows | ||
| only done CT arrows lately :) | |||
| Ven | does he not? | ||
| masak | no idea | 13:27 | |
| Ven | must've been liskov's arrows then | ||
| typelevel.org/blog/2014/07/02/type_...ibniz.html / typelevel.org/blog/2014/09/20/highe...ibniz.html that's where I learned the most about our use of leibniz | 13:28 | ||
| masak | huh, type equality. sounds like the beginning of homotopy theory to me. (through my very weak understanding of that topic.) | 13:33 | |
| those two posts are a little bit above me still. :/ | 13:36 | ||
| Ven | though you can blame scala, really.. | 13:39 | |
|
13:44
vendethiel joined
|
|||
| Ven 's done reading | 14:21 | ||
| I skimmed the 3rd part, though... | |||
| Admittedly much more interesting than doing java and php... | |||
| masak | :) | 14:24 | |
| I should re-read it. | |||
| also, I should learn more Smalltalk. | |||
| and Self. | |||
| and I should learn more about the Strongtalk project and the optimizations they did. | |||
|
15:12
Ven joined
|
|||
| Ven | masak: I've done the gnu smalltalk koans -- that was interesting | 15:15 | |
| need to find something like that for self | |||
| masak | yes, I think you mentioned the koans | 15:17 | |
| I'm not familiar with them | |||
| Ven | github.com/sl4m/gnu_smalltalk_koans | 15:19 | |
| masak | nice. | 15:22 | |
| oh, the `| var1 var2 |` syntax is for declarations? | 15:23 | ||
| not block parameters, like in Ruby? | |||
| Ven | indeed | 15:28 | |
| also, it does the same different as block vs sub | 15:52 | ||
| ...which I'm not sure my "pure functional" part like | |||
| masak | hrm | ||
| Ven | return is "^" | 15:58 | |
| masak | aye, that part I remember. kind of a statement prefix op. | 16:00 | |
| it makes visual sense. doesn't make me like it ;) | |||
|
16:27
Ven joined
17:30
Ven joined
20:42
vendethiel joined
|
|||