brooks94
brooks94

Reputation: 3936

Is it feasible to implement a Clean backend with LLVM

Would it be feasible to implement a backend for Clean using the LLVM toolkit? If not, what are the stumbling blocks?

Also, if you happened to know of a good reference for the "ABC assembler" used as an IR by the Clean compiler, please include it in your answer. Thanks.

Upvotes: 3

Views: 389

Answers (2)

Thom Wiggers
Thom Wiggers

Reputation: 7034

You might be interested in the following articles (I'm having trouble finding them since the ST department screwed up their server config):

Smetsers, J.E.W. Compiling CLEAN to Abstract ABC-Machine Code, University of Nijmegen, Technical Report 89-20, October 1989. Describes how CLEAN is translated into (intermediate) ABC code.

Koopman P.W.M., Eekelen M.C.J.D. van, Nöcker E.G.J.M.H., Smetsers S., Plasmeijer M.J. (1990). 'The ABCmachine: A Sequential Stack-based Abstract Machine For Graph Rewriting'. Technical Report 90-22, University of Nijmegen.

Also see http://clean.cs.ru.nl/ST_Publications.

Upvotes: 1

Michael Sondergaard
Michael Sondergaard

Reputation: 1494

Without any sort of documentation of the ABC-intermediate language, it's going to be tough (I have been unable to find any what so ever).

It's definitely possible, however. As you hint at yourself, you would need to implement the code generator to use llvm instead -- the scope of which depends entirely on the complexity of the ABC-language.

The llvm-backend for Haskell may be of inspiration: http://hackage.haskell.org/trac/ghc/wiki/Commentary/Compiler/Backends/LLVM

Upvotes: 1

Related Questions