`
pundit
  • 浏览: 231478 次
  • 性别: Icon_minigender_1
  • 来自: 火星
社区版块
存档分类
最新评论

微软干对了,联合语言框架

阅读更多

前言:没有一种语言能适合所有的用途。

 

谷歌高管Rob Pike 在OSCON 开源大会上打开了简化式编程语言新议题 今天的商业级编程语言--尤其是C++和Java--太过复杂而不能与今日计算环境充分相容。谷歌资深工程师Rob Pike 在周四于O'Reilly开源大会上的一次谈话中发表了以上论点。


(Rob Pike, Go语言创始人,AT&T Bell Lab前Member of Technical Staff,现在google研究操作系统。罗伯伯是Unix的先驱,是贝尔实验室最早和Ken Thompson以及Dennis M. Ritche开发Unix的猛人,UTF-8的设计人。)

“我觉得这些语言太难用了,太精细,太复杂,太冗长。而且这些缺点似乎在与日俱增,”Pike说,“它们被过度接受,被用得太广了。”

Pike详细说明了此类语言的缺点,以此展开描述了他和其它谷歌工程师对所开发的名叫Go的新编程语言所持的期望。

为了证实此类语言的复杂性,Pike展示了一些C++代码示例。其中一例是一个几乎占据了屏幕整行的变量声明。

“我们怎么能让这种东西成为在学校里教、在产业里被使用的操控计算机的标准方式?”他问道。这种语言“太官僚了(制度化)。每一步都必须要考虑编译是否可通过,”他说。

尽管Pike承认他自己有点爱开玩笑,他声明说此类问题确实应该被提及。C++出现是因为人们对使用低级语言C绝望,Java出现是为了简化C++。随着时间的推移,新的特性都加在了新出现的二者之上,使它们越来越复杂了。

“成熟(复杂)会带来噪音(不可预知不被期望的错误),”他补充说。

Pike还说,此类语言还是在多核处理器和网络被广泛应用等大的事物出现之前被开发出来的,因此它们不能简单地与这些新环境相容。

Pike并不是谷歌唯一一个表达对传统商业级编程语言不满的人。

在上个月的USENIX 年度会议上,Gmail工程师Adam de Boor 出语惊动了与会者。他说,公司的Gmail服务完全是由JavaScript写的,总代码全长443,000行,全部手写。

他指出,尽管Java更具有表达性,它也更加繁琐。“在这个节骨点上,对我来说所使用语言的选择问题是一个大问题,”de Boor说。

JavaScript是为避免C++和Java不断增长的复杂性,而在过去十年里被开发出来的一批语言中的一支。其它支还包括Ruby和Python。但是尽管有了一个简化了的语法,这类语言也同样有它的弱点,他论证道。

这类新语言要慢一些,伸缩性较差,还隐藏了更多的错误,Pike详尽地描述道。

这类语言多为解释型而非编译型,它意味着用这类语言写的程序在运行前是没被编译过的,因此运行的缓慢得多。它们也倾向于使用动态数据类型,即程序员无需定义他们变量所属的数据类型。

“动态数据类型并不见得好。本来你可以在编译时找出的错误的,它(动态数据类型)让你只能在运行时找出错误,”他说。

借着这些观点,Pike接下来描述了作为融合两类语言集各自优点的一个大胆尝试--Go语言。“Go是把静态数据类型语言的安全与效率和动态数据类型解释型语言的方便与轻松结合起来的一个尝试,”他说,“它到底能做多少,还得你亲自去尝试了才知道。”

与会人员Larry Augustin, 客户关系管理软件提供商SugarCRM的CEO对Pike所指出的C++和Java变得太复杂了的观点表示赞同,尽管他也说这是在一切为应对广泛应用需求而发展的语言身上所发生着(了)的。

“这些语言在复杂度上增长的原因是,它们用得越多,我们就会发现越多的错误和二义性,然后为消除这些错误和二义性而做的工作又创造出了一些更复杂的东西出来,”具有软件工程和程序语言设计背景的Augustin这么说。

“我很欣赏你们的目标,”他谈及Pike等人的努力时这么说。“问题是他能否达成那一目标,抑或是在被越来越多人用之后,它也会变得很复杂,”Augustin说。

 

原文:

July 22, 2010

Google executive frustrated by Java, C++ complexity

Google's Rob Pike makes the case for simpler programming languages at the OSCON open source conference

| Print | 5 comments|

Today's commercial-grade programming languages -- C++ and Java, in particular -- are way too complex and not adequately suited for today's computing environments, Google distinguished engineer Rob Pike argued in a talk Thursday at the O'Reilly Open Source Conference.

Pike made his case against such "industrial programming languages" during his keynote at the conference in Portland, Oregon.

[ Keep up with app dev issues and trends with InfoWorld's Fatal Exception and Strategic Developer blogs. ]

"I think these languages are too hard to use, too subtle, too intricate. They're far too verbose and their subtlety, intricacy and verbosity seem to be increasing over time," Pike said. "They're oversold, and used far too broadly."

Pike detailed the shortcomings of such languages as a way of describing the goals that he and other Google engineers have for a new programming language they developed, called Go.

As an illustration of the complexity of such languages, Pike showed a few examples of C++ code. One example was of a variable declaration that stretched nearly across an entire line of the screen.

"How do we have stuff like this [get to be] the standard way of computing that is taught in schools and is used in industry?" he asked, rhetorically. This sort of programming "is very bureaucratic. Every step must be justified to the compiler," he said.

While Pike admitted that he was being somewhat facetious, he asserted that such questions still should be asked. C++ came about because of people's frustration with working with the low-level C language, and Java came about as a way to simplify C++. Over time, however, new features were added to both languages, making them more and more complex.

"Noise comes with sophistication," he said.

Pike also added that such languages were developed before the advent of multicore processing and widespread networking, so they don't easily accommodate these new environments.

Pike is not the lone Google employee expressing dissatisfaction with traditional commercial-grade languages.

At the USENIX annual conference last month, Gmail engineer Adam de Boor surprised the audience by noting that the company's Gmail service was written entirely in JavaScript, and that all of its code, around 443,000 lines worth, was written by hand.

He noted that while Java is more expressive, it is also more verbose. "At this point to me it's a matter of choice which language you use," de Boor said.

JavaScript is one of a whole batch of languages -- others include Ruby and Python -- that have been developed over the past 10 years in response to the growing complexity of C++ and Java. But while having a simpler syntax, such languages have their drawbacks as well, he argued.

These new languages tend to be slower, don't scale as well, and can harbor more errors, Pike elaborated.

The languages tend to be interpreted rather than compiled, meaning the programs written in such languages aren't compiled before running, so tend to run slower as a result. They also tend to be dynamically typed, meaning programmers don't need to specify what type of data their variables will hold.

"Dynamic typing is not necessarily good. You get static errors at run time which you really should be able to catch at compile time," he said.

With all this in mind, Pike then described Go as an attempt to fuse the best attributes of both sets of languages.

"Go is an attempt to combine the safety and performance of statically typed languages with the convenience and fun of dynamically typed interpretative languages," he said, before adding, "to the extent that it succeeds you'll have to judge for yourself."

One member of the audience, Larry Augustin, the CEO of customer relationship management software provider SugarCRM, agreed with Pike's assessment that C++ and Java have gotten too complex, although he noted that this typically happens with all languages as they grow to meet a wider range of use cases.

"The reason that these languages have grown in complexity is because the more they are used, the more errors and ambiguities we've found, and the attempts to remove those ambiguities and errors have created something more complex," said Augustin, who has a background in software engineering and programming language design.

"I appreciate his goal," he said of Pike's efforts. "The question is can he achieve his target result? or does Go [become more complex] as more people use it," Augustin said.

Joab Jackson covers enterprise software and general technology breaking news for The IDG News Service. Follow Joab on Twitter at @Joab_Jackson. Joab's e-mail address is Joab_Jackson@idg.com

参考文章

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics