News for hackers. Stuff that matters.
Re:Miranda released as free software by kick on Friday February 28, 2020 @06:08PM (#22447266)
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.

Re:Miranda released as free software by wk_end on Saturday February 29, 2020 @02:11AM (#22449399)
You've made several comments here suggesting that GHC - pretty widely considered an extremely powerful compiler - is inferior to what Miranda offers. Can you substantiate your claim that Miranda is faster than Haskell/GHC?

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.

Re:Miranda released as free software by fanf2 on Saturday February 29, 2020 @04:32PM (#22453247)
Oh wow, Miranda is still using an SK combinator reduction evaluator dating from 1986, in K&R C. It isn't even using supercombinators, which I read about in https://www.microsoft.com/en-us/research/publication/the-imp...

Combinators are fun, but not very fast :-) https://dl.acm.org/doi/10.1145/800087.802798 http://ioccc.org/years.html#1998_fanf

Re:Miranda released as free software by kick on Saturday February 29, 2020 @02:52AM (#22449521)
I promise I'll respond to this in the morning, I'm very tired right now and don't want to give a good and reasonable question an answer that hasn't been thought out well, especially given that my responses have been getting less detailed and concise as I've gotten more tired.
Re:Miranda released as free software by ncmncm on Saturday February 29, 2020 @04:52PM (#22453383)
Just for comparison, C++ running the shortest, simplest possible quicksort does 100,000,000 32-bit ints in 8s. Three more lines, and it's 3.4s. That's 1.3ns each time it looks at an element.

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.

Re:Miranda released as free software by yatac42 on Saturday February 29, 2020 @05:06PM (#22453498)
> C++ and the shortest, simplest possible quicksort

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?

Re:Miranda released as free software by ncmncm on Saturday February 29, 2020 @05:16PM (#22453553)
It means that speed is not a very interesting basis for comparing them. If you cared much about speed, you would look elsewhere.
Re:Miranda released as free software by yatac42 on Saturday February 29, 2020 @05:55PM (#22453784)
Again I want to emphasize that you were comparing different algorithms on different data structures. It's like someone made a benchmark using the naive recursive Fibonacci definition and then you implemented the iterative version in another language and concluded from that that the other language must be much faster. The different algorithm is what gave you (most of) the speed up, not the language.

I mean, I don't doubt that C++ is in fact faster than Haskell, just not by that much.

Re:Miranda released as free software by kick on Saturday February 29, 2020 @05:47PM (#22453739)
Their criticism is fair: I have been making a performance argument. I do think they've misinterpreted my performance argument, though, which I'll get to. (There's a lot of backlog I need to catch up with; this thread is very large and my typing speed is significantly faster than the speed at which I can think.)
Re:Miranda released as free software by bakul on Friday February 28, 2020 @10:16PM (#22448515)
I learned about Miranda from the appendix of "The Implementation of Functional Programming Languages" 1987 book by Simon Peyton Jones (IIRC one can find a PDF copy online). I liked it a lot though I had no access to its implementation. Glad to know it is now available. Its implementation is small by today's standards!
Re:Miranda released as free software by soegaard on Saturday February 29, 2020 @08:58AM (#22450550)
Ditto!
Re:Miranda released as free software by msie on Friday February 28, 2020 @06:26PM (#22447378)
The language was such a pleasure to use in university in the early 90’s. Those were the days where you paid for compilers. My prof was grumbling about the licensing fees for Miranda though.
Re:Miranda released as free software by kick on Friday February 28, 2020 @08:29PM (#22448028)
Yeah, it was a bit ridiculous. Incredibly good software compared to what we've got now, though.
Re:Miranda released as free software by agumonkey on Friday February 28, 2020 @06:29PM (#22447393)
how come it was so much faster ? smaller semantics allowing for more optimizations ? or some obscure reason ?
Re:Miranda released as free software by asdkjh345 on Saturday February 29, 2020 @08:29AM (#22450418)
It isn't, it is much slower. Download them both and try a few tests for yourself, GHC produces much faster binaries.
Re:Miranda released as free software by kick on Friday February 28, 2020 @08:31PM (#22448036)
Short: Haskell made a bunch of poor design decisions that they've since doubled down on, the fastest implementation isn't very good, the art of writing compilers and interpreters has effectively been lost, and Miranda was written by and designed by professionals.
Re:Miranda released as free software by jolux on Friday February 28, 2020 @08:35PM (#22448054)
"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?

Re:Miranda released as free software by kick on Saturday February 29, 2020 @01:53AM (#22449340)
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, have ditched PL-design, or have died.

Turbo Pascal, too, although that one's kind of strange because the author of it later went on to do a complete 180° turn while still working in PL design and implementation (plus it was never freed).

Ken Thompson's cc suite for Plan 9 was behind a million-dollar license fee until a decade ago, and it wasn't even for any modern CPUs. He once quit the industry to become a flight instructor; he's at Google, but he's retired now.

The best advice is "Stay small!" which most Free Software compilers seem to be violently against. It's not their fault, though: it's hard not to take new code when it's offered to you!

We'll probably never see the source code behind any version of the k interpreter by Arthur Whitney, and trying to get an interview with him is like going on a snipe hunt, so good luck figuring out anything about his approach besides "Small!" It doesn't help that Kx sues the hell out of anyone who's actually seen the k source and tries implementing anything remotely like it that's not a toy.

Every modern compiler is for multiple architectures in convoluted ways. This is generally a terrible idea, especially with how divergent they're getting in the times we're in, even between chips that have the same instruction set.

Intel x86_64 processors aggressively speculate almost as intensely as Transmeta did back in the day, but we're still treating them and AMD chips more or less the same, and we're using the same compilers that we're using on that instruction set for RISC-V and for ARM and for Itanium and for obscure 16-bit CPUs and so on.

Portable compilers aren't bad in principle, but when you look at pcc compared to GCC you'll see exactly where we went wrong: pcc wasn't very optimized, it was simple, and it was understandable. Great for bootstrapping. Not great for getting the most out of your CPU. Having portable compilers that try to heavily optimize is a mistake.

No one seems to know what a CPU cache is!

And how many compilers do you know that compile to C, or to LLVM bytecode or similar? It's insane: nobody should be doing that! That approach doesn't make much sense!

And the only argument any of these people can make is "But our language is too big for it to be practical to write something unique for each architecture! Piggybacking makes it way quicker!"

No one seems to realize that their languages are getting too large. They aren't even getting too large in a graceful way: Common Lisp is probably the biggest language there is, but it's extremely portable, and is easy to write an interpreter for.

Things got complicated really fast, and domain knowledge was sort of lost in the waves of proprietary compilers as they were destroyed by GCC. I appreciate that free software "won" to some extent, but if it hadn't have won as fast, we might have had some knowledge transfer happen that was actually useful.

Walter Bright isn't doing magic, but he and the people he work with seem to be some of the only people in Free Software who are making a compiler that's fast and good in the x86_64 world.

Re:Miranda released as free software by onei on Saturday February 29, 2020 @02:06AM (#22449385)
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.

Re:Miranda released as free software by kick on Saturday February 29, 2020 @02:32AM (#22449467)
Good question!

BCPL's O-Code is far different from LLVM bytecode. O-Code was little more than a virtual stack machine. Very similar to Forth, though slightly more complicated.

I could be wrong, but isn't Open64 more or less dead? The only thing I can think of that actually uses it (CUDA) isn't best-in-class.

Re:Miranda released as free software by onei on Saturday February 29, 2020 @03:20AM (#22449600)
I believe you're correct about Open64, but it was an interesting examples of a compiler when I was researching them last, particularly its usage of WHIRL [1]. It's a similar approach as used by GCC and LLVM with their front, middle and back-end approach, although I can't quite remember if it pioneered that approach or not.

[1] https://www.mcs.anl.gov/OpenAD/open64A.pdf

Re:Miranda released as free software by ZeRoo on Saturday February 29, 2020 @02:55AM (#22449532)
So u say, LLVM or whatever is insane because it's large. so what do u think about QBE[0] ?

0 : https://c9x.me/compile/

Re:Miranda released as free software by kick on Saturday February 29, 2020 @03:53PM (#22453019)
I don't know enough about QBE to give a well-informed assessment of it, so I'll refrain.
Re:Miranda released as free software by pjmlp on Saturday February 29, 2020 @06:37AM (#22450113)
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 by onei on Saturday February 29, 2020 @03:51PM (#22453004)
From what I can tell, Xerox PARC didn't exist until 1970 and apparently used Smalltalk, which was after BCPL in 1967. I don't doubt you're correct, so do you have any links for earlier bytecode examples?
Re:Miranda released as free software by pjmlp on Sunday March 01, 2020 @02:50AM (#22455719)
Burroughs Large Systems, released into the market in 1961, nowadays sold as Unisys ClearPath MCP mainframes.

Xerox PARC had Smalltalk, Mesa (later Mesa/Cedar) and Interlisp-D.

The platforms would first load the respective microcode into the CPU for the bytecodes used by the desired workstation environment.

Initially Xerox PARC made use of BCPL, but quickly they realised it wasn't the best way to write systems software and created Mesa to replace it.

After all, BCPL was intended to bootstrap CPL, not to write fully systems with it.

Other 60's computer companies were making use of either Algol or PL/I dialects, all the way up to the 80's.

Lots of juice papers at Bitsavers.

Re:Miranda released as free software by agumonkey on Saturday February 29, 2020 @07:17AM (#22450207)
All these points are valid, but that doesn't say

1) why miranda was fast itself (was it compiling perf or runtime perf) ?

2) why haskell is so bad .. since miranda lineage with haskell is quite strong, unless SPJ, JH, PW and the likes had zero access to miranda techniques or no legal right to use them.. I fail to see how they made haskell compiler so bad.

Re:Miranda released as free software by chrisseaton on Saturday February 29, 2020 @05:06AM (#22449910)
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 by kick on Saturday February 29, 2020 @05:18PM (#22453568)
I'm not conflating anything, as far as I'm aware. The question was:

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

I think I did a pretty good job in answering it, although it was a bit rambling.

The people on the standards committees for these languages are generally also the ones implementing compilers, at least at first. The ones that don't have significant overlap between the two fail. ALGOL-68 comes to mind in the past, FORTRAN-03/08 comes to mind now.

Also, there were fast Lisp compilers back then (as fast as Lisp can get, at least, and keyword "compilers" as I'm not misinterpreting the two), along with decent (eh) Smalltalk compilers: Ruby isn't that unique. An optimizing compiler for Ruby could have used many of the techniques, given that most of the bottlenecks in Ruby are the same as many Lisps. Of course, it won't map perfectly, but much of it would. (I will admit that this paragraph is written with primarily old versions of Ruby in mind, because beyond 2007 or so, when it was basically a Lisp with Smalltalk tendencies under the hood, I haven't really kept up.)

Many techniques absolutely have been lost over time, even in obvious spots, where you'd expect them to be maintained quite well; I have a folder of poorly-OCR'd, poorly-scanned ACM papers of novel, technically-interesting & fast pre-1990 compilers with significantly less downloads than citations. Academic papers aren't really where you'd expect to see "lost" techniques, but publishing is a wasteland, and most non-famous on this subject (and computers in general, partially; ever tried to find more than a handful of papers on Sun's Spring?) written between 1970 and 1990 are practically lost. The industry has the memory of a dormouse, though it might get better now that more and more things are becoming source-available.

Re:Miranda released as free software by chrisseaton on Saturday February 29, 2020 @07:36PM (#22454274)
Can you give any concrete examples of techniques that have been lost?
Re:Miranda released as free software by ferzul on Sunday March 01, 2020 @02:53AM (#22455725)
i know you're in high demand in this thread, but if it's possible to publish that folder (or the refs therein) that would be nice.
Re:Miranda released as free software by terminaljunkid on Sunday March 01, 2020 @02:11AM (#22455606)
> The best stuff was all proprietary for decades.

Well, maybe. But it is hard to believe if most of those things aren't rediscovered in these decades. And IIRC that GCC took over partially because it was quite better. GCC / LLVM appear to implement every new technique in someone's PhD thesis like Diophantine equation solvers into optimization passes. I suspect it is no longer the case.

If you're saying compiler itself is slow, well the rat race among compilers is producing benchmark binaries (sadly). But given how much we have advanced, I suppose fine grained incremental compilation should be norm in every compiler.

> Turbo Pascal, too

Here I suppose you are talking about compile speeds. Well Turbo Pascal had the advantage that it was integrated with an IDE. Eclipse and IIRC visual studio can also reach those speeds using incremental / background compilation.

> We'll probably never see the source code behind any version of the k interpreter by Arthur Whitney

I have heard a about this K. What is this? Is this an array programming language like APL? I would like some pointers.

> Having portable compilers that try to heavily optimize is a mistake. Again here there are tradeoffs. People like the comfort of portability and thus don't care about small performance increments as long as code performs reasonably well. Although I would think we can have a peephole optimizer that can optimize based on target machine upon installation.

> No one seems to know what a CPU cache is!

While this may be true for normal programmer, compiler implementers care quite a lot about caches. Especially most JIT optimizations are about cache.

> Compiling to C / LLVM IR doesn't make sense.

Sure that's a tradeoff. But that allows to implement compilers in less time and utilize most optimizations.

However I too think the progress in compilers has stalled in these years. There are native programming languages being created. But it is almost Compile to C or embracing LLVM monoculture. Appreciably Go didn't do that. And due to proliferation of scripting / JIT languages, there's not much scope for optimizing or fast compilers. In particular I am sceptical of LLVM monoculture. The compilers rat race prioritizing benchmarks above other things isn't going to end well. Moreover my gut feeling is today's compiler infrastructure is not suitable for High level languages.

Re:Miranda released as free software by sedachv on Saturday February 29, 2020 @05:01PM (#22453458)
> I appreciate that free software "won" to some extent, but if it hadn't have won as fast, we might have had some knowledge transfer happen that was actually useful.

I was recently listening to the 2007 "Copyleft Capitalism: GPLv3 & the Future of Software Innovation" talk¹ by Eben Moglen (who incidentally happened to have worked on IBM's APL interpreter), and he makes the opposite argument: it was the source code hoarding of the Microsoft-driven personal computer industry that was the biggest impediment to knowledge transfer and innovation.

¹ https://www.youtube.com/watch?v=68aimESyyeU

Re:Miranda released as free software by kick on Saturday February 29, 2020 @05:27PM (#22453628)
Oh, certainly! My claim isn't that libre software harms knowledge transfer at all. It's great!

But free compilers won so quickly even when they weren't obviously better that many proprietary compilers died quick, unceremonious deaths, with no obvious successors, and leading their authors to go into different areas. This was a bad thing, in my opinion, because a lot of early compilers were written in incredibly clever ways, and those clever ways died with them.

I think my comment was also worded poorly:

> I appreciate

> that free software "won" to some extent

is how I was hoping it would be interpreted, but I think it was interpreted as:

> I appreciate

> to some extent

> that free software "won"

Free software winning was absolutely the right thing, I just wish it would have been a bit less sudden.

Re:Miranda released as free software by jolux on Saturday February 29, 2020 @08:40PM (#22454525)
I'm still really interested in concrete specifics of what has been lost. Right now it just sounds like magic, which leaves me skeptical. I'm a huge fan of programming languages as a field and hope to someday do research in it, and this is a bit of history I'm not well versed in.
Re:Miranda released as free software by sedachv on Sunday March 01, 2020 @02:57PM (#22458881)
Compare Symbolics Genera to a Free Software Common Lisp development environment today (SBCL and SLIME on GNU Emacs). The latter does a lot less and is more bloated. Commercial Common Lisp compilers like Allegro and LispWorks have features and optimizations that Free Software compilers lack (Allegro has really good debugging tools and garbage collection, LispWorks has excellent support for concurrent programming).

Intel Fortran compiler and their C++ compiler produce the fastest code. Lucid Energize and IBM VisualAge C++ did incremental compilation and had IDE features not available with Free Software C++ compilers and editors/debuggers.

https://www.youtube.com/watch?v=pQQTScuApWk http://www.edm2.com/index.php/VisualAge_C++_4.0_Review

Re:Miranda released as free software by jolux on Sunday March 01, 2020 @07:48PM (#22460574)
Genera ran on actual Lisp machines, I feel that that is not a fair comparison.

It's not exactly hidden knowledge that the Intel compilers produce the best code, it's just that they have draconian licensing requirements. Furthermore, that knowledge cannot possibly be lost, because they're still actively developed to this day. I'm interested in the technological specifics of what these older platforms did that the newer ones cannot do, and why the knowledge of how to do them has been lost.

Re:Miranda released as free software by greydius on Friday February 28, 2020 @08:55PM (#22448168)
Would you mind elaborating on these points?
Re:Miranda released as free software by kick on Saturday February 29, 2020 @02:50AM (#22449517)
I have for most of it elsewhere in this thread (I think you can find my answers by checking my /comments), but for what I didn't get to, I'll get to tomorrow. My responses are getting worse as I tire.
Re:Miranda released as free software by rixed on Saturday February 29, 2020 @01:46AM (#22449319)
Do you mean that the compiler was fast or that the generated programs were fast? Do we have a competitor for Clean?
Re:Miranda released as free software by rixed on Saturday February 29, 2020 @05:41AM (#22449993)
Answering to myself: the provided implementation is an interpreter only.
Re:Miranda released as free software by kick on Saturday February 29, 2020 @01:54AM (#22449345)
Clean was directly inspired by Miranda.
Re:Miranda released as free software by voldacar on Saturday February 29, 2020 @12:18AM (#22449029)
Are there any more modern functional languages that are as fast or faster?
Re:Miranda released as free software by kick on Saturday February 29, 2020 @12:51AM (#22449159)
k, J & APL, in roughly that order.
Re:Miranda released as free software by comex on Saturday February 29, 2020 @03:35AM (#22449641)
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.

Re:Miranda released as free software by Athas on Saturday February 29, 2020 @03:45AM (#22449664)
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 by kick on Saturday February 29, 2020 @05:28PM (#22453632)
k is faster than hand-written C in many cases, and significantly faster than compiled Haskell.
Re:Miranda released as free software by Volt on Saturday February 29, 2020 @10:56PM (#22455026)
You're ignoring the main point of the comment though:

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

Re:Miranda released as free software by voldacar on Saturday February 29, 2020 @01:18AM (#22449261)
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.

Re:Miranda released as free software by kick on Saturday February 29, 2020 @02:03AM (#22449379)
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 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.

Re:Miranda released as free software by mlochbaum on Saturday February 29, 2020 @03:43AM (#22449659)
No, it's the SIMD loop thing.

The claim that k runs quickly because its functions fit in the CPU cache is, as far as I can tell, an off-hand comment that Arthur Whitney made once which has been repeated far more than it deserves. It's false—instruction cache behavior doesn't contribute significantly to k's advantage over other languages—for a few reasons: inner loops in array languages are 3–5 orders of magnitude smaller than the CPU cache, the loops that compiled languages produce also fit in cache, and instruction caching doesn't matter all that much for performance anyway. Despite spending plenty of time looking for it, I've never been able to measure an impact of code size on performance. Even data caching doesn't have that much of an effect: current versions of Dyalog APL almost always allocate new arrays from uncached memory (this is mostly fixed in the next version), and it's still one of the fastest array languages around. Unless you're using SIMD, code with linear access patterns can't even keep up with main memory, and the cache has no effect.

Why is using SIMD cheating? SIMD loops are the only way to get the full performance out of a CPU, and fast compilers do try to produce them. If it turns out that array-based interpreters are a better way to convert programmer intentions to SIMD loops than scalar compilers (and it certainly seems that way) then the array languages are legitimately faster. I suppose SIMD is considered "non-portable" because you can't use it from C, but that's an artificial restriction coming from historical programming language design decisions. The most important vector instructions are the same in any modern vector ISA. How is using standard CPU features cheating? They're not even that much newer than double-precision float support.

(I'm an implementor for Dyalog APL.)

Re:Miranda released as free software by kick on Saturday February 29, 2020 @05:34PM (#22453673)
My comment was that taking advantage of SIMD wasn't cheating, but "cheating" was a joke in both cases.

Though I disagree with your comment on the cache: it's very blatantly better for interpreters; Whitney isn't the only one who's a believer in that, Moore does too, and Moore is more competent than just about anybody. If you look at the performance of k and Moore-written Forths compared to Dyalog APL, it does seem like they have a point.

Re:Miranda released as free software by mlochbaum on Saturday February 29, 2020 @06:13PM (#22453896)
If you're talking about parsing speed, Dyalog is slow because it has a much more complicated grammar, and because it stores the execution stack in the workspace in order to make stack overflows impossible. If you're claiming k or Forth is faster for large array processing, I'd like to see some benchmarks. Do you have a citation for Moore on the instruction cache?
Re:Miranda released as free software by Athas on Saturday February 29, 2020 @03:50AM (#22449680)
> 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 by bakul on Saturday February 29, 2020 @03:03AM (#22449553)
You can write code in a functional programming style in k/j/apl, the same as in Scheme etc., but they are imperative languages.
Re:Miranda released as free software by otabdeveloper2 on Saturday February 29, 2020 @07:50AM (#22450293)
C++.

Not even joking.

Re:Miranda released as free software by nicoburns on Saturday February 29, 2020 @08:26AM (#22450406)
Rust.
Re:Miranda released as free software by chombier on Saturday February 29, 2020 @10:07AM (#22450892)
If you don't box all your closures, functional programming in Rust gets tedious quite quickly. But if you do, I guess it's no longer that fast...
Re:Miranda released as free software by hope-striker on Sunday March 01, 2020 @05:53AM (#22456316)
> If you don't box all your closures, functional programming in Rust gets tedious quite quickly.

Somewhat true, but argument position and return position impl Trait have made that slightly nicer.

Re:Miranda released as free software by asdkjh345 on Saturday February 29, 2020 @08:31AM (#22450428)
Haskell. Despite the unsubstantiated claim to the contrary, haskell is much faster.