Perl 6 - the future is here, just unevenly distributed

IRC log for #6macros, 2015-11-25

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

All times shown according to UTC.

Time Nick Message
03:09 vendethiel joined #6macros
08:12 FROGGS joined #6macros
08:38 Ven joined #6macros
08:57 masak Ven: I've been mulling over your point about operators as methods.
08:57 Ven hi
08:57 masak yo
08:57 masak Ven: I think it would be possible to do that, but I think the losses would be significant.
08:57 Ven conflating both as Qtypes?
08:57 masak no, deeper than that
08:58 masak as a first reason, lexical subs enjoy many advantages because some of their existence is statically scoped.
08:58 masak this means (among other things) that operators can be macros.
08:58 masak if they were methods, I don't think they could be.
08:58 masak because method dispatch is Late.
09:01 Ven well, everything would need to be late-bound
09:01 Ven that's why you'd need to declare fixity etc upfront OR just have fixed fixity OR have a static type system
09:04 masak yeah
09:05 masak let's just say, as Perl 6 stands today, all other things being equal, you'd lose ops-as-macros
09:08 Ven ya
09:10 Ven "fixed fixity" as in scala would totally work
09:10 Ven I'm gonna go ahead and actually say I'd prefer that... because stuff like haskell's fixity is absolutely insane
09:10 Ven Especially the fact you can change the fixity of an infix call...
09:11 Ven (i.e. fixity `foo` 3)
09:13 masak *nod*
09:16 masak I confess that at this point, most precedence/custom-op systems other languages have seem more or less insane/broken compared to what Perl 6 offers :)
09:29 Ven I've seen too much crazy stuff to enjoy custom precedence
09:49 masak that's what I like about Perl 6's custom precedence. it makes some kind of sense.
09:50 masak of course, I maintain that in 007 I got it slightly more right :P
09:51 Ven ;-)
09:52 masak (in Perl 6, two ops can accidentally get the same precedence because their precedences were created with the same tighter/looser instruction. that can't happen in 007)
11:39 Ven joined #6macros
12:02 Ven mmmh
12:02 Ven maybe there's a point to make that late-bound OO has less niceties if you have macros
12:02 Ven (not by design, but because macros can fill in)
12:34 masak it's a little bit of that, and of its converse
12:35 masak a language with many late-bound things, and many facilities to "reduce the pressure" caused by design needs -- like Perl 6 -- pushes the need for macros out to ever more unlikely semantic niches
12:41 Ven well, perl 6 has its fair share of inconsistencies and corner cases...
12:55 masak yes, of course
12:55 masak and some of those will be exposed as part of exposing the macro API
12:57 Ven :/
12:58 masak ...which is largely good, because it will give people a bigger surface to go in and "fix" some of them
13:00 Ven no, I disagree
13:00 Ven that's forcing a burden on people
13:00 Ven I don't want to have to think, when coding, that I need to use .WHAT before comparing, because it's itemized, because the list I'm mapping is an Array, not a List
13:01 Ven Itemization plainly shouldn't exist. I'd like a better module system, where I can alias classes, java-style "use". The fact I can import specific symbols is pretty good already, though.
13:01 Ven Flattening at all shouldn't have been part of the language. it doesn't bring anything to the table, and it's miles more complicated than perl5's. I need to memorize a whole class of function signatures to know if they're "*@a" or "@a" or "+a" or whateverelse
13:02 Ven the dynamic symbols are globals, and for a language that says it likes lexical scope so much, this is pretty sad. Especially as it was solved in every lisp dozens of years ago (even clojure has the right answer).
13:03 Ven I shouldn't have to think "oh yeah, I can't use any() there, because there's a possibility one element of the array might be Mu, and that'll randomly break my code. (having to cap junctions is not that bad, though)
13:05 Ven Lists shouldn't confuse themselves with items. ".[0]" shouldn't be the identity function on non-associatives, but someone wanted hyper-operators to be just a bit too DWIMmy I guess?
13:05 masak you have good points
13:05 masak I think I agree fully about flattening/lists and junctions
13:05 masak dynamicals: yes, I can see the problem. not sure I'm up in arms about fixing it at this point in the game.
13:06 Ven it's mostly like "you know all the problem we solve with namespaces and lexical scope? Let's fight them again with dynamics"
13:07 Ven I don't like the fact it *doesn't* conflates strings and lists, but that is a good thing™. just not one I'm used to yet.
13:08 masak I come from the other direction on that one
13:09 masak viewing all those (mostly FP) languages that do conflate those as... cute, but largely misguided on that point
13:09 masak actually, let me condemn head/tail-based recursion while I'm at it
13:09 Ven yeah. perl6 does the right thing on Unicode
13:09 Ven s/on/wrt/
13:10 masak it's a 20th century notion which should die under the pavement of monoidal algebra and mapreduce
13:10 masak anyway, back to the main point: corner cases and macro APIs
13:10 Ven I don't like the fact operators have custom fixity. Means you get less of both worlds: you need to define methods such as CALL-ME, and that means if you pass an object "in a pipeline", the pipeline won't have your module importer and you overloaded operators
13:11 Ven (though, we don't often overload operators, so that's good)
13:11 Ven it breaks duck typing, that's for sure
13:11 masak I *am* passionate about providing a convenience for people who want to build a better Perl 6 (or, more likely, parts of it) to be able to make their userland modification look "native"
13:12 masak JS and Perl 5 have taught me that as long as your language has closures, you can build what you want at the cost of some extra curly braces and commas
13:13 Ven http://doc.perl6.org/language/traps <- that's a bit of an issue; having such a page before the 1.0 even landed :P.
13:13 masak macros are there partly to eliminate those extra curly braces and commas, making the feature "blend in" with the rest of the language
13:13 Ven I don't like containers, but I know not everybody is that passionate about immutability etc as I am :)
13:18 Ven ok, I'm done with my rant
13:18 Ven I believe the main thing I'll want to fix will be flattening. The rest is meh
13:20 Ven macro idea: a circumfix operator that builds a typed array.
13:21 Ven T[1, 2, 3] will give me an Array[Int] :P
13:44 masak ooh :)
13:44 masak I like immutability, but I believe the industry/theorics are in a general state of "not quite there yet"
13:46 masak ok, about to ship the refactor
13:47 masak this commit isn't very big, all in all -- but it did take a lot of work
13:49 masak I feel I'm not so much making individual changes/patches, as I am making rough brush strokes, then standing back and pondering the result...
14:00 masak pushed! \o/
14:01 masak now it's back to the last few points of https://github.com/masak/007/issues/25#issuecomment-156453622, and then we can close #25 :)
14:29 Ven joined #6macros
14:30 * Ven looks
17:12 FROGGS joined #6macros
17:17 masak ladies and gentlebots
17:17 masak this now works in 007:
17:17 masak $ perl6 bin/007 -e='macro moo() { return Q::Identifier { name: "foo" } }; my foo = 42; say(moo())'
17:17 masak 42
17:18 masak in other words, we just got synthetic ASTs
17:18 masak no doubt there are vast swathes of bugs in there that I haven't discovered yet
17:18 masak it's largely untested
17:18 masak but I want you all to try to stretch your imaginations to what can now be done in 007
17:18 masak hint: macros just got a crapload more powerful
17:18 masak runtime can now create *unhygienic* ASTs.
17:19 masak if you build something cool enough, your contribution might be immortalized in the upcoming examples/ directory :)
17:58 vendethiel joined #6macros
18:01 vendethiel cool, cool, cool
18:01 vendethiel mh, this channel could do with a 007 evalbot =P
18:02 masak ooh, yes
18:02 masak I'm all for that -- would it be an easy thing to extend camelia, you think?
18:03 vendethiel camelia is perl5 :(
18:03 vendethiel but yes
18:03 vendethiel I think it shouldn't be too hard. it needs the appropriate compiling support, though
18:54 masak doesn't matter what language camelia is -- it could be Python or Haskell for all I care :)
18:54 masak re-implementing camelia in Perl 6 just to get 007 running on-channel would be a distraction
21:38 vendethiel masak: I can't *declare* a variable yet, though, can I?
21:46 masak Try It And See
21:46 masak I can't think of a reason it wouldn't work, actually
21:46 masak well
21:46 masak you still can't cheat the parser into believing things that aren't lexically there are there
21:47 masak but assuming you just mean "can I arbitrarily inject Q::Statement::My in code?", the answer is yes
21:49 masak one point remaining on https://github.com/masak/007/issues/25#issuecomment-156453622
21:49 masak I'll tackle it tomorrow
21:49 masak 'night
21:56 vendethiel great stuff
22:49 pdcawley joined #6macros
22:58 FROGGS joined #6macros
23:12 FROGGS joined #6macros
23:32 FROGGS joined #6macros

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