196 points · by kick · 6y ago · 121 comments
It was one of the pioneering purely-functional languages, but seems to have been mostly forgotten. That's unfortunate, because in many ways it still is superior to its successors. Their fault for keeping it proprietary for so long, really.
FWIW, I just tried doing a very quick dumb benchmark - the classic functional pseudo-quicksort. GHC spit out a binary that can sort 10,000,000 numbers in a few seconds on my laptop. Miranda (after cranking up the heap size a couple orders of magnitude) took noticeably more time to sort only 1,000,000.
Combinators are fun, but not very fast :-) https://dl.acm.org/doi/10.1145/800087.802798 http://ioccc.org/years.html#1998_fanf
So when you are already giving up an order of magnitude or two, another doesn't matter so much. It pays then to steer the conversation toward other merits.
wk_end was talking about "functional pseudo-quicksort" on immutable linked lists. You're presumably talking about a proper quicksort on mutable arrays. That's comparing apples to oranges.
And even if you weren't, how is that an argument? Person A says "X is faster than Y", then person B says "Actually I just ran X and it took 10x longer than Y" and then you say "Well Z, which isn't even part of this discussion, is 1000x faster than both X and Y, so your argument is invalid". How does that follow?
I'm curious, how does that happen? Were the techniques used in compilers and interpreters of yore never recorded for posterity in academic papers or technical documentation?
Edit: For that matter, from quickly browsing the source code, it looks like Miranda is interpreted as well. So it’s absurd to say it’s faster than Haskell.
but if it's really true that other than array languages, no modern FP language can outperform Miranda then that's really depressing.
I was under the impression that GHC attempted to generate decently good code, maybe it's all the little allocations that slow Haskell down or something like that.
Not even joking.
Which was not such a bad idea: I had three years of C & five of C++ under my belt already at the time but never touched a functional programming language.
Very few co-students had worked with Lisp and they did have an advantage. But they still had to new learn a new language.
Trivia 1: I was going out with a German-Iranian girl who's name was Miranda, at the same time.
Trivia 2: As I was also studying graphics design with an emphasis on typography then I made her a t-shirt for her b-day that used the 'Mirinda'[1] logo but turned it into 'Miranda'. She never wore it which hurt me a bit at the time. Maybe I should dig that out and donate it as the logo for that language since theirs is an absolute eyesaw? :]
[1] Mirinda is a carbonated soft drink (https://en.wikipedia.org/wiki/Mirinda) The logo in the 90's looked different -- like this: http://tiny.cc/24rnkz
nit: "eyesaw" -> "eyesore" (unless "eyesaw" was deliberate -- pretty evocative!)
Fresh out of high-school and our first programming course, the lecturer said something like "Ok all you smartarses who have mucked around in BASIC and think you can program, we're going to teach you Miranda!"
Students grumble at having to learn such an esoteric language; the justification of the professor is that it's simpler and more focussed than Haskell and so better for teaching functional concepts. This may be true but perhaps he's just been teaching the same material for decades and doesn't want to update it.
Which ones?
Honestly though there weren't too many outright "mistakes", but some parts of Haskell have evolved significantly, for example the introduction of the IO monad and all the associated type classes, compared to the original based on infinite lazy lists.
Everything is laid out plainly, and you can learn how to work with the language in a matter of minutes.
Even the readme was one of the best I've ever encountered. It makes no undue assumptions and leaves no work up to the reader. It even notes that one may need to make certain edits to the Makefile on certain systems and, if needed, how and where one should do so (I've had to make several other programs in the past that require more tweaking and don't document the possibility or guide the user at all).
The language itself seems slim and elegant so far, but, if nothing else, I'm amazed at the level of quality of the compiler documentation, the manageable size of the source, and the REPL's design--it encourages you to write entire programs from the REPL, by allowing you to direct output to a file and to invoke an editor to modify the current scripts loaded into the environment--all this without the need for special plugins on the editor side; instead of having to invoke the REPL from your editor, your REPL invokes your editor--honestly it seems like the right relationship and now I'm fairly confused why other REPL focused languages don't commonly support this.
Everything comes bundled too--you don't need to go through some gitbook based tutorial docs in your browser to get up to speed--it's all available right from the system itself.
A lot of contemporary programming languages I've used don't have nearly as good of an onboarding experience. It makes me wonder to what extent this is just a rare case of quality work by great programmers and to what extent its symptomatic of what one can deliver with licensing and funding, as opposed to purely open-source contributions largely driven by community interest.
That is originally how REPLs worked in Lisp and APL systems in the 1960s. In BBN Lisp/Interlisp (see http://www.softwarepreservation.org/projects/LISP/bbnlisp/W-...) and APL\360 you called the built-in editor from the REPL. There were not really any stand-alone interactive editor programs around back then, and the operating systems BBN Lisp and APL ran on mostly did not properly support running multiple processes to run editors anyway. Maclisp on ITS had job control, and you could call external editors: http://www.maclisp.info/pitmanual/edit.html
Doing it the other way around is better for projects written in multiple languages, dealing with multiple implementations, running processes on remote systems, and IDE features.
This is an interesting note to end on, because I'm not sure licensing and funding is one of the main factors that leads to this sort of thing. I think rationally designing environments in a holistic way is just sort of a lost art among programmers in general, in favor of the sort of anarchy and patchwork that characterizes software development in the present day
I agree with their view fairly strongly. Modern proprietary languages aren't this good at all in the same areas, either.
Thanks for checking this out, it makes me happy that someone's gained something from doing so.
I would agree on the "lost art" and "anarchy" — this definitely gives me something to think about!
And I'm glad you shared this! I had a blast checking it out.
The up and down arrows just show escape sequences instead of going to previous/next history.
Entering `foo = 123` gives the error `UNDEFINED NAME - foo`. Entering `exp foo = 123` gives the same error.
Entering the same expression on a line in a file works though (`/f test.m`).
Am I doing it wrong?
> Because it is a proper name, not an acronym, only the first letter of Miranda is capitalised.
It took me a second to realize that most language names of this era were in fact all-caps acronyms
https://en.m.wikipedia.org/wiki/Timeline_of_programming_lang...
The all-caps acronyms were the 1960s and before
I started hacking (a lot!) this week on an experimental project in Swift. Swift is similar to Haskell and Miranda in supporting functional programming. I like Haskell’s syntax and in general REPL based Haskell development, so at first Swift’s syntax bugged me. However, when I set my project up with Playgrounds for developing bits of low level functionality in what is effectively a REPL environment, and spent a day with XCode, I now think Swift is a worthy substitute for Haskell for some projects (i.e., when targeting macOS and/or iOS).
$ ls *.[chy] | grep -v y.tab | xargs wc -l |sort -n
3 version.c
9 utf8.h
21 fdate.c
30 lex.h
62 big.h
88 utf8.c
143 combs.h
144 cmbnms.c
295 just.c
320 menudriver.c
350 data.h
656 big.c
1000 trans.c
1220 lex.c
1315 data.c
1674 types.c
1689 rules.y
2241 steer.c
2394 reduce.c
13654 totalI certainly agree that most languages should be libre, but clearly it's not necessary for success. k has brought billions of dollars of profit, but is the most proprietary of all languages. C# developers are the most common in the world, for some reason. VBA is popular. Excel has the most programmers. Mathematica makes millions. Matlab makes millions.
> [T]he easiest way to move forward was to begin with an existing language, and evolve it in whatever direction suited us. Of all the lazy languages under development, David Turner’s Miranda was by far the most mature. It was pure, well designed, fulfilled many of our goals, had a robust implementation as a product of Turner’s company, Research Software Ltd, and was running at 120 sites. Turner was not present at the meeting, so we concluded that the first action item of the committee would be to ask Turner if he would allow us to adopt Miranda as the starting point for our new language. After a brief and cordial interchange, Turner declined. His goals were different from ours. We wanted a language that could be used, among other purposes, for research into language features; in particular, we sought the freedom for anyone to extend or modify the language, and to build and distribute an implementation. Turner, by contrast, was strongly committed to maintaining a single language standard, with complete portability of programs within the Miranda community. He did not want there to be multiple dialects of Miranda in circulation and asked that we make our new language sufficiently distinct from Miranda that the two would not be confused. Turner also declined an invitation to join the new design committee [...] Haskell owes a considerable debt to Miranda, both for general inspiration and specific language elements that we freely adopted where they fitted into our emerging design.
[1] P. Hudak, J. Hughes, S. Peyton Jones, P. Wadler, A History of Haskell: Being Lazy With Class. https://www.microsoft.com/en-us/research/wp-content/uploads/...
(i guess eta isn't tracking ghc, but i think that's because of unviability rather than a specific intention to fork the language.)
It supports more platforms and implementations than CLR ever will, including bare metal deployments with real time GC.
Thanks to those implementations, there is a plethora of GC algorithms and JIT/AOT optimizations not yet available in CLR, like AVX-512 auto-vectorization, JIT code caches with PGO, tiered JIT compilation, real time GC, GC able to deal with multi-TB heaps with ms pauses, ...
If you want something like VisualVM or JFR, you need big pockets for Visual Studio Enterprise, and it still doesn't match in capabilities.
Naturally the CLR has other things going for it like having had NGEN since day one, value types, reiffed generics and designed from the get go to support multiple languages, including C++.
Use the SAFE template if you are interested in doing web development with this language.
[0]: https://fable.io/ [1]: https://reasonml.github.io/
If you make a new language today, you should figure out who it's for (probably yourself and a couple of other people), and design it accordingly. As was always the case.
So, basically, COBOL?
Back in the day, Orwell was a free Miranda clone. So I used that.
See:
https://web.archive.org/web/20181015090301/http://miranda.or...
It was still proprietary as of 2018/most of 2019, got a source release in the form of a 32-bit version around December, and then a 64-bit version released around a month ago, from what I can tell. I completely missed this occurring until a friend pointed it out, but I'm so happy it did.
Beautiful piece of software.