美文网首页
Origins(溯源)

Origins(溯源)

作者: 王老怪的开发笔记 | 来源:发表于2024-01-10 14:45 被阅读0次

What are Go's ancestors?
Go的祖先是什么?

Go is mostly in the C family (basic syntax), with significant input from the Pascal/Modula/Oberon family (declarations, packages), plus some ideas from languages inspired by Tony Hoare's CSP, such as Newsqueak and Limbo (concurrency). However, it is a new language across the board. In every respect the language was designed by thinking about what programmers do and how to make programming, at least the kind of programming we do, more effective, which means more fun.
Go 大部分属于 C 语系(基本语法),有来自 Pascal/Modula/Oberon 语系(声明、包)的significant input,加上一些受 Tony Hoare 的 CSP 启发的语言的想法,例如 Newsqueak 和 Limbo(并发)。然而,它是一种全新的语言。从各个方面来看,该语言的设计都考虑了程序员的工作以及如何使编程(至少是我们所做的编程)更有效,这意味着更有趣。

across the board
全面地;

What are the guiding principles in the design?
设计的指导原则是什么?

When Go was designed, Java and C++ were the most commonly used languages for writing servers, at least at Google. We felt that these languages required too much bookkeeping and repetition. Some programmers reacted by moving towards more dynamic, fluid languages like Python, at the cost of efficiency and type safety. We felt it should be possible to have the efficiency, the safety, and the fluidity in a single language.
当 Go 被设计时,Java 和 C++ 是编写服务器最常用的语言,至少在 Google 是这样。我们认为这些语言需要太多的记账和重复。一些程序员的反应是转向更动态、更流畅的语言,比如 Python,但代价是效率和类型安全。我们认为应该可以用单一语言实现高效、安全和流畅。

repetition
n. 重复,反复;背诵;复制品,副本;[乐]复唱,复奏,重奏;

bookkeeping
n. 记账,簿记,管账;

Go attempts to reduce the amount of typing in both senses of the word. Throughout its design, we have tried to reduce clutter and complexity. There are no forward declarations and no header files; everything is declared exactly once. Initialization is expressive, automatic, and easy to use. Syntax is clean and light on keywords. Repetition (foo.Foo* myFoo = new(foo.Foo)) is reduced by simple type derivation using the := declare-and-initialize construct. And perhaps most radically, there is no type hierarchy: types just are, they don't have to announce their relationships. These simplifications allow Go to be expressive yet comprehensible without sacrificing, well, sophistication.
Go 试图减少两种意义上的打字量。在整个设计过程中,我们努力减少混乱和复杂性。没有前向声明,也没有头文件;一切都被声明一次。初始化具有表现力、自动且易于使用。语法简洁,关键字较少。 通过使用声明和初始化构造的foo.Foo* myFoo = new(foo.Foo)简单类型派生可以减少重复 ( ) 。:=也许最根本的是,不存在类型层次结构:类型只是类型,它们不必声明它们的关系。这些简化使得 Go 既具有表达能力又易于理解,而且又不牺牲复杂性。

clutter
n. 杂乱;混乱;喧嚣;
vt. 使凌乱;乱糟糟地堆满;
vi. 乱哄哄地跑;发出吵闹声;

hierarchy
n. [计]分层,层次;等级制度;统治集团;天使的级别或等级;

comprehensible
adj. <正>可理解的,能懂的;

sacrificing
v. 牺牲,献出( sacrifice的现在分词 );

sophistication
n. 老练,精明;强词夺理,诡辩;伪品,掺杂品;有教养;复杂巧妙,高水平;

Another important principle is to keep the concepts orthogonal. Methods can be implemented for any type; structures represent data while interfaces represent abstraction; and so on. Orthogonality makes it easier to understand what happens when things combine.
另一个重要原则是保持概念正交。方法可以被任何类型实现;结构代表数据,接口代表抽象;等等。正交性使我们更容易理解事物组合时会发生什么。

orthogonal
adj. [数]直角的;矩形的;直交的;互相垂直的;

相关文章

网友评论

      本文标题:Origins(溯源)

      本文链接:https://www.haomeiwen.com/subject/qitondtx.html