Telegram Group & Telegram Channel
Forwarded from 银河-蜗牛 GalaxySnail
我觉得 zig 的异步、包管理都不是最大的痛点,因为这些点上 C 还不如 zig。我心目中的 better C 应该是写起来需要担心的事情严格比 C 更少,所有在 better C 中需要操心的东西在 C 中本来就需要操心,而很多 C 当中需要担心的大坑在 better C 中不存在。
但很可惜的是,zig 还并不符合我心目中的这个标准。单从语言上来说,一个巨坑就是 result location semantics,在赋值的等号左右引用同一个变量很容易导致意外的结果;另一个就是传递函数参数时会隐式按引用传递,从而导致意外的指针别名。这都是 C 当中不存在的 footgun。
然后更别说标准库了,感觉他们根本不懂怎么设计一个正常的标准库。数据结构和算法还好,但问题是小到前两天群里提过的对象的名为 format 方法会影响格式化行为,作为一个接口的特殊方法没任何标记;而更严重的是大到和操作系统有关的接口更是一坨,比如认为 realpath 不该存在 [1],不能以 append 模式打开文件 [2],最逆天的是硬编码了一系列 errno 为 unreachable,但实际上没有哪个 errno 是不可能发生的 [3]
[1] https://github.com/ziglang/zig/issues/19353
[2] https://github.com/ziglang/zig/issues/14375
[3] https://www.group-telegram.com/ZigChinese/17244



group-telegram.com/rynif/34622
Create:
Last Update:

我觉得 zig 的异步、包管理都不是最大的痛点,因为这些点上 C 还不如 zig。我心目中的 better C 应该是写起来需要担心的事情严格比 C 更少,所有在 better C 中需要操心的东西在 C 中本来就需要操心,而很多 C 当中需要担心的大坑在 better C 中不存在。
但很可惜的是,zig 还并不符合我心目中的这个标准。单从语言上来说,一个巨坑就是 result location semantics,在赋值的等号左右引用同一个变量很容易导致意外的结果;另一个就是传递函数参数时会隐式按引用传递,从而导致意外的指针别名。这都是 C 当中不存在的 footgun。
然后更别说标准库了,感觉他们根本不懂怎么设计一个正常的标准库。数据结构和算法还好,但问题是小到前两天群里提过的对象的名为 format 方法会影响格式化行为,作为一个接口的特殊方法没任何标记;而更严重的是大到和操作系统有关的接口更是一坨,比如认为 realpath 不该存在 [1],不能以 append 模式打开文件 [2],最逆天的是硬编码了一系列 errno 为 unreachable,但实际上没有哪个 errno 是不可能发生的 [3]
[1] https://github.com/ziglang/zig/issues/19353
[2] https://github.com/ziglang/zig/issues/14375
[3] https://www.group-telegram.com/ZigChinese/17244

BY &'a ::rynco::UntitledChannel


Warning: Undefined variable $i in /var/www/group-telegram/post.php on line 260

Share with your friend now:
group-telegram.com/rynif/34622

View MORE
Open in Telegram


Telegram | DID YOU KNOW?

Date: |

Under the Sebi Act, the regulator has the power to carry out search and seizure of books, registers, documents including electronics and digital devices from any person associated with the securities market. On Telegram’s website, it says that Pavel Durov “supports Telegram financially and ideologically while Nikolai (Duvov)’s input is technological.” Currently, the Telegram team is based in Dubai, having moved around from Berlin, London and Singapore after departing Russia. Meanwhile, the company which owns Telegram is registered in the British Virgin Islands. Telegram has become more interventionist over time, and has steadily increased its efforts to shut down these accounts. But this has also meant that the company has also engaged with lawmakers more generally, although it maintains that it doesn’t do so willingly. For instance, in September 2021, Telegram reportedly blocked a chat bot in support of (Putin critic) Alexei Navalny during Russia’s most recent parliamentary elections. Pavel Durov was quoted at the time saying that the company was obliged to follow a “legitimate” law of the land. He added that as Apple and Google both follow the law, to violate it would give both platforms a reason to boot the messenger from its stores. The S&P 500 fell 1.3% to 4,204.36, and the Dow Jones Industrial Average was down 0.7% to 32,943.33. The Dow posted a fifth straight weekly loss — its longest losing streak since 2019. The Nasdaq Composite tumbled 2.2% to 12,843.81. Though all three indexes opened in the green, stocks took a turn after a new report showed U.S. consumer sentiment deteriorated more than expected in early March as consumers' inflation expectations soared to the highest since 1981. In addition, Telegram now supports the use of third-party streaming tools like OBS Studio and XSplit to broadcast live video, allowing users to add overlays and multi-screen layouts for a more professional look.
from us


Telegram &'a ::rynco::UntitledChannel
FROM American