有没有一种语言,能像 Python 一样简单,像 C 一样快,比 Rust 更安全?

2作者: jerryzhang663 个月前
鉴于人工智能如此强大,我们应该拥有一种更好的编程语言。这种语言被命名为 cpluz/cz,意指它大致介于 C 和 C++ 之间,但有一些差异。由于它的设计理念与 C++ 截然不同,我们的理念是“简单即是最好”。 我最初的计划如下: A. 路线图:0.1 版本是 C++23 的一个子集。这样做的好处是它可以与现有的 C++ 生态系统共存,所有程序和库都可以共享。 1.0beta 版本是一个重大突破。在这个阶段,应该有工具或人工智能可用,将 0.1 版本和 C++23 代码完全转换为 CZ1.0 + 独立的编译器工具。 B. 语言设计:目前考虑的:1. 无头文件;使用模块;2. C++20 + 多维下标运算符/if consteval;3. 使用 C++23 库。 总体目标是: 一页速查表(+半页基本概念,如果你没有任何编码知识);一本完整的书 10 页。这意味着大致不超过 20 条基本语法规则。这将使人工智能和人类都能轻松学习并与之交流,实现像 Python 一样的易用性。并将其他所有内容都放入库中。 基于 C++,它应该实现类似的速度,甚至更高效,因为它更简单。 除了 Rust 的安全性,我们还需要增加信任,这意味着在共享之前进行严格的代码审查(包括测试代码,这些代码曾被 XZ 的黑客利用)。 考虑到人工智能的发展速度,完成一个完整的课程大约需要 18 个月,这并不过分吧?
查看原文
With the AI being so powerful, we should have a better programming language. This language is named cpluz&#x2F;cz, signifying that it is generally between C and C++, but with some differences. Because its philosophy is fundamentally different from C++, ours is &quot;simple the best&quot;.<p>My initial plan is as follows:<p>A. Roadmap: Version 0.1 is a subset of C++23. The advantage is that it can coexist with the existing C++ ecosystem, all programs and libraries can be shared.<p>Version 1.0beta is a hardbreak. At this stage, tools or AI should be available to completely convert version 0.1 and C++23 code into CZ1.0 + independent compiler tools.<p>B. Language design: Currently considered: 1. No header; use modules; 2. C++20 + Multidimensional Subscript Operator&#x2F;if consteval; 3. Use the C++23 library.<p>The overall goal is:<p>One-page cheat sheet (+half a page of basic ideas, if you have zero coding knowledge); 10 pages of a full book. This means roughly no more than 20 basic syntax rules. This will allow both AI and humans to easily learn and communicate with it, achieving ease use as Python. And put everything else in the library.<p>Based on C++, it should achieve similar speed, and even more efficient because it&#x27;s simpler.<p>Besides the safety of Rust, we also need to add Trust, which means strict code review before sharing (including test code, which exploited by hackers of XZ).<p>Given the speed of AI development, a complete course should take about 18 months, which isn&#x27;t an exaggeration?