News for hackers. Stuff that matters.
Re:A Tale of Two Pwnies (Part 1) by marshray on Tuesday May 22, 2012 @09:50PM (#4011092)
C can represent the type "array of 10 ints":

     int array[10];
But probably you meant runtime variable values.
Re:A Tale of Two Pwnies (Part 1) by ktosiek on Wednesday May 23, 2012 @11:33AM (#4013554)
Well, here the compiler won't help you with bounded access - you can easily read array[42], and it would compile (and maybe even work... but just a little bit funny ;-)).

With dependent types function to get element from array may have type (this is pseudocode): get (array : T[n], index : m) : T {n : nat, m : nat, m < n} which would mean "function get, which takes: n long array of elements of type T, index of type m, where m is smaller than n, and returns T". Type-level naturals and bounded array access are the basic examples of dependent typing, more interesting ones may be red-black trees with guarantees about their shape put in the type or some magic for creating DSLs.

Re:A Tale of Two Pwnies (Part 1) by jackpirate on Wednesday May 23, 2012 @01:40AM (#4011724)
the type of that is an (int*) if I'm not mistaking
Re:A Tale of Two Pwnies (Part 1) by marshray on Wednesday May 23, 2012 @02:15AM (#4011806)
There's an automatic conversion to int* when necessary, but the array is nominally a distinct type. This is particularly apparent in C++ where you can do things like instantiate a template from the array type and create a compile-time function to return the number of elements.