TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Ask HN: How to learn Functional programming using a small language?

4 点作者 philonoist超过 6 年前
I have a strong preference to SML&#x2F;family than LISP&#x2F;family or others.<p>Haskell, Scala, Ocaml, F# and the likes are big and take intimidatingly long time to get a grip over functional way of thinking. I need a small language to make me dive into functional paradigm and concepts as deeply as possible, which rivals maybe even Haskell&#x27;s depth.<p>My method of learning requires a resource that provides solving huge number of problems that take a considerably good load on cognitive and mathematical abstractions( like math theories, algorithms and puzzles) as against building something in applied sense. I am opposed to &quot;hit the ground real world with practical projects&quot; as a way of learning for now.<p>I have strong preference to expressively statically typed compiled languages and a resource that forces me to think functionally. I have dabbled Python and C only superficially. I will return to them after I am comfortable with functional paradigm.<p>Does any of this mean I have to avoid languages that compile to Javascript? If not, I am open to them as well.<p>I am frustrated and helpless to come to terms with the fact that many universities can get to teach Standard ML through all helpful resources like gotchas, problem sets, and assignments along with solutions discussed in class at mere introductory year of the curriculum, but none of them being available outside of it online readily if not for free. No MOOCs by them as well.<p>It would be helpful if the language has enough presence in terms of tooling, documentation and discussion online so that I would be able to progress easily if at all I am stuck anywhere.<p>All I need is a good resource and please guide me if my approach of problem solving or anything else for being functionally proficient is wrong.

6 条评论

rs86超过 6 年前
I don&#x27;t think those kinds of exercises will teach you about functional programming... Here&#x27;s why. You can understand imperative programming as a sequence of operations. But functional programming is more like a composition of transformations. It really requires study because you need to think differently.<p>I would suggest rewriting the standard library of a functional language.... Read the standard functions on lists, maps, tuples, folds, maps, and reimplement them...
galfarragem超过 6 年前
Elm.<p>I&#x27;m more or less in the same position as you and that&#x27;s my conclusion. Haskell is a behemoth, Purescript is still intimidating. F# and Scala, I don&#x27;t want to mess up with .Net or JVM. Clojure and Elixir are interesting but don&#x27;t have a rich type system. Elm is the one that seems to remain. Maybe Reason also.<p><a href="https:&#x2F;&#x2F;elm-lang.org&#x2F;" rel="nofollow">https:&#x2F;&#x2F;elm-lang.org&#x2F;</a>
krat0sprakhar超过 6 年前
If you know Python, you might like coconut <a href="http:&#x2F;&#x2F;coconut-lang.org&#x2F;" rel="nofollow">http:&#x2F;&#x2F;coconut-lang.org&#x2F;</a><p>&gt; Coconut is a functional programming language that compiles to Python. Since all valid Python is valid Coconut, using Coconut will only extend and enhance what you&#x27;re already capable of in Python.<p>Why use Coconut? Coconut is built to be useful. Coconut enhances the repertoire of Python programmers to include the tools of modern functional programming, in such a way that those tools are easy to use and immensely powerful; that is, Coconut does to functional programming what Python did to imperative programming. And Coconut code runs the same on any Python version, making the Python 2&#x2F;3 split a thing of the past.
nikonyrh超过 6 年前
I would strongly recommend Clojure, which is dynamically but strongly typed LISP on JVM. The best part is the REPL, which is only true if you use a well-tuned IDE. Personally I still use NightCode but there are many others out there.<p>For me the biggest selling points were immutable data structures by default, nice core library (reduce, reductions, iterate, map with multiple arguments, ...) and super simple syntax. Being a LISP after all.<p>And to extend to the client side you can turn onto ClojureScript, which is almost the same language which compiles to JS instead of JVM bytecode.
agbell超过 6 年前
Haskell 98 is a quite small language and most learn Haskell resources focus on Haskell 98 and not on various extensions to the language.
kazinator超过 6 年前
Why do you have strong preferences about type systems if you&#x27;ve only dabbled in Python and C.