Python、Lua和Ruby比较——脚本语言大P.K.

时间:2021-08-11 00:19:02
译者按:Python、lua和ruby在C/C++是日渐式微的情况下,在java/.net的围歼中努力抗争的三个当红小生。在Tom Gutschmidt的著作《Game Programmng with Python, Lua and Ruby》一书中,介绍了三种语言在游戏中的应用,其中尤为了不起的是在书中最后一章中比较了三种脚本,作者没有说孰优孰劣,但是读者你认为呢?欢迎留言讨论。
本文最初发表于恋花蝶的博客http://blog.csdn.net/lanphaday,欢迎转载,但敬请保持全文完整。
 
Python versus Lua Versus Ruby
Python、Lua和Ruby——脚本大P.K.
Tom Gutschmidt 著
 
So which of the three languages is the best to use on your project? That depends a great deal on what you want to accomplish. To wrap up the book, I've outlined some of the pros and cons of each language in this section.
这三种语言中的哪一种更合适你的项目?很大程度取决于你想达到什么样的目标。作为一书的结尾,在这一节里,我会描述一下它们各自的优点和不足。
Python Pros and Cons
Python的优点和不足
The pros of Python are as follows:
Python的优点如下:
·         Python has more extension modules than the other languages.
·         Python比其它语言有更多扩展模块。
·         Many online Python tutorials exist. There are also plenty of English books and reference materials, many sample scripts exist online, and there is a wealth of introductory material. The Python.org Website is a good place to start looking for these because it has sections for beginners, tutorials, guides organized by topic, and lists of links and references.
·         在网上可以找到很多Python教程。不仅如此,还有大量的英文书籍和资料。Python.org有很多为初学者准备的依主题组织的资料、教程和编程指南,此外还有很多链接和参考。
·         Most folks really enjoy the syntax of the Python language because it appears clean and is easy to read.
·         很多人都喜欢Python语言的语法,因为它清晰易读。
·         Python has an edge where libraries are concerned. There are many libraries, and, for the most part, they are well documented.
·         Python在支持库上大占优势,因为它有很多库,而且大部分都有完善的文档支持。
·         Lots of tools that tie into Python are available, and they are often easier to find than the tools for Lua and Ruby.
·         很多工具可以用于Python,但难以找到适用于Lua和Ruby的。
The cons of Python are as follows:
Python的不足:
·         Existing Python debuggers are considered quirky and slow. Debugging support on Macintosh and consoles is even weaker.
·         现有的Python调试器诡异而且效率低下。在Macintosh(苹果计算机)和控制台下进行调试是一个梦魇。
·         It can be difficult to bundle Python with other languages. There are lots of binary DLLs, and Python has (compared to the other languages) a large standard distribution.
·         Python难以与其它语言集成,它有太多的二进制DLL,而且Python带了巨大的标准发布包。
·         Lots of folks really dislike the white space sensitivity of Python syntax.
·         同样的,也有很多人不喜欢Python对空白符敏感的语法。
·         Python can be quite slow at times, as everything is an object on the heap.
·         因为堆上的任何东西都是对象,所以Python有时候会慢得难以忍受。
Lua Pros and Cons
Lua的优点和不足
The pros of Lua are as follows:
Lua的优点:
·         Lua is probably the fastest of the three languages and usually uses the least amount of runtime memory.
·         Lua在这三种语言中是运行时速度最快而且占内在最少的。
·         Lau has the smallest memory footprint for bundling.
·         集成Lua只会增加极少的内存占用率。
·         The Lau C API is very well documented and has good examples for integrating with C.
·         Lua的C API有着完备着文档和很好的例子,可以容易地通过C集成在软件里。
The cons of Lua are as follows:
Lua的不足:
·         The documentation has improved but is still a bit sketchy overall. Of the three languages, Lua it is probably the least documented (the API being the exception), with the least amount of code comments. This makes for the largest ramp-up time to learn, and there isn't much in the way of introductory Lua material.
·         尽管Lua的文档已经增进不少,但仍然有所不足。三种语言中,Lua可能是文档最少的(API方面是个例外),因为代码中极少注释,这也增加了学习的难度。另外,对Lua的本质也没有什么介绍。
·         There isn't a lot of built-in functionality for Lua. There is little support if you need to create a large, complex application.
·         Lua内建的功能很少,并没有对创建大型的复杂应用程序提供足够支持。
·         Lua could use a better garbage collectorthe current development is moving towards that now. Right now, Lua GC uses a very simple and traditional simple mark and sweep.
·         Lua应该使用更好的垃圾收集机制,Lua现在的GC仍然使用非常简单而且传统的“标记和清除”方式。
Pros and Cons of Ruby
Ruby的优点和不足
The pros of Ruby are as follows:
Ruby的优点:
·         Ruby possesses fairly good advanced debuggers.
·         Ruby有极好的高级调试器。
·         Ruby is object oriented from the ground up, and programmers who are OOP enthusiasts or who are used to the OOP paradigm will find the language extremely comfortable.
·         Ruby是最彻底的面向对象语言,对于OOP*者和惯于使用OOP范式的程序员,他们将会发现Ruby是最适合他们的语言。
·         Ruby has arguably the simplest syntax, with no real rules exceptions. Especially true for OOP enthusiasts.
·         Ruby的语法极为简单,没有让人出乎意料规则,特别适合OOP行家的习惯。
The cons of Ruby are as follows:
Ruby的不足:
·         Lack of English documentation.
·         英文文档极度缺乏。
·         Fewer existing works and samples for games than with the other languages.
·         与其它语言相比,在游戏方面所作的工作和实例都少得多。

Python、Lua和Ruby比较——脚本语言大P.K.的更多相关文章

  1. 常用脚本语言Perl,Python,Ruby,Javascript一 Perl,Python,Ruby,Javascript

    常用脚本语言Perl,Python,Ruby,Javascript一 Perl,Python,Ruby,Javascript Javascript现阶段还不适合用来做独立开发,它的天下还是在web应用 ...

  2. Vim技能修炼教程(12) - Vim的脚本语言支持

    Vim的脚本语言支持 本节开始,我们正式接触vimscript这门古老的脚本语言. 首先要说明,vim支持的扩展语言很多,比如python, python3, ruby, lua,tcl等常见脚本语言 ...

  3. 1.1 Python是一种什么样的语言

    小时不识月,呼作白玉盘.很多人习惯地说Python不过是一种脚本语言而已,实际上这种说法是非常不准确的,完全不能体现出Python的强大.严格来说,Python是一门跨平台.开源.免费的解释型高级动态 ...

  4. python是强类型还是弱类型语言

    几句话了解python特性 Python 是强类型的动态脚本语言 好多人对python到底是强语言类型还是弱语言类型存在误解,其实,是否是强类型语言只需要一句话就可以判别, 强类型:不允许不同类型相加 ...

  5. Python、Lua和Ruby——脚本大P.K.

    转自Python.Lua和Ruby--脚本大P.K. Python versus Lua Versus Ruby Python.Lua和Ruby--脚本大P.K. Tom Gutschmidt 著 赖 ...

  6. Python、Lua和Ruby三大语言脚本哪家强?

    这三种语言中的哪一种更合适你的项目?很大程度取决于你想达到什么样的目标.作为一书的结尾,在这一节里,我会描述一下它们各自的优点和不足.   Python的优点和不足 Python的优点如下: 1. P ...

  7. Perl,Python,Ruby,Javascript 四种脚本语言比较

    Perl 为了选择一个合适的脚本语言学习,今天查了不少有关Perl,Python,Ruby,Javascript的东西,可是发现各大阵营的人都在吹捧自己喜欢的语言,不过最没有争议的应该是Javascr ...

  8. Python、Lua和Ruby之优劣

    Python.Lua和Ruby之优劣 Python Python的优点:1.Python比其它语言有更多扩展模块.2.在网上可以找到很多Python教程.不仅如此,还有大量的英文书籍和资料.Pytho ...

  9. Ruby(面向对象程序设计的脚本语言)入门

    Ruby是一种为简单快捷的面向对象编程(面向对象程序设计)而创的脚本语言. 简单介绍 Ruby 是开源的,在Web上免费提供,但须要一个许可证. Ruby 是一种通用的.解释的编程语言. Ruby 是 ...

随机推荐

  1. MVC4 WebAPI POST数据问题

    api [HttpPost] public string PostAvartos(Test model) { if (model != null) { LoggerHelper.WriteInfo(m ...

  2. java源代码分析----jvm.dll装载过程

    简述众所周知java.exe是java class文件的执行程序,但实际上java.exe程序只是一个执行的外壳,它会装载jvm.dll(windows下,以下皆以windows平台为例,linux下 ...

  3. UVaLive 7269 Snake Carpet (找规律,模拟)

    题意:给定一个数字n,表示有n条蛇,然后蛇的长度是 i ,如果 i 是奇数,那么它只能拐奇数个弯,如果是偶数只能拐偶数个,1, 2除外,然后把这 n 条蛇, 放到一个w*h的矩阵里,要求正好放满,让你 ...

  4. Android 下拉刷新上拉载入效果功能

    应用场景: 在App开发中,对于信息的获取与演示.不可能所有将其获取与演示,为了在用户使用中,给予用户以友好.方便的用户体验,以滑动.下拉的效果动态载入数据的要求就会出现. 为此.该效果功能就须要应用 ...

  5. 我为什么坚持DBA一定要懂开发

    我为什么坚持DBA一定要懂开发时间 2016-03-23 15:34:08 张碧池的幸福生活原文 http://pottievil.com/我为什么坚持dba一定要懂开发/主题 DBA 数据库最近手头 ...

  6. Redis学习-SortedSet

    Sorted-Sets和Sets类型极为相似,它们都是字符串的集合,都不允许重复的成员出现在一个Set中.它们之间的主要差别是Sorted-Sets中的每一个成员都会有一个分数(score)与之关联, ...

  7. Linux OpenGL 实践篇-3 绘制三角形

    本次实践是绘制两个三角形,重点理解顶点数组对象和OpenGL缓存的使用. 顶点数组对象 顶点数组对象负责管理一组顶点属性,顶点属性包括位置.法线.纹理坐标等. OpenGL缓存 OpenGL缓存实质上 ...

  8. MySQL查询语句报错 sql_mode=only_full_group_by 问题

    升级MySQL到5.7后,查询语句总是报sql_mode=only_full_group_by问题,总结归纳了两种解决方案,推存第二种解决方案. 报错信息: [Err] 1055 - Expressi ...

  9. springBoot项目启动类启动无法访问

    springBoot项目启动类启动无法访问. 网上也查了一些资料,我这里总结.下不来虚的,也不废话. 解决办法: 1.若是maven项目,则找到右边Maven Projects --->Plug ...

  10. mybatis spring boot深入

    [size=large]头一篇博文说了整合了spring boot和mybatis大家都可以对后台数据进行操作但是如何才能进行高效的操作数据库节省代码,下面来一起谈论哈mybatis的通用mapper ...