
Miranda released as free software - kick
https://www.cs.kent.ac.uk/people/staff/dat/miranda/
======
kick
You've at least heard of (if not used) a programming language heavily inspired
by Miranda: Haskell. A lot of things about Miranda were really interesting; it
reflects modern languages in some ways, but looks completely foreign in other
ways. Like Haskell, whitespace was significant; unlike Haskell, it was fast.
Really fast.

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.

~~~
voldacar
Are there any more modern functional languages that are as fast or faster?

~~~
kick
k, J & APL, in roughly that order.

~~~
comex
As far as I know, all three of those languages are interpreted. They might be
good at slinging together predefined operations with fast implementations
written in another language (C)… as long as you’re operating in parallel on
large arrays, so that you spend more time inside the C functions than actually
interpreting. But if you need to write your own operations or just do anything
that’s isn’t massively parallel, none of those languages even compete. For
example, you couldn’t write a performant compiler in them. In contrast,
languages like Haskell and OCaml have compilers that generate native code –
maybe not C-level native code, but still an order of magnitude faster than an
interpreter.

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.

~~~
kick
k is faster than hand-written C in many cases, and significantly faster than
compiled Haskell.

~~~
Volt
You're ignoring the main point of the comment though:

>For example, you couldn’t write a performant compiler in them.

------
virtualritz
When I started studying CS in Hamburg, Germany, in the early 90's, they taught
us Miranda to have everyone on the same level.

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](https://en.wikipedia.org/wiki/Mirinda))
The logo in the 90's looked different -- like this:
[http://tiny.cc/24rnkz](http://tiny.cc/24rnkz)

~~~
nevster
Likewise, when I started my CS degree at UNSW in 1989 they taught us Miranda
before moving on to Modula-2.

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!"

~~~
jimmux
ANU in maybe 2003, we had a single tutorial in Miranda to demonstrate the
functional paradigm. It wasn't enough to appreciate the value of functional
programming, but I guess they still had licenses and wanted to use them for
something.

------
hyper_reality
Miranda is still taught as a language for University College London's
Functional Programming course: [https://www.ucl.ac.uk/module-
catalogue/modules/functional-pr...](https://www.ucl.ac.uk/module-
catalogue/modules/functional-programming/COMP0020)

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.

~~~
kick
He's right! Haskell is still stuck with most of the wrong decisions they made
in '88, and it was intended as a (clunkier) Miranda clone, anyway.

~~~
saagarjha
> Haskell is still stuck with most of the wrong decisions they made in '88

Which ones?

~~~
brmgb
While I don't agree with the general snarkiness towards Haskell of the
commenter you are replying to, being lazy by default could be seen as Haskell
original mistake. It was interesting from a research point of view though.

~~~
ferzul
it's hard to call the sine qua non of a language a bad design decision. if it
were, the language would be dead. haskell survives because it's a lazy purely
functional language with some industry support. bad design decisions have to
be something apart from that.

~~~
brmgb
I can't disagree more.

What set Haskell apart is how it successfully limited side effect to the IO
type and the introduction of type classes.

Laziness by default is definitely a bad design choice as far as I'm concerned.
The drawbacks are not worth it.

------
voidhorse
I've been playing with Miranda a little bit since seeing this yesterday, and
man, I gotta say, the quality of the REPL environment and documentation is
amazing.

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.

~~~
sedachv
> 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.

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-...](http://www.softwarepreservation.org/projects/LISP/bbnlisp/W-21_LISP_Editor_Apr67.pdf))
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](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.

~~~
kick
I disagree with your last sentence, but thank you for bringing the history
here up!

------
rwmj
This is really big news, albeit about 27 years too late to matter. Miranda is
the elegant sister of Haskell, a really beautiful pure functional language.
When I was a student I wrote a Perl(!) script which translated Miranda source
to Haskell so I could test my classwork exercises at home on my Linux/386
machine without having to go into the labs (no internet in those days!)

------
_bxg1
Under "Why the name Miranda?":

> 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

~~~
froh
I kindly beg to differ for the 1980s:

[https://en.m.wikipedia.org/wiki/Timeline_of_programming_lang...](https://en.m.wikipedia.org/wiki/Timeline_of_programming_languages)

The all-caps acronyms were the 1960s and before

------
mark_l_watson
I read the overview, cool language, very cool to see it open sourced, and just
looking at the code it is clear how much it inspired Haskell.

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).

~~~
LessDmesg
Swift is not similar to Haskell and Miranda. It's an imperative refcounted
manually managed language with strict evaluation, while Haskell and Miranda
are GCed languages with lazy evaluation and immutability. It's hard to find
languages more different, really.

~~~
mark_l_watson
You are right of course about the non-lazy part and like Scala, it is easy
enough to use mutable data, although not good style.

------
chubot
Cool, looks like a pretty browsable/readable code. There's some apparently
duplicate code in '/new/' I omitted.

    
    
        $ 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 total

------
LessDmesg
Here's an idea I have: never close-source any programming language, make 'em
free and open from day zero. Languages are not products, but infrastructure,
like roads. They benefit and grow from the number of users, not from paywalls.
Closed languages tend to fade into obscurity. That's why everyone knows
Haskell and nobody knows Miranda, everyone knows Java and nobody Eiffel. I
laughed when I read that the author of Shen/Qi changed the license from a
commercial to a slightly more permissive one, when no one cares about his
little language. Such conceit kills languages. Microsoft has realized this
only recently with .NET, when the JVM was already miles ahead. Which is sad
because the CLR is so much smarter than JVM.

~~~
saberience
How is JVM miles ahead of the CLR? All I ever hear (at my current and previous
jobs) is about how Java's runtime and tools are miles behind .Net and the CLR.

~~~
pjmlp
As someone that works with both platforms since the early days.

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++.

------
jungletime
Back in the 90s I remember taking a course that used Simple ML. I was pretty
amazed by it's elegant syntax, and If I remember it correctly, it was either
based on, or related to Miranda. I haven't really used a functional language
since university. But would love to try one again. Whats worth checking out? I
know nothing. Anything I can use to make a website or an interesting project
within a week of learning.

~~~
Multicomp
F# is an ml inspired language running on the .net clr.

Use the SAFE template if you are interested in doing web development with this
language.

~~~
jungletime
Is this possible to use on a Mac

~~~
jolux
Definitely, using .NET Core.

------
kick
I _think_ I've responded to everything in this thread. If I've missed
something, please point it out. I'll look through again later: I spent like
five hours straight replying to this thread today, so I'm kind of tired of
talking.

------
jonstewart
I learned a bit of Miranda in my programming languages class at the University
of Iowa, back in... 1999? 2000?, under Prof. Arthur Fleck. Just that little
bit of Miranda really prepared me for generic and functional idioms in C++.

------
lucidone
I learned a bit of Miranda and Oberon for a programming languages course back
in school, prior to knowing what Haskell was (or even functional programming
proper). Can anyone speak to its capability for a fun hobby project (web dev,
or a CLI)? I liked the language.

------
z3t4
If you would make a new language today you would design for readability above
all else. Because modern software are huge, while programs back in the day was
small.

~~~
beagle3
Readability is entirely and extremely subjective. I don't find Japanese
readable, but that's because I never bothered to put the time in to learn it.
I find TeX and LaTeX readable, though. Readability becomes slightly more
objective, but not much more so, when you have a well defined and sufficiently
homogenous target audience.

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.

------
tus88
First language I learned at Uni, right before C!

------
mleonard
Anyone know of any available-online courses that teach functional programming
using Miranda?

------
buckminster
This could do with a 2010 label.

Back in the day, Orwell was a free Miranda clone. So I used that.

~~~
kryptiskt
The page has been updated recently, the 64-bit version was added this year. So
it's actually the date on the page that is wrong.

~~~
kick
Yeah, the date on the page is wrong.

See:

[https://web.archive.org/web/20181015090301/http://miranda.or...](https://web.archive.org/web/20181015090301/http://miranda.org.uk/downloads)

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.

------
lngnmn1
Wonderful. Along with original MIT Scheme it is a great teaching language and
an example of clarity, brevity and conciseness which comes from a rigorously
trained mind.

Beautiful piece of software.

