Pretty much so.

Sometimes, not being able to have values of 0 bytes causes wastefulness.

For instance, a map from keys to items becomes a set if the items are of the
type void. If I write code like this, the code can pass typechecking but is
to be
stopped by the C compiler. Instead, I have to use integer 0 as a dummy item
but doing so wastes memory and CPU cycles.

I read that ancient Romans did not have a numeral for zero. By that, you
could
infer that they were a very pratical people :)

On Sat, Mar 10, 2018 at 10:34 AM, Brandon Barker <brandon.bar...@gmail.com>
wrote:

> Ah, interesting - to get around that, does ATS just translate every void
> value assiagnment as the execution of a C function call returning void?
>
> On Saturday, March 10, 2018 at 9:44:34 AM UTC-5, gmhwxi wrote:
>>
>> ATS's void is unit. The name 'void' refers to the fact that the memory
>> needed
>> for the void-value is 0 bytes. Unfortunately, there is no type in C of 0
>> size (I did
>> try struct{}). This is the place where a theorist and an engineer differ
>> fundamentally.
>> One really needs a theorist's C in order to compile ATS faithfully.
>>
>> On Sat, Mar 10, 2018 at 9:35 AM, Brandon Barker <brandon...@gmail.com>
>> wrote:
>>
>>> I find the following diagram helpful to sort of know what's what in
>>> Scala: https://www.scala-lang.org/old/node/128.html
>>>
>>> Now, ATS is very different, I'm not sure such a diagram could even make
>>> sense (it isn't a language that deals with subclassing much as I understand
>>> it). But if anything like it is possible (and maybe more than one diagram
>>> is necessary), I think it could be helpful to place these early on in one
>>> of the ATS documentation sections/books.
>>>
>>> Now I get the sense that ATS's void is actually the unit type, is this
>>> correct? What is the uninhabited type in ATS, if any?
>>>
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "ats-lang-users" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to ats-lang-user...@googlegroups.com.
>>> To post to this group, send email to ats-lan...@googlegroups.com.
>>> Visit this group at https://groups.google.com/group/ats-lang-users.
>>> To view this discussion on the web visit https://groups.google.com/d/ms
>>> gid/ats-lang-users/c0a94aab-c802-493e-a786-3e44e5cd3173%40go
>>> oglegroups.com
>>> <https://groups.google.com/d/msgid/ats-lang-users/c0a94aab-c802-493e-a786-3e44e5cd3173%40googlegroups.com?utm_medium=email&utm_source=footer>
>>> .
>>>
>>
>> --
> You received this message because you are subscribed to the Google Groups
> "ats-lang-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to ats-lang-users+unsubscr...@googlegroups.com.
> To post to this group, send email to ats-lang-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/ats-lang-users.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/ats-lang-users/572f06f4-9db2-4120-8e4b-e730453bd39b%
> 40googlegroups.com
> <https://groups.google.com/d/msgid/ats-lang-users/572f06f4-9db2-4120-8e4b-e730453bd39b%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"ats-lang-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ats-lang-users+unsubscr...@googlegroups.com.
To post to this group, send email to ats-lang-users@googlegroups.com.
Visit this group at https://groups.google.com/group/ats-lang-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ats-lang-users/CAPPSPLr30KRYmfi2wxBTv0J4ZCyO9EDjoTiC9u3W2ZQ2WX9kLA%40mail.gmail.com.

Reply via email to