--- Log opened Sat Feb 04 00:00:32 2017 |
00:09 | | LadyOfLight [catalyst@Nightstar-bf54ag.dab.02.net] has joined #code |
00:09 | | Kindamoody|afk is now known as Kindamoody |
00:10 | | LadyOfLight` [catalyst@Nightstar-8kgs38.dab.02.net] has joined #code |
00:11 | < LadyOfLight`> | ...is auto akin to a pronoun? |
00:11 | <&McMartin> | I think of it as an adjective |
00:13 | < LadyOfLight`> | It basically lets you elide a known name so you don't repeat yourself |
00:13 | | LadyOfLight [catalyst@Nightstar-bf54ag.dab.02.net] has quit [Ping timeout: 121 seconds] |
00:13 | < LadyOfLight`> | But if you overuse it then it becomes ambiguous |
00:13 | | LadyOfLight` is now known as LadyOfLight |
00:14 | <&McMartin> | I think I disagree with the last sentence there, though not to the degree that some of the more aggressive folks do |
00:15 | < LadyOfLight> | I should write the blog post about it |
00:15 | <&McMartin> | (It is apparently technically possible to use auto for _all object types everywhere_ including cases where you are declaring a variable of a different type than the initializer, and you use various syntax to clear this up) |
00:15 | <&McMartin> | (Which, well, I guess it's consistent) |
00:15 | < LadyOfLight> | Yeah |
00:15 | < LadyOfLight> | You can use it anywhere a template type could be derived from context |
00:15 | <&McMartin> | I'm rejecting the "ambiguous with overuse" because type-inferred and dynamic languages effectively also use it everywhere for everything |
00:16 | <&McMartin> | And this is usually touted as a feature there :) |
00:16 | < LadyOfLight> | Yeah, and they become impossible to track type with |
00:16 | <&McMartin> | It has occurred to me that I am only considering the C++11 cases of auto here |
00:17 | <&McMartin> | And not the ones where you have auto in std::function argument types, etc |
00:17 | <&McMartin> | Restrict scope of my judgement appropriately~ |
00:17 | < LadyOfLight> | :3 |
00:58 | | Kindamoody is now known as Kindamoody[zZz] |
01:15 | | Derakon[AFK] is now known as Derakon |
01:23 | | Derakon_ [Derakon@Nightstar-5mvs4e.ca.comcast.net] has joined #code |
01:24 | | Derakon [Derakon@Nightstar-5mvs4e.ca.comcast.net] has quit [NickServ (RECOVER command used by Derakon_)] |
01:24 | | Derakon_ is now known as Derakon |
01:24 | | mode/#code [+ao Derakon Derakon] by ChanServ |
01:35 | | Vornicus [Vorn@ServerAdministrator.Nightstar.Net] has quit [Connection reset by peer] |
01:44 | | Derakon is now known as Derakon[AFK] |
01:58 | | Vornicus [Vorn@ServerAdministrator.Nightstar.Net] has joined #code |
01:58 | | mode/#code [+qo Vornicus Vornicus] by ChanServ |
03:40 | | Alek [Alek@Nightstar-cltq0r.il.comcast.net] has quit [Ping timeout: 121 seconds] |
03:43 | | Alek [Alek@Nightstar-cltq0r.il.comcast.net] has joined #code |
03:43 | | mode/#code [+o Alek] by ChanServ |
05:03 | <&jeroud> | https://github.com/ocaml/ocaml/commit/8b2beb93ca99e609ffad11703019ce14dabd9619 |
05:07 | <&jeroud> | LadyOfLight: Statically typed languages with type inference are *not* impossible to track type with. ;-) |
05:07 | <&jeroud> | They also have completely different type systems to the curly brace languages. |
05:11 | | Alek [Alek@Nightstar-cltq0r.il.comcast.net] has quit [Ping timeout: 121 seconds] |
05:15 | | Alek [Alek@Nightstar-cltq0r.il.comcast.net] has joined #code |
05:15 | | mode/#code [+o Alek] by ChanServ |
05:15 | | * Vornicus really should learn him a haskell for great good but |
05:17 | <&jeroud> | I'm trying to learn Haskell again, but not very actively. |
05:18 | <&jeroud> | Pi is an excellent Haskell tutor. |
05:26 | <@Pi> | Or at least enthusiastic, if not excellent. :D |
05:53 | | celticminstrel is now known as celmin|sleep |
06:22 | | Derakon[AFK] is now known as Derakon |
06:38 | < LadyOfLight> | jerith: it would take me some time to explain what I mean by impossible to track |
06:38 | < LadyOfLight> | I don't mean for the machine |
06:40 | | LadyOfLight` [catalyst@Nightstar-m3nn0v.dab.02.net] has joined #code |
06:41 | <&jerith> | For the human? |
06:41 | < LadyOfLight`> | Yeah |
06:41 | <&jerith> | FWIW, I find it much easlier to track types in my head in OCaml than Java. |
06:41 | <&jerith> | Also easier. |
06:42 | <&jerith> | But OCaml's type system is such that complete static type inference is possible. |
06:42 | < LadyOfLight`> | But explaining why would take me a while, largely because I would need to refine what I mean by type |
06:42 | <&jerith> | Java's isn't, because there's no way to differentiate between similar classes/interfaces/whatever. |
06:42 | | LadyOfLight [catalyst@Nightstar-8kgs38.dab.02.net] has quit [Ping timeout: 121 seconds] |
06:43 | < LadyOfLight`> | It's not actually the inference that is the main issue, it is scary information is available to the programmer where |
06:43 | <&jerith> | F# and Scala also have this issue. |
06:43 | < LadyOfLight`> | And I think, fundamentally, the problem is that we still program as if writing symbols on paper |
06:44 | | LadyOfLight` is now known as LadyOfLight |
06:44 | <&jerith> | In practice, I frequently hit C-c C-t in emacs to get the type of the current expression. |
06:44 | <&jerith> | And there's no way I could successfully write nontrivial OCaml without editor support. |
06:45 | <&jerith> | (But the same is true of Java.) |
06:45 | <&jerith> | I agree with the sentiments on text-as-code. |
06:46 | <&jerith> | But I haven't yet seen a workable alternative. |
06:46 | < LadyOfLight> | That's something I may work on |
06:46 | <&jerith> | The graphical-blocks-as-code systems are fantastic for very limited niches, but they have a really low complexity cap. |
06:46 | < LadyOfLight> | There's a wonderful series of essays and presentations by Bret Victor about this |
06:47 | < LadyOfLight> | Well, I think the actual way to present data and code and machines involves being able to switch between modes |
06:47 | < LadyOfLight> | Rather than getting stuck in any one |
06:48 | < LadyOfLight> | But I ought to sleep rather than talk philosophy at this point |
06:48 | < LadyOfLight> | I'm so tired :( |
06:48 | <&jerith> | I think the best I've seen is text-as-code with continuous compilation that lets you work with the AST or whatever directly (or through some other abstraction) and translate that back to text. |
06:48 | | * jerith hugs. |
06:49 | < LadyOfLight> | Yeah, this is why i believe LISPs to be on the right track |
06:49 | < LadyOfLight> | Type is just more metadata, I believe it to have been elevated unnecessarily |
06:50 | <&jerith> | I want a good static type system, though. |
06:50 | <&jerith> | Where "good" is defined as "a useful tool that aids productivity". |
06:51 | < LadyOfLight> | Yeah, sure, but why is type considered anything other than additional data about variables? There's no reason the type system should be so narrowly defined |
06:51 | | Derakon is now known as Derakon[AFK] |
06:51 | < LadyOfLight> | Again, I like clojure's approaches to it |
06:51 | <&jerith> | Clojure is by far my favourite LISP. |
06:52 | <&jerith> | Anyway, you go sleep. I'm happy to have this conversation another time. :-) |
06:52 | < LadyOfLight> | Clojure is my current favourite language, for a number of reasons |
06:52 | < LadyOfLight> | Yeah, I'm not sure if I can |
06:52 | < LadyOfLight> | I'm not doing very well from a MH perspective :( |
06:52 | < LadyOfLight> | I actually feel completely shot of confidence |
06:53 | <&jerith> | If you have the time and brain, I'd recommend learning OCaml or Haskell (or maybe Rust, but I've never used that myself) just for the experience of what static typing can be. |
06:56 | < LadyOfLight> | I like Haskell's static typing, but feel like it tries far too hard to make them the point of programming at the expense of the hardware |
06:56 | < LadyOfLight> | OCaml is definitely on my list |
06:56 | <&jerith> | Python has been my go-to language for over a decade, but I think I'm burned out on dynamic typing and not having any guarantees about what kind of values I'm working with. |
06:57 | <&jerith> | I think Haskell is a bit too academic and theoretical. |
06:57 | <&jerith> | Well, the community moreso than the language. |
06:57 | < LadyOfLight> | Dynamicly typed languages don't let you carry contact |
06:57 | < LadyOfLight> | Context* |
06:58 | < LadyOfLight> | Haskell feels like it thinks very highly of itself and the community is a huge turn off |
06:58 | < LadyOfLight> | There is a lot of alpha nerding going on there |
07:04 | | * Vornicus does get grumpy about that sort of thing |
07:04 | <~Vornicus> | "look how easy Ruby is!" should be in the marketing materials, guys, not documentation |
07:04 | <&McMartin> | It is particularly aggravating when they then follow it up with a giant pile of line noise and assert that it's so easy it requires no explanation |
07:04 | <&McMartin> | And then don't explain it |
07:05 | < LadyOfLight> | Python seems to suffer from its own hubris somewhat |
07:05 | < LadyOfLight> | Ruby is smoking crack |
07:05 | <&McMartin> | My favorite Ruby expression is ???!!??:!!!?? |
07:06 | <~Vornicus> | Which somehow is supposed to make sense apparently |
07:06 | <~Vornicus> | well no |
07:06 | <~Vornicus> | it's supposed to look terrible on purpose, but |
07:06 | < LadyOfLight> | [&]() |
07:07 | < LadyOfLight> | Ugh |
07:08 | < LadyOfLight> | [&](){ [=](){ }(); }(); |
07:08 | < LadyOfLight> | Hurray for c++ (?) |
07:08 | < LadyOfLight> | McMartin: what does it do? |
07:08 | <~Vornicus> | I suspect we can come up with utterly recockulous piles of line noise for basically every language |
07:09 | <&McMartin> | It evaluates to true |
07:10 | < LadyOfLight> | Yeah, but some (Perl) encourage it |
07:10 | <&McMartin> | It's a combination of ?: and !, which work as you'd expect |
07:10 | <&McMartin> | And then the ?x operator which is ord(0 |
07:10 | <&McMartin> | ord() |
07:10 | <&McMartin> | Because we need a special operator for ord(). |
07:10 | <~Vornicus> | obviously |
07:11 | < LadyOfLight> | Based on clojure's sequences, I might expect (!) to return true |
07:11 | <~Vornicus> | so: "if the charcode of '?' is nonzero, return not not the charcode of '?', otherwise return not not not the charcode of '?' " |
07:11 | < LadyOfLight> | As in the not operator called with an arity of 0 |
07:11 | <&McMartin> | It's (??) ? !!(??) : !!!(??) |
07:11 | <&McMartin> | Yeah, Vorn has it |
07:11 | <&McMartin> | so !! is basically cast-to-bool |
07:12 | < LadyOfLight> | That's fairly common, no? |
07:12 | <~Vornicus> | somewhat. |
07:12 | <~Vornicus> | you should, generally, use bool instead, and then only if you *really* need to cast, etc |
07:13 | <&McMartin> | I forget if Ruby rocks the "0 but true" that Perl and JS do |
07:13 | < LadyOfLight> | Sure, but fundamentally I feel like it's an explicit type annotation |
07:13 | <&McMartin> | Oof |
07:13 | | * McMartin is suddenly visited by The Kitten Spirit |
07:13 | | * McMartin finds a warm place to lie down while continuing to IRC |
07:14 | <~Vornicus> | The Kitten Spirit? |
07:14 | < LadyOfLight> | I should drink water and go to the loo and try to get more sleep |
07:14 | <~Vornicus> | Did it give you a 10? |
07:15 | <&McMartin> | I don't think that's how it works |
07:15 | <~Vornicus> | a shame. |
07:16 | <&McMartin> | Also, porkour: https://media.giphy.com/media/jUqGboXXv1SEM/giphy.gif |
07:19 | <~Vornicus> | yes. |
07:20 | <&McMartin> | But yes, I have been visited by the Kitten Spirit and granted the proportional strength and energy of an extremely lazy kitten |
07:20 | < LadyOfLight> | Hehe |
07:21 | < LadyOfLight> | I have the speed and dexterity of a dazed mountain lion |
07:30 | <&McMartin> | Hm. Kernel update |
07:30 | | McMartin [mcmartin@Nightstar-rpcdbf.sntcca.sbcglobal.net] has quit [[NS] Quit: brb] |
07:35 | | McMartin [mcmartin@Nightstar-rpcdbf.sntcca.sbcglobal.net] has joined #code |
07:35 | | mode/#code [+ao McMartin McMartin] by ChanServ |
08:18 | | Vornicus [Vorn@ServerAdministrator.Nightstar.Net] has quit [Ping timeout: 121 seconds] |
10:43 | | Kindamoody[zZz] is now known as Kindamoody |
11:02 | | Derakon_ [Derakon@Nightstar-5mvs4e.ca.comcast.net] has joined #code |
11:04 | | Derakon[AFK] [Derakon@Nightstar-5mvs4e.ca.comcast.net] has quit [Ping timeout: 121 seconds] |
13:10 | | LadyOfLight` [catalyst@Nightstar-flmrkl.dab.02.net] has joined #code |
13:13 | | LadyOfLight [catalyst@Nightstar-m3nn0v.dab.02.net] has quit [Ping timeout: 121 seconds] |
13:21 | | LadyOfLight` is now known as LadyOfLight |
13:49 | | LadyOfLight` [catalyst@Nightstar-flmrkl.dab.02.net] has joined #code |
13:49 | | LadyOfLight [catalyst@Nightstar-flmrkl.dab.02.net] has quit [The TLS connection was non-properly terminated.] |
13:58 | | LadyOfLight [catalyst@Nightstar-bt5k4h.81.in-addr.arpa] has joined #code |
14:45 | | celmin|sleep is now known as celticminstrel |
15:15 | | Kindamoody is now known as Kindamoody|afk |
16:52 | | Vornicus [Vorn@ServerAdministrator.Nightstar.Net] has joined #code |
16:52 | | mode/#code [+qo Vornicus Vornicus] by ChanServ |
17:13 | | LadyOfLight` [catalyst@Nightstar-flmrkl.dab.02.net] has quit [[NS] Quit: Bye] |
17:43 | | Derakon__ [Derakon@Nightstar-5mvs4e.ca.comcast.net] has joined #code |
17:45 | | Derakon_ [Derakon@Nightstar-5mvs4e.ca.comcast.net] has quit [Ping timeout: 121 seconds] |
18:34 | | Alek [Alek@Nightstar-cltq0r.il.comcast.net] has quit [Ping timeout: 121 seconds] |
18:38 | | Alek [Alek@Nightstar-cltq0r.il.comcast.net] has joined #code |
18:38 | | mode/#code [+o Alek] by ChanServ |
18:42 | | LadyOfLight [catalyst@Nightstar-bt5k4h.81.in-addr.arpa] has quit [[NS] Quit: Leaving] |
18:50 | | LadyOfLight [catalyst@Nightstar-flmrkl.dab.02.net] has joined #code |
18:50 | | Derakon__ is now known as Derakon |
18:50 | | mode/#code [+ao Derakon Derakon] by ChanServ |
19:40 | | LadyOfLight` [catalyst@Nightstar-9vv577.dab.02.net] has joined #code |
19:43 | | LadyOfLight [catalyst@Nightstar-flmrkl.dab.02.net] has quit [Ping timeout: 121 seconds] |
21:28 | | LadyOfLight [catalyst@Nightstar-bt5k4h.81.in-addr.arpa] has joined #code |
22:00 | | Kindamoody|afk is now known as Kindamoody |
22:27 | <&[R]> | > y |
22:27 | <&[R]> | ["Fiery Burst (reserve) (6)", "Storm Bolt (Reserve) (6)", "Improved Buckler Defense (8)", "Improved Critical (8)", "Improved TWF (4)", "Quick Draw (5)", "Run (4)", "Two-Weapon Fighting (7)", "Weapon Finesse (8)", "Weapon Focus Wakizashi (7)", "Weapon Specialization Wakizashi (5)", "Arcane Strike (8)"] |
22:27 | <&[R]> | > y.map(function(s) { return r.exec(s) }) |
22:27 | <&[R]> | [["Fiery Burst (reserve) (6)", "6"], null, ["Improved Buckler Defense (8)", "8"], null, ["Improved TWF (4)", "4"], null, ["Run (4)", "4"], ["pon Fighting (7)", "7"], null, ["Weapon Focus Wakizashi (7)", "7"], ["zashi (5)", "5"], null] |
22:27 | <&[R]> | > r |
22:27 | <&[R]> | RegExp /.*\(([0-9]+)\)/g |
22:27 | | * [R] is very confused. |
22:28 | <&[R]> | Why is it not a valid regex on those strings? |
22:30 | <~Vornicus> | that is odd. |
22:31 | <&[R]> | y.map(function(s) { return /\(([0-9]+)\)/.exec(s) }) // Further oddity, this works 100% |
22:32 | <&[R]> | (Even with the .*) |
22:34 | <~Vornicus> | That is very strange indeed |
22:34 | <~Vornicus> | (also, confirmed that it's doing that here too) |
22:38 | <&ToxicFrog> | Oo. A mystery. |
22:39 | <~Vornicus> | Utterly silly |
22:40 | <&ToxicFrog> | What language is this? |
22:40 | <~Vornicus> | JS |
22:41 | <&[R]> | Yes |
22:42 | <&ToxicFrog> | Does the same thing here. Weiiiiiiiird. |
22:42 | <~Vornicus> | Happens in both Chrome and FF latest. |
22:42 | <&ToxicFrog> | If I run that regex on individual strings it fails on, though, it works |
22:43 | <&ToxicFrog> | (/.*\(([0-9]+)\)/g).exec("Storm Bolt (Reserve) (6)") |
22:43 | <&ToxicFrog> | ["Storm Bolt (Reserve) (6)", "6"] |
22:43 | <~Vornicus> | Something has gone utterly bonkers |
22:44 | <~Vornicus> | There must be hidden regex state that's doing this, it's the only thing that makes sense |
22:44 | <&ToxicFrog> | Oh dur |
22:44 | <&ToxicFrog> | Yeah, JS regexes are stateful |
22:45 | <&ToxicFrog> | "If the match succeeds, the exec() method returns an array and updates properties of the regular expression object." |
22:45 | <~Vornicus> | Look at what it dead to Two Weapon Fighting and WS Wakizashi |
22:45 | <&[R]> | Yeah, looks like it's assuming it's being run on the same string repeatedly. |
22:46 | <&ToxicFrog> | Re-create the regex on each call and it works. |
22:46 | <~Vornicus> | Which makes sense for what we're seeing: each time we've gotten null, it's been on a thing where A. the previous item matched and B. this item is shorter than the previous |
22:46 | <&ToxicFrog> | Ahaaaaa |
22:46 | <~Vornicus> | Or rather, the targeted '(') has an index <= the index of the previous string's targeted ')' |
22:46 | <&ToxicFrog> | "If your regular expression uses the "g" flag, you can use the exec() method multiple times to find successive matches in the same string." |
22:47 | <&ToxicFrog> | Drop the /g |
22:48 | <&[R]> | Yup, that was it |
22:48 | <&[R]> | Coolio |
22:48 | <&[R]> | :) |
22:48 | | * Vornicus is a meddling kid today |
23:07 | < LadyOfLight> | ...today? xD |
23:28 | <~Vornicus> | I mean, we solved a mystery |
--- Log closed Sun Feb 05 00:00:33 2017 |