element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet & Tria Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • About Us
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Single-Board Computers
  • Products
  • Dev Tools
  • Single-Board Computers
  • More
  • Cancel
Single-Board Computers
Forum Google Go on ARM
  • Blog
  • Forum
  • Documents
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Single-Board Computers to participate - click to join for free!
Actions
  • Share
  • More
  • Cancel
Forum Thread Details
  • Replies 26 replies
  • Subscribers 59 subscribers
  • Views 3004 views
  • Users 0 members are here
  • debian
  • bbb
  • go
  • rasperry_pi
  • golang
  • arm
Related

Google Go on ARM

morgaine
morgaine over 12 years ago

Ealier today, selsinork wrote in another thread (new one here owing to my change of topic):

selsinork wrote:

 

Interestingly,  it's not so long ago that x86 systems were far less capable in terms of  memory, storage and likely CPU than today's ARM systems, yet were  perfectly capable of compiling everything required natively. How quickly  we forget, and how quickly we bloat the software with unnecessary junk  to the point this is no longer true.

That is so very true!!!

 

Software technology needs occasional revolutions too, just like society, to remove layers of accreted crud.  This happens so rarely in computing alas that we're up to our eyeballs in it and barely keeping our heads clear.  It is so rare that I'd like to highlight one relatively recent instance of it, although it is admittedly a revolution with a small 'r'  as it hasn't captured much mindshare in the computing industry.  It's the programming language Google Go.

 

It's not the Go language syntax nor semantics that are revolutionary,  although it is nice enough in both respects and has lots of very effective features especially for concurrent programming.  What is revolutionary about it is its implementation meme, which renouces the idea that building software is divorced from language definition and is performed by third party tools ("make" and its many equivalents in the commandline and IDE worlds) with limited knowledge of the language beyond syntax.  That almost universally prevalent idea has slowed down system building to a crawl right across the world of computing, and it's almost single-handedly reponsible for the problem you described.  (I'm referring to build time only here.)

 

Instead, Go provides integrated build tools and a software construction meme in which to compile a module requires looking only at its immediate dependencies, no further.  In other words, if module A is dependent on B, and B is dependent on C, then to compile A does not require looking at C.  (No explosion of header file lookups.)  Extrapolate this to complex systems with many layers of dependency in breadth and in which each dependency is itself dependent on multiple layers of dependency in depth, and as you can imagine, Go application building can be literally orders of magnitude faster than in most of the languages in common use today.  Many compiles are pretty much instantaneous despite having lots of dependencies.

 

That's "revolutionary" of the kind that removes decades of accumulated crud which has slowed down our systems to a crawl.  It's worth spreading the word about it.  Oh, and it works on ARM, not as efficiently as on x86 yet but it's improving all the time.  I think we should be using Go very widely for as much as possible outside the kernel.

 

Just today on one of my BBB's with Debian installed:

debian@bbb:#  apt-get install golang

...

Need to get 21.9 MB of archives.
After this operation, 81.4 MB of additional disk space will be used.

...

debian@bbb:$  go version

go version go1.0.2

debian@bbb:$  vi hello.go

debian@bbb:$  cat hello.go

package main

 

import "fmt"

 

func main() {
        fmt.Println("Hello, World!")
}

debian@bbb:$  go build hello.go

debian@bbb:$  ./hello

Hello, World!

debian@bbb:$

Viva la revolucion!  image

 

More seriously, it still has a long way to go in a few areas (integration/interoperation is one), but I see very good things ahead for Go.  I recommend that engineers add it to their toolbox and gradually expand their use over time.  Expect huge reductions in crud / time gains on large projects.

 

 

Morgaine.

  • Sign in to reply
  • Cancel

Top Replies

  • Former Member
    Former Member over 12 years ago in reply to morgaine +1
    Morgaine Dinova wrote: The result isn't in dispute. Anyone can experience it for themselves The result is rarely in dispute. At least not by anyone willing to do some simple comparisons. History, however…
  • morgaine
    morgaine over 12 years ago in reply to Former Member +1
    selsinork wrote: History, however, is littered with cases of the inferior choice 'winning'. VHS vs Betamax ? RPi vs * ? Yeah, but fortunately we can leave the discussions about "winning" to the respective…
Parents
  • Former Member
    Former Member over 12 years ago

    That almost universally prevalent idea has slowed down system building to a crawl right across the world of computing, and it's almost single-handedly reponsible for the problem you described.  (I'm referring to build time only here.)

    Actually, C has the nice feature that compilations can be done in parallel,

    using -j or --jobs, so having a multi-core machine can speed up compilation nicely.

    I think in order to have Go's transitive compilation independence, your data structures

    need to (implicitly) use a lot more indirection, so you pay a run-time performance penalty,

    although I have not looked at Go closely.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • morgaine
    morgaine over 12 years ago in reply to Former Member

    That's not a C feature, it's a feature of make:

    make  -j [jobs]  --jobs[=jobs]

    Make knows almost nothing at all about C, so if you've added the -j option to its compilation flags it'll merrily kick off concurrent builds for anything that the Makefile hasn't specifically ordered through sequential dependencies.  The most common candidate is to build concurrently all the .o files listed on the RHS of a target, but it does so without understanding why, ie. merely because its Makefile has been configured that way.

     

    And what's worse, those many instances of the C compiler that have been kicked off by make will all process the same C header files repeatedly and independently, only slightly held back from total insanity by the magic #ifdef-#include-#endif incantations in the .h headers which are added manually by programmers, not a feature of the language system.

     

    It's very different in Go.  The "go" build utility doesn't obey a configuration file at all, and instead it digs out the dependency information directly from the module being compiled.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • Former Member
    Former Member over 12 years ago in reply to morgaine

    That's not a C feature, it's a feature of make:

    What I meant is that it's a feature of C that compilations can be done in any order or in parallel,

    so you can use make's -j feature. 

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • morgaine
    morgaine over 12 years ago in reply to Former Member

    coder27 wrote:

     

    What I meant is that it's a feature of C that compilations can be done in any order or in parallel,

    But that's not really a feature of C, it's a feature of the reentrancy of language compilers in all Unix-like systems and indeed in all sane operating systems everywhere.  I can't think off-hand of any current-day language compiler that can't compile two different sourcefiles concurrently on a multitasking system even in the same directory, and the only reason why they won't usually compile the same sourcefile concurrently twice over is because this would normally result in concurrent writing of the same output file which is likely to result in corruption.

     

    Make -j makes good use of this general reentrancy of compilers (and it never attempts to compile one and the same file concurrently), but it's not a feature of the languages themselves.  Make just obeys its makefiles, and does exactly the same whatever the language.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
Reply
  • morgaine
    morgaine over 12 years ago in reply to Former Member

    coder27 wrote:

     

    What I meant is that it's a feature of C that compilations can be done in any order or in parallel,

    But that's not really a feature of C, it's a feature of the reentrancy of language compilers in all Unix-like systems and indeed in all sane operating systems everywhere.  I can't think off-hand of any current-day language compiler that can't compile two different sourcefiles concurrently on a multitasking system even in the same directory, and the only reason why they won't usually compile the same sourcefile concurrently twice over is because this would normally result in concurrent writing of the same output file which is likely to result in corruption.

     

    Make -j makes good use of this general reentrancy of compilers (and it never attempts to compile one and the same file concurrently), but it's not a feature of the languages themselves.  Make just obeys its makefiles, and does exactly the same whatever the language.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
Children
No Data
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube