Talk:Type detection: Difference between revisions

added a section header to have the TOC in the correct location.
mNo edit summary
(added a section header to have the TOC in the correct location.)
 
(15 intermediate revisions by 3 users not shown)
Line 1:
==start of a draft task?==
Hi, Is this the start of a draft task? --[[User:Paddy3118|Paddy3118]] ([[User talk:Paddy3118|talk]]) 12:57, 7 October 2015 (UTC)
:# '''Questions:''' Is ''type detection'' itself a task ? What problem might I be trying to solve by detecting a type (at run-time) in the compiled version of a statically typed language ? Are you, for some reason, thinking of a class of problems which can't be solved in terms of an untyped lambda calculus ? If so, what are they ? Does this sound like a Rosetta task (the value of which is that languages turn out to be '''unexpectedly similar beneath the surface''', if you set them all to the same task) ? Or is it a stamp-collector, list-maker or grammatical librarian's task (simply absorbed in the cataloguing of notational '''differences''') ?
Line 10 ⟶ 11:
: PS There are some existing tasks, like list flattening (http://rosettacode.org/wiki/Flatten_a_list) which already demonstrate type-conditional divergence of evaluation or flow. Perhaps "type detection", however, would either be too parochial (or simply misleading) as a description of what is happening in, for example, pattern matching. [[User:Hout|Hout]] ([[User talk:Hout|talk]]) 18:14, 7 October 2015 (UTC)
 
'''==Spam attempt ?'''==
:I notice that www.BugMeNot.com provides a login-control evasion service, by sharing ersatz login credentials.
 
Line 16 ⟶ 17:
 
:Perhaps the user(s) of these shared BugMeNot credentials would like to allay our suspicions ? [[User:Hout|Hout]] ([[User talk:Hout|talk]]) 13:39, 8 October 2015 (UTC)
 
::Hi. BugMeNot user here. I've corrected this thread to have a proper title, as i believe it's supposed to have.
 
::First, i can say that my choice of a shared account like this, is just because i'm a bit of a casual user/contributor of the site. I wasn't allowed to post anonymously and thus went for the 2nd easiest solution. If i end up caring about my account and wanting to go in to deeper usage/discussions and gain more trust, i'll be sure to create a proper account. But i assure you i'm a good person and have good intentions. Although i can't guarantee this account won't be used by others.
 
:: The language was just what i happened to be working on at the time and not meant as a challenging exercise. It was fairly easy for me to contribute with it, since i was already working on it. I must admit, it's also a selfish reason, cause i believe i might benefit from having this article here for future reference and hopefully others do too. The fact that others saw it as an invitation to expand it with more languages, is really a testament to the community on this wiki and it's really nice to see. I can understand your worry about spam, but people are clearly maintaining this wiki very nicely, so it should hopefully be detected fairly quickly and efficiently if it actually happens. --[[User:Bugmenot2|Bugmenot2]] ([[User talk:Bugmenot2|talk]]) 10:10, 19 October 2015 (UTC)
::: As "you" say ''i can't guarantee this account won't be used by others'' … Perhaps taking the 30 seconds it requires to get a consistent username is actually a ''sine qua non'' of anything resembling constructive conversation. It could be construed as quite impolite to lazily expect others to 'talk' to a reusable ersatz name without any sense of whether the same person is behind it from one sentence to another. There's not even any coherent 'body corporate' or 'legal person' behind a mutable string that's simply been picked up somewhere in a public space and very possibly dropped again, perhaps several times. Any one of the sentences that have been typed under the various bugmenot1-Ns took longer than simply getting a username. [[User:Hout|Hout]] ([[User talk:Hout|talk]]) 11:14, 19 October 2015 (UTC)
 
:::: I can see that this was posted by [[User:Hout|Hout]], but you forgot to add a signature. I'm not sure how to add a signature for someone else, so i'm at least mentioning it.
 
::::: I've added it now, and perhaps 'you' see my point … '''Not one''' of the "BugmenotN" sentences have anything that actually constitutes the signature of a persistent 'person', individual or corporate. [[User:Hout|Hout]] ([[User talk:Hout|talk]]) 11:28, 19 October 2015 (UTC)
 
:::: I didn't expect to use this account for discussions. I merely wanted to create a few small contributions where i saw i could help. When i saw there was a discussion about me, i felt i should at least respond. --[[User:Bugmenot2|Bugmenot2]] ([[User talk:Bugmenot2|talk]]) 10:47, 19 October 2015 (UTC)
 
::::: Good. Get yourself a username and do that. [[User:Hout|Hout]] ([[User talk:Hout|talk]]) 11:19, 19 October 2015 (UTC)
 
==Delete?==
Line 21 ⟶ 37:
 
:I agree – that seems sensible, unless they can give a proper account of themselves [[User:Hout|Hout]] ([[User talk:Hout|talk]]) 15:17, 8 October 2015 (UTC)
 
:I do not agree (I am a "wiki inclusionist"). Try to make stuff useful of it (it should be the primary priority), or use pure-wiki-deletion. Whether or not the user that wrote it is using BugMeNot is irrelevant; the contents of the page are what matter, and anyone can fix it, therefore anyone <i>should</i> fix it! --[[User:Zzo38|Zzo38]] ([[User talk:Zzo38|talk]]) 19:37, 9 October 2015 (UTC)
 
:: I just noticed this thread here after i wrote the response in the thread above. Please see my response there. --[[User:Bugmenot2|Bugmenot2]] ([[User talk:Bugmenot2|talk]]) 10:10, 19 October 2015 (UTC)
 
==Could the draft description be coaxed into something useful ?==
Line 38 ⟶ 58:
Given that, the text processing context sounds promising, and should probably be more focal than a framing like ''Show a function/procedure which …'' . Perhaps for example, (thinking about Goal 1 above) that is not quite how a declarative language would be used. Better to make no assumptions about language-internal issues, and to frame the task itself.
 
On Goals 2 and 3 (''demonstrate how languages are similar and different'', & ''learning another approach'') you would need to allow for the differences such as, for example, that between run-time "Type detection" and compiler-driven pattern-matching. Framing it too tightly in terms of "type detection" assumptions would marginalise some languages, and miss the scope for comparing different approaches., for example, safe static checking in Haskell and Java, unsafe static checking in C++, and dynamic checking in Lisp, Scheme, Perl etc.
 
(Not easy though, to think of a task which centrally turns on any of the issues which arise, unless, perhaps, complex data structures are inherently likely to be involved ...)
 
Finally, on the learning aspect of Goal 3, it would clearly be good to find a task which learners are quite likely to actually encounter and think about
 
( It may also be worth looking at some existing tasks which already demonstrate type-conditional evaluation or flow – ''flattening lists'', for example – just to check that something more focused is really required. There are probably also many tasks which demonstrate evaluation or flow which is conditional on the particular type of numeric values – maybe what is really needed is an index, rather than an additional task ) [[User:Hout|Hout]] ([[User talk:Hout|talk]]) 18:34, 9 October 2015 (UTC)
 
==Perhaps search a nested list or tree ?==
 
A natural context for type-conditional evaluation or flow is a search for a value through the leaves of a tree, or through the sub-lists of a nested list/array.
 
I may be missing something, but I haven't spotted a task that immediately looks like '''search a tree''' or '''search a nested list'''. If there is such a gap, I think that perhaps 'Type detection' could usefully be reworked and reframed (possibly retitled ?) to fill it. [[User:Hout|Hout]] ([[User talk:Hout|talk]]) 14:53, 10 October 2015 (UTC)
 
==Description doesn't match==
 
The task description mentioned at the top is a different task, not type detection (although one that may involve type detection), and it is the one implemented in zkl. The other three (JavaScript, OASYS Assembler, PHP) implement type detection. Some tasks are meant to explain features of the programming language (such as special symbols, naming conventions, etc), and this perhaps is similar, but nevertheless can be improved so that better explanation, examples, examples of usage, etc are possible. I think C++ has RTTI (although I don't really know as I do not program in C++). Haskell has the "Typeable" class for supporting type detection. Entries on here could also link to tasks which use type detection to achieve their task in this programming language. --[[User:Zzo38|Zzo38]] ([[User talk:Zzo38|talk]]) 17:59, 10 October 2015 (UTC)