Languages

Non-technical related questions should go here.
User avatar
jonathan
Respected Member
Posts: 377
Joined: Thu Dec 10, 2009 6:07 pm
Contact:

Languages

Post by jonathan »

So, we can program in XC, C and C++. The C and C++ implementations run through the LLVM compiler and the XC implementation will shortly too.

Clearly that fills most of the space of current embedded programming. But does anyone have any other ideas for languages and compilers to target the XMOS architecture?

It would seem inevitable that occam and potentially occam-pi is targeted to the architecture - I wondered if anyone from Kent is reading this or interested in doing the port? What about other languages?


Image
User avatar
dbetz
Member
Posts: 13
Joined: Thu Dec 10, 2009 10:18 pm
Location: Bedford, NH
Contact:

Post by dbetz »

Does LLVM mean that C and C++ target a virtual machine and do not generate native code? How does this affect performance?
User avatar
jonathan
Respected Member
Posts: 377
Joined: Thu Dec 10, 2009 6:07 pm
Contact:

Post by jonathan »

dbetz wrote:Does LLVM mean that C and C++ target a virtual machine and do not generate native code? How does this affect performance?
The LLVM compiler infrastructure uses a low-level code representation that is targeted by the compiler front-end. This low-level object code representation has been designed to be a great target for language-independent analyses and optimizations before, during and after code generation. The LLVM front-end targets this intermediate object code representation and the LLVM back-end translates this object code into native code.

Obviously LLVM is flexible, and once you have the intermediate object code, it's up to you what strategies you employ - you can use a run-time and dynamically optimize the code or use static optimizations and then translate to the architecture native code.

By cleanly separating the front and back end of the compiler infrastructure this lowers the burden of adding an existing language to a new architecture whilst simultaneously lowering the burden of adding a new architecture to an existing language. It also enables compiler developers to focus attention on language-independent optimizations on the intermediate code rather than constantly reinventing and reimplementing existing optimizations on a per-language basis in their new compiler.

To demonstrate this, when the XC LLVM compiler is complete, it will be possible with a little work to target XC at other architectures. Equally, it might already to be possible to look at targeting some other LLVM languages to the XMOS architecture already: memory and feature-permitting of course. Fortran might be an interesting place to start looking...

The LLVM pages are worth a read - I've probably paraphrased quite a bit. http://llvm.org/
Image
User avatar
Folknology
XCore Legend
Posts: 1274
Joined: Thu Dec 10, 2009 10:20 pm
Contact:

Post by Folknology »

Actually I would love to see the Pure (http://code.google.com/p/pure-lang/) language ported to XMOS I am fascinated by it. It would be a great language for DSP work.

Whether it could be ported however is a question one for your toolchain folks. It does have the advatange of being written around LLVM however which brings up some interesting opportunities.

Anyhow take a look, if nothing else I'm sure you will be intrigued.

PS I would be intereested in seeing Occam running also, would give me a excuse to learn it
PPS have you also seen JoCaml http://jocaml.inria.fr/ that is also interesting and distant relative of the occam family with an interesting model for concurrency using join calculus.

regards
Al
User avatar
jonathan
Respected Member
Posts: 377
Joined: Thu Dec 10, 2009 6:07 pm
Contact:

Post by jonathan »

Pure looks very interesting. I think code and stack space might be a problem running on a single core, and the interpreter might need reimplementing to get a port of it on the XMOS architecture. But I don't think it's necessarily totally out of bounds.
Image
User avatar
Folknology
XCore Legend
Posts: 1274
Joined: Thu Dec 10, 2009 10:20 pm
Contact:

Post by Folknology »

There was another language that I would put on my XMOS wish list : Google's Go language.

I has some good synergies i.e. CSP like concurrency. but most of all I am refershed by its aim to be a 'safe' programming language.

Unfortunately this may also be difficult due to its memory requirements, although they have not ruled out targeting the embedded space, see my thread about it here http://groups.google.com/group/golang-n ... 4df406288b

It might be worth you guys engaging in that thread

regards
Al
User avatar
nosey
Newbie
Posts: 1
Joined: Mon Mar 07, 2011 6:21 pm

Post by nosey »

Ada support please!!!

I would likely adopt an xmos device for one of my commercial projects given Ada programming language support.

http://www.adaic.org/advantages/features-benefits/
http://en.wikibooks.org/wiki/Ada_Programming
http://www.seas.gwu.edu/~mfeldman/ada-p ... mmary.html
http://www.adacore.com/

* An extremely strong, static and safe type system, which allows the programmer to construct powerful abstractions that reflect the real world, and allows the compiler to detect many logic errors before they become bugs.
* Modularity, whereby the compiler directly manages the construction of very large software systems from sources.
* Information hiding; the language separates interfaces from implementation, and provides fine-grained control over visibility.
* Readability, which helps programmers review and verify code. Ada favours the reader of the program over the writer, because a program is written once but read many times. For example, the syntax bans all ambiguous constructs, so there are no surprises, in accordance with the Tao of Programming's Law of Least Astonishment. (Some Ada programmers are reluctant to talk about source code which is often cryptic; they prefer program text which is close to English prose.)
* Portability: the language definition allows compilers to differ only in a few controlled ways, and otherwise defines the semantics of programs very precisely; as a result, Ada source text is very portable across compilers and across target hardware platforms. Most often, the program can be recompiled without any changes.[2]
* Standardisation: standards have been a goal and a prominent feature ever since the design of the language in the late 1970s. The first standard was published in 1980, just 3 years after design commenced. Ada compilers all support exactly the same language; there are no dialects.

Ada is a modern programming language designed for large, long-lived applications – and embedded systems in particular – where safety and security are essential.

When Ada was first defined, it was ahead of its time. It had ambitious requirements and introduced many features - e.g., packages, exceptions, generics, tasking - that were not used in mainstream languages of the early 1980s. Subsequent developments, both in the computing field in general and in programming language technology in particular, have confirmed that Ada's design decisions were correct.

Ada is seeing significant usage worldwide in the high-integrity and safety-critical domains including commercial and military aircraft avionics, air traffic control, railroad systems, and medical devices. With its embodiment of modern software engineering principles Ada is an excellent teaching language for both introductory and advanced computer science courses, and it has been the subject of significant university research especially in the area of real-time technologies.

From the programmers perspective, the role of the programming language is to offer leverage: developers will do their jobs more effectively and efficiently when the language they are using offers better support for the various "ilities" (readability, maintainability, portability, etc.) These are precisely the goals that Ada was designed to meet, and which it has been achieving successfully for nearly twenty years in large, long-lived systems worldwide.
User avatar
Folknology
XCore Legend
Posts: 1274
Joined: Thu Dec 10, 2009 10:20 pm
Contact:

Post by Folknology »

Actually it would be good to get an update on the status of languages for Xmos, how is the complete Opensource toolchain coming on, when will it switch over to LLVM completely, are we likely to see any new XC features, is there some sort of rooadmap?

How possible is it to target Xmos XS1 with other LLVM languages?

regards
Al
User avatar
jonathan
Respected Member
Posts: 377
Joined: Thu Dec 10, 2009 6:07 pm
Contact:

Post by jonathan »

Folknology wrote:Actually it would be good to get an update on the status of languages for Xmos, how is the complete Opensource toolchain coming on, when will it switch over to LLVM completely, are we likely to see any new XC features, is there some sort of rooadmap?

How possible is it to target Xmos XS1 with other LLVM languages?

regards
Al
Hey XMOS - can you get an answer to this?
Image
User avatar
jonathan
Respected Member
Posts: 377
Joined: Thu Dec 10, 2009 6:07 pm
Contact:

Post by jonathan »

It's pretty important for the "open source" project to know what's going on with open sourcing the toolchain and language implementations. In my view, completing the work on the LLVM XC compiler is crucial, for many, many reasons. That's why I'm bumping this again. :-) So Richard, DaveL, Doug or Mark - or anyone else! - any way you could tell us more about the roadmap?

Or if not, when you will be able to tell us more? ;-)
Image
Post Reply