Go for embedded systems

5,892 views
Skip to first unread message

xavm

unread,
Sep 8, 2011, 10:50:48 AM9/8/11
to golang-nuts
Hello
I would like to know if someone know if there are implementations of
Go for real time operating systems like VXWorks, QNX, freeRTOS, ...?
With its capabilities, Go should suitable to replace C or Ada in hard,
and loose real time embedded applications...
regards
Xavier

Paul Borman

unread,
Sep 8, 2011, 1:36:06 PM9/8/11
to xavm, golang-nuts
Unless you turn off garbage collection I can't imagine Go being suitable for hard realtime.  Even if you do turn of garbage collection, Go's liberal memory allocation would also make it unsuitable for hard realtime.  The hard realtime portion of a program cannot do any standard memory allocation as allocating memory is a non-deterministic operation.

Even for "loose" or "soft" realtime (which doesn't really mean anything but "it seems to be fast enough") you will have to be careful about the potential impact of garbage collection and memory allocation at unfortunate times.

All that said, very few applications require hard realtime.  VxWorks already supports C++ (which when not used as a C compiler almost alway results in a non-deterministic program, IMHO) so maybe Go on VxWorks isn't so far fetched.

Gustavo Niemeyer

unread,
Sep 8, 2011, 1:41:38 PM9/8/11
to xavm, golang-nuts

I have a bunch of boards here just waiting for a miraculous amount of
time for me to get involved on something like that. The very first
step for me would be to port gc to the ARMv7-M (Cortex M3, etc), which
unfortunately support only the Thumb2 instruction set. It's not
entirely far-fetched since there used to be Thumb support, and was
dropped because no one cared about, and Thumb2 should actually be
easier than Thumb.

That's wishful thinking for me right now, though.. I don't have any
chance of getting time to hack on this, somewhat unfortunately. It's a
very fun problem.

--
Gustavo Niemeyer
http://niemeyer.net
http://niemeyer.net/plus
http://niemeyer.net/twitter
http://niemeyer.net/blog

-- I never filed a patent.

Ian Lance Taylor

unread,
Sep 8, 2011, 2:22:04 PM9/8/11
to xavm, golang-nuts
xavm <xavier...@gmail.com> writes:

gccgo has been ported to RTEMS (http://rtems.org/).

As others have said the current implementation of Go is unlikely to be
useful in a hard real time environment.

Ian

Paulo Pinto

unread,
Sep 8, 2011, 4:16:39 PM9/8/11
to golang-nuts
Agreed. It needs to offer the same time of capabilities like Real Time
Java,
which offers APIs to control the GC and the scheduler to be able to
comply
with real time constraints.

--
Paulo

On Sep 8, 8:22 pm, Ian Lance Taylor <i...@google.com> wrote:

Paul Borman

unread,
Sep 8, 2011, 4:26:07 PM9/8/11
to Paulo Pinto, golang-nuts

oxymoron |ˌäksəˈmôrˌän|

noun

a figure of speech in which apparently contradictory terms appear in conjunction (e.g., real time java).

(Sorry, I couldn't resist)

Paulo Pinto

unread,
Sep 9, 2011, 1:50:43 AM9/9/11
to golang-nuts
Java also compiles to native code, so you can apply your joke to Go
as well...

On Sep 8, 10:26 pm, Paul Borman <bor...@google.com> wrote:
> oxymoron |ˌäksəˈmôrˌän|
>
> noun
>
> a figure of speech in which apparently contradictory terms appear in
> conjunction (e.g., *real time java*).

xavm

unread,
Sep 9, 2011, 3:05:02 AM9/9/11
to golang-nuts
http://www.atego.com/products/aonix-perc-raven/
www.atego.com/products/aonix-perc/
http://fr.wikipedia.org/wiki/Profil_Ravenscar //for ada but the same
problematics
https://info.aiaa.org/tac/isg/SOFTC/Public%20Documents/Technical%20Working%20Groups/Safety%20Critical%20Programming%20Languages/Ravanscar%20Java/Ravanscar%20Java.pdf
//ravenscar for java

why not ravenscar for Go?



On Sep 8, 10:26 pm, Paul Borman <bor...@google.com> wrote:
> oxymoron |ˌäksəˈmôrˌän|
>
> noun
>
> a figure of speech in which apparently contradictory terms appear in
> conjunction (e.g., *real time java*).

Kyle Lemons

unread,
Sep 9, 2011, 1:50:50 PM9/9/11
to Paulo Pinto, golang-nuts
Java also compiles to native code, so you can apply your joke to Go
as well...
He has already said that he doesn't think Go is suitable for (hard) real-time systems.  The difference is that nobody is marketing something called "Real Time Go." 

xavm

unread,
Sep 10, 2011, 6:36:02 AM9/10/11
to golang-nuts
it seems badly.
it could be interesting to know the true scope of Go today: only for
google internal use? only on the server side? only a subset of
applications addressed by c or c++?
regards

Gustavo Niemeyer

unread,
Sep 10, 2011, 12:49:20 PM9/10/11
to xavm, golang-nuts
Hi Xavier,

> it could be interesting to know the true scope of Go today: only for
> google internal use? only on the server side? only a subset of
> applications addressed by c or c++?

The answer is no, no, and no.

Go is a general programming language, used inside and outside of
Google, and is indeed used in some situations where C and C++ would be
used, but has also been making good inroads into situations where
languages like Python and Ruby were seen before.

Embedded is clearly not the focus, though.

ron minnich

unread,
Sep 10, 2011, 1:57:06 PM9/10/11
to xavm, golang-nuts
On Sat, Sep 10, 2011 at 3:36 AM, xavm <xavier...@gmail.com> wrote:

> it could be interesting to know the true scope of Go today: only for
> google internal use? only on the server side? only a subset of
> applications addressed by c or c++?

At Sandia a good number of people who used to program using C, C++,
Perl, Python, whatever, for the HPC management software, have moved to
Go and have no intention of going back ... Go hits a good place
between efficiency and language capability and ease of writing code.

ron

Gustavo Niemeyer

unread,
Sep 10, 2011, 3:32:01 PM9/10/11
to Xavier Mehaut, golang-nuts
> for me go is more related to c/c++ replacement in almost every area,
> not replacing python or java or ruby,

It is in fact replacing these languages for a lot of people in the
real world. I believe even the Go creators themselves were not
expecting that at first, but it's an undeniable fact that it is
happening.

> why not widespread Go in a near future to embedded systems
> (real time or not)?  So Go could be really seen as a general
> language.

It is seen as a general programming language today. Embedding is the
opposite of general.

Xavier Mehaut

unread,
Sep 10, 2011, 1:56:39 PM9/10/11
to Gustavo Niemeyer, golang-nuts
thx gustavo for the answer ; my question was indeed a rhetorical question, knowing the answer but hoping another one ;)
for me go is more related to c/c++ replacement in almost every area, not replacing python or java or ruby, which should eventually be the scope of the forthcoming Dart language. On the server side is even competited with script languages like perl which do well their job for repetitive small tasks. So my question was : why not widespread Go in a near future to embedded systems (real time or not)? So Go could be really seen as a general language.
regards

Envoyé de mon iPhone

Xavier Mehaut

unread,
Sep 10, 2011, 2:29:07 PM9/10/11
to ron minnich, golang-nuts
thx ron for your experience return; im sure that Go is a nice and efficient language ; no doubt fir that.
i hope to see unrul where we could benefit of it powerness.
regards

Envoyé de mon iPhone

Uriel

unread,
Sep 11, 2011, 2:53:21 PM9/11/11
to xavm, golang-nuts
See this page for some examples of organizations other than Google
using Go in production:

http://go-lang.cat-v.org/organizations-using-go

uriel

carloj...@gmail.com

unread,
Oct 23, 2015, 1:51:36 PM10/23/15
to golang-nuts, xavier...@gmail.com
so no Go for metal bare
Reply all
Reply to author
Forward
0 new messages