News for hackers. Stuff that matters.
Re:Why people were enthused about GCC early on in its life by david-given on Monday February 02, 2015 @05:32PM (#8987487)
Both LLVM and gcc suffer from the problem that they're vast underdocumented code bases with Internal Platform Syndrome and mostly-but-not-quite-finished internal tools which generate undebuggable code. The actual working set of knowledge which you need to do serious work on the compiler, such as porting it to a new backend, mostly exists as tribal knowledge only, and the only way to find this out is to either investigate the source yourself or to try and ask for help on the mailing lists. LLVM's is significantly more helpful than gcc's, because LLVM has more people participating and more momentum behind it, but you're still not guaranteed to get an answer. Actually producing a working backend is an enormous investment of time and effort.

By way of example: I'm interested in the Broadcom Videocore IV processor, also known as the main processor on the Raspberry Pi. I bounced off both gcc and LLVM, and for much the same reason --- after getting the port about 75% complete I ran into blocking issues that I couldn't fix on my own and couldn't get enough assistance on the mailing lists to fix. Which is a shame. (I should point out that prior to that I did do a VC4 backend for the ACK compiler. It generates terrible, terrible but working code.)

I have run into commercial compilers which were easy to port, and generated good code, to boot. Volker Barthelman's vbcc even has a VC4 backend, which produces amazing code, and his compiler is a tiny fraction of the size of either gcc or LLVM! But it's not open source. Maybe one day we'll get a similarly good open source small compiler...

Re:Why people were enthused about GCC early on in its life by voltagex_ on Monday February 02, 2015 @05:56PM (#8987666)
Offtopic: what's a good way to learn about the Videocore processor? I now own a B+ and a Pi 2 so it might be worth my while.
Re:Why people were enthused about GCC early on in its life by david-given on Monday February 02, 2015 @06:14PM (#8987770)
I have absolutely no idea about the processor in the Pi 2, but I got all the specs for the Pi 1 from here:

https://github.com/hermanhermitage/videocoreiv

(It's a beautiful processor. 32 registers, built in DSP, built in vector processing, some really elegant instruction design, dual core, and enough weirdness that writing good code is satisfying without being frustrating. No double precision float, alas, although it's got single precision, and for some bizarre reason there's no adc or sbc instruction which makes 64 bit arithmetic annoying.)

If you're interested in playing with it, you might also like a look at my half-finished pure-VC4-code boot loader here:

https://cowlark.com/piface

Stick it on an SD card, hook up a serial terminal, and it'll boot directly on the VC4 without even starting up the ARM.

Re:Why people were enthused about GCC early on in its life by voltagex_ on Monday February 02, 2015 @06:45PM (#8987919)
Whoa, does that mean there's a chance of replacing the proprietary bootloader on the Pi? It's the most common complaint I see here.
Re:Why people were enthused about GCC early on in its life by david-given on Tuesday February 03, 2015 @04:17AM (#8989482)
You can replace the proprietary bootloader on the SD card. You can't replace the one in the ROM. And while running executables is easy --- just drop a VC4 binary called bootcode.bin onto the root directory of the card and the ROM loader will load and run it --- there's a lot of hardware setup which still needs to be figured out; such as initialising the SDRAM.

I originally wanted to get Prex (a Minix-like microkernel OS with a Unix interface which doesn't need an MMU) running on the VC4, but I need an actual working compiler for that.

Re:Why people were enthused about GCC early on in its life by acqq on Tuesday February 03, 2015 @05:35AM (#8989645)
May I ask you: why programming VC4 (apart from taking over the control of the rest of Raspberry Pi?) It's only 250 MHz? And if you want the new control of the Raspberry Pi, why, as it's so proprietary?
Re:Why people were enthused about GCC early on in its life by nitrogen on Thursday February 05, 2015 @03:28AM (#9002254)
Clock speed is only a very small part of the performance of a chip when comparing across completely different architectures (like VC4 vs. ARM).
Re:Why people were enthused about GCC early on in its life by david-given on Tuesday February 03, 2015 @11:31AM (#8991269)
Because the VC4 is really cool, basically.
Re:Why people were enthused about GCC early on in its life by phire on Tuesday February 03, 2015 @12:37AM (#8989029)
Pi 2 apparently has the exact same GPU/VPU as the Pi 1.

The only thing they changed was the arm cores and the memory subsystem.