Is it possible to write LLVM IR but not using C++? I'm exceedingly terrible at C++. I was thinking, isn't it possible to write the IR using Java? I effectively have emit some sort of binary op codes to be passed into llvm right? The same thing for if I wanted to integrate a GC? Could the interfacing be done in any other language? -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20141013/f4659a1c/attachment.html>
On Mon, Oct 13, 2014 at 10:35 AM, Dave Pitsbawn <dpitsbawn at gmail.com> wrote:> Is it possible to write LLVM IR but not using C++? > > I'm exceedingly terrible at C++. > > I was thinking, isn't it possible to write the IR using Java? >You can use llvmpy (Python bindings to LLVM) to create LLVM IR modules, if you'd like. [http://www.llvmpy.org/]> I effectively have emit some sort of binary op codes to be passed into > llvm right? > >Not sure what you're asking here, can you clarify? Eli> The same thing for if I wanted to integrate a GC? Could the interfacing be > done in any other language? > > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev > >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20141013/c325fb98/attachment.html>
You can write LLVM IR by hand as far as that is concerned ... If you mean generating IR automatically from a program written in some language you need to use a compiler frontend based on LLVM and emit IR instead of going further with the compilation. Most of the frontends for LLVM target C like languages, but with Dragonegg you could use some of the GCC frontends to start from something else. I know that Dragonegg supports Go and not so complex java programs Marcello 2014-10-13 10:35 GMT-07:00 Dave Pitsbawn <dpitsbawn at gmail.com>:> Is it possible to write LLVM IR but not using C++? > > I'm exceedingly terrible at C++. > > I was thinking, isn't it possible to write the IR using Java? I > effectively have emit some sort of binary op codes to be passed into llvm > right? > > The same thing for if I wanted to integrate a GC? Could the interfacing be > done in any other language? > > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev > >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20141013/c9c3d7b1/attachment.html>
Got it. That's much better than C++! I think you answered my question by pointing to llvmpy about the opcode part. On Mon, Oct 13, 2014 at 10:44 AM, Eli Bendersky <eliben at google.com> wrote:> > > On Mon, Oct 13, 2014 at 10:35 AM, Dave Pitsbawn <dpitsbawn at gmail.com> > wrote: > >> Is it possible to write LLVM IR but not using C++? >> >> I'm exceedingly terrible at C++. >> >> I was thinking, isn't it possible to write the IR using Java? >> > > > You can use llvmpy (Python bindings to LLVM) to create LLVM IR modules, if > you'd like. [http://www.llvmpy.org/] > > > >> I effectively have emit some sort of binary op codes to be passed into >> llvm right? >> >> > Not sure what you're asking here, can you clarify? > > Eli > > > > >> The same thing for if I wanted to integrate a GC? Could the interfacing >> be done in any other language? >> >> _______________________________________________ >> LLVM Developers mailing list >> LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu >> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev >> >> >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20141013/1e875197/attachment.html>
Thanks! On Mon, Oct 13, 2014 at 10:49 AM, Marcello Maggioni <hayarms at gmail.com> wrote:> You can write LLVM IR by hand as far as that is concerned ... > > If you mean generating IR automatically from a program written in some > language you need to use a compiler frontend based on LLVM and emit IR > instead of going further with the compilation. > Most of the frontends for LLVM target C like languages, but with Dragonegg > you could use some of the GCC frontends to start from something else. > > I know that Dragonegg supports Go and not so complex java programs > > Marcello > > 2014-10-13 10:35 GMT-07:00 Dave Pitsbawn <dpitsbawn at gmail.com>: > >> Is it possible to write LLVM IR but not using C++? >> >> I'm exceedingly terrible at C++. >> >> I was thinking, isn't it possible to write the IR using Java? I >> effectively have emit some sort of binary op codes to be passed into llvm >> right? >> >> The same thing for if I wanted to integrate a GC? Could the interfacing >> be done in any other language? >> >> _______________________________________________ >> LLVM Developers mailing list >> LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu >> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev >> >> >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20141013/4ee3c913/attachment.html>
On 10/13/14 11:44 AM, Eli Bendersky wrote:> On Mon, Oct 13, 2014 at 10:35 AM, Dave Pitsbawn <dpitsbawn at gmail.com> wrote: > >> Is it possible to write LLVM IR but not using C++? >> >> I'm exceedingly terrible at C++. >> >> I was thinking, isn't it possible to write the IR using Java? >> > > > You can use llvmpy (Python bindings to LLVM) to create LLVM IR modules, if > you'd like. [http://www.llvmpy.org/]LLVM also has C bindings. I'm not aware of a tutorial specifically for these bindings, but a great reference for things along the line of "how do use LLVM as my language's backend" is the Kaleidoscope tutorial: http://llvm.org/docs/tutorial/ (which has guides for both OCaml and C++). Cheers, Jon> > > >> I effectively have emit some sort of binary op codes to be passed into >> llvm right? >> >> > Not sure what you're asking here, can you clarify? > > Eli >-- Jon Roelofs jonathan at codesourcery.com CodeSourcery / Mentor Embedded
Seemingly Similar Threads
- [LLVMdev] writing llvm ir not in c++
- [LLVMdev] Is bitcast now needed in LLVM?
- [LLVMdev] MCJIT finalizeObject output to use in external process
- [LLVMdev] MCJIT finalizeObject output to use in external process
- [LLVMdev] alloca not in first bb behaving differently