Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Readers > Amazon Kindle > Kindle Developer's Corner

Notices

Reply
 
Thread Tools Search this Thread
Old 04-20-2017, 05:31 PM   #1
pirl8
Pest
pirl8 ought to be getting tired of karma fortunes by now.pirl8 ought to be getting tired of karma fortunes by now.pirl8 ought to be getting tired of karma fortunes by now.pirl8 ought to be getting tired of karma fortunes by now.pirl8 ought to be getting tired of karma fortunes by now.pirl8 ought to be getting tired of karma fortunes by now.pirl8 ought to be getting tired of karma fortunes by now.pirl8 ought to be getting tired of karma fortunes by now.pirl8 ought to be getting tired of karma fortunes by now.pirl8 ought to be getting tired of karma fortunes by now.pirl8 ought to be getting tired of karma fortunes by now.
 
Posts: 204
Karma: 239254
Join Date: Jan 2012
Location: Italy
Device: KT, PW3
GoLang on Kindle

"Go is an open source programming language that makes it easy to build simple, reliable, and efficient software". It's a compiled programming language derived from "C" created at Google in 2007 by Robert Griesemer, Rob Pike (yes, that Rob Pike), and Ken Thompson (yes, that Ken Thompson). You can get it here for your platform.

It comes with a native cross compiler enabling the programmer to build binaries for the most common operative systems and architectures in a very easy way.

You install it, you set the environment variable GOROOT to the Go install directory, GOPATH to your work directory, add $GOROOT/bin (or %GOROOT%/bin) to your PATH, and you're ready to go.

Create a directory hello in your work directory, enter it, and create there the typical hello world demo source code:

Code:
package main

import "fmt"

func main() {
	fmt.Println("Hello, world")
}
Name the file anythingyolike.go and then compile it with go build. An executable will be build, named as the project directory (hello in this case). Go builds a (large) static executable with everything in. No dependencies at all to distribute.

Switching from an OS to another or between hardware architectures is as easy as setting two environment variables and compile again your project.

As far as I know PW3, for example, should be an ARM Cortex A8, implementing the ARMv7A specs. The variables to set are:

Code:
GOOS=linux
GOARCH=arm
GOARM=7

At the moment I haven't got a Kindle to test Go generated binaries: my PW1 has been stolen and I'm waiting a PW3, hoping it's still jailbreakeable.

Can anybody try it, please?

Last edited by pirl8; 04-20-2017 at 06:07 PM.
pirl8 is offline   Reply With Quote
Old 04-20-2017, 07:09 PM   #2
knc1
Going Viral
knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.
 
knc1's Avatar
 
Posts: 17,212
Karma: 18210809
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
It would be nice if you referenced the existing thread on using the GO language.
It would save your readers from having to search for a thread that is several years old.
knc1 is offline   Reply With Quote
Advert
Reply

Tags
cross-compile, golang


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Golang for arm and Pocketbook transient PocketBook Developer's Corner 0 05-16-2015 01:22 PM
$0.01 in Kindle Store: Interactive Sudoku for Kindle 2 and Kindle DX - Volume 1 Xia Deals and Resources (No Self-Promotion or Affiliate Links) 2 11-07-2009 10:06 AM


All times are GMT -4. The time now is 04:23 PM.


MobileRead.com is a privately owned, operated and funded community.