安德烈亚斯的实用语言比较 [英] Andreas' practical language comparison

查看:61
本文介绍了安德烈亚斯的实用语言比较的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,


我开始了一点实用的语言比较。 - 实际

在某种意义上我比较实际发行版和版本

及其库(不是抽象语言规范)解决了小的问题
测试用例喜欢8皇后问题。


目前有17种不同语言的贡献,而且对于Phyton(以及Lisp。和Forth。还有很多其他语言)有
无。

如果有人有兴趣做出一些实施,

请看看:

http://www.kochandreas.com/home/language/lang.htm


并将您的代码片段(或评论家)邮寄给我,或将其发布在这里。


非常感谢,

-

Andreas

他尖叫:这是SIG!

Hi all,

i started a little "practical language comparison" - practical
in the sense that i compare how actual distributions and versions
and their libraries (not abstract language specifications) solve small
test cases like the 8 queens problem.

Currently there are contributions for 17 different languages, and
none for Phyton (and Lisp. And Forth. And many others ).
If someone is interested in contributing a few implementations,
please have a look at:

http://www.kochandreas.com/home/language/lang.htm

and mail me your code snippets (or critics) or post them here.

thanks a lot,
--
Andreas
He screamed: THIS IS SIG!

推荐答案

Andreas Koch写道:
Andreas Koch wrote:
我开始了一点实用的语言比较。 - 实际
在某种意义上我比较了实际发行版和版本以及它们的库(不是抽象语言规范)如何解决像8皇后问题这样的小测试案例。

http://www.kochandreas.com/home/language/ lang.htm

并将您的代码片段(或评论家)邮寄给我或在此发布。
i started a little "practical language comparison" - practical
in the sense that i compare how actual distributions and versions
and their libraries (not abstract language specifications) solve small
test cases like the 8 queens problem.

http://www.kochandreas.com/home/language/lang.htm

and mail me your code snippets (or critics) or post them here.




Java的实现冒泡排序不遵循算法的

规范。它无法使用交换

标志来确定何时终止循环。


-Peter



The Java implementation of Bubble Sort doesn''t follow the
specification for the algorithm. It fails to use a "swapped"
flag to determine when to terminate the loop.

-Peter


Andreas Koch写道:
Andreas Koch wrote:
我开始了一点实用的语言比较。 - 实际
在某种意义上我比较了实际发行版和版本以及它们的库(不是抽象语言规范)如何解决像8皇后问题这样的小测试案例。
如果有人有兴趣做出一些实施,
请看看:

http:/ /www.kochandreas.com/home/language/lang.htm

并将您的代码片段(或评论家)邮寄给我,或将其发布在此处。
i started a little "practical language comparison" - practical
in the sense that i compare how actual distributions and versions
and their libraries (not abstract language specifications) solve small
test cases like the 8 queens problem.

Currently there are contributions for 17 different languages, and
none for Phyton (and Lisp. And Forth. And many others ).
If someone is interested in contributing a few implementations,
please have a look at:

http://www.kochandreas.com/home/language/lang.htm

and mail me your code snippets (or critics) or post them here.




你可能想更多地考虑一下你在那里提供信息的方式。就目前而言,似乎很可能会严重影响人们制作尽可能短的节目,而不是最可读或最典型的节目。

a给定的语言。


此外,即使你留下行数,不同的语言

(和人)通常以不同的方式计算行数。例如,

C计数分号和逗号的一些行计数程序

而不是换行符,因为它们更接近代表

*语句*的数量,当你在思考代码行时,这就是

时间的大部分时间。


我发送了基于算法的冒泡排序,但是如果这只是一场最少的比赛,那我就不打算花更多的时间来打扰更多,

自第一个人到发布一些Perl会赢(虽然K

似乎已准备好在该区域进行激烈的竞争,

如果当前列表有任何迹象)。


-Peter



You might want to put a little more thought into the way you
present the information there. As it stands, it appears likely
to heavily influence people to produce the shortest possible
programs, rather than the most readable or even most typical for
a given language.

Also, even if you leave the line counts in, different languages
(and people) typically count lines differently. For example,
some line-counting programs for C count semicolons and commas
rather than newlines, as these are closer to representative of
the number of *statements*, and that''s what matters most of the
time when you are thinking "lines of code".

I sent bubble sort, based on the algorithm, but I''m not going
to bother with more if this is simply a fewest-lines competition,
since the first person to post some Perl will win (although K
appears to be ready to give tight competition in that area,
if the current list is any indication).

-Peter


Peter Hansen写道:

Peter Hansen wrote:

冒泡排序的Java实现没有遵循算法的
规范。它没有使用交换
标志来确定何时终止循环。
The Java implementation of Bubble Sort doesn''t follow the
specification for the algorithm. It fails to use a "swapped"
flag to determine when to terminate the loop.




谢谢Peter - 快速解决方案我纠正了问题

我自己(以及更正的排序顺序),并添加了你的

python示例。

-

Andreas

他尖叫:这是SIG!



Thanks Peter - for a quick solution i corrected the problem
myself (and corrected sort order, too), and added your
python examples.
--
Andreas
He screamed: THIS IS SIG!


这篇关于安德烈亚斯的实用语言比较的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆