`
tibaloga
  • 浏览: 868679 次
文章分类
社区版块
存档分类
最新评论

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

 
阅读更多
译者按: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

    The cons of Lua are as follows:Lua的不足:· The documentation has improved b

    用Python,Lua和Ruby语言设计游戏-Game.Programming.with.Python.Lua.And.Ruby.

    将教你如何使用游戏界中的三款主流脚本语言进行游戏编程。 从深层次阐述Python、Lua和Ruby这三种解释性脚本语言和用它们编写的游戏。

    用Python,Lua和Ruby语言设计游戏

    译者按:Python、lua和ruby在C/C++是日渐式微的情况下,在java/.net的围歼中努力抗争的三个当红小生。在Tom Gutschmidt的著作《Game Programmng with Python, Lua and Ruby》一书中,介绍了三种语言在游戏中的应用,...

    游戏脚本语言(ruby初步)

    了解游戏脚本编程的基础,初步了解ruby的语法和基本用法。联系python和lua(WOW用到的脚本语言),让你透视脚本语言的奥秘!

    最好用的Lua,Python,Perl,Ruby,NSIS开发编辑器

    最好用的Lua脚本开发编辑器还支持Python,Perl,Ruby,NSIS

    Lua开发包 for Script.NET V2.1.1

    Script.NET是蓝蚂蚁工作室开发的一套用于Tcl/Python/Ruby/Lua/NSIS 等脚本语言开发的集成开发环境,刚刚发布的2.1.1版本新增了Ruby脚本的支持,可以支持Ruby脚本的开发、调试、生成可执行文件、控制台等功能,可以...

    Script.NET脚本语言开发平台2.1.1版本

    Script.NET是蓝蚂蚁工作室开发的一套用于Tcl/Python/Ruby/Lua/NSIS 等脚本语言开发的集成开发环境,刚刚发布的2.1.1版本新增了Ruby脚本的支持,可以支持Ruby脚本的开发、调试、生成可执行文件、控制台等功能,可以...

    为 SciTE 添加右键打开 (支持38种文件格式)

    后来根据一些文件格式的特性(如python,ruby,perl,xml, css等文件格式),又手动修改了注册表的添加位置,亲测成功! 使用方法: 解压后直接双击,该点确定点确定,该点ok点ok,无需重启,直接生效。 附上所...

    Ruby开发包 for Script.NET V2.1.1

    Script.NET是蓝蚂蚁工作室开发的一套用于Tcl/Python/Ruby/Lua/NSIS 等脚本语言开发的集成开发环境,刚刚发布的2.1.1版本新增了Ruby脚本的支持,可以支持Ruby脚本的开发、调试、生成可执行文件、控制台等功能,可以...

    starcore_for_winuwp.3.5.0.zip

    CLE(Common Language ...•支持telnet客户端,可以直接使用lua/python/ruby脚本与CLE交互. •为多种脚本语言提供统一和规范的访问接口 •支持delphi. 上传的资源为CLE for Windows10 UWP,内涵帮助文档和Examples

    为 SciTE 添加右键打开 (共38中文件)

    即使是图片,音乐和视频文件,也有 '用SciTE打开' 的右键菜单,我感觉很不智能,则写脚本,生成了对38种文件格式(包括: c,cpp, python, perl, ruby, e, lua, xml)才会有 'Edit with SciTE' 这个右键菜单的注册表...

    gvim 7.4.110 for Windows 64 位,带 +lua 及 Lua 库(开箱即用)

    脚本语言支持有:Python 2.7、Python 3.3、Ruby 2.0.0、Lua 5.2(只需要能找到 lua52.dll 文件已经自带 lua52.dll 文件,方便各位使用 neocomplete 插件)。 md5sum: 1acd40c636111e838e0ec20792c04ff3 VIM - Vi ...

    Programming_In_Lua.doc(word版本,带完整文档结构图)

    除了Lua外,还有很多类似的脚本语言,例如:Perl、Tcl、Ruby、Forth、Python。虽然其他语言在某些方面与Lua有着共同的特色,但下面这些特征是Lua特有的: ① 可扩展性。Lua的扩展性非常卓越,以至于很多人把Lua用作...

    Tcl开发包 for Script.NET V2.1.1

    Script.NET是蓝蚂蚁工作室开发的一套用于Tcl/Python/Ruby/Lua/NSIS 等脚本语言开发的集成开发环境,刚刚发布的2.1.1版本新增了Ruby脚本的支持,可以支持Ruby脚本的开发、调试、生成可执行文件、控制台等功能,可以...

    NSIS开发包 for Script.NET V2.1.1

    Script.NET是蓝蚂蚁工作室开发的一套用于Tcl/Python/Ruby/Lua/NSIS 等脚本语言开发的集成开发环境,刚刚发布的2.1.1版本新增了Ruby脚本的支持,可以支持Ruby脚本的开发、调试、生成可执行文件、控制台等功能,可以...

    Script.NET python 开发包

    编辑、调试、运行tcl、python、perl、ruby、lua脚本; 脚本的编译/加密和生成可执行文件(每种脚本语言支持的程度不同); 效率分析等辅助功能(目前只有tcl、perl脚本支持了此功能); 关键字帮助,通过F1键或...

    Android脚本语言环境SL4A.zip

    ASE目前支持Python,Lua和 BeanShell,未来将加入对Ruby和JavaScript的支持。示例代码require "android"android.startSensing()android.sleep(1) --Give the sensors a moment to come online.silent = ...

    mpkg:从Shell脚本管理软件包

    因此,它不需要任何额外的异国情调的解释如Python和Ruby,LUA ... mPKG使用任何POSIX系统中随附的标准实用程序,例如sh , grep , tar , wget和awk 。 这使mPKG适用于通常嵌入嵌入式设备,该设备以单个二进制文件...

Global site tag (gtag.js) - Google Analytics