Being introduced to Miranda was a revelation to me back in the day. I still prefer aspects of Miranda syntax over Haskell. For example, the formatting of guards in Miranda:
gcd a b = gcd (a-b) b, if a>b
= gcd a (b-a), if a<b
= a, if a=b
versus Haskell
gcd a b | a>b = gcd (a-b) b
| a<b = gcd a (b-a)
| a==b = a
I know it's a small thing and you can get used to such differences but since FP became just an occasional side interest for me, I never made the switch as a heavyish Miranda user to Haskell. For a long time even getting a Haskell compiler to run was a massive pain.
So I started using Mark Jones' Gofer[1] interpreter which was trivial to build and still is 20 years later assuming you can find the source tar ball. It kept the nicer syntax of Miranda and added most of the power features of Haskell. I particularly liked the generalized list comprehension feature which really should have made it into Haskell; things like combinator parser code reads beautifully with it.
I know it's what you're used to but Haskell code always looks ugly to me in comparison to Miranda or Gofer.
I found the Miranda version much easier to read. But then I'm a mathematician who has never used Haskell, and it's fairly similar to how mathematicians write multi-line functions.
I vaguely seem to remember that the designer's of Haskell picked a different syntax for guards to make the language look less like Miranda. Miranda was owned by a private company (IIRC) and they didn't want to run the risk of infringing on their IP. But I don't know if that's really true.
It's funny you posted this, because today was examination day for the 'Functional Programming in Miranda' course at University College London, one of the last institutions to actually teach a course in Miranda.
Indeed, it's a great stepping stone to Haskell, with many of the important functional concepts but without some advanced (albeit useful) stuff like monadic programming.
One of the downsides is the ancient Mira console, which can output cryptic error messages, and which doesn't have command history out the box. Nevertheless, it's lightyears faster to start than GHCI, so good for learning.
Multiple universities (at least Utrecht and Nijmegen) in the Netherlands use Haskell for teaching functional programming, and I believe some FP research is also carried out there using Haskell.
Radboud University actually switched to Haskell this year, now that Ralf Hinze is teaching the functional programming course. Before they used to teach Clean (which is not that different from Haskell).
UT Austin used Haskell as the intro freshman language until pressure from large regional donors/employers caused them to switch to Java in the early 2000s.
If you enjoyed this paper than I highly encourage you to read Wadler's 'Why calculating is better than scheming' where in he critiques SICP for it's choice of using Scheme, arguing that Miranda would have been a better language to go with.
Interesting, I've read this before but it connects to some things I've been thinking about and discussing with people recently. A comment I made earlier today was about the value of static/expressive type systems, and how that can let you quickly go from specification -> code. My point being the relatively short semantic distance between many specification languages and the type systems in Ada/Haskell/others.
You get a similar effect in connecting between intent and code when using a more algebraic language versus the Algol-lineage and Lisp-lineage languages. You reduce the semantic distance (especially paired with a good type system from above) from your specification to your executable code.
I agree in terms of pure utility that that makes a lot of sense. You basically spec it out via setting up types.
But in the context on SICP I'm not sure that would be ideal. As that book is about teaching 101 programming by introducing you to the idea of black box abstraction and building a program through layers of abstraction.
Starting with types would be an entirely different approach to go at it.
So personally, in my ideal university, I'd prefer to learn Scheme/LISP as the 101 course introduction to programming and learn a Haskell-esque language the following term and thereafter.
Although that being said, I used a practical language as my introduction to programming (Ruby) before diving into SICP - which really taught me programming. So maybe it's worth going with practical first, then diving into the theoretical underpinning so you fully appreciate and grasp what you are doing.
We used Miranda in my first year intro to CS course back in 2006. It was still used at my university up until last year. Others may disagree, but I feel that it's a fine language for teaching fundamental CS concepts like recursion/induction, formal reasoning about your programs, data types, etc.
This took me back. It was the first language taught to us in Computer Science at UNSW (1989).
I remember the first lecture went something along the lines of "Ok, all you smart arses who've mucked around at home with BASIC and think you can program. We're going to teach you Miranda!"
Ditto. That was the first language I was taught at UNSW (in 1993). It was quite a change from the BASIC, assembler, and C I had taught myself in high-school.
This talk by David Turner gives a good overview of the development of "lazy, strongly typed, polymorphic, higher order, purely functional languages" https://www.youtube.com/watch?v=QVwm9jlBTik It touches on Miranda from 35:00.
Thanks for posting this, as someone who poked around functional languages for years, this lecture really pulled together a lot of ideas. Im amazed at the ability of a good teacher (world class even) to illuminate complex subjects.
Miranda was used as the implementation language for the "Implementing functional languages: a tutorial"[0] book co-authored by SPJ. The book is well constructed (and free).
Had a taste of both Miranda and Prolog in my college programming languages course (2000?). Miranda made it much easier for me to reason about C++ templates a few years later when C++ compilers finally started getting better.
I learned Miranda at SFU way back in the 90's. It was a language way ahead of its time back then. I'm glad to see that so many languages nowadays have some of the stuff I worked with in Miranda.
Also reminiscent of OCaml, which is taught in the introductory sequence of CS classes at Harvard (CS51). Introducing CS students to functional programming early on is valuable for distancing Computer Science, the field, from the mechanics of programming.
Also pretty sure that the CS51 class is sponsored by Jane Street Capital (one of the few companies in the world that uses the language!).
So I started using Mark Jones' Gofer[1] interpreter which was trivial to build and still is 20 years later assuming you can find the source tar ball. It kept the nicer syntax of Miranda and added most of the power features of Haskell. I particularly liked the generalized list comprehension feature which really should have made it into Haskell; things like combinator parser code reads beautifully with it.
I know it's what you're used to but Haskell code always looks ugly to me in comparison to Miranda or Gofer.
[1] https://en.wikipedia.org/wiki/Gofer_(programming_language)