Re:Designing a Programming Language for the Desert
by dom96 on Tuesday June 19, 2018 @04:18AM
(#17344663)
So futhark is designed to be small and specific to a single class of problems. Has the author considered implementing it in another language as a DSL?
[ Parent
| on HN ]
Re:Designing a Programming Language for the Desert
by Athas on Tuesday June 19, 2018 @05:50AM
(#17345116)
Yes, we considered that. There were two reasons we wrote a standalone language instead:
* It gives more flexibility and simplicity, regarding both syntax and type system. The compiler can also more easily analyse the AST, because there are no artifacts of an embedding.
* An embedded DSL is practically available only to users of the host language. In contrast, Futhark is equally accessible to many languages, either via direct code generation (such as for Python), or using a fairly simple C FFI.
The best example of an embedded high performance DSL is, I believe, Accelerate[0] for Haskell. It is really good, but is ultimately only accessible to Haskell programmers, and the implementation has to solve non-trivial problems related to the embedding.