是否有任何静态类型的功能语言? [英] Are there any statically-typed functional languages?

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

问题描述

我来自静态类型的背景并正在研究函数式编程,但是我对动态类型并不完全满意.我很好奇那里有什么样的选择.

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

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

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

推荐答案

有很多.想起了Haskell,OCaml和F#.如果您是Windows开发人员,则F#非常好,并且受到Microsoft(非常强大的StackOverflow社区)的大力支持. Lisp家族语言(Common Lisp,Scheme,Clojure)是动态功能语言的示例.

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具有可选的静态类型.另一方面,Haskell,OCaml和F#编译器使用类型推断来确定性地推断类型.当您第一次查看用OCaml编写的代码时,缺少显式类型使它看起来像是动态类型语言,而静态类型的类型安全性却使它们看起来杂乱无章.我认为动态语言的可选静态类型(一个好主意)最终将被类型推断所取代,并且从现在起10年后,静态与动态辩论将成为现实.

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天全站免登陆