The OpenNET Project / Index page

[ новости /+++ | форум | теги | ]



"Выпуск языка программирования Zig 0.11.0"
Версия для распечатки Пред. тема | След. тема
Форум Разговоры, обсуждение новостей
Исходное сообщение [ Отслеживать ]
Присылайте удачные настройки в раздел примеров файлов конфигурации на WIKI.opennet.ru.
. "Выпуск языка программирования Zig 0.11.0" +/
Сообщение от Аноним (141), 06-Авг-23, 17:48 
https://github.com/ziglang/zig/issues/1530#issuecomment-4227...

> Many of you are doubting whether u0 is a valid type, and theoretically, it is valid. From a type theory's perspective, u0 is the "unit type", which is always constructible, but carries no information. void, empty tuple, empty struct, enum with a single element are all the same. u0, u1, u2, ... are closely related by "product of types": u1 = u0 * onebit, u2 = u1 * onebit, ...
> For a high-level functional language like Haskell or Ocaml, not including u0 would probably be a mistake. But now the problem is, Zig is a low-level language, and cares about machine representations and such. u0 and u1, u2, ... differs in a fundamental way that u0 has no memory representation. Including u0 in Zig breaks the assumption that all integers have a memory representation, which in turn may break things if handled carelessly.
> .

Ответить | Правка | Наверх | Cообщить модератору

Оглавление
Выпуск языка программирования Zig 0.11.0, opennews, 04-Авг-23, 22:20  [смотреть все]
Форумы | Темы | Пред. тема | След. тема



Партнёры:
PostgresPro
Inferno Solutions
Hosting by Hoster.ru
Хостинг:

Закладки на сайте
Проследить за страницей
Created 1996-2024 by Maxim Chirkov
Добавить, Поддержать, Вебмастеру