有静态类型的函数语言吗? [英] are there statically-typed functional languages?

查看:126
本文介绍了有静态类型的函数语言吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我来自一个静态类型的背景并且正在研究函数式编程,但是我知道这是一个非常困难的事情,对动态打字并不完全感兴趣。好奇什么样的选择。



开始的一个答案:ActionScript 3是静态类型的,并提供了一些功能范例,但AS3程序并不经常使用它们。

解决方案

有很多。想起Haskell,OCaml和F#。如果您是Windows开发人员,F#非常好,并得到Microsoft(以及非常强大的StackOverflow社区)的良好支持。 Lisp系列语言(Common Lisp,Scheme,Clojure)是动态函数式语言的例子。

ActionScript 3具有可选的静态类型。另一方面,Haskell,OCaml和F#编译器使用类型推断来确定性地推断类型。当你第一次看到用OCaml编写的代码时,由于缺少显式类型,它使得静态类型安全类型的动态类型语言看起来很杂乱。我认为动态语言的可选静态类型(一个好主意)最终将被类型推断所取代,并且从现在开始的10年静态与动态辩论将毫无意义。

this is a hard thing to google, maybe SO has better answers?

i'm coming from a statically-typed background and investigating functional programming, but i'm not entirely excited about dynamic typing. curious what kind of options are out there.

one answer to start: ActionScript 3 is statically-typed and offers some functional paradigms, though AS3 programs don't often use them.

解决方案

There are many. Haskell, OCaml and F# come to mind. If you are a Windows developer, F# is very nice and is well supported by Microsoft (along with a very strong StackOverflow community). Lisp family languages (Common Lisp, Scheme, Clojure) are examples of dynamic functional languages.

ActionScript 3 has optional static typing. The Haskell, OCaml and F# compilers, on the other hand, use type inference to deterministically infer types. When you first look at code written in OCaml the absence of explicit types gives it the clutter free look of a dynamically typed language with the type safety of static typing. It is my opinion that optional static typing for dynamic languages (a great idea) will eventually be replaced by type inference and that 10 years from now the static versus dynamic debate will be moot.

这篇关于有静态类型的函数语言吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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