Talk:Type detection

From Rosetta Code
Revision as of 18:14, 7 October 2015 by Hout (talk | contribs) (Tasks like 'flattening a list' already demonstrate type-conditional divergence of evaluation (or flow) but "Type detection" would sometimes mislead.)

Hi, Is this the start of a draft task? --Paddy3118 (talk) 12:57, 7 October 2015 (UTC)

  1. 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) ?
  2. Thoughts: The message of Rosetta is that you get deep insights when different languages are coming at the same non-linguistic task from their own distinctive angles, rather than each trying to jump through contrived grammatical or notational hoops. There may well be interesting and genuine problems to which solutions can be found by making use of the notion of type, but I think the way to find them will be to step back from particular (and perhaps parochial) problems encountered within scripting (and other dynamically typed) languages, and to think a bit more deeply about what type systems are good for, and why they are there.
A task to which Miranda, Haskell or OCaml users might respond by saying not really relevant, doesn't really arise outside the REPL or doesn't arise at all, would probably be too superficial, and a bit of a waste of potential for insight and comparison.
In short – what is the concrete problem (outside the language) for which the solutions may include branching on types  ? What is the actual task ? How would you frame it so that it scored well as a Rosetta task in terms of the 3 values formulated on the landing page:
  1. Likely to harvest responses from as many different languages as possible
  2. Designed to demonstrate how languages are similar and different, and to
  3. Aid a person with a grounding in one approach to a problem in learning another
? Hout (talk) 17:47, 7 October 2015 (UTC)
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. Hout (talk) 18:14, 7 October 2015 (UTC)