Live data from Hacker News

Miranda released as free software

cs.kent.ac.uk

61–70 of 126 posts

Re: Miranda released as free software

#61
post #59
post #38

Earlier quoted context omitted.

k, J & APL, in roughly that order.

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, n…

Most of the APLs don't automatically parallelise array operations either, because it's hard to know automatically when it's worth it. This is exacerbated by the fact that most APLs don't have a compiler, so the granularity of independent operations is fine.

While I don't know much about the mysteries of Ks implementation, I know that the most widely used industrial APL implementation, Dyalog, uses a pretty conventional explicit task parallel API for parallelism. They call it "isolates", and it's essentially about launching a thread that has its own internal APL state (with a lot of polish for convenience and communication, of course). There may be a few primitive operations that are automatically parallel internally, but they are rare.

Re: Miranda released as free software

#62
post #44

Earlier quoted context omitted.

APL is cheating since all the magic happens in highly pipelined SIMD-heavy loops :p 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.

APL isn't cheating because of that, it's cheating because it's small enough to fit in your CPU cache! I'm sure something else can beat Miranda, I'm just unsure of what. I don't really care for the FP paradigm outside of arrays and Lisp, though, so I'll be the first to admit that I haven't spent days looking; just a few hours here and there. Oh, actually: Stalin probably does. It's an R4RS compiler. Good luck getting…

> Oh, actually: Stalin probably does. It's an R4RS compiler. Good luck getting it to compile, though. It took me a few hours and a lot of code changes to get it to compile half a decade ago (I wanted to compare the one I was writing, which was a lot worse, naturally, but much easier to compile). The compiler itself is slow as a tortoise, but it generates really wonderful code. It's probably rotted a bit now, though.

Stalin isn't really a good compiler in the realm of high-performance computing. What did and does make Stalin awesome is that it showed how you could compile away most of the overhead of using a very high-level language (Scheme) and end up with code that matched reasonably written C. That does not mean its competitive with the code generated by a heavily vectorising Fortran compiler for number crunching. Stalin is more about removing language overheads than about pushing the hardware to the hilt.

If you want a compiler built around the same rough philosophy as Stalin, then there's MLton, which is also still maintained: http://mlton.org/

Re: Miranda released as free software

#63

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

And ML (the language) is still a core part of Cambridge University compsci.

Re: Miranda released as free software

#65
post #41
post #15

Earlier quoted context omitted.

"the art of writing compilers and interpreters has effectively been lost" 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?

Spent a good while thinking on your question: The best stuff was all proprietary for decades. Even now, we only got Miranda's source code weeks ago. Miranda was written in the 1980s! It's the same for a lot of languages. Nial's the example I usually bring up for one that was freed far too late. People with the domain knowledge that would have helped deal with the complexity of modern systems are all either retired, h…

I think you’re conflating language design with language implementation.

If I’m being paid to write a Ruby compiler then ‘keep the language simple’ isn’t an option available to me, is it.

And the techniques from the 80s would be absolutely hopeless at compiling and optimising Ruby. A lot of the implementation approaches you’re talking about work brilliantly for a single-pass compiler for a trivial language like Pascal generating basic machine code but they aren’t expansive or powerful enough for bigger problems.

So the techniques haven’t been lost - they are in most cases either not enough or not applicable to our languages and the output we need.

Re: Miranda released as free software

#66
post #64

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.

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.

Re: Miranda released as free software

#67
post #58
post #20

Earlier quoted context omitted.

JavaScript has some FP parts, and is kind of the goto language for websites. But is not strictly functional.

If you want something functional that compiles to JavaScript you can for f# use Fabel [0] and there is a ocaml-like language called reasonML [1] that also does it. [0]: https://fable.io/ [1]: https://reasonml.github.io/

Reason{ML,} is just a new syntax for OCaml, still perfectly round trip translatable I believe (though that's something I expect to diverge over the years). You can use js_of_ocaml or BuckleScript to translate either OCaml or ReasonML written code to JavaScript.

Re: Miranda released as free software

#68
post #40
post #2

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 forgot…

Do you mean that the compiler was fast or that the generated programs were fast? Do we have a competitor for Clean?

Answering to myself: the provided implementation is an interpreter only.

Re: Miranda released as free software

#69
post #46
post #41

Earlier quoted context omitted.

Spent a good while thinking on your question: The best stuff was all proprietary for decades. Even now, we only got Miranda's source code weeks ago. Miranda was written in the 1980s! It's the same for a lot of languages. Nial's the example I usually bring up for one that was freed far too late. People with the domain knowledge that would have helped deal with the complexity of modern systems are all either retired, h…

Why is compiling to LLVM bytecode insane? Compiling to bytecode and then working with a simpler language has worked for decades since the introduction of BCPL. It's also the approach used by Open64, where you compile to WHIRL which is then optimised with successive passes until you eventually output whatever the architecture can run.

Compiling to bytecode is almost a decade older than BCPL, was the way to go at Xerox PARC and most mainframes that survive to this day.

Re: Miranda released as free software

#70

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 se…

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.

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.
Post reply on HN