Haskell 之后该学什么语言?

发布于 2024-09-24 23:04:45 字数 1665 浏览 3 评论 0原文

作为我的第一门编程语言,我决定学习 Haskell。我是一名分析哲学专业的学生,​​Haskell 让我能够快速、正确地创建感兴趣的程序,例如自然语言解析转换器、定理证明器和解释器。尽管我只进行了两个半月的编程,但我发现 Haskell 的语义和语法比更传统的命令式语言更容易学习,并且(现在)对其大部分结构感到满意。

然而,用 Haskell 编程就像巫术,我想拓宽我的编程知识。我想选择一种新的编程语言来学习,但我没有足够的时间来选择任意一种语言,然后放弃它,然后重复。所以我想我应该在这里提出这个问题,以及关于我正在寻找的语言类型的一些规定。有些是主观的,有些是为了简化从 Haskell 的过渡。

  • 强类型系统。在 Haskell 编程中我最喜欢的部分之一是编写类型声明。这有助于构建我对各个功能及其与整个程序的关系的想法。它还使非正式地推理我的程序的正确性变得更加容易。我关心的是正确性,而不是效率。
  • 强调递归而不是迭代。我在 Haskell 中使用迭代构造,但以递归方式实现它们。然而,理解递归函数的结构比理解复杂的迭代过程要容易得多,特别是在使用组合器和高阶函数(如映射、折叠和绑定)时。
  • 学习有收获。 Haskell 是一种有益的工作语言。这有点像阅读康德。然而,我几年前使用 C 的经历却并非如此。我不是在寻找 C。该语言应该强制执行一个概念上有趣的范例,而在我完全主观的观点中,C 语言之类的人则没有。

权衡答案:当然,这些只是注释。我只想回复所有给出正确答复的人。你非常有帮助。

1)一些回复表明,强调递归的强静态类型语言意味着另一种函数式语言。虽然我想继续与 Haskell 密切合作,但 camccann 和 larsmans 正确地指出,另一种这样的语言会“过于轻松地过渡”。这些评论非常有帮助,因为我不想用 Caml 编写 Haskell!在证明助手中,Coq 和 Agda 看起来都很有趣。特别是,Coq 将为构造逻辑和形式类型理论提供扎实的介绍。我花了一点时间研究一阶谓词和模态逻辑(Mendellsohn、Enderton、Hinman 的一些),所以我可能会从 Coq 中获得很多乐趣。

2) 其他人则非常青睐 Lisp(Common Lisp、Scheme 和 Clojure)。据我所知,Common Lisp 和 Scheme 都有出色的入门材料(On LispThe Reasoned SchererSICP)。 SICP中的材料让我倾向于Scheme。特别是,通过 SICP 的方案将涵盖不同的评估策略、惰性的实现,以及关注延续、解释器、符号计算等主题的机会。最后,正如其他人指出的那样,Lisp 对代码/数据的处理将是全新的。因此,我非常倾向于选项(2),即 Lisp。

3)第三,序言。 Prolog 有大量有趣的材料,它的域正是我感兴趣的。它语法简单,易于阅读。目前我无法发表更多评论,但在阅读了 Prolog 概述并浏览了一些介绍性材料后,它的排名为 (2)。而且 Prolog 的回溯似乎总是被黑进 Haskell 中!

4)在主流语言中,Python 看起来最有趣。蒂姆·耶茨 (Tim Yates) 让这些语言听起来非常有吸引力。显然,Python 经常被教授给计算机科学专业的一年级学生;所以它要么概念丰富,要么易于学习。我必须做更多研究。

谢谢大家的建议!看起来 Lisp(Scheme、Clojure)、Prolog 或像 Coq 或 Agda 这样的证明助手是被推荐的主要语言。

As my first programming language, I decided to learn Haskell. I'm an analytic philosophy major, and Haskell allowed me to quickly and correctly create programs of interest, for instance, transducers for natural language parsing, theorem provers, and interpreters. Although I've only been programming for two and a half months, I found Haskell's semantics and syntax much easier to learn than more traditional imperative languages, and feel comfortable (now) with the majority of its constructs.

Programming in Haskell is like sorcery, however, and I would like to broaden my knowledge of programming. I would like to choose a new programming language to learn, but I do not have enough time to pick up an arbitrary language, drop it, and repeat. So I thought I would pose the question here, along with several stipulations about the type of language I am looking for. Some are subjective, some are intended to ease the transition from Haskell.

  • Strong type system. One of my favorite parts of programming in Haskell is writing type declarations. This helps structure my thoughts about individual functions and their relationship to the program as a whole. It also makes informally reasoning about the correctness of my program easier. I'm concerned with correctness, not efficiency.
  • Emphasis on recursion rather than iteration. I use iterative constructs in Haskell, but implement them recursively. However, it is much easier to understand the structure of a recursive function than a complicated iterative procedure, especially when using combinators and higher-order functions like maps, folds and bind.
  • Rewarding to learn. Haskell is a rewarding language to work in. It's a little like reading Kant. My experience several years ago with C, however, was not. I'm not looking for C. The language should enforce a conceptually interesting paradigm, which in my entirely subjective opinion, the C-likes do not.

Weighing the answers: These are just notes, of course. I'd just like to reply to everyone who gave well-formed responses. You have been very helpful.

1) Several responses indicated that a strong, statically typed language emphasizing recursion means another functional language. While I want to continue working strongly with Haskell, camccann and larsmans correctly pointed out that another such language would "ease the transition too much." These comments have been very helpful, because I am not looking to write Haskell in Caml! Of the proof assistants, Coq and Agda both look interesting. In particular, Coq would provide a solid introduction to constructive logic and formal type theory. I've spent a little time with first-order predicate and modal logic (Mendellsohn, Enderton, some of Hinman), so I would probably have a lot of fun with Coq.

2) Others heavily favored Lisp (Common Lisp, Scheme and Clojure). From what I gather, both Common Lisp and Scheme have excellent introductory material (On Lisp and The Reasoned Schemer, SICP). The material in SICP causes me to lean towards Scheme. In particular, Scheme through SICP would cover a different evaluation strategy, the implementation of laziness, and a chance to focus on topics like continuations, interpreters, symbolic computation, and so on. Finally, as others have pointed out, Lisp's treatment of code/data would be entirely new. Hence, I am leaning heavily towards option (2), a Lisp.

3) Third, Prolog. Prolog has a wealth of interesting material, and its primary domain is exactly the one I'm interested in. It has a simple syntax and is easy to read. I can't comment more at the moment, but after reading an overview of Prolog and skimming some introductory material, it ranks with (2). And it seems like Prolog's backtracking is always being hacked into Haskell!

4) Of the mainstream languages, Python looks the most interesting. Tim Yates makes the languages sound very appealing. Apparently, Python is often taught to first-year CS majors; so it's either conceptually rich or easy to learn. I'd have to do more research.

Thank you all for your recommendations! It looks like a Lisp (Scheme, Clojure), Prolog, or a proof assistant like Coq or Agda are the main langauages being recommended.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(17

梦晓ヶ微光ヅ倾城 2024-10-01 23:04:45

我想拓宽我的编程知识。 (...)我想我应该在这里提出这个问题,以及关于我正在寻找的语言类型的一些规定。有些是主观的,有些是为了简化从 Haskell 的过渡。

强类型系统。 (...)它也使得非正式地推理我的程序的正确性变得更加容易。我关心的是正确性,而不是效率。

强调递归而不是迭代。 (...)

恐怕您在这里过度放松了过渡。非常严格的类型系统和纯函数式风格是 Haskell 的特征,几乎任何类似于主流编程语言的东西都需要至少在其中之一上做出一些妥协。因此,考虑到这一点,这里有一些广泛的建议,旨在保留您似乎喜欢的 Haskell 的大部分内容,但有一些重大转变。

  • 忽视实用性并追求“比 Haskell 更Haskell”:由于非终止和其他混乱的妥协,Haskell 的类型系统充满了漏洞。清理混乱并添加更强大的功能,您将获得像 CoqAgda 这样的语言,其中函数的类型包含其正确性的证明(您甚至可以阅读函数箭头-> 作为逻辑含义!)。这些语言已用于数学证明和正确性要求极高的程序。 Coq 可能是该风格中最著名的语言,但 Agda 具有更多 Haskell 风格的感觉(并且是用 Haskell 本身编写的)。

  • 无视类型,添加更多魔法:如果 Haskell 是魔法,那么 Lisp 就是原始的、原始的创造魔法。 Lisp 家族语言(还包括 SchemeClojure)具有几乎无与伦比的灵活性和极简主义。这些语言本质上没有语法,直接以树数据结构的形式编写代码; Lisp 中的元编程比某些语言中的非元编程更容易。

  • 做出一点妥协,向主流靠拢:Haskell 属于深受 ML 影响的广泛语言系列,您可能可以转向其中任何一种语言,而无需难度很大。当涉及到类型和函数式风格的使用的正确性保证时,Haskell 是最严格的之一,而其他风格通常是混合风格和/或出于各种原因做出务实的妥协。如果您想接触一下 OOP 并访问许多主流技术平台,JVM 上的 Scala 或 .NET 上的 F# 与 Haskell 有很多共同点,同时提供简单的与 Java 和 .NET 平台的互操作性。 F# 由 Microsoft 直接支持,但与 Haskell 相比有一些恼人的限制以及非 Windows 平台上的可移植性问题。 Scala 与 Haskell 的类型系统和 Java 的跨平台潜力有直接对应,但具有更重量级的语法,并且缺乏 F# 所享有的强大的第一方支持。

其他答案中也提到了大多数建议,但希望我的理由能提供一些启发。

I would like to broaden my knowledge of programming. (...) I thought I would pose the question here, along with several stipulations about the type of language I am looking for. Some are subjective, some are intended to ease the transition from Haskell.

Strong type system. (...) It also makes informally reasoning about the correctness of my program easier. I'm concerned with correctness, not efficiency.

Emphasis on recursion rather than iteration. (...)

You may be easing the transition a bit too much here, I'm afraid. The very strict type system and purely functional style are characteristic of Haskell and pretty much anything resembling a mainstream programming language will require compromising at least somewhat on one of these. So, with that in mind, here are a few broad suggestions aimed at retaining most of what you seem to like about Haskell, but with some major shift.

  • Disregard practicality and go for "more Haskell than Haskell": Haskell's type system is full of holes, due to nontermination and other messy compromises. Clean up the mess and add more powerful features and you get languages like Coq and Agda, where a function's type contains a proof of its correctness (you can even read the function arrow -> as logical implication!). These languages have been used for mathematical proofs and for programs with extremely high correctness requirements. Coq is probably the most prominent language of the style, but Agda has a more Haskell-y feel (as well as being written in Haskell itself).

  • Disregard types, add more magic: If Haskell is sorcery, Lisp is the raw, primal magic of creation. Lisp-family languages (also including Scheme and Clojure) have nearly unparalleled flexibility combined with extreme minimalism. The languages have essentially no syntax, writing code directly in the form of a tree data structure; metaprogramming in a Lisp is easier than non-meta programming in some languages.

  • Compromise a bit and move closer to the mainstream: Haskell falls into the broad family of languages influenced heavily by ML, any of which you could probably shift to without too much difficulty. Haskell is one of the strictest when it comes to correctness guarantees from types and use of functional style, where others are often either hybrid styles and/or make pragmatic compromises for various reasons. If you want some exposure to OOP and access to lots of mainstream technology platforms, either Scala on the JVM or F# on .NET have a lot in common with Haskell while providing easy interoperability with the Java and .NET platforms. F# is supported directly by Microsoft, but has some annoying limitations compared to Haskell and portability issues on non-Windows platforms. Scala has direct counterparts to more of Haskell's type system and Java's cross-platform potential, but has a more heavyweight syntax and lacks the powerful first-party support that F# enjoys.

Most of those recommendations are also mentioned in other answers, but hopefully my rationale for them offers some enlightenment.

甜警司 2024-10-01 23:04:45

我将成为那个人并建议你要求错误的东西。

首先你说你想拓宽你的视野。然后你描述你想要的语言,它的视野听起来与你已经拥有的视野非常相似。通过一遍又一遍地学习同样的东西,你不会获得太多收获。

我建议你学习 Lisp——即 Common Lisp、Scheme/Racket 或 Clojure。默认情况下它们都是动态类型的,但具有某种类型提示或可选的静态类型。 Racket 和 Clojure 可能是您最好的选择。

Clojure 是较新的版本,具有更多 Haskellism,例如默认不变性和大量惰性求值,但它基于 Java 虚拟机,这意味着它有一些奇怪的地方(例如,JVM 不支持尾部调用消除,因此递归是一种 hack)。

Racket 比较老,但一路走来已经获得了很多功能,例如静态类型支持和专注于函数式编程。我想您可能会充分利用 Racket。

Lisps 中的宏系统非常有趣,并且比您在其他地方看到的任何宏系统都强大得多。仅此一点就至少值得一看。

I'm going to be That Guy and suggest that you're asking for the wrong thing.

First you say that you want to broaden your horizons. Then you describe the kind of language that you want, and its horizons sound incredibly like the horizons you already have. You're not going to gain very much by learning the same thing over and over.

I would suggest you learn a Lisp — i.e. Common Lisp, Scheme/Racket or Clojure. They're all dynamically typed by default, but feature some sort of type hinting or optional static typing. Racket and Clojure are probably your best bets.

Clojure is more recent and has more Haskellisms like immutability by default and lots of lazy evaluation, but it's based on the Java Virtual Machine, which means it has some odd warts (e.g. the JVM doesn't support tail call elimination, so recursion is kind of a hack).

Racket is much older, but has picked up a lot of power along the way, such as static type support and a focus on functional programming. I think you'd probably get the most out of Racket.

The macro systems in Lisps are very interesting and vastly more powerful than anything you'll see anywhere else. That alone is worth at least looking at.

挥剑断情 2024-10-01 23:04:45

从适合你专业的角度来看,显而易见的选择似乎是逻辑语言,例如 Prolog 或其衍生语言。逻辑编程可以用函数式语言非常巧妙地完成(参见,例如 理性策划者),但您可能喜欢直接使用逻辑范例。

诸如 twelf 或 coq 之类的交互式定理证明系统也可能会引起您的兴趣。

From the standpoint of what suits your major, the obvious choice seems like a logic language such as Prolog or its derivatives. Logic programming can be done very neatly in a functional language (see, e.g. The Reasoned Schemer) , but you might enjoy working with the logic paradigm directly.

An interactive theorem proving system such as twelf or coq might also strike your fancy.

一腔孤↑勇 2024-10-01 23:04:45

我建议你学习 Coq,它是一个强大的证明助手,其语法会让 Haskell 程序员感到舒服。 Coq 的一个很酷的地方是它可以被提取到其他函数式语言,包括 Haskell。 Hackage 上甚至有一个用 Coq 编写的包(Meldable-Heap),证明其操作的属性,然后提取到 Haskell。

另一种比 Haskell 更强大的流行语言是 Agda - 我不知道Agda 不知道它是依赖于 Hackage 的类型,并且受到我尊敬的人的尊重,但这些对我来说已经是足够好的理由了。

我不认为这两者中的任何一个都是容易的。但是,如果您了解 Haskell 并希望发展到一种比 Haskell 类型系统更强大的语言,那么应该考虑它们。

I'd advise you learn Coq, which is a powerful proof assistant with syntax that will feel comfortable to the Haskell programmer. The cool thing about Coq is it can be extracted to other functional languages, including Haskell. There is even a package (Meldable-Heap) on Hackage that was written in Coq, had properties proven about its operation, then extracted to Haskell.

Another popular language that offers more power than Haskell is Agda - I don't know Agda beyond knowing it is dependently typed, on Hackage, and well respected by people I respect, but those are good enough reasons to me.

I wouldn't expect either of these to be easy. But if you know Haskell and want to move forward to a language that gives more power than the Haskell type system then they should be considered.

一瞬间的火花 2024-10-01 23:04:45

由于您没有提到除了您的主观兴趣之外的任何限制,并强调“学习有回报”(好吧,好吧,我将忽略静态类型限制),我建议学习几种不同范式的语言,最好是那些对于他们每个人来说都是“典范”。

  • 代码即数据/同像性的一种 Lisp 方言,因为它们即使不是最好的,也是很好的动态(或多或少严格)函数式编程语言的示例
  • Prolog 作为主要的逻辑编程语言
  • Smalltalk 作为一种真正的 OOP 语言(也很有趣,因为它通常极其以图像为中心的方法)
  • 也许 ErlangClojure 如果您对并发/并行/分布式编程语言感兴趣,
  • Forth 用于面向堆栈的编程
  • Haskell 用于严格函数式静态类型惰性编程)

尤其是 Lisps(CL 不是就像Scheme)和Prolog(和Haskell)一样拥抱递归。

虽然我不是这些语言中任何一种语言的大师,但除了 Erlang 和 Forth 之外,我确实花了一些时间与它们中的每一种语言相处,它们都给了我大开眼界和有趣的学习经历,因为每种语言都从不同的角度解决问题。

因此,尽管我似乎忽略了关于您没有时间尝试几种语言的部分,但我宁愿认为花在其中任何一种语言上的时间都不会浪费,您应该看看所有这些语言。

As you didn't mention any restrictions besides your subjective interests and emphasize 'rewarding to learn' (well, ok, I'll ignore the static typing restriction), I would suggest to learn a few languages of different paradigms, and preferably ones which are 'exemplary' for each of them.

  • A Lisp dialect for the code-as-data/homoiconicity thing and because they are good, if not the best, examples of dynamic (more or less strict) functional programming languages
  • Prolog as the predominant logic programming language
  • Smalltalk as the one true OOP language (also interesting because of its usually extremely image-centric approach)
  • maybe Erlang or Clojure if you are interested in languages forged for concurrent/parallel/distributed programming
  • Forth for stack oriented programming
  • (Haskell for strict functional statically typed lazy programming)

Especially Lisps (CL not as much as Scheme) and Prolog (and Haskell) embrace recursion.

Although I am not a guru in any of these languages, I did spend some time with each of them, except Erlang and Forth, and they all gave me eye-opening and interesting learning experiences, as each one approaches problem solving from a different angle.

So, though it may seem as if I ignored the part about your having no time to try a few languages, I rather think that time spent with any of these will not be wasted, and you should have a look at all of them.

假装不在乎 2024-10-01 23:04:45

面向堆栈的编程语言怎么样? Cat 达到了您的最高点。它是:

  • 带有类型推断的静态类型。
  • 让您重新思考常见的命令式语言概念,例如循环。条件执行和循环由组合器处理。
  • 奖励 - 迫使您了解另一种计算模型。给你另一种思考和分解问题的方式。

Dobbs 博士于 2008 年发表了一篇关于 Cat 的短文,尽管语言略有变化。

How about a stack-oriented programming language? Cat hits your high points. It is:

  • Statically typed with type inference.
  • Makes you re-think common imperative languages concepts like looping. Conditional execution and looping are handled with combinators.
  • Rewarding - forces you to understand yet another model of computation. Gives you another way to think about and decompose problems.

Dr. Dobbs published a short article about Cat in 2008 though the language has changed slightly.

野心澎湃 2024-10-01 23:04:45

如果您想要一个强类型的 Prolog,Mercury 是一个有趣的选择。我过去曾涉足过它,我喜欢它给我带来的不同视角。它在类型系统中还具有调制性(哪些参数需要自由/固定)和确定性(有多少结果?)。

Clean 与 Haskell 非常相似,但具有唯一性类型,可用作Monad(更具体地说,IO monad)。唯一性类型对于处理数组也有一些有趣的作用。

If you want a strong(er)ly typed Prolog, Mercury is an interesting choice. I've dabbled in it in the past and I liked the different perspective it gave me. It also has moded-ness (which parameters need to be free/fixed) and determinism (how many results are there?) in the type system.

Clean is very similar to Haskell, but has uniqueness typing, which are used as an alternative to Monads (more specifically, the IO monad). Uniqueness typing also does interesting stuff to working with arrays.

澉约 2024-10-01 23:04:45

我有点晚了,但我发现没有人提到一些范式和相关语言,您可能会对它们的高级抽象和通用性感兴趣:

I'm a bit late but I see that no one has mentioned a couple of paradigms and related languages that can interest you for their high-level of abstraction and generality:

悲念泪 2024-10-01 23:04:45

尽管它未能满足您的一个重要标准(静态*类型),但我还是会推荐 Python。我认为您应该看看它的几个原因:

  • 对于命令式语言来说,它的功能令人惊讶。这是我学习后印象深刻的事情之一。以 列表推导式 为例。它具有 lambda、一流函数以及许多受函数启发的迭代器组合(映射、折叠、拉链...)。它使您可以选择最适合问题的范式。
  • 恕我直言,它就像 Haskell 一样,非常适合编写代码。语法简单而优雅。
  • 它的文化注重以简单的方式做事,而不是过于关注效率。

如果您正在寻找其他东西,我理解。例如,正如其他人所建议的那样,逻辑编程可能正是您的拿手好戏。


* 我假设你在这里指的是静态类型,因为你想声明类型。从技术上讲,Python 是一种强类型语言,因为您不能随意将字符串解释为数字。有趣的是,有一些 Python 衍生版本允许静态类型,例如 Boo

Despite its failure to meet one of your big criteria (static* typing), I'm going to make a case for Python. Here are a few reasons I think you should take a look at it:

  • For an imperative language, it is surprisingly functional. This was one of the things that struck me when I learned it. Take list comprehensions, for example. It has lambdas, first-class functions, and many functionally-inspired compositions on iterators (maps, folds, zips...). It gives you the option of picking whatever paradigm suits the problem best.
  • IMHO, it is, like Haskell, beautiful to code in. The syntax is simple and elegant.
  • It has a culture that focuses on doing things in a straightforward way, rather than focusing too minutely on efficiency.

I understand if you are looking for something else though. Logic programming, for instance, might be right up your alley, as others have suggested.


* I assume you mean static typing here, since you want to declare the types. Techincally, Python is a strongly typed language, since you can't arbitrarily interpret, say, a string as an number. Interestingly, there are Python derivatives that allow static typing, like Boo.

新一帅帅 2024-10-01 23:04:45

我会推荐你​​Erlang。它不是强类型语言,您应该尝试一下。这是一种非常不同的编程方法,您可能会发现存在强类型不是最佳工具(TM)的问题。无论如何,Erlang 为您提供了静态类型验证工具(打字机、透析器),您可以在从中受益的部分使用强类型。这对你来说可能是有趣的经历,但要做好准备,这将是非常不同的感觉。如果你正在寻找“概念上有趣的范例”,你可以在 Erlang 中找到它们,消息传递、内存分离而不是共享、分发、OTP、错误处理和错误传播而不是错误“预防”等等。 Erlang 可能与你当前的经验相去甚远,但如果你有 C 和 Haskell 的经验,仍然会让人头疼。

I would recommend you Erlang. It is not strong typed language and you should try it. It is very different approach to programming and you may find that there are problems where strong typing is not The Best Tool(TM). Anyway Erlang provides you tools for static type verification (typer, dialyzer) and you can use strong typing on parts where you gain benefits from it. It can be interesting experience for you but be prepared, it will be very different feeling. If you are looking for "conceptually interesting paradigm" you can found them in Erlang, message passing, memory separation instead sharing, distribution, OTP, error handling and error propagation instead of error "prevention" and so. Erlang can be far away from your current experience but still brain tickling if you have experience with C and Haskell.

圈圈圆圆圈圈 2024-10-01 23:04:45

根据您的描述,我建议 OcamlF#< /强>。

ML 系列在强类型系统方面总体上非常好。对递归以及模式匹配的强调也很明显。

我有点犹豫的是学习的回报部分。毫无疑问,学习它们对我来说是有益的。但考虑到你的限制和你对你想要的东西的描述,看来你实际上并没有在寻找比 Haskell 更不同的东西。

如果您没有施加限制,我会建议使用 PythonErlang,这两者都会带您走出舒适区。

Given your description, I would suggest Ocaml or F#.

The ML family are generally very good in terms of a strong type system. The emphasis on recursion, coupled with pattern matching, is also clear.

Where I am a bit hesitant is on the rewarding to learn part. Learning them was rewarding for me, no doubt. But given your restrictions and your description of what you want, it seems you are not actually looking for something much more different than Haskell.

If you didn't put your restrictions I would have suggested Python or Erlang, both of which would take you out of your comfort zone.

诗笺 2024-10-01 23:04:45

根据我的经验,强类型+强调递归意味着另一种函数式编程语言。话又说回来,我想知道这是否非常有价值,因为它们都不会像 Haskell 那样“纯粹”。

正如其他发帖者所建议的,Prolog 和 Lisp/Scheme 都很好,尽管它们都是动态类型的。许多具有浓厚理论“品味”的伟大书籍已经出版,尤其是关于Scheme的书籍。看看SICP,里面也传达了很多一般计算机科学智慧(元循环解释器等)。

In my experience, strong typing + emphasis on recursion means another functional programming language. Then again, I wonder if that's very rewarding, given that none of them will be as "pure" as Haskell.

As other posters have suggested, Prolog and Lisp/Scheme are nice, even though both are dynamically typed. Many great books with a strong theoretical "taste" to them have been published about Scheme in particular. Take a look at SICP, which also conveys a lot of general computer science wisdom (meta-circular interpreters and the like).

人海汹涌 2024-10-01 23:04:45

Factor 将是一个不错的选择。

Factor will be a good choice.

一身软味 2024-10-01 23:04:45

您可以开始研究 Lisp

Prolog 也是一种很酷的语言。

You could start looking into Lisp.

Prolog is a cool language too.

满栀 2024-10-01 23:04:45

如果您决定放弃对类型系统的偏好,您可能会对 J 编程语言感兴趣。它的突出之处在于它强调功能组合。如果你喜欢 Haskell 中的无点风格,J 的默认形式将会是有益的。我发现它非常发人深省,尤其是在语义方面。

确实,它不符合您对您想要的东西的先入之见,但请看一下。只要知道它就在那里就值得去发现。完整实现的唯一来源是 J Software, jsoftware.com。

If you decide to stray from your preference for a type system,you might be interested in the J programming language. It is outstanding for how it emphasizes function composition. If you like point-free style in Haskell, the tacit form of J will be rewarding. I've found it extraordinarily thought-provoking, especially with regard to semantics.

True, it doesn't fit your preconceptions as to what you'd like, but give it a look. Just knowing that it's out there is worth discovering. The sole source of complete implementations is J Software, jsoftware.com.

纸伞微斜 2024-10-01 23:04:45

选择主流之一。考虑到可用的资源、您的技能的未来适销性、丰富的开发人员生态系统,我认为您应该从 JavaC# 开始。

Go with one of the main streams. Given the resources available, future marketability of your skill, rich developer ecosystem I think you should start with either Java or C#.

万人眼中万个我 2024-10-01 23:04:45

很好的问题——在花了几个月的时间彻底享受 Haskell 后,我最近一直在问自己,尽管我的背景非常不同(有机化学)。

和你一样,C 及其同类也是不可能的。

我一直在 Python 和 Ruby 作为两种实用的主力脚本语言(骡子?)之间摇摆不定,它们都有一些让我高兴的功能组件。在此不展开任何 Rubyist/Pythonist 辩论,但我个人对这个问题的务实回答是:

学习你第一个有理由应用的那个(Python 或 Ruby)。

Great question-- I've been asking it myself recently after spending several months thoroughly enjoying Haskell, although my background is very different (organic chemistry).

Like you, C and its ilk are out of the question.

I've been oscillating between Python and Ruby as the two practical workhorse scripting languages today (mules?) that both have some functional components to them to keep me happy. Without starting any Rubyist/Pythonist debates here, but my personal pragmatic answer to this question is:

Learn the one (Python or Ruby) that you first get an excuse to apply.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文