Jump to content

Talk:Data type

Page contents not supported in other languages.
From Wikipedia, the free encyclopedia
(Redirected from Talk:Datatype)


Topic of this article

[edit]

I'm starting this article now that type system is moved out of the way. Type is an abstract concept of type systems but data type is a concrete type of data. While Type system gives an overview on issues on designing a system, this article can give an overview on different kinds of data types used in practise. The topic relates to data structure (an article in need of cleanup) and some stuff in there about the building blocks could be dealt with here. The way I see it, a node of a data structure or data without smaller operable structure is a data type. --TuukkaH 10:46, 28 February 2006 (UTC)[reply]

Sorry, but the above paragraph (and also the current Overview section of the article) implies that 'integer' is a data type, but 'array of integer' is not a data type. And that would be wrong. — Preceding unsigned comment added by 216.16.232.122 (talk) 17:34, 7 July 2011 (UTC)[reply]

You could differentiate between a "primitive type" and a "compound type", perhaps, but I'm not sure it's a very useful distinction. Ketil (talk) 07:16, 3 April 2012 (UTC)[reply]

Lost info?

[edit]

The C++ entry has links to datatype (no space) and sub-entries on strong/weak, safe/unsafe, nominative/structural, and static/dynamic typing. These links lead now to the article data type but these entries are missing.

Is this by design or mistake?

Liastnir 14:24, 28 February 2006 (UTC)[reply]

The article that was here with those sections is now located at Type system. If you'd like to be really helpful, you can click "What links here" and fix the broken links! —donhalcon 14:39, 28 February 2006 (UTC)[reply]
Similarly some articles are looking for Static_and_dynamic_typing. Mathiastck 16:55, 23 August 2006 (UTC)[reply]

User:Guest

The compound word "datatype" is sometimes used in place of "data type". It is not clear whether this is an "official" new word or simply the product of us making up new words as we go along. But, it works. 198.102.62.250 01:21, 11 November 2006 (UTC)[reply]

defined range.

[edit]

I know I am almost on a lost crusade here but I still believe it to be important to mentions concept of choosing a range needed and let the actual hardware representation to the compiler. And I would like to go further on this as this concept gives are real win/win situation:

  • It is easier to understand for programmer
  • 100% portable type Range_Type is range -5 .. 10; means the same on any CPU or language implementation.
  • Better optimization: The compiler is free to choose either Byte or Integer for the above definition - depending on optimisation setting (speed vs. size).

The concept is so elegant and powerful that it is a shame that is almost forgotten (AFAIK Pascal introduced the notion in the 1970th). So I believe it is important to mention so "Byte, Word, Integer, etc. pp" are not "god given" (Independent of which god you believe in) but what they really are: An implementation detail for which they are alternatives.

See wikibooks:Ada_Programming/Types/range or wikibooks:Ada_Programming/Types/digits for a syntax example.

--Krischik T 12:19, 9 February 2007 (UTC)[reply]

>>Who told you that these are always the ranges. These are very naive values. Moreover, who says that one byte has to be 8 bits? Haven't you heard of 9 bit byte? Please don't destroy the charm of wikipedia. I have already seen novices writing on the topics they don't completely know of. Please stop this non-sense.

Some of what you said doesn't make much sense, but ranges as part of a data type is a legitimate topic in data types. Feel free to add it to the article. If you know you are on a crusade, write an article on your own site and leave facts on wikipedia. Also, read "Why Pascal Is Not My Favorite Programming Language" by Kernighan to see the flipside of ranges as part of the type system in a programming language and why they can actually be a bad thing. Here is an HTML version [[1]]. Gendut (talk) 02:15, 24 May 2009 (UTC)[reply]

Data Structures & Abstract Types

[edit]

Right now, these are both empty sections with 'main article' links in them. Usually you see those prior to at least a short summary of the subject in question, so can someone write that up? Or simply move them to the 'see also' section? --124.177.141.85 15:32, 26 March 2007 (UTC)[reply]

merge from Dynamic data typing

[edit]

The article at Dynamic data typing is very short and it seems to me it would be better as a section in this article.--NHSavage 21:19, 27 March 2007 (UTC)[reply]

Actually on second thoughts it would be better to merge with Type system. I'll change the template.--NHSavage 09:11, 31 March 2007 (UTC)[reply]

Real vs. Floating-point

[edit]

I think the term "Real numbers" is a misuse in any system that does not provide symbolic algebra: No floating-point type can truly represent Pi or even 1/3. —The preceding unsigned comment was added by Medinoc (talkcontribs) 09:25, 14 May 2007 (UTC).[reply]

Is the page a disambig page?

[edit]

I moved materials about primitive types here to primitive type, since those are actually more concrete than discussion give there. The consequence of this is that, now, the article is basically a disambig page. On the one hand, this may not be a bad thing, since now type system talks about what data types, how they are used etc. On the other hand, I can't see the point of the existence of this article. I am unwilling to make editorial proposals, but just wanted to point this out. -- Taku 05:38, 8 October 2007 (UTC)[reply]

Misleading

[edit]

If look at the source cited in our article on data type, you'll see how misleading it is. It changed "Data type as set of values with set of operations", which is a topic amongst others in type theory (different models exists) to "A data type [...] is a set of values and the operations on those values" excluding all other models.

The concrete implementation of types (as done in implementations of programing languages) is a model of a type. But not all types can be modeled by sets. Function types are a problem. See for instance Dana Scott's lattices.

Pcap ping 10:00, 28 August 2009 (UTC)[reply]

I don't think this is a concern with the current article, and I might take off the templates at the top of the page.1Z (talk) 15:02, 22 October 2011 (UTC)[reply]
Is it commonly accepted that the "type int represents [...] the operations that can be performed on integers, such as addition [...]"? Personally, I would say that functions (say taking two ints and returning an int) are a distinct type from ints themselves, but maybe I'm mistaken? Ketil (talk) 12:59, 23 March 2012 (UTC)[reply]

Content from Type system

[edit]

It was misplaced at Type system, please merge it with Data type:

A type of types is a kind. Kinds appear explicitly in typeful programming, such as a type constructor in the Haskell language.

Types fall into several broad categories:

 Done I've done this as much as seems feasible. Subtyping is a relation of types, rather than a kind of type, so was left out. Partial types are just syntactic so also left out. Also ownership types skipped because I don't know what those are. Mathnerd314159 (talk) 05:36, 11 August 2022 (UTC)[reply]

Abstract type or abstract data type

[edit]

I am trying to understand why is the definition of "abstract type" used in the section "abstract data type".

see: https://en.wikipedia.org/wiki/Abstract_data_type

and

https://en.wikipedia.org/wiki/Abstract_type

I have been two days trying to figure out the diferences between and this particular section seems to use the definitions simultaneously.:

"Any type that does not specify an implementation is an abstract data type"


And another thing is that after the first dot in the same section it says:

" For instance, a stack (which is an abstract type) can be implemented as an array (a contiguous block of memory containing multiple values), or as a linked list (a set of non-contiguous memory blocks linked by pointers)."

and after that it is in the little list of abstract data types. — Preceding unsigned comment added by Elcarlis54 (talkcontribs) 16:16, 3 January 2017 (UTC)[reply]


I can't give any suggestions because i don't know much of it

Rewrite of the section "Abstract data type"

[edit]

Unfortunately, the article Abstract data type currently is so, that one cannot really draw from it. I thus turned the section towards Algebraic specification, which historically is the center piece of ADT research and gave more appropriate examples. In particular, the data type stack is at least misleading. Though it is ubiquitously in ADT literature, it is considered there truly as data, i.e. something that cannot be modified, meaning data vs. state or machine. -- Cobalt pen (talk) 15:43, 11 October 2020 (UTC)[reply]

Type (CS), topic of this article and this article's use in WP

[edit]

Please see the very first comment on this talk page, which sets the article's conceptual border. While i agree with the limit, which substantially helped it to shape the article now comes out to have some unwanted consequences.

Most particular, Type (computer science) is a link to this article. Thus the narrow range positively wanted here is extended to a broader topic.

An immediate consequence was, that the section "function types" here was never filled in for at least eight years, rightly because functions are not data but actually the article's delimitation.

Excluded by this setting are not only any non-data types like those for modules, classes, etc., but also types in the scope of type theory, which is a topic common research in both computer science and mathematics. As a consequence with link, WP currently presents that CS would have a very narrow concept of type, which is factually untrue.

IMO, the general concept of type in CS is shared with that in type theory. So we now have some Type (computer science) which falsely ends here and some Type (type theory), which in part, pulls in another direction. Additionally, CS has created masses of concrete Type systems over times.

The issue cannot be solved in this article, but is a rather a topic of the current structure of the related lemmata in WP.

I tried to resolve it the following way:

  • Type (type theory) becomes a short article presenting only the material that is common both in CS in math, i.e. basically types defined are opposed to values and expressions, the common syntax E : T, and a few more general notes, e.g. that types can themselves have types, etc. and limit this article to that generality, so that it does not become a kitchen sink. I expressed that the concept is shared, too.
  • Type (computer science) could then safely become a link to that.
  • I dismissed to keep the Type (type theory) a link into the section of Type theory. While it is almost identical, types in Type theory have their own particular direction, much like these here.
  • I also added an about-template here and a main-template in the related section in Type theory.

Unfortunately, WP appears to be very sensitive against structural changes. What happened was, that the change was almost instantly and completely reverted. Parts by another author who appears to be concerned about stub articles and some automated script.

As i think, that the current structure is wrong and unfortunate, and the current link of Type (computer science) ends here, i believe the issue can be best resolved here. -- Cobalt pen (talk) 09:02, 13 October 2020 (UTC)[reply]

While WP can be sensitive to structural changes, there are a number of formal processes for discussing contentious changes and then implementing them if there is a consensus. See WP:SPLIT which might be most relevant here. You are always entitled to make bold changes, but have to be prepared for them to be reverted if there is some disagreement or just concern. One of the reasons for the sensitivity to change is that Wikipedia is heavily interlinked. What you see as a logical structural change affects all the other articles that link in to the pages as they are currently defined, as well as external urls that we have no control over. Whenever you change the meaning of a page or the target of a redirect, you need to assess all those other pages to make sure you aren't skewing things or just completely breaking wikilinks. However, the main reason that your changes were reverted is that they were entirely unsourced. Wikipedia requires reliable sources for all articles and unsourced content is liable to be removed at any time. Combining undiscussed structural changes with creating an uncited article is pretty much a non-starter. Lithopsian (talk) 14:26, 13 October 2020 (UTC)[reply]
Lithopsian, thanks for the note. While i do agree with its points, the situation might be more complicate as the issue became distributed over a whole field of articles. It is difficult to solve it locally, as suggested in the WP: shortcuts. This has been tried earlier, apparently also with this article itself, as one can see from its first note here. If one pages up, other authors also tried to fix it, but it did not succeed and finally only made it worse. The topic "type" is shared with between computer science, logic and foundations of mathematics at least. On top of this come applied science and many application fields. Perhaps, the issue cannot be solved here. I'm therefore looking for other institutions in WP for a proper resolution. From its project's introduction page, Wikipedia talk:WikiProject Logic could fit. -- Cobalt pen (talk) 09:17, 14 October 2020 (UTC)[reply]
Certainly not simple. Type is used in a lot of contexts. It may help to bring together all the articles you think are involved, with a phrase summarising their current usage, into one place and then layout what you think a better structure might be. Reorganisations are possible, but doing them with an agreed discussion to point to will make your life a whole lot easier. Or you might just look at the disambiguation page type and see if you can hang other articles off it. Or consider a Wikipedia:Broad-concept_article: type itself may be too vague and broad for that, but perhaps for the stricter scientific meanings. Lithopsian (talk) 14:01, 14 October 2020 (UTC)[reply]

Data type

[edit]

What is data type 2409:4050:E8E:112B:46E6:7FA3:597F:C170 (talk) 17:00, 19 November 2021 (UTC)[reply]

Are enumerations primitive or composite?

[edit]

@Murray Langton Per primitive type, only machine types are primitive, and enumerations are not machine types hence are not primitive. Although enums might implemented using primitive types, e.g. in C, in most languages they are distinct types, e.g. in Java an enum value is implemented as a unique value of a new class. Per its lead, an enumerated type is a degenerate tagged union of unit type. Tagged unions are composite, hence enums are too. Mathnerd314159 (talk) 21:52, 10 August 2022 (UTC)[reply]

Also [2] lists enumeration as a composite type. Mathnerd314159 (talk) 02:00, 11 August 2022 (UTC)[reply]
In the lead of enumerated type it says that such types can be treated as degenerate tagged unions, not that they are such things.
I have have always thought of composite types as having one or more components, which can be individually accessed (e.g. string often has a length and some characters).
In C an enumeration is just treated as a (possibly small) integer i.e. a primitive.
In other languages, where an enumeration defines a new type, all the type-related stuff is handled by the translator, with the actual implementation being done as primitive integers. Murray Langton (talk) 06:43, 11 August 2022 (UTC)[reply]
[3] also lists enumerations as composite, although there the terminology is scalar vs composite rather than primitive vs composite. R.e. your definition of composite, IMO a type with accessible components is an aggregate type. This currently redirects to composite type, due to being used interchangeably in the database field, but I would argue that in a general-purpose programming language not all composite types are aggregate. E.g. a union type is not aggregate, but it is composite. The definition of composite is more general as it includes any non-primitive type. Also with the other definition of primitive as "built-in to the programming language" enumerations are user-defined types hence composite.
I have to admit though that the primitive / aggregate / composite / scalar / atomic / derived / generated (last 3 from [4]) terminologies for datatypes are a huge mess, nobody seems to agree on them. I think long-term it would be better to write the article so it was neutral on the categorization of individual datatypes and merely summarized the differing terminologies in a separate section. Mathnerd314159 (talk) 16:10, 11 August 2022 (UTC)[reply]
I agree that the terminologies for data types are a bit of a mess. When I get time I'll look at what is involved in a rewrite. Murray Langton (talk) 22:03, 11 August 2022 (UTC)[reply]
OK, I started the rewrite. The section still needs expanding, I was thinking of [5] and ISO/IEC 11404 as sources. I can't track down a good source that defines composite data type. Google says it may appear in Stansifer's [6] but I don't have easy access to that book. It's in his course slides but that isn't really a good source. Mathnerd314159 (talk) 19:52, 12 August 2022 (UTC)[reply]