-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
llvm-hs question #160
Comments
That's a very intriguing possibility. It does seem as though There are two possible downsides, as I see it, though they may not be showstoppers:
I think the bottom line is that I'm not sure any of the people currently working on |
Hi all,
I'm a new maintainer of llvm-hs, the evolution of the old
llvm-general
project. While discussing switching the GHC LLVM backend tollvm-hs
, it was pointed out thatllvm-pretty
exists, and that while it doesn't provide full coverage of LLVM IR constructs, a big advantage ofllvm-pretty
is that this project (a pure Haskell bitcode reader) exists, which means bitcode loading doesn't have to require linking withlibLLVM
.While
llvm-hs
has a pure Haskell AST, and a pure Haskell LLVM assembly printer, it does not have a pure Haskell method of ingesting LLVM IR in either bitcode or assembly formats. For that, we uselibLLVM
via the FFI, and lift the C++ datastructures to the pure Haskell AST with an encoder/decoder monad.I'm just wondering if there would be any interest in porting this parser so that it parses to the
llvm-hs-pure
AST. Likellvm-pretty
this AST is pure Haskell. Unlikellvm-pretty
, the Haskell AST maps one-to-one to the LLVM C++ AST, and is a complete mapping of the C++ system of datatypes (to the point that every entity in our Haddock has a link to a corresponding entity in LLVM doxygen). This allows someone who is familiar with LLVM to immediately start working withllvm-hs
. We have all the same monadic code generation machinery inllvm-hs-pure
thatllvm-pretty
has, to the point where I've been wondering if the author ofllvm-pretty
was aware of the existence ofllvm-hs-pure
!It might aid the development of this parser if it was trivially easy to compare your parsed AST with the AST produced by LLVM's own bitcode loader. Similarly, it might be useful to lower the parsed AST to bitcode via the native LLVM bitcode writer, and see that it roundtrips correctly. Both of those capabilities are offered by
llvm-hs
in one line of code.It seems like joining forces may be beneficial to both projects!
The text was updated successfully, but these errors were encountered: