Perl 6 - the future is here, just unevenly distributed

IRC log for #rosettacode, 2011-08-13

| Channels | #rosettacode index | Today | | Search | Google Search | Plain-Text | summary

All times shown according to UTC.

Time Nick Message
00:10 Laranja joined #rosettacode
02:45 kpreid joined #rosettacode
03:01 * mikemol cackles
03:02 mikemol I figured out how to do [[Longest string challenge]] in C, within the restrictions given.
03:02 fedaykin http://rosettacode.org/wik​i/Longest_string_challenge
03:03 kpreid ooh, cute
03:04 kpreid wait, you need to return *all* of the longest *and* not use lists?
03:04 mikemol Yeah, that's part of the pain of it.
03:04 kpreid The task description should explicitly permit or forbid reading the input twice.
03:05 mikemol Leave a note at [[Talk:Longest string challenge]]
03:05 fedaykin http://rosettacode.org/wiki/T​alk:Longest_string_challenge
03:07 mikemol The solution I thought of would work with the given sample data, but might fail upon appropriately-crafted alternate data.
03:08 mikemol Hm. My solution might have the same failing as an earlier solution I'd thought of.
03:10 mikemol Whether or not various usages and manipulations of pointers and blocks of memory constitute using prohibited data types.
03:11 mikemol Ledrug added an omit template for C because you can't loop in C without using comparison operators.
03:12 mikemol Actually, that's not really true; evaluated as a conditional expression, (0 != func()) is the same as (func()), but the latter doesn't break the task rules.
03:14 mikemol I was thinking about using a couple compile-time-initialized blocks of memory, and memset them to 0.
03:15 mikemol That opens the way for tricks involving null-terminated strings.
03:17 mikemol Huh. Actually, the solution got even simpler than I was thinking about.
03:17 * mikemol starts coding.
03:27 mwn3d_phone It looks like the first perl 6 solution uses arithmetic
03:27 mwn3d_phone Not sure if the "*-1" counts or not
03:30 TimToady it is not at all clear from the description how explicit the use of a particular must be before it is prohibited.  I'm sure all of these implementations are doing plenty of arithmetic and list processing internally...
03:30 TimToady it's also not clear what "datatype" means
03:31 TimToady though I do agree that the Perl 6 solutions are over the line, probably
03:33 mikemol I'm not certain it'
03:33 mikemol ugh
03:34 TimToady are first-class closures a datatype, for instance?
03:35 TimToady and what about all the languages where strings *are* lists?
03:35 mikemol I think the question then becomes whether lists are recognized explicitly as types.
03:36 TimToady so if they are, such a language can't use strings either :)
03:36 mwn3d_phone To be fair the task explicitly says that its used for teaching icon
03:38 mikemol I expect the intent is to force the programmer into discovering some idiom particular to Icon.
03:39 TimToady it's very difficult to define something like that negatively
03:39 mwn3d_phone Yeah. And the intent of putting it on RC was to see how well the concept(s) translate(s) into other languages.
03:39 mikemol Hm.
03:40 mikemol I take it C doesn't allow typedefs for statically-sized arrays? http://codepad.org/7FB0sBjL
03:40 fedaykin "C code - 50 lines - codepad"
03:48 mikemol Just about there...Not sure what's up with line 25, though. http://codepad.org/i87ZJ2DX
03:48 fedaykin "C code - 56 lines - codepad"
04:14 mikemol Argh. I think I got my array dimensions flipped. http://codepad.org/f6z52kkT
04:14 fedaykin "C code - 69 lines - codepad"
04:15 mikemol Anyway, off to sleep. It's uncomfortably hot here atm. Maybe I'll pick up on that code later.
05:53 kingxerxes joined #rosettacode
11:01 FireFly joined #rosettacode
11:36 dagnyscott joined #rosettacode
14:12 mikemol I'm amused at how [[Longest string challenge]] worked out. I like the idea that the *point* of the task was demonstrating how to circumvent the letter of the task.
14:12 fedaykin http://rosettacode.org/wik​i/Longest_string_challenge
14:14 mikemol It's a curious task, because it suggests that the higher-level a language is, the more unidiomatic a solution is likely to be.
14:15 mikemol It also suggests to me a possible distinction between 'normal' and 'puzzle' tasks.
14:16 mikemol A normal task, such as one defined by {{task}}, would ask for solutions written to the spirit of the task, while a puzzle, via {{puzzle}}, would ask for solutions written to the letter of the task.
14:47 kpreid That seems like a nice distinction.
14:48 kpreid I would want to see if that corresponds to the existing use of the 'puzzle' classification.
14:48 * TimToady is working on a real Perl 6 solution that doesn't "cheat"
14:48 TimToady (much)
14:49 kpreid (oh, hello there)
15:06 Hypftier hm, $input|group Length|sort Name|select -exp Group would be no *explicit* creation or usage of arrays, but $input is one and there's no other way I could get to piped-in input otherwise :/
15:49 _ilbot joined #rosettacode
15:49 Topic for #rosettacode is now Rosetta Code: Coding in (∞ - 1) languages ; http://irclog.perlgeek.de/rosettacode/today ; Pop a tab and stick around!
18:15 kingxerxes joined #rosettacode
19:12 mwn3d_phone joined #rosettacode
19:27 mwn3d_phone joined #rosettacode
20:22 mwn3d_phone joined #rosettacode
22:09 kingxerxes joined #rosettacode

| Channels | #rosettacode index | Today | | Search | Google Search | Plain-Text | summary