一个具有快速能力的原型语言

huangapple go评论96阅读模式
英文:

A prototyping language with the ability to be fast

问题

作为一名具有强大数学背景的工程学生,我在大学里处理一些类似这样的问题:

-(数值)模拟
-人工智能问题
-机器人技术
-控制系统
-还有其他一些

正如你所看到的,有些只是数值问题,而其他一些则需要处理某些符号类型。
目前我正在使用Java进行工作,但我对它不太满意(不能确切地说为什么,可能是个人口味),现在我正在寻找一种编程语言,可以轻松地原型化新算法,例如Python,而不必关心低级细节,但如果需要的话,可以加快速度,例如并发/并行编程等(在Python中编写并在C / C ++中重写不是我首选的选项...)

总结一下:

-易于原型化,但
-加速算法的能力
-语法没有像Java那样的样板代码
-易于阅读的语法(我知道大多数语言都可以实现,但有些语言更鼓励你...)

我在网站上查看了一些,比如http://rosettacode.org/,并选择了2或3个喜欢的语言:Go,Lisp(也许还有Haskell),但欢迎其他推荐。

英文:

as an engineering student with a strong mathemathical background, i dealing some problems like this at university:

  • (numerical) Simulations
  • AI Problems
  • Robotics
  • Control Systems
  • and some more

as you can see some are just numerical ones, others have to process some kinds of symbols.
currently i'm working with java, but i'm not very pleased with it (can't say exactly why, probably a personal taste) and now i'm searching for a programming language, in which i can easily prototype new algorithms, like for example in python, and don't care about low level stuff, but has the ability to speed things up if neccessary, e.g. with concurrent/parallel programming, etc. (writing it in python and rewrite it in C/C++ isn't really a option i prefer...)

to sum it up:

  • easy to prototype, but
  • the ability to speed algorithms up
  • syntax without boilerplate stuff like in java
  • syntax which is easy to read (i know this could be achived with the most, but some language encourage you more...)

i've looked around at sites, like http://rosettacode.org/ and picked 2 or 3 favorites: Go, Lisp (and maybe Haskell) but other recommandations are welcome

答案1

得分: 6

Common Lisp使用SBCL非常快,如果你花时间让它变快的话。

为什么这符合你的需求?

  • 符号计算
  • 良好的数字处理
  • 默认情况下编译为本地代码。
英文:

Common Lisp using SBCL is pretty fast if you take the time to make it fast.

Why does this fit what you want?

  • symbolic computations
  • good number handling
  • compiles to native <s>on demand</s> by default.

答案2

得分: 4

我会使用Python和Cython一起来加速你的代码。对于符号计算,你可以使用http://code.google.com/p/sympy/。

英文:

I would use python together with cython: http://www.cython.org for speeding up your code. For symbolic computations you have http://code.google.com/p/sympy/

答案3

得分: 3

尝试Clojure;它满足您大部分的要求。

  • 使用Java库,编译为Java字节码,并且有Java IDE的插件,因此您对Java及其生态系统的现有知识将会派上用场。

  • 非常简洁、易读,并且非常适合原型开发。

  • 对不同并发策略有很好的支持。

  • 性能正在迅速提高;典型的任务速度与Java相差不大,而慢速任务通常可以通过最小的改动(例如在适当的地方使用Java原生类型提示)来提高速度。

英文:

Try Clojure; it fulfills most of your requirements.

  • Uses Java libraries, compiles to Java bytecode, and has plugins for Java IDEs, so some of your existing knowledge about Java and its ecosystem will come in handy.

  • Very concise, readable, and ease of prototyping is extremely high.

  • Great support for different concurrency strategies.

  • Performance is getting better fast; typical stuff is within a speed factor of 2 of Java, and slow things can typically be made fast with minimally confounding changes (e.g. a few type hints here and there to use Java primitives.)

答案4

得分: 3

一个替代Common Lisp的选择是Scheme的实现。到目前为止,我最喜欢的是Racket。

http://racket-lang.org/

当我开始学习Lisp时,我从Scheme开始,几天内就能够学会它。此外,Racket在Lisp方面是一种相当完整的语言,并且在DrRacket中有一个不错的集成开发环境。

英文:

An alternative to Common Lisp would be a implementation of scheme. My favorite so far is Racket.

http://racket-lang.org/

When I first got into Lisp I started with scheme and ended up being able to learn it within a matter of days. Also Lisp-wise Racket is a pretty complete language and has a decent IDE in DrRacket.

答案5

得分: 2

F#对于原型设计来说是一种非常出色的语言,原因如下:

F#具有交互模式,可以直接评估代码块,而无需编译整个项目。这在原型设计过程中非常有价值。
类型推断有助于保持代码简洁,并且在重构类型层次结构时相对轻松。这在生产代码中可能不是很重要,但在原型设计过程中非常有价值。
F#与.NET的集成使得原型扩展现有产品变得容易。在常见情况下,原型由于时间限制而成为产品,将F#代码集成到.NET产品中也很容易。
如果原型设计在整个开发过程中占据重要地位,那么F#确实可以帮助您加快编码速度。

我认为F#生成的代码不会比其他.NET语言快很多。特别是函数式编程风格,尤其是纯度(无副作用),可以应用于其他编程语言,这意味着在其他语言中编写并发程序同样容易。然而,在F#中这样做会“感觉更自然”。

F#具有Option类型,可以用来替代null值。在编译时可以保证代码对于空指针异常的可靠性,这是一个巨大的优势。

最后,请注意F#仍在开发中,并存在一些问题,其中一些问题可能会随着时间的推移而消失,但并非全部。请参考devhawk和Oliver Sturm在此问题上的观点(特别是关于线性作用域和相互依赖的类,其他问题如重载、更好的Visual Studio集成已经得到解决)。

这在文章中有所提及:https://stackoverflow.com/questions/328329/why-should-i-use-f

作者:JOH

英文:

How about F#?

F# is a remarkable language for prototyping for the following reasons:

F# has an interactive mode allowing you to evaluate blocks of code directly, without compiling your entire project.
Type inference helps keep code small, and makes refactoring your type hierarchy relatively painless. This may not be so important in production code, but I found that to be very valuable during prototyping.
F# integration with .NET makes it easy to prototype extensions of your existing products. In the all-too-common case when a prototype becomes a product (due to time constraints), it's also easy to integrate your F# code within your .NET product.
If prototyping makes up a significant part of your overall development process, then F# can really help you speed up your coding.

I don't think F# will produce code that is significantly faster than other .NET languages. The functional style of programming, in particular purity (no side-effects), can be applied to other programming languages, meaning it is just as easy to write concurrent programs in other languages as well. It does however "feel more natural" to do so in F#.

F# has the Option type, which can be used in place of null values. Code reliability with respect to null-pointer exceptions can be guaranteed at compile time, which is a huge benefit.

Finally, be advised that F# is still in development, and suffers issues, some of which may disappear over time, but not all. See for instance what devhawk and Oliver Sturm have to say about it (in particular about linear scoping and interdependent classes, other issues like overloading, better Visual Studio integration have already been addressed).

this is stated in article: https://stackoverflow.com/questions/328329/why-should-i-use-f

by JOH

huangapple
  • 本文由 发表于 2011年9月10日 02:44:27
  • 转载请务必保留本文链接:https://go.coder-hub.com/7366093.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定