What interest is there in LLVM?
What interest is there in LLVM?
I would love to start an LLVM compiler for the extended firmware. LLVM produces a language agnostic assembler and bytecode. It is a truly modern compiler system that is fast, has great error generation, and built in optimizers. This will enable the use of Ada, Fortran, C, C++, etc without having to write a parser/ optimizer for each one. We wouldn't have the associated runtimes (no new, delete, virtual, throw in C++) but we would get the enormous benefits of the languages, extensibility, and the optimizations provided by the LLVM system.
And it can be integrated with BrickCC, XCode, etc.
I am creating a sourceforge project this week for this effort. Please post a reply if interested, concerned, or even think if I fell of the rocker.
Cheers,
Dave
And it can be integrated with BrickCC, XCode, etc.
I am creating a sourceforge project this week for this effort. Please post a reply if interested, concerned, or even think if I fell of the rocker.
Cheers,
Dave
Re: What interest is there in LLVM?
Sounds good but I can't see how you are going to integrate that to produce NXT-specific code.
Will follow your progress with great interest.
PS Did a quick google after reading this and it may already be possible - http://projects.cs.kent.ac.uk/projects/ ... c?rev=6960
Will follow your progress with great interest.
PS Did a quick google after reading this and it may already be possible - http://projects.cs.kent.ac.uk/projects/ ... c?rev=6960
A sophistical rhetorician, inebriated with the exuberance of his own verbosity, and gifted with an egotistical imagination that can at all times command an interminable and inconsistent series of arguments to malign an opponent and to glorify himself.
-
- Posts: 358
- Joined: 01 Oct 2010, 06:37
- Location: Denmark
- Contact:
Re: What interest is there in LLVM?
Sounds rather interesting. However I don't really know LLVM, is it really that flexible so we can take the whole C (or other) language, yet add limitations or change certain aspects so certain aspects of the firmware can be taken care of.
I was actually about to take a closer look on how classes with simple inheritance could work in NBC code the next few days. I have an idea, so I want to try it out. Is it something you are interested in hearing more about?
I was actually about to take a closer look on how classes with simple inheritance could work in NBC code the next few days. I have an idea, so I want to try it out. Is it something you are interested in hearing more about?
My blog: http://spillerrec.dk/category/lego/
RICcreator, an alternative to nxtRICeditV2: http://riccreator.sourceforge.net/
RICcreator, an alternative to nxtRICeditV2: http://riccreator.sourceforge.net/
Re: What interest is there in LLVM?
Hi,
This is a brave initiative. But what would be the benefit of this, what is the unique selling point of this that can't be found in the alternatives that are available already? You mentioned optimized code and the debugger. Are there others?
Aswin
This is a brave initiative. But what would be the benefit of this, what is the unique selling point of this that can't be found in the alternatives that are available already? You mentioned optimized code and the debugger. Are there others?
Aswin
My blog: nxttime.wordpress.com
Re: What interest is there in LLVM?
Very good questions and points! This makes me have to really think about what I proposing.
@spillerrec
I big yes. LLVM has been designed ground up to be a modular system. It is what Apple is using to provide the flexibility for their large array of platforms, including JIT compilation for graphics hardware support.
It is a language agnostic bytecode. It currently has explicit support for C, C++, Obj-C, and Fortran. They all create the same bytecode.
Of course I would be interested. My initial thoughts for Clang (the C++ front-end) is to remove the virtual keyword and simply depend on compile-time polymorphism.
@h-g-t
I googled LLVM LEGO numerous times! Now I see I should have googled LLVM Nxt From the Wiki it appears to be another brick OS that uses LLVM for its compiler. I am not interested in a third party OS.
@aswin0
I am going to bullet the benefits I perceive.
- Use of John's extended LEGO endorsed firmware
- Leveraging some of the work of NXC
- Easily integrated with XCode
- Full C++ front-end is complete and actively updated by companies like Apple
--- I really like NXC but it is still missing some basic C constructs.
--- C++ is an extremely powerful language, and getting better.
--- We can concentrate on platform, not language parsing
- LLVM performs optimizations tin the various stages of compilation and link time that is beyond most of our pay-scales!
- Multi-language support
- LLVM's error repotting is better than any other C/C++ compiler I have seen.
@John
My gut tells me hat creating a back-end that translates bytecodes and modifying an already robust and modular C++ front-end is going to be simpler and have more payout than maintaining and independent C/C++ front-end.
@spillerrec
I big yes. LLVM has been designed ground up to be a modular system. It is what Apple is using to provide the flexibility for their large array of platforms, including JIT compilation for graphics hardware support.
It is a language agnostic bytecode. It currently has explicit support for C, C++, Obj-C, and Fortran. They all create the same bytecode.
Of course I would be interested. My initial thoughts for Clang (the C++ front-end) is to remove the virtual keyword and simply depend on compile-time polymorphism.
@h-g-t
I googled LLVM LEGO numerous times! Now I see I should have googled LLVM Nxt From the Wiki it appears to be another brick OS that uses LLVM for its compiler. I am not interested in a third party OS.
@aswin0
I am going to bullet the benefits I perceive.
- Use of John's extended LEGO endorsed firmware
- Leveraging some of the work of NXC
- Easily integrated with XCode
- Full C++ front-end is complete and actively updated by companies like Apple
--- I really like NXC but it is still missing some basic C constructs.
--- C++ is an extremely powerful language, and getting better.
--- We can concentrate on platform, not language parsing
- LLVM performs optimizations tin the various stages of compilation and link time that is beyond most of our pay-scales!
- Multi-language support
- LLVM's error repotting is better than any other C/C++ compiler I have seen.
@John
My gut tells me hat creating a back-end that translates bytecodes and modifying an already robust and modular C++ front-end is going to be simpler and have more payout than maintaining and independent C/C++ front-end.
Re: What interest is there in LLVM?
a different firmware could be a big advantage for your LLVM/C/C++ project because both the Lego and the Enhanced firmware are currently too much limited:
no stack, no heap, no pointers, no recursion, no dynamic memory allocation, no re-entrant functions, no double, no full stdio.h implementation - and a quite slow runtime performance (slower than the Lejos and/or RobotC fw).
Using different C compilers on the same limited fw base would end up (CMIIW) in having just another NXC dialect implementation with exactly the same limitations like NXC already has.
On the other hand - just having NXC on a different stack/heap designed fw would be already a "big leap for (NeXT)mankind".
no stack, no heap, no pointers, no recursion, no dynamic memory allocation, no re-entrant functions, no double, no full stdio.h implementation - and a quite slow runtime performance (slower than the Lejos and/or RobotC fw).
Using different C compilers on the same limited fw base would end up (CMIIW) in having just another NXC dialect implementation with exactly the same limitations like NXC already has.
On the other hand - just having NXC on a different stack/heap designed fw would be already a "big leap for (NeXT)mankind".
-
- Posts: 358
- Joined: 01 Oct 2010, 06:37
- Location: Denmark
- Contact:
Re: What interest is there in LLVM?
I finished my first draft on an implementation, however testing it in full-scale required a lot of macro-functions and I ran out of patience so it isn't properly tested... Anyway, take a look: http://spillerrec.wordpress.com/2011/02 ... -firmware/dsjove wrote:Of course I would be interested. My initial thoughts for Clang (the C++ front-end) is to remove the virtual keyword and simply depend on compile-time polymorphism.
Yeah, it will. However I would be grateful for a compiler that could actually compile well... And if it could optimize, I would be jumping in joy.doc-helmut wrote:Using different C compilers on the same limited fw base would end up (CMIIW) in having just another NXC dialect implementation with exactly the same limitations like NXC already has.
My blog: http://spillerrec.dk/category/lego/
RICcreator, an alternative to nxtRICeditV2: http://riccreator.sourceforge.net/
RICcreator, an alternative to nxtRICeditV2: http://riccreator.sourceforge.net/
Re: What interest is there in LLVM?
so if your LLVM / C will be the same as EFW/NXC :
what would be the advantage of your project opposite to NXC?
what would be the advantage of your project opposite to NXC?
-
- Posts: 358
- Joined: 01 Oct 2010, 06:37
- Location: Denmark
- Contact:
Re: What interest is there in LLVM?
If done properly, we would get faster programs (I would guess about 10% on average, but I have experienced over 30%) and smaller programs while using fewer RAM resources.
Using a proven parser will also be a big advantage as many of the issues we experience every now and then because incomplete or buggy support of C in NXC would be unlikely. (Two of my old NXC programs stopped working because the newer compiler parsed differently.)
Having proper error messages would be nice too, since some of them are rather cryptic. Warnings would also be a nice addition.
It would be much easier for others to implement another language for the standard firmware as they could simply take this project and add a new parser on top of it. What other text-based languages are there to program you NXT running standard firmware?
But even with something like LLVM, it will probably require a lot of work to get something like this done properly. Dave, how long are you intending to go with such a project? And are you still intending to try to do it?
Using a proven parser will also be a big advantage as many of the issues we experience every now and then because incomplete or buggy support of C in NXC would be unlikely. (Two of my old NXC programs stopped working because the newer compiler parsed differently.)
Having proper error messages would be nice too, since some of them are rather cryptic. Warnings would also be a nice addition.
It would be much easier for others to implement another language for the standard firmware as they could simply take this project and add a new parser on top of it. What other text-based languages are there to program you NXT running standard firmware?
But even with something like LLVM, it will probably require a lot of work to get something like this done properly. Dave, how long are you intending to go with such a project? And are you still intending to try to do it?
My blog: http://spillerrec.dk/category/lego/
RICcreator, an alternative to nxtRICeditV2: http://riccreator.sourceforge.net/
RICcreator, an alternative to nxtRICeditV2: http://riccreator.sourceforge.net/
Who is online
Users browsing this forum: No registered users and 0 guests