Live data from Hacker News

Intel Haskell Research Compiler

github.com

31–39 of 39 posts

Re: Intel Haskell Research Compiler

#31
post #12

Earlier quoted context omitted.

About as ironic as Java or C++ being written in C.

Not quite; Hotspot (Sun/Oracle JVM) and Android Runtime are both C++; the major C/C++ implementations (GCC, LLVM/Clang, MSVC, Intel C++ Compiler) are all C++ too, although GCC was C until 2010 and MSVC's 16-bit ancestors were as well.

Intel's compiler is written in C as well.

Re: Intel Haskell Research Compiler

#32
post #10

In essence, a big reason why the Intel team was able to do this was because they're getting optimized IR from GHC's front-end[0], and then applying further optimizations with their compiler (HRC) and then converting it into yet another IR (MIL) used by yet another compiler (FLRC), designed by Intel for arbitrary functional programming languages, for some further optimizations and ultimately into C where Intel's C com…

That first paragraph was a fun summary. It sounds like they're just throwing proven tools and tactics at a tough problem getting some good results. They start with output of one, high-quality tool. Like prior projects, they find an intermediate point in the transition that lets them add or experiment with optimizations. Then, they feed it into another high-quality tool to get even more out.

Looks like good research mixed with good, engineering tradeoffs.

Re: Intel Haskell Research Compiler

#33

Earlier quoted context omitted.

Indeed. Fire and forget. Sad. Some number of years ago I worked in Intel's software labs. It really drove home to me the point that software development is a long attention span activity, and chip development is a short attention span activity. Mixing both at the same company is difficult. A chip design has a short shelf life, and zero field upgradability, so to be successful building chips you drive hard to tape out…

The chips I build are in the field for decades. Compare that to the JavaScript flavor of the hour. Seems more like ADD. Common Lisp is about the only software I would consider declaring long attention span. The fixed nature of a chip requires far more attention than something you can push an update to. "Ship it and fix it later" was pioneered by the software industry. That is the essence of short attention span, unco…

"Common Lisp is about the only software I would consider declaring long attention span."

COBOL. Fortran. PL/I. C. C++. Ada. Java, C#, and PHP possibly given enough time. Hopefully, Python is on that list too as it wouldn't be a bad language to get stuck in for a legacy codebase. Far as massively popular ones go, at least.

""Ship it and fix it later" was pioneered by the software industry."

Planned obsolescence was pioneered by the hardware industry. Appliances especially. Software split between that and lock-in. Mainstream hardware is throw-away these days. You're right that hardware sticks around longer than a lot of software on average.

Re: Intel Haskell Research Compiler

#34
post #11

Earlier quoted context omitted.

Word I heard was that it was originally designed as a compiler for both Standard ML and Haskell. I think the Haskell part only came later.

Haskell was the second frontend. Don't think we ever did a SML frontend. We can't really discuss what the original frontend was so it was scrubbed from the release.

Is that because it became an internal product with competitive advantage or something more boring? I've abstracted away from detail enough so you could hopefully answer.

Re: Intel Haskell Research Compiler

#35
post #24

Earlier quoted context omitted.

Also something called STG.

I don't think you can call the STG an IL...

We can test that. Is it the target, machine code? If not, are there any optimizations that can happen between the two? If it's not machine code & can be improved, then it's probably safe to classify it as an IL. Or common sense variant: it's not the final language so it's an intermediate language. :)

Re: Intel Haskell Research Compiler

#36

Earlier quoted context omitted.

Indeed. Fire and forget. Sad. Some number of years ago I worked in Intel's software labs. It really drove home to me the point that software development is a long attention span activity, and chip development is a short attention span activity. Mixing both at the same company is difficult. A chip design has a short shelf life, and zero field upgradability, so to be successful building chips you drive hard to tape out…

The chips I build are in the field for decades. Compare that to the JavaScript flavor of the hour. Seems more like ADD. Common Lisp is about the only software I would consider declaring long attention span. The fixed nature of a chip requires far more attention than something you can push an update to. "Ship it and fix it later" was pioneered by the software industry. That is the essence of short attention span, unco…

> Compare that to the JavaScript flavor of the hour

That's a rather selective and misleading comparison. The Javascript language is over 20 years old.

The uses of Javascript you're presumably referring to are mainly in user interfaces, a deceptively challenging problem which hardware companies are notoriously bad at.

> Common Lisp is about the only software I would consider declaring long attention span.

C is much older than Common Lisp. C++ is about the same age as Common Lisp.

But perhaps you're thinking of Lisp in general, including the predecessors to Common Lisp, in which case you should probably also mention Fortran.

Looking at other widely used programming languages today, Python is over 25 years old, only about 7 years younger than Common Lisp. Java is also more than 20 years old.

All of these languages are still widely used, in many actively used applications that themselves are 20+ years old, in every conceivable application domain.

In short, the distinction you're trying to make isn't at all clear.

Re: Intel Haskell Research Compiler

#37
post #36

Earlier quoted context omitted.

The chips I build are in the field for decades. Compare that to the JavaScript flavor of the hour. Seems more like ADD. Common Lisp is about the only software I would consider declaring long attention span. The fixed nature of a chip requires far more attention than something you can push an update to. "Ship it and fix it later" was pioneered by the software industry. That is the essence of short attention span, unco…

> Compare that to the JavaScript flavor of the hour That's a rather selective and misleading comparison. The Javascript language is over 20 years old. The uses of Javascript you're presumably referring to are mainly in user interfaces, a deceptively challenging problem which hardware companies are notoriously bad at. > Common Lisp is about the only software I would consider declaring long attention span. C is much ol…

ANSI CL: 1994 ANSI C: 1989

"Much older" here denotes five years.

The ANSI C committee was formed in 1983. The Lisp one in 1986; however, by then Common Lisp was already a thing with Guy Steele's book published (1984). That all started around 1982, supposedly. (Wikipedia: "Work on Common Lisp started in 1981 after an initiative by ARPA manager Bob Engelmore to develop a single community standard Lisp dialect.[6] Much of the initial language design was done via electronic mail.[7][8] Guy Lewis Steele, Jr. gave at the 1982 ACM Symposium on LISP and functional programming the first overview of Common Lisp.")

ANSI CL is rooted in some Lisp dialects which precede the entire development of C.

Re: Intel Haskell Research Compiler

#38

Earlier quoted context omitted.

Haskell was the second frontend. Don't think we ever did a SML frontend. We can't really discuss what the original frontend was so it was scrubbed from the release.

Is that because it became an internal product with competitive advantage or something more boring? I've abstracted away from detail enough so you could hopefully answer.

It's not an internal product but I wouldn't call it boring either. There were some new ideas and some non-technical reasons why they couldn't be used at that time but they could still be viable and potentially something we wouldn't want public.

Re: Intel Haskell Research Compiler

#39
I feel like other functional language compiler writers could target some layer of GHC / Intel HRC / FLRC compiler stack, as a target (instead of say, generating LLVM bitcode or even machine code directly). As someone interested in programming language design (and as a big believer in strong, static typing), I'll consider targeting one of the layers of this existing compiler stack, if I were to build a compiler for a new language.

Also, the related paper for this project is quite interesting and insightful: http://www.leafpetersen.com/leaf/publications/hs2013/hrc-pap...

Post reply on HN