--- Log opened Sat Apr 13 00:00:10 2013 |
00:05 | | himi [fow035@Nightstar-5d05bada.internode.on.net] has joined #code |
00:05 | | mode/#code [+o himi] by ChanServ |
00:17 | | Vornicus [vorn@ServerAdministrator.Nightstar.Net] has quit [[NS] Quit: Leaving] |
00:44 | <&McMartin> | starlogs still fantastic, omg |
00:45 | | * McMartin just noticed the star destroyer effect if you don't preload a log into it |
00:45 | <@froztbyte> | haha |
00:45 | <@froztbyte> | yeah |
00:52 | | * Derakon eyes McM, eyes #angband-dev where someone just linked starlogs an hour ago. |
00:54 | | * McMartin linked it in here four hours ago |
00:58 | <&ToxicFrog> | starlogs? |
00:58 | <&McMartin> | http://starlogs.net/#michaelcmartin/Ophis |
01:06 | | Turaiel is now known as Turaiel[Offline] |
01:27 | <&ToxicFrog> | It doesn't pan down to a view of the commit graph when the music ends~ |
01:49 | | Turaiel[Offline] is now known as Turaiel |
01:53 | <@Namegduf> | This is the best thing ever. |
02:05 | | himi [fow035@Nightstar-5d05bada.internode.on.net] has quit [Ping timeout: 121 seconds] |
02:18 | | himi [fow035@Nightstar-5d05bada.internode.on.net] has joined #code |
02:18 | | mode/#code [+o himi] by ChanServ |
02:25 | | * ToxicFrog pwnz0rs his new modem |
02:37 | | Thalasleep [thalass@Nightstar-f97b970e.bigpond.net.au] has joined #code |
02:55 | | * McMartin installs the new Light Table. |
02:55 | <&McMartin> | Wow, OK, it *looks* a lot more slick than the old one |
02:55 | <&McMartin> | I also have very little idea how to do anything now~ |
02:57 | | Thalasleep is now known as Thalass |
03:06 | | himi [fow035@Nightstar-5d05bada.internode.on.net] has quit [Ping timeout: 121 seconds] |
03:19 | | himi [fow035@Nightstar-5d05bada.internode.on.net] has joined #code |
03:19 | | mode/#code [+o himi] by ChanServ |
03:20 | | RichyB [richardb@Nightstar-86656b6c.cable.virginmedia.com] has joined #code |
03:21 | | Kindamoody[zZz] is now known as Kindamoody |
03:26 | | himi [fow035@Nightstar-5d05bada.internode.on.net] has quit [Ping timeout: 121 seconds] |
03:36 | | Vornicus [vorn@ServerAdministrator.Nightstar.Net] has joined #code |
03:36 | | mode/#code [+qo Vornicus Vornicus] by ChanServ |
03:39 | | himi [fow035@Nightstar-5d05bada.internode.on.net] has joined #code |
03:39 | | mode/#code [+o himi] by ChanServ |
03:39 | | syksleep_ is now known as Syk |
03:55 | | d4de [olorin@687AAB.418D22.56FCC6.6F5C3A] has quit [Ping timeout: 121 seconds] |
04:02 | | d4de [olorin@687AAB.1E386D.85741A.CD486C] has joined #code |
04:03 | | VirusJTG [VirusJTG@Nightstar-09c31e7a.sta.comporium.net] has quit [[NS] Quit: Program Shutting down] |
04:22 | | d4de [olorin@687AAB.1E386D.85741A.CD486C] has quit [Ping timeout: 121 seconds] |
04:36 | | himi [fow035@Nightstar-5d05bada.internode.on.net] has quit [Ping timeout: 121 seconds] |
04:49 | | himi [fow035@Nightstar-5d05bada.internode.on.net] has joined #code |
04:49 | | mode/#code [+o himi] by ChanServ |
04:58 | | d4de [olorin@687AAB.418D22.95850D.D4B73D] has joined #code |
05:22 | | himi [fow035@Nightstar-5d05bada.internode.on.net] has quit [Ping timeout: 121 seconds] |
05:23 | | mac [mac@Nightstar-fe8a1f12.il.comcast.net] has joined #code |
05:35 | | himi [fow035@Nightstar-5d05bada.internode.on.net] has joined #code |
05:35 | | mode/#code [+o himi] by ChanServ |
06:21 | | RichyB [richardb@Nightstar-86656b6c.cable.virginmedia.com] has quit [Ping timeout: 121 seconds] |
06:39 | | himi [fow035@Nightstar-5d05bada.internode.on.net] has quit [Ping timeout: 121 seconds] |
06:52 | | himi [fow035@Nightstar-5d05bada.internode.on.net] has joined #code |
06:52 | | mode/#code [+o himi] by ChanServ |
07:00 | | Turaiel is now known as Turaiel[Offline] |
07:07 | | Derakon is now known as Derakon[AFK] |
07:12 | | * McMartin first up Light Table |
07:12 | <&McMartin> | Gas: I am now cooking with it |
07:18 | <&jerith> | starlogs!!! |
07:22 | <&McMartin> | SUCCESS |
07:39 | <&McMartin> | https://hkn.eecs.berkeley.edu/~mcmartin/CCA.html |
07:41 | <@Azash> | McMartin: This is pretty cool |
07:41 | <@Azash> | Does it ever reach a state where it begins looping? |
07:41 | <&McMartin> | One of several |
07:41 | <&McMartin> | Unless you mean "back to the very start" |
07:42 | <@Azash> | No, just "back to a certain point" |
07:42 | <&McMartin> | Oh. Yes. |
07:42 | <&McMartin> | It should either end by going static or reaching a state where Every Cell Changes Every Tick. |
07:42 | <&McMartin> | The latter tends to look like spirals evolving and then devouring the space. |
07:42 | <&jerith> | Wheee! Green! |
07:43 | <@Azash> | Yeah, I think I got the latter |
07:43 | <&McMartin> | (Also, so far I've only tested this one on FF; if people have other browsers handy I'd love to hear about it actually working~) |
07:43 | <&McMartin> | In that case, it's looping every 13 ticks at that point. |
07:43 | <@Azash> | Do you mind if I rip your hello world idea off? |
07:43 | <&McMartin> | You mean, as a thing to do? |
07:43 | <&McMartin> | Go right ahead. |
07:43 | <&jerith> | McMartin: Fine on Chrome. |
07:44 | <&McMartin> | I wasn't kidding about the "it's been my practice Graphics project for 20 years" thing. |
07:44 | <&McMartin> | It's *really good at it* |
07:44 | <&McMartin> | I mean, really |
07:44 | <&McMartin> | The core algo here was all of 30 lines of JavaScript. |
07:45 | <@Azash> | "It's" or "I'm" ? :P |
07:45 | <&McMartin> | Well, both >_> |
07:45 | <&McMartin> | But I meant "CCA is really good at being a practice project" |
07:46 | <&McMartin> | It looks cool, it's conceptually super-simple, and it doesn't require anything more than animation and the ability to draw rectangles. |
07:46 | <@celticminstrel> | It feels like it always ends up the same. I mean, it's obviously not exactly the same, but it's the same basic sort of thing. |
07:46 | <&McMartin> | Yup |
07:46 | <&McMartin> | It's an order-from-chaos thing. |
07:46 | <@celticminstrel> | Mm |
07:47 | <&McMartin> | (Depending on start condition, you can end up with it freezing.) |
07:47 | <@celticminstrel> | ...oh? How likely is that? |
07:47 | <&jerith> | Freezing is rare. |
07:47 | <&McMartin> | You can make it less rare by bumping the state count. |
07:47 | <&McMartin> | If I wanted to make this be actually good I'd let you set speed and state count |
07:47 | <@celticminstrel> | Heh. |
07:47 | <&McMartin> | (You can also make it *more* rare by making the arena larger.) |
07:48 | <&jerith> | McMartin: Where's your Android version? |
07:49 | <&jerith> | I just realised that since it's not in the store I don't have it on my not-even-new-anymore phone. |
07:49 | <&McMartin> | https://hkn.eecs.berkeley.edu/~mcmartin/android/CCA.apk |
07:49 | <&McMartin> | My android browser does not seem to be able to handle the HTML5 version~ |
07:50 | <&McMartin> | I'm also not sure what happens if you spike your CPU hard enough that the window.setTimeout calls start overlapping. |
07:50 | <&McMartin> | I vaguely recall that the JS terp is singlethreaded; will it just run an "overdue" event after it finishes its current processing? |
07:51 | <@celticminstrel> | ...aren't you calling setTimeout from the timeout callback? |
07:51 | <&McMartin> | I am. |
07:51 | <@celticminstrel> | At the end? |
07:51 | <&McMartin> | But I do it at the beginning, not the end, in the hopes of a smoother framerate. |
07:51 | <@celticminstrel> | Oh. |
07:51 | <&jerith> | Android Firefox handles it fine. |
07:51 | <&jerith> | Which it pretty awesome, actually |
07:51 | <@celticminstrel> | I'm pretty sure it's single-threaded, yes. |
07:53 | <@celticminstrel> | Somewhere I recall reading that you shouldn't use setInterval because you can't rely on the interval being what you asked for; it would just call the next instance immediately after finishing the previous if it took too long. And I think using setInterval is about equivalent to calling setTimeout at the start of the callback. |
07:53 | | Thalass [thalass@Nightstar-f97b970e.bigpond.net.au] has quit [Ping timeout: 121 seconds] |
07:53 | <&McMartin> | Hm. Doesn't work in IE, because it says the object doesn't support "getContext" |
07:56 | <&jerith> | McMartin: Why do you have two IFs in your android dir? |
07:56 | <&McMartin> | jerith: So that I could easily load them into Twisty |
07:57 | <&McMartin> | Which is terrible. |
07:57 | <&jerith> | Yes. And the others I've tried are even terribler. |
07:57 | <&McMartin> | Yes :( |
07:57 | <@celticminstrel> | IFs? |
07:57 | <&jerith> | There's a not-as-terrible thing for iOS. |
07:58 | <&jerith> | celticminstrel: Interactive Fiction. |
07:58 | <&jerith> | Think Zork. |
07:58 | <@celticminstrel> | I don't actually know Zork. Though I've certainly heard of it. |
07:59 | <&McMartin> | jerith: Well, Plotkin has been trying very hard to get decent support going. |
07:59 | <&McMartin> | Ah, OK, IE starts working if I turn off compat mode. |
07:59 | <&jerith> | I'd back a kickstarter for it. |
08:00 | <@celticminstrel> | ...that seems odd. |
08:00 | | himi [fow035@Nightstar-5d05bada.internode.on.net] has quit [Ping timeout: 121 seconds] |
08:01 | <&McMartin> | Aha, I see. It's because I didn't put a doctype at the top of that page. |
08:02 | <&McMartin> | A better page for McMartin's IF Projects is, however, https://hkn.eecs.berkeley.edu/~mcmartin/if/ |
08:04 | <&jerith> | Your hmk homepage looks a little out of date. |
08:04 | <&jerith> | Ugh. |
08:04 | <&jerith> | hkn, not hmk. How did I tyop that so badly? |
08:04 | <&McMartin> | It's wildly so |
08:04 | <&McMartin> | And a lot of the other stuff elapsed. |
08:05 | <&jerith> | For one thing, it links to a bunch of stuff at Stanford that no longer exists. |
08:05 | <&McMartin> | "Do a complete webspace rewrite" is on my list |
08:08 | | ErikMesoy|sleep is now known as ErikMesoy |
08:13 | | himi [fow035@Nightstar-5d05bada.internode.on.net] has joined #code |
08:13 | | mode/#code [+o himi] by ChanServ |
08:19 | | Vornicus [vorn@ServerAdministrator.Nightstar.Net] has quit [[NS] Quit: Leaving] |
08:25 | | himi [fow035@Nightstar-5d05bada.internode.on.net] has quit [Ping timeout: 121 seconds] |
08:26 | | thalass [thalass@Nightstar-f97b970e.bigpond.net.au] has joined #code |
08:28 | | mac [mac@Nightstar-fe8a1f12.il.comcast.net] has quit [[NS] Quit: Leaving] |
08:39 | | himi [fow035@Nightstar-5d05bada.internode.on.net] has joined #code |
08:39 | | mode/#code [+o himi] by ChanServ |
08:45 | | thalass is now known as Thalass|werkin |
08:56 | | Kindamoody is now known as Kindamoody|afk |
08:56 | <&McMartin> | Woot, fixed the doctype &c stuff and now it not only runs on IE, it also is running in my Android browser |
09:02 | | celticminstrel [celticminst@Nightstar-e83b3651.cable.rogers.com] has quit [[NS] Quit: And lo! The computer falls into a deep sleep, to awake again some other day!] |
10:18 | | Syk [the@Nightstar-60339bc0.iinet.net.au] has quit [[NS] Quit: leaving] |
10:18 | | Syka [the@Nightstar-60339bc0.iinet.net.au] has joined #code |
10:56 | | Thalass|werkin is now known as Thalass |
11:02 | | himi [fow035@Nightstar-5d05bada.internode.on.net] has quit [Ping timeout: 121 seconds] |
11:15 | | Syka is now known as SykOut |
11:15 | | himi [fow035@Nightstar-5d05bada.internode.on.net] has joined #code |
11:15 | | mode/#code [+o himi] by ChanServ |
12:27 | | Thalass [thalass@Nightstar-f97b970e.bigpond.net.au] has quit [[NS] Quit: Leaving] |
12:27 | | thalass [thalass@Nightstar-f97b970e.bigpond.net.au] has joined #code |
12:34 | | himi [fow035@Nightstar-5d05bada.internode.on.net] has quit [Ping timeout: 121 seconds] |
12:46 | | VirusJTG [VirusJTG@Nightstar-09c31e7a.sta.comporium.net] has joined #code |
12:47 | | himi [fow035@Nightstar-5d05bada.internode.on.net] has joined #code |
12:47 | | mode/#code [+o himi] by ChanServ |
14:30 | | Orthia [orthianz@3CF3A5.E1CD01.B089B9.1E14D1] has quit [Ping timeout: 121 seconds] |
14:33 | | himi [fow035@Nightstar-5d05bada.internode.on.net] has quit [Ping timeout: 121 seconds] |
14:35 | | RichyB [richardb@Nightstar-86656b6c.cable.virginmedia.com] has joined #code |
14:46 | | himi [fow035@Nightstar-5d05bada.internode.on.net] has joined #code |
14:46 | | mode/#code [+o himi] by ChanServ |
14:53 | | himi [fow035@Nightstar-5d05bada.internode.on.net] has quit [Ping timeout: 121 seconds] |
15:06 | | himi [fow035@Nightstar-5d05bada.internode.on.net] has joined #code |
15:06 | | mode/#code [+o himi] by ChanServ |
15:21 | | SykOut is now known as Syk |
15:25 | | celticminstrel [celticminst@Nightstar-e83b3651.cable.rogers.com] has joined #code |
15:26 | | mode/#code [+o celticminstrel] by ChanServ |
15:27 | <@Azash> | Does anyone have any links that might be helpful in "I want to develop further as a programmer, what next"-contexts? |
15:28 | | * Syk drops Knuth's books on Azash |
15:28 | | * Azash feels his every bone break |
15:28 | | * Syk 's work here is done |
15:29 | <@Azash> | Thanks for the suggestion though |
15:32 | < Syk> | yeah |
15:32 | < Syk> | I hear Knuth's stuff is 'definitive', although I'm not sure in what exactly |
15:32 | < Syk> | I'm way too scared to read them <v<; |
15:33 | < Syk> | I may grow a spontaneous UNIX-style beard if I do |
15:33 | <@Azash> | I'm thinking "Cormen on steroids" |
15:33 | < Syk> | Azash: you could always play with something sufficiently Different |
15:34 | < Syk> | like, go play around with Go's parallelism or something specialised such as that |
15:34 | <@Azash> | x86 -> Scheme -> Go -> M -> APL -> Visual Basic |
15:34 | < Syk> | an order of your language history? |
15:34 | <@Azash> | Nah, joking about sufficiently different |
15:35 | < Syk> | oh :P |
15:35 | <@Azash> | My language history personally goes like VB - NWScript/RPG Maker 2000 - Java - Lua - C/C++ - Haskell - Bash - Node.js |
15:36 | | * Azash rolls off for naptime |
15:36 | | * Syk drops some Python+Twisted on Azash to compensate for the Node.js insanity |
15:40 | | himi [fow035@Nightstar-5d05bada.internode.on.net] has quit [Ping timeout: 121 seconds] |
15:52 | <@celticminstrel> | ...pffft. |
15:52 | <@celticminstrel> | Also, node.js isn't a language, is it? |
15:52 | <@celticminstrel> | The language is JavaScript. |
15:53 | | himi [fow035@Nightstar-5d05bada.internode.on.net] has joined #code |
15:53 | | mode/#code [+o himi] by ChanServ |
16:04 | < Syk> | celticminstrel: it might as well be it's own language due to the shoehorning |
16:05 | <@celticminstrel> | Hm? |
16:09 | < Syk> | celticminstrel: that it needs a half tonne of external libraries to do anything, that is :P |
16:37 | | thalass is now known as Thalassleep |
16:41 | | Thalassleep [thalass@Nightstar-f97b970e.bigpond.net.au] has quit [Ping timeout: 121 seconds] |
17:04 | | Derakon[AFK] is now known as Derakon |
17:07 | | cpux|2 [cpux@Nightstar-98762b0f.dyn.optonline.net] has joined #code |
17:10 | | cpux [cpux@Nightstar-98762b0f.dyn.optonline.net] has quit [Ping timeout: 121 seconds] |
17:29 | | cpux [cpux@Nightstar-98762b0f.dyn.optonline.net] has joined #code |
17:29 | | mode/#code [+o cpux] by ChanServ |
17:30 | | cpux|2 [cpux@Nightstar-98762b0f.dyn.optonline.net] has quit [Ping timeout: 121 seconds] |
17:39 | | cpux [cpux@Nightstar-98762b0f.dyn.optonline.net] has quit [Ping timeout: 121 seconds] |
17:42 | < ErikMesoy> | I seem to recall Python had something like "for i,j in i_index, j_index" to run two iterators, but I get an error "too many values to unpack" trying to do it. What's the correct syntax? The "for" docs don't seem to mention this. |
17:43 | < Syk> | um |
17:43 | < Syk> | was it zip? |
17:43 | < Syk> | ...I forgot |
17:44 | < Syk> | ...I know it was in an Idiomatic Python talk :( |
17:44 | < Syk> | ErikMesoy: yes, it is zip |
17:44 | < Syk> | ErikMesoy: for i, j in zip(i_index, j_index): |
17:45 | < Syk> | ErikMesoy: there's izip for an iterator version |
17:45 | < Syk> | ErikMesoy: more details here: http://stackoverflow.com/questions/1663807/how-can-i-iterate-through-two-lists-i n-parallel-in-python |
17:46 | < Syk> | ErikMesoy: itertools.izip should handle the iterators, I believe |
17:47 | < ErikMesoy> | Mmhm. |
17:48 | < ErikMesoy> | Thanks |
17:48 | < Syk> | ErikMesoy: http://docs.python.org/2/library/itertools.html#itertools.izip |
17:48 | < Syk> | i think regular zip only works with tuples |
17:48 | < Syk> | np! |
17:48 | < Syk> | but, off to slep I go |
17:48 | | Syk is now known as syksleep |
17:50 | <@jeroud> | Regular zip() works with any iterables, but ends when the shortest of its args is consumed. |
17:50 | <@jeroud> | I think izip() is more flexible. |
17:50 | < syksleep> | regular zip returns a tuple |
17:50 | < syksleep> | izip returns an iterator |
17:50 | <@jeroud> | Yeah, that too. |
17:50 | < syksleep> | so in memory constrained situations, izip stops everything exploding, or something |
17:51 | <@jeroud> | zip() consumes all its args upfront. |
17:51 | <@jeroud> | izip() consumes one element of each at a time. |
17:54 | < syksleep> | yeah |
17:54 | | * syksleep drops to sleep because 1am |
18:02 | <@iospace> | lolsleep |
18:08 | | cpux [cpux@Nightstar-98762b0f.dyn.optonline.net] has joined #code |
18:08 | | mode/#code [+o cpux] by ChanServ |
18:28 | | Kindamoody|afk is now known as Kindamoody |
18:39 | | cpux|2 [cpux@Nightstar-98762b0f.dyn.optonline.net] has joined #code |
18:42 | | cpux [cpux@Nightstar-98762b0f.dyn.optonline.net] has quit [Ping timeout: 121 seconds] |
18:51 | | himi [fow035@Nightstar-5d05bada.internode.on.net] has quit [Ping timeout: 121 seconds] |
19:05 | | himi [fow035@Nightstar-5d05bada.internode.on.net] has joined #code |
19:05 | | mode/#code [+o himi] by ChanServ |
20:39 | | Kindamoody is now known as Kindamoody[zZz] |
20:48 | | Vornicus [vorn@ServerAdministrator.Nightstar.Net] has joined #code |
20:48 | | mode/#code [+qo Vornicus Vornicus] by ChanServ |
20:51 | <@Azash> | syksleep: Yeah I had some problems with node.js |
20:51 | <@Azash> | I'm sure grepping will get you some massive tantrum from me :P |
21:14 | | Turaiel[Offline] is now known as Turaiel |
21:35 | | * jerith is tired of node.js. |
21:36 | <&jerith> | A significant chunk of the internet seems to treat it as some kind of magic scaling juice that will make all your problems go away if you just rewrite all your code in JavaScript. |
21:37 | < ErikMesoy> | "if you rewrite all your code" sounds like a now-you-have-two-problems thing, regardless of language. |
21:38 | <@froztbyte> | well, in this particular case, you have a bunch more |
21:38 | <@froztbyte> | because javascript :D |
21:38 | <@froztbyte> | (I know just enough about it to know how pretty terrible it is) |
21:39 | <&jerith> | JS is improving slightly, at least. |
21:39 | <@froztbyte> | sure, but most things do over time |
21:39 | <&jerith> | The language designers know its terrible and are at least trying to fix some things. |
21:39 | <&jerith> | Contrast this with PHP which just keeps getting worse. |
21:40 | < ErikMesoy> | Worse than the Hebrew Double Dot error messages? |
21:40 | <@froztbyte> | I'm mostly wondering how easily they can fix the silly bits in JS though |
21:40 | <@froztbyte> | ErikMesoy: yes |
21:40 | < ErikMesoy> | Makes me wonder if they're trying for a record. |
21:40 | <@froztbyte> | no, they're not going for any goal in particular |
21:41 | <@froztbyte> | uhm, have you looked at PHP's function namespace? |
21:41 | < ErikMesoy> | I try not to. |
21:42 | <@froztbyte> | go do it quickly |
21:43 | | * ErikMesoy begins emitting many wtfs per minute. |
21:45 | <@froztbyte> | haha |
21:47 | | cpux|2 is now known as cpux |
21:48 | | * ErikMesoy sees the words "die with fatal error" in the PHP namespace FAQ. |
21:48 | < ErikMesoy> | I think that's enough for now. |
21:48 | <@froztbyte> | no, don't worry |
21:49 | <@froztbyte> | you can just edit the config and set a runtime variable and redirect your error logging and run the function with @ in front |
21:49 | <@froztbyte> | then it'll be fine |
21:49 | <@froztbyte> | I promise |
21:49 | < ErikMesoy> | Your assurance does not exactly lower my wtfs/minute. |
21:49 | <@froztbyte> | http://me.veekun.com/blog/2012/04/09/php-a-fractal-of-bad-design/ is an excellent summary on this note :) |
21:50 | <@froztbyte> | ErikMesoy: hehe |
21:50 | < ErikMesoy> | ah yes, the php hammer, I remember reading that |
21:50 | < ErikMesoy> | http://www.flickr.com/photos/raindrift/sets/72157629492908038/ |
21:53 | <@froztbyte> | indeedy |
21:57 | <~Vornicus> | I still don't understand how anyone stands for weak typing |
21:58 | <&jerith> | Vornicus: It makes certain kinds of things easy. |
21:58 | <&jerith> | The fact that they're invariably bad ideas is irrelevant. |
21:59 | <@froztbyte> | if it walks like a duck, and quacks like a duck, it might still be a lawnmower |
22:00 | <&jerith> | If you have the standard wibbly wobbly incoherent view of the world that most people do, it makes sense to you that you can meaningfully compare 7 and "6.5". |
22:05 | <~Vornicus> | This is a thing I understood when I was six. the rest of the world needs to grow the fuck up |
22:06 | < ErikMesoy> | Yeah, well, the mathematicians stated several thousand years ago the axiom "two things that are equal to the same thing are equal to each other" and PHP hasn't gotten that far yet. :p |
22:10 | <&jerith> | Vornicus: Basically, thinking is hard and people want to avoid having to do it. |
22:10 | <&jerith> | So you wriet a thing that tries to guess what they mean. |
22:10 | <&jerith> | *write |
22:10 | <@Namegduf> | And aren't very good about actually reducing thinking. |
22:10 | < ErikMesoy> | Because figuring out how to do that requires thinking. |
22:11 | <&jerith> | But that's impossible, so it ends up being a horrible mess that explodes all over. |
22:11 | <@celticminstrel> | "weak typing"? |
22:12 | <&jerith> | celticminstrel: Silently trying to convert things to different types based on context. |
22:12 | <&jerith> | Most languages have a smidgen of it. |
22:12 | <&jerith> | int/float conversion, for example. |
22:12 | <@celticminstrel> | Oh right. |
22:13 | <@celticminstrel> | int/float conversion is kinda silly to not have. :/ |
22:13 | <@celticminstrel> | At least, int-to-float. I could understand not having the reverse. |
22:13 | <&jerith> | There are situations when you don't actually want it. |
22:13 | <&jerith> | But they're not all that common. |
22:13 | <@Namegduf> | I think it's still good to not have that one- you get unpleasant results around division if you're not very clear on what you're doing. |
22:13 | <&ToxicFrog> | "weak typing" is not very well defined, but generally it's a sliding scale where the more willing a language is to coerce values, the more weakly typed it is |
22:14 | <@Namegduf> | Also int generally has bounds and float doesn't. |
22:14 | <@Namegduf> | If you're explicit where you're mixing types where the conversion happens, it's much easier to follow. |
22:14 | <@celticminstrel> | Float has bounds... |
22:14 | <&jerith> | Namegduf: Floats have different kinds of bounds. |
22:14 | <@Namegduf> | Well, okay, yes, it has bounds eventually, after which it turns into "infinity" or "negative infinity". |
22:15 | <@Namegduf> | It also has precision limitations. |
22:15 | <@froztbyte> | Namegduf: float has bounds, but ... oh, jerith said that |
22:16 | <&jerith> | Namegduf: But it has precision bounds. |
22:16 | <@Namegduf> | I believe I did say that, yes. |
22:16 | <@Namegduf> | Two lines prior to yours. |
22:17 | <@Namegduf> | Doesn't alter the point, though, because severely different kinds of bounds is also a good reason to want to keep which a given piece of math is operating in clear. |
22:17 | <~Vornicus> | int-float conversion and stuff-bool conversion ("truthiness") are the most common. |
22:18 | <@Namegduf> | Things mostly get nasty when strings get involved, although both of those have their downsides. |
22:18 | <@Namegduf> | (Although it's mostly string->bool which gets really bad when it comes to stuff-bool conversions) |
22:19 | <&ToxicFrog> | (all strings are boolean true. There, done~) |
22:20 | <&jerith> | ToxicFrog: Even the empty string? |
22:20 | <&ToxicFrog> | Yes. |
22:20 | <&jerith> | Lots of languages define empty collections and sequences to be false. |
22:21 | <&jerith> | That has some pretty useful consequences. |
22:21 | <&ToxicFrog> | Lots do, but the ones I use regularly don't~ |
22:21 | <~Vornicus> | In approximate order of commonness I see these things considered false: False itself; nil-oids; 0; empty strings; empty containers. |
22:22 | <~Vornicus> | (empty cstrings are false) |
22:22 | <@Namegduf> | They might or might not be. |
22:23 | <@froztbyte> | it's still funny to me that 0 is typically a false-ish, but exit state 0 == all good |
22:23 | <@Namegduf> | More exactly, C distinguishes between null and empty strings, and null strings are false but empty ones aren't. |
22:23 | <&ToxicFrog> | froztbyte: the idea there, I believe, is that if the program succeeded you don't much care otherwise, but if it failed you might want to programatically test why |
22:24 | <@Namegduf> | Then there's "0", "0.0", "false"... |
22:24 | <&ToxicFrog> | A lot of programs define different exit codes for different error conditions, and some even | together multiple codes in cases where you can have multiple types of failure simultaneously. |
22:24 | <&jerith> | The is only one success case, but there may be multiple failure cases. |
22:24 | | Orthia [orthianz@3CF3A5.E1CD01.B089B9.1E14D1] has joined #code |
22:24 | | mode/#code [+o Orthia] by ChanServ |
22:25 | <@Namegduf> | It's those weird "string coerced to another type would be false so the string is false" cases where it really starts to become unpleasant. |
22:28 | <&ToxicFrog> | Namegduf: yes. Designwise, my preference is generally to disallow coercion entirely (or restrict it heavily, and in particular not allow coercions that would change truthiness) and treat only nil and false as false |
22:28 | <@Namegduf> | I like that. |
22:29 | <@Namegduf> | As I mentioned, I'm not a fan of int-float coercion because I don't think obscuring the details of what you're doing when you're mixing the two, which is generally not something you want to be doing much, is helpful to writing good code. |
22:30 | <@Namegduf> | Time saved to write an explicit case + conciseness vs reduced clarity/maintainability/bug headaches tradeoff isn't worth it. |
22:30 | <@Namegduf> | *explicit cast |
22:30 | <&jerith> | I'm reasonably okay with numeric type promotion. |
22:31 | <@Namegduf> | Promotion within ints and floats is pretty okay, to a strictly wider type. I still wouldn't choose to have it, but it's not very hazardous. |
22:31 | <&jerith> | It doesn't violate the principle of least surprise and I can check for integers if I really want them. |
22:32 | <&jerith> | I generally prefer an explicit decimal type that doesn't have all the pitfalls and spiders that floats have, though. |
22:32 | <&jerith> | (Although that comes with a steep runtime cost.) |
22:33 | <&jerith> | https://twitter.com/old_sound/status/323116927243386880 |
22:34 | <@froztbyte> | ToxicFrog: indeed |
22:34 | <@froztbyte> | ToxicFrog: but it amuses me nonetheless :) |
22:35 | <&jerith> | I'm also quite happy with truthiness that is well-defined and reasonably sensible. |
22:36 | <&jerith> | Then there's FORTRAN, which lets you redefine numeric literals. |
22:36 | <@Namegduf> | I'm okay with it up until it gets to "compensating for coercions which would change truthiness by having strange strings also be false" |
22:36 | <@Namegduf> | If it stops somewhere in the list Vornicus wrote initially, that's pretty okay. |
22:36 | <@Tamber> | jerith: Hey, you never know when your code might be executing in a universe where pi is 3.6, and 2 is *actually* 8! |
22:37 | | VirusJTG_ [VirusJTG@Nightstar-09c31e7a.sta.comporium.net] has joined #code |
22:37 | <&jerith> | Namegduf: I'm definitely opposed to those kinds of coersions. |
22:38 | <&jerith> | I actually implemented a language not too long ago where str->int/float coersions were actually entirely reasonable in certain contexts. |
22:40 | | VirusJTG [VirusJTG@Nightstar-09c31e7a.sta.comporium.net] has quit [Ping timeout: 121 seconds] |
22:40 | | Vornicus [vorn@ServerAdministrator.Nightstar.Net] has quit [[NS] Quit: Leaving] |
22:42 | <&jerith> | The language in question is XPath, where everything starts life as a string. |
22:49 | | Turaiel is now known as Turaiel[Offline] |
23:00 | | ErikMesoy is now known as ErikMesoy|sleep |
23:03 | | gnolam [lenin@Nightstar-b2aa51c5.cust.bredbandsbolaget.se] has quit [Client closed the connection] |
23:04 | | gnolam [lenin@Nightstar-b2aa51c5.cust.bredbandsbolaget.se] has joined #code |
23:04 | | mode/#code [+o gnolam] by ChanServ |
--- Log closed Sun Apr 14 00:00:24 2013 |