加载中

27 Languages

  • Procedural programming: C, Rust, Cython

  • Object-oriented data modelling: Java, C#, Eiffel

  • Object-oriented C derivatives: C++, D

  • Array-oriented data processing: MATLAB/Octave, Julia

  • Statistical data analysis: R

  • Computational pipeline modelling: Haskell, Scala, Clojure, F#

  • Event driven programming: JavaScript, Go, Erlang, Elixir

  • Gradual typing: TypeScript

  • Dynamic metaprogramming: Hy, Ruby

  • Pragmatic problem solving: Lua, PHP, Perl

  • Computational thinking: Scratch, Logo

As a co-designer of one of the world's most popular programming languages, one of the more frustrating behaviours I regularly see (both in the Python community and in others) is influential people trying to tap into fears of "losing" to other open source communities as a motivating force for community contributions. (I'm occasionally guilty of this misbehaviour myself, which makes it even easier to spot when others are falling into the same trap).

27 种语言

  • 过程型编程语言: C, Rust, Cython

  • 面向对象数据建模语言: Java, C#, Eiffel

  • C 的面向对象衍生语言: C++, D

  • 面向数组的数据处理: MATLAB/Octave, Julia

  • 统计数数据分析: R

  • 计算型管道建模: Haskell, Scala, Clojure, F#

  • 事件驱动编程: JavaScript, Go, Erlang, Elixir

  • 渐变类型: TypeScript

  • 动态元编程: Hy, Ruby

  • 实用问题解决: Lua, PHP, Perl

  • 计算型思维: Scratch, Logo

作为这个世界上最流行的编程语言之一的合作设计者,我经常遇到一种令人非常沮丧的行为( Python 社区和其它领域中都存在)就是社区中有影响力的人尝试去在其它开源社区中灌输对于”缺失“的恐惧感,并以此驱动别人对本社区做出贡献(我自己偶尔也会做出这样不当的行为,当别人掉进这个陷阱时我也更容易觉察出来)。

While learning from the experiences of other programming language communities is a good thing, fear based approaches to motivating action are seriously problematic, as they encourage community members to see members of those other communities as enemies in a competition for contributor attention, rather than as potential allies in the larger challenge of advancing the state of the art in software development. It also has the effect of telling folks that enjoy those other languages that they're not welcome in a community that views them and their peers as "hostile competitors".

In truth, we want there to be a rich smorgasboard of cross platform open source programming languages to choose from, as programming languages are first and foremost tools for thinking - they make it possible for us to convey our ideas in terms so explicit that even a computer can understand them. If someone has found a language to use that fits their brain and solves their immediate problems, that's great, regardless of the specific language (or languages) they choose.

虽然借鉴其他编程语言社区的经验是一件好事,但用基于恐惧的方法来推动行动有很大问题,社区成员为了吸引代码贡献者的注意,容易把其他社区的成员视为竞争对手,而不是作为潜在的盟友共同迎接挑战,推动软件开发技术的进步。还会导致社区排斥那些喜欢其他编程语言的人,把他们当做敌人。

事实上,我们希望有更丰富的跨平台开源编程语言可供选择,编程语言是最重要的思维工具,可以把我们的想法转换成计算机能理解的明确的条款。如果人们发现了某种语言既适合他们的大脑又能直接解决问题,这就很好了,不必关心他们到底选的是那种语言。

So I have three specific requests for the Python community, and one broader suggestion. First, the specific requests:

  1. If we find it necessary to appeal to tribal instincts to motivate action, we should avoid using tribal fear, and instead aim to use tribal pride. When we use fear as a motivator, as in phrasings like "If we don't do X, we're going to lose developer mindshare to language Y", we're deliberately creating negative emotions in folks freely contributing the results of their work to the world at large. Relying on tribal pride instead leads to phrasings like "It's currently really unclear how to solve problem X in Python. If we look to ecosystem Y, we can see they have a really nice approach to solving problem X that we can potentially adapt to provide a similarly nice user experience in Python". Actively emphasising taking pride in our own efforts, rather than denigrating the efforts of others, helps promote a culture of continuous learning within the Python community and also encourages the development of ever improving collaborative relationships with other communities.

  2. Refrain from adopting attitudes of contempt towards other open source programming language communities, especially if those communities have empowered people to solve their own problems rather than having to wait for commercial software vendors to deign to address them. Most of the important problems in the world aren't profitable to solve (as the folks afflicted by them aren't personally wealthy and don't control institutional funding decisions), so we should be encouraging and applauding the folks stepping up to try to solve them, regardless of what we may think of their technology choices.

  3. If someone we know is learning to program for the first time, and they choose to learn a language we don't personally like, we should support them in their choice anyway. They know what fits their brain better than we do, so the right language for us may not be the right language for them. If they start getting frustrated with their original choice, to the point where it's demotivating them from learning to program at all, then it makes sense to start recommending alternatives. This advice applies even for those of us involved in improving the tragically bad state of network security: the way we solve the problem with inherently insecure languages is by improving operating system sandboxing capabilities, progressively knocking down barriers to adoption for languages with better native security properties, and improving the default behaviours of existing languages, not by confusing beginners with arguments about why their chosen language is a poor choice from an application security perspective. (If folks are deploying unaudited software written by beginners to handle security sensitive tasks, it isn't the folks writing the software that are the problem, it's the folks deploying it without performing appropriate due diligence on the provenance and security properties of that software)

因此我要给 Python 社区提三个具体的要求和一个更广泛的建议,首先说这些要求:

1.当我们想要激励部落成员,提高社区吸引力时,我们不应该使用恐惧法,相反我们应该使用自豪法。当使用恐惧法激励时,比如说这样的话:“如果我们不解决问题 X,那么 Python 开发者将会减少,他们将会转而去使用语言 Y”,那么我们就在故意地向全世界自由贡献代码的人传递负能量。但如果我们使用自豪法,说出来的话将是这样的:“Python 中的问题 X 的确难以解决,看看语言 Y 的社区,他们用一个极好的方法解决了这个问题,我们也可以在 Python 中尝试这个解决方案,以同样优雅的方式解决 Python 中的问题”。积极地强调“以我们自己的努力为自豪”,有利于促进 Python 社区中不断学习的文化,还会不断促进与其他社区关系的发展。

2.克制对其他编程语言社区蔑视的态度,特别是对那些有大牛存在,能自己解决遇到的问题,不必等待商业软件供应商屈尊解决问题的社区。世界上的大多数重要的问题都不是利益驱动的问题(那些人想要解决问题,不是为了谋取财富,也没有机构出钱资助他们),所以我们应该鼓励和赞扬那些加紧尝试解决问题的人。不必管他们使用的是什么技术。

3.如果我们认识的人刚开始学习编程,即使他们所选的编程语言是我们自己所不喜欢的。我们也要支持他们,因为他们比我们清楚什么更适合他们的大脑。所以对我们合适的语言不一定适合他们。如果他们开始对当初的选择感到沮丧,以至于完全打消了他们学习编程的积极性,这时给他们推荐编程语言才更有意义。这个建议甚至也对我们当中做过改进网络安全方面工作的人有用,对于原本不安全的语言,我们的解决方式是,通过改善操作系统中的沙盒功能,渐进地破除这个语言选择障碍,用原生系统的安全属性,改善了编程语言默认行为,不应该从应用安全的角度评价编程语言的好坏,迷惑初学者。(如果有人请编程新手写了一个未经审计的软件,却部署为处理安全敏感的问题,这不是程序员的问题,而应该怪那个部署的人没有尽职调查软件的来源和安全属性。)

My broader suggestion is aimed at folks that are starting to encounter the limits of the core procedural subset of Python and would hence like to start exploring more of Python's own available "tools for thinking".

One of the things we do as part of the Python core development process is to look at features we appreciate having available in other languages we have experience with, and see whether or not there is a way to adapt them to be useful in making Python code easier to both read and write. This means that learning another programming language that focuses more specifically on a given style of software development can help improve anyone's understanding of that style of programming in the context of Python.

我更多的建议是针对人开始遭遇 Python 的核心程序集的境界,也因此开始探索更多的 Python 自身的“思维工具”。

我们做 Python 核心开发过程的一部分事情是由于领会的特点具有在其他语言我们具有优势,是否能够用一种合适的方式让 Python 代码容易读写。这意味着学习别的程序语言能够明确特定的风格,并且在 Python 中编程提高人对软件开发的认识。

To aid in such efforts, I've provided a list below of some possible areas for exploration, and other languages which may provide additional insight into those areas. Where possible, I've linked to Wikipedia pages rather than directly to the relevant home pages, as Wikipedia often provides interesting historical context that's worth exploring when picking up a new programming language as an educational exercise rather than for immediate practical use.

While I do know many of these languages personally (and have used several of them in developing production systems), the full list of recommendations includes additional languages that I only know indirectly (usually by either reading tutorials and design documentation, or by talking to folks that I trust to provide good insight into a language's strengths and weaknesses).

为了有助于这样的努力, 我已经列出了下面可供探索的领域,还有一些对这些领域可能提供额外见解的语言。我尽可能的链接到 Wikipedia 页面而不是直接转向相关的首页,因为维基百科经常会给出一些有趣的历史背景,当选择一门新的编程言作为一项学术型的练习而不是被立即用来实践性使用的时候,这些背景值得去探索。

然而就我个人而言, 我熟悉许多的编程语言(并且已经使用了其中的一些进行开发生产系统) 。所有的推荐包括我间接了解的语言(或通过阅读一些材料和设计文档,又或者是从和我信任的朋友之间的交流中得知一门语言的优势和劣势)。

There are a lot of other languages that could have gone on this list, so the specific ones listed are a somewhat arbitrary subset based on my own interests (for example, I'm mainly interested in the dominant Linux, Android and Windows ecosystems, so I left out the niche-but-profitable Apple-centric Objective-C and Swift programming languages, and I'm not familiar enough with art-focused environments like Processing to even guess at what learning them might teach a Python developer). For a more complete list that takes into account factors beyond what a language might teach you as a developer, IEEE Spectrum'sannual ranking of programming language popularity and growth is well worth a look.

Procedural programming: C, Rust, Cython

Python's default execution model is procedural: we start at the top of the main module and execute it statement by statement. All of Python's support for the other approaches to data and computational modelling covered below is built on this procedural foundation.

本应该有很多的与沿出现在名单之中,但是对于列出来的这些特定的语言只是随意的一些子集,它们从某些程度来讲是基于我自己的兴趣而选出来的(比如说:我主要的兴趣点在于占支配地位的Linux,Android 和 Windows生态系统,所以在这里我就忽略了封闭但是更加有利可图的以 Apple 为中心的 Objective-C 和 Swift 编程语言,而且我对于专注于艺术环境的编程语言就不太了解,如Processing,我甚至需要猜测从其中学到的东西怎么样可以指导一个 Python 开发者)。对于一个更全面的编程语言名单而言需要考虑很多因素,除了考虑一个编程语言能够指导你成为一个开发者外,IEEE Spectrum 的一年一度关于编程语言流行度和增长的排名也非常值得了解一下。

面向过程编程语言 C,Rust,Cython

Python 默认的运行模型是过程型的:我们从主模块的顶部开始然后一句一句执行。所有的 Phthon 对于其他数据和计算模型的方法支持都是基于它是过程型的这一特性。

The C programming language is still the unchallenged ruler of low level procedural programming. It's the core implementation language for the reference Python interpreter, and also for the Linux operating system kernel. As a software developer, learning C is one of the best ways to start learning more about the underlying hardware that executes software applications - C is often described as "portable assembly language", and one of the first applications cross-compiled for any new CPU architecture will be a C compiler

Rust, by contrast, is a relatively new programming language created by Mozilla. The reason it makes this list is because Rust aims to take all of the lessons we've learned as an industry regarding what not to do in C, and design a new language that is interoperable with C libraries, offers the same precise control over hardware usage that is needed in a low level systems programming language, but uses a different compile time approach to data modelling and memory management to structurally eliminate many of the common flaws afflicting C programs (such as buffer overflows, double free errors, null pointer access, and thread synchronisation problems). I'm an embedded systems engineer by training and initial professional experience, and Rust is the first new language I've seen that looks like it may have the potential to scale down to all of the niches currently dominated by C and custom assembly code.

C 语言毫无疑问仍然是底层编程语言的统治者. 它是实现 Python 解释器的核心语言,同样也是实现 Linux 操作系统内核的核心语言。作为软件开发人员,学习 C 语言是学习更多关于软件所运行的底层硬件的最好起点 - C 语言经常被描述为“可移植的汇编语言”,通常使用 C 语言编译器作为交叉编译器,为新的 CPU 体系结构编译出第一个应用程序。

Rust,相比之下, 是一个由 Mozilla 创建的比较新的语言。它能够进入这个名单的原因是,Rust 吸取了工业界已知的关于不能在 C 语言中做什么的教训,并且被设计成可以与 C 库互操作的语言,它对硬件的控制达到了和低级系统编程语言相同的精度,但它使用不同的编译时方法进行数据建模和内存管理,在结构上消除了许多常见的困扰 C 程序的的缺陷(比如缓存溢出、重复释放内存错误、空指针访问以及线程同步问题)。我是一名嵌入式系统工程师,通过培训具备了最初的专业经验,我已经看到,当前被 C 语言和定制汇编代码统治的各个领域很有可能会被 Rust 取代。

Cython is also a lower level procedural-by-default language, but unlike general purpose languages like C and Rust, Cython is aimed specifically at writing CPython extension modules. To support that goal, Cython is designed as a Python superset, allowing the programmer to choose when to favour the pure Python syntax for flexibility, and when to favour Cython's syntax extensions that make it possible to generate code that is equivalent to native C code in terms of speed and memory efficiency.

Learning one of these languages is likely to provide insight into memory management, algorithmic efficiency, binary interface compatibility, software portability, and other practical aspects of turning source code into running systems.

Cython 也是一种默认的更底层的语言,但是与通用目标语言 C,Rust 不同,Cython 主要用于书写 CPython 扩展模块。Cython 被设计作为一个 Python 的超集,让程序员选择何时支持纯 Python 语法的灵活性,当 Cython 语法支持的扩展使其可以生成的代码相当于本地C代码的速度和内存效率。

学习这些语言之一是以实用的角度增强其对内存管理,算法效率,二进制接口兼容性,软件可移植性,将源代码转换成运行系统的深刻理解。

Object-oriented data modelling: Java, C#, Eiffel

One of the main things we need to do in programming is to model the state of the real world, and offering native syntactic support for object-oriented programming is one of the most popular approaches for doing that: structurally grouping data structures, and methods for operating on those data structures into classes.

Python itself is deliberately designed so that it is possible to use the object-oriented features without first needing to learn to write your own classes. Not every language adopts that approach - those listed in this section are ones that consider learning object-oriented design to be a requirement for using the language at all.

面向对象的数据建模: Java, C#, Eiffel

编程中最主要的任务之一是为现实世界的状态建模,这方面最通常的方法是面向对象语言所提供的那些原生的语法支持:把数据结构、操作这些数据结构的方法组合成类。

Python原生设计上就可以直接使用面向对象的特性,而不需要一上来先学习如何编写自己的类。不是每种语言都才有这样的方式 - 对于本节列出的这些语言,学习面向对象的设计思想是使用这些语言的前提。

After a major marketing push by Sun Microsystems in the mid-to-late 1990's,Java became the default language for teaching introductory computer science in many tertiary institutions. While it is now being displaced by Python for many educational use cases, it remains one of the most popular languages for the development of business applications. There are a range of other languages that target the common JVM (Java Virtual Machine) runtime, including the Jython implementation of Python. The Dalvik and ART environments for Android systems are based on a reimplementation of the Java programming APIs.

C# is similar in many ways to Java, and emerged as an alternative after Sun and Microsoft failed to work out their business differences around Microsoft's Java implementation, J++. Like Java, it's a popular language for the development of business applications, and there are a range of other languages that target the shared .NET CLR (Common Language Runtime), including the IronPython implementation of Python (the core components of the original IronPython 1.0 implementation were extracted to create the language neutral .NET Dynamic Language Runtime). For a long time, .NET was a proprietary Windows specific technology, with mono as a cross-platform open source reimplementation, but Microsoft shifted to an open source ecosystem strategyin early 2015.

得益于 Sun Microsystems 在 20 世纪 90 年代中后期对 Java 语言的市场推广,Java 成了很多大专院校计算机科学入门课程的默认语言。虽然现在在很多教育领域它正被 Python 淘汰,但它在商业应用程序开发领域仍然是一种最受欢迎的语言。有一系列其它语言针对公共的 JVM(Java 虚拟机)运行时的实现,包括 Python 的 Jython 实现。Android 系统的 Dalvik 和 ART 环境是基于 Java 编程 API 实现的。

C# 在很多方面与 Java 相似,在 Sun 和 Microsoft 解决关于 J++(微软实现的 Java 语言)和标准 JAVA 不一致的问题失败后,它是作为J++的替代语言出现的。像 Java 一样,它也是一个受欢迎的商业应用开发语言,有一系列其它语言针对共享 .NET CLR(公共语言运行库)的实现,包括 Python 的 IronPython 实现(原始的 IronPython 1.0 中的核心组件被抽取出来创建 .NET 动态语言运行库的中间层)。在很长的一段时间里,.NET是只能在 Windows 系统中使用的专有技术,有一个跨平台的开源代码 mono 重新实现了.NET,但在 2015 年初,微软宣布了 .NET 开源计划。

返回顶部
顶部