5 ms·
As much as I hate to say this, I think untyped functional programming is the way to go to teach about the virtues of functional programming. We do this at my u
by norswap 9y ago
As much as I hate to say this, I think untyped functional programming is the way to go to teach about the virtues of functional programming.
We do this at my university using the obscure but awesome Oz programming language (1). But then students (and some professors, truth be told) complain that it's obscure...
If I had to pick one, I'd say Elixir. It's like Erland with less wonky syntax. Another option is a pure scheme. But people hate on the parens (yes, it's not very smart, but people are going to do it anyway).
Pyret (2) is also made for this purpose, but that's sort of the caveat: it's a teaching language and people don't like that.
(1) https://www.info.ucl.ac.be/~pvr/book.html https://www.info.ucl.ac.be/~pvr/book.html
(2) https://www.pyret.org/ https://www.pyret.org/
- pivo 9y agoToo bad about scheme, that's the language I used to learn functional programming and it seemed to make so much sense in that context.
- submeta 9y agoI got in touch with Scheme twenty years ago. Read the specification (R5RS) and that was the first time programming in Lisp made sense to me. Because the specification was so short, I could remember every detail after a short time. Also the syntax was so predictable unlike Common Lisp with its myriad of operations. Without reading too many books about Scheme I started programming in it. Learned about tail recursion. About destructive vs non destructive operations. About functions that always returned values. Then I got in touch with SICP ("Structure and Interpretation of Computer Programs"). Man, that book was a revelation. Scheme was a breathe of fresh air coming from C/Pascal/Java. It was a totally different way to tell the computer what I wanted to do (although I had similar thoughts several years earlier programming my HP28s calculator in a Forth like language, then later when I started using Mathematica).
- flavio81 9y agoScheme is pretty alive and kicking, see "Racket".
- Fiahil 9y ago> We do this at my university using the obscure but awesome Oz programming language I got exposed to Oz by accident, in school. This programming language is so obscure and the documentation so indecipherable, that we thought it was created as a mean of torture for new students. Luckily for us, our functional programming classes were using OCaml and it was awesome.
- norswap 9y agoReally? I think the documentation is up to par: http://mozart.github.io/mozart-v1/doc-1.4.0/ http://mozart.github.io/mozart-v1/doc-1.4.0/ Clearly, it's possible to do better. It's also possible to do much worse, and it is often done.
- Zalastax 9y agoAs an outsider taking a quick look I found it difficult to navigate. Guided by a course that can be fine, but without that I have no idea where to start. Compare that with the tours of D and go: https://tour.dlang.org/ https://tour.dlang.org/ & https://tour.golang.org https://tour.golang.org
- mncharity 9y agoAt least back in 2004, the Oz documentation was sufficiently problematic that I wrote a VirtualManual[1]. > Mozart/Oz has a lot of documentation. Many documents, papers, lecture notes, etc, and several web pages which list them. And subjects are often discussed in several documents. This page attempts to integrate the documentation, saying "for subject foo, see these n sources". I expect the links are mostly rotted now. The scattered fragmentation of the documentation was tolerable once you were familiar with both the language and its documents. But for new users, especially those without the Oz textbook, it was a serious barrier. Glad to hear it's now much better. Thank you for the reminder of all this -- my anonymously-editable Oz wiki was still running, gathering unindexed spam. Static partial snapshot now. Activity moved to an official wiki a decade ago. Perhaps sometime, I'll look to see if any of its other pages, were also still linked to or used, or of possible historical interest, and restore them too. Thanks again. [1] http://www.vendian.org/oz/wiki/index.cgi?VirtualManual http://www.vendian.org/oz/wiki/index.cgi?VirtualManual
- cryptonector 9y agoI mean, you could use jq[0], if dynamically typed functional languages are your thing. It's probably not a bad idea, actually, since jq is so simple... (It's also quite accessible in terms of implementation, so it's probably a good platform for an entry-level CS language implementation course, but then, too, homoiconic languages such as LISP are even more accessible for such courses. Also, jq is fundamentally limited in that it does not and cannot have closures of indefinite extent, nor functions as first-class types whose values can be stored in objects of any kind -- so it's not really appropriate beyond an entry-level class.) But I do think the Haskell family of languages is fantastic, and something to teach more, at least to math and CS majors. [0] https://stedolan.github.io/jq https://stedolan.github.io/jq
- sitkack 9y agoI think implementing a Lisp in Lua would be a great problem to learn functional programming with.
- barrkel 9y agoThere's an upside to using an "obscure" language: everybody starts out on the same level. And with a multi-paradigm language like Oz, it's easier to teach a breadth of different concepts, since most languages tilt heavily one way or another.
- nextos 9y agoOz is absolutely awesome. It's a shame few languages have inherited its ideas.
- doublec 9y agoOz is a great language, good to see it getting some use. It's a pity it hasn't got more popular.
- alexbanks 9y agoAbove all, I'd like to learn Clojure. For whatever reason, it seems most of the Clojure devs I've met are able to spin more magic with the language than any other "type" of dev I've met. Plus I think Rich Hickey is a genius. I haven't looked into Elixir much at all, are there obvious pros to using it over an older/more established functional language like Clojure or Scala?
- anthonybullard 9y agoComparing it to Scala, it has a blazing fast compiler, is a smaller language with less ways to obfuscate code while still supporting metaprogramming. Also, you get all the advantages of the BEAM and OTP.
- eggy 9y agoLFE (Lisp Flavored Erlang) is also a good choice. The site has the beginnings of implementing SICP in it. [1,2] I prefer J myself. [3] [1] lfe.io [2] http://docs.lfe.io/current/index.html [3] jsoftware.com