紅色/系統(Red/System),
在Syllable項目使用的新式程序語言,有了下一個里程碑式的成果——其編譯器的一個ARM代碼生成器後端。該後端支持Android(
見截圖)和通用ARM Linux(
Debian上的截圖)。以前,用於生成 Mac OS X 可執行文件的後端已經完成(到目前爲止支持x86的CPU)。
hello arm android
php
hello arm qemuhtml
紅語言如今擁有兩個完整的CPU代碼生成器後端:一個用在x86上,另外一個用在ARM上。新的ARM後端支持ARMv5及更高版本的架構。這意味着除了最 小的嵌入式版本CPU(它們使用使用一種不爲紅語言所支持的獨特的Thumbs指令集)外,全部當前的CPU都能被支持。
除了對這些32位的CPU的支持以外,在對AVR Atmel 8位CPU上的一個代碼生成器的支持上也作了
部分工做。
如今支持的可執行文件格式包括 ELF, OS X 上的 Mach-O , Windows 上的 PE 以及 Arduino等嵌入式設備上的 Intel HEX 格式。ELF支持涵蓋 x86 Linux, ARM Linux, Android 以及 Syllable桌面。對FreeBSD 的支持正在開發中。
交叉編譯對紅語言來講有如屢見不鮮。好比,canonical 演示程序可被從Syllable Server以及其餘被支持的主平臺中面向Android ARM進行編譯。方法以下:
- rebol -s rsc.r -t Android /path/to/tests/hello.reds
複製代碼
轉載請註明:Linux人社區>
英文資訊翻譯專版.編譯
英文原文:
Red/System Language Gets OS X, ARM, Android Backends
posted by
Kaj-de-Vos on Sun 1st Jan 2012 19:42 UTC

Red/System, the
new programming language that is
used in the Syllable project, has reached its next milestone: an
ARM code generator backend for its compiler. It supports Android (
screenshot) and generic ARM Linux (
screenshot on Debian). Earlier, the backend for generating
Mac OS X executables was already completed (for x86 CPUs so far).
Red now has two complete CPU code generator backends: one for x86 and one for ARM. The new ARM backend supports the ARMv5 architecture and up. This means that all current ARM CPUs are supported except the smallest embedded versions, which use a distinct Thumbs instruction set that is not yet supported by Red.
Apart from these 32 bits CPUs,
work has also been done on a code generator for AVR Atmel 8 bits CPUs. This has been demonstrated running on an Arduino board
at Software Freedom Day 2011 in the Netherlands (the Arduino demonstration is towards the end of the English spoken video).
Executable file formats now supported are ELF, Mach-O for OS X, PE for Windows and Intel HEX format for embedded devices such as Arduino. ELF support has variations for x86 Linux, ARM Linux, Android and Syllable Desktop. FreeBSD support is under development.
Cross-compiling is trivially easy with Red. For example, the canonical demo program can be compiled to target Android ARM from Syllable Server or any of the other supported host platforms like this:
- rebol -s rsc.r -t Android /path/to/tests/hello.reds
複製代碼