一种具有快速能力的原型设计语言
作为一名具有强大数学背景的工科学生,我在大学处理一些这样的问题:(
- 数值)模拟
- 人工智能问题
- 机器人
- 控制系统
- 等等,
正如你所看到的,有些只是数值问题,其他必须处理某些类型的符号。 目前我正在使用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
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
如果你花时间让它变得更快的话,使用 SBCL 的 Common Lisp 是相当快的。
为什么这符合你想要的?
按需。Common Lisp using SBCL is pretty fast if you take the time to make it fast.
Why does this fit what you want?
on demandby default.我将 python 与 cython 一起使用: http://www.cython.org 来加速你的代码。对于符号计算,您有 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/
尝试 Clojure;它满足您的大部分要求。
使用 Java 库,编译为 Java 字节码,并具有 Java IDE 插件,因此您有关 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.)
Common Lisp 的替代方案是计划的实现。到目前为止我最喜欢的是 Racket。
http://racket-lang.org/
当我第一次接触 Lisp 时,我从方案开始,最终成为几天之内就能学会。此外,Lisp-wise Racket 是一种相当完整的语言,并且在 DrRacket 中有一个不错的 IDE。
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.
F# 怎么样?
F# 是一种出色的原型语言,原因如下:
F# 具有交互模式,允许您直接评估代码块,而无需编译整个项目。
类型推断有助于保持代码较小,并使重构类型层次结构相对轻松。这在生产代码中可能并不那么重要,但我发现这在原型设计过程中非常有价值。
F# 与 .NET 的集成使您可以轻松地对现有产品进行原型扩展。在原型成为产品(由于时间限制)的常见情况下,将 F# 代码集成到 .NET 产品中也很容易。
如果原型制作是整个开发过程的重要组成部分,那么 F# 确实可以帮助您加快编码速度。
我认为 F# 生成的代码不会比其他 .NET 语言快得多。编程的函数式风格,特别是纯粹性(无副作用),可以应用于其他编程语言,这意味着用其他语言编写并发程序也同样容易。然而,在 F# 中这样做确实“感觉更自然”。
F# 具有 Option 类型,可以用来代替空值。可以在编译时保证代码针对空指针异常的可靠性,这是一个巨大的好处。
最后,请注意,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