Page 1 of 3

Google Go Language

Posted: Tue May 06, 2014 8:08 pm
by uwekel
Hi,

the last two days i was playing around with Googles language Go. It is a well designed language and something between C and Python. At last i installed the GTK3 package, because i wanted to see whether it could do GTK applications, what is my main GUI on Linux. I compiled one of the small example programs and was happy to see that it run and worked. When i opened the folder containing the executable file, i couldn't believe my eyes!

The filesize was over 14 MB just for a small window with a label widget in it :!: I am not sure what's going on in that binary, but i guess that the whole GTK3 library has been linked in :?

After that i did a small program with PureBasic with just a few GTK3 bindings (not gtk3 subsystem), and guess what, the filesize is just 35KB :D

Ok, filesizes are not that important, but what will happen if we need some other libraries as well :oops:

Just wanted to let you know.

Uwe

Re: Google Go Language

Posted: Tue May 06, 2014 8:15 pm
by RASHAD
Playing with Google in any way maybe we will be WANTED some day some place
That is not the case with Fred and freak :mrgreen:
Be safe

Re: Google Go Language

Posted: Wed May 07, 2014 2:31 am
by Shield
It's not only the GTK3 lib. Go links everything statically.
However, 14MB seems to be a little too much. I tried this example here http://mattn.github.io/go-gtk/ (edit: looks like it's GTK2)
and the result was about 6MB. After stripping symbols I ended up with slightly over 3MB.

You can't really compare Go to PureBasic. Go provides you with a full runtime including garbage collector,
the possibility for reflection, type information, stack traces, etc. All these features are not available in PB.

Could you show us the example you found? I'd be interested in why you get a whopping 14MB.

Re: Google Go Language

Posted: Wed May 07, 2014 8:59 am
by uwekel
@Shield: I used github.com\conformal\gotk3\gtk and the simple.go in the example folder. The filesize was 14251 KB.

Re: Google Go Language

Posted: Thu May 08, 2014 5:52 am
by fsw
A while ago I read that Go is not yet in the "get the executable file size as small as possible" phase.
They first want to code all the guts perfectly, and then look at the executable file size.
However they acknowledged that something happened and the file size almost doubled.
I think it happened with version 1.2 and it is fixed in trunk for 1.3.
The file size of a hello world executable will still be some mega-byte though because, as was said earlier, they statically link everything.

BTW: gotk3 from conformal is the way to go (use it myself). If you like Qt there is a qml library available.

IMHO go is the best "new" c-syntax programming language.

nuff said.

Re: Google Go Language

Posted: Thu May 08, 2014 7:34 am
by TI-994A
Not all platforms have the luxury of having their SDKs pre-installed, like .Net and Java.

That's the great thing about PureBasic; always lean and mean! :D

Re: Google Go Language

Posted: Tue Nov 10, 2015 9:31 am
by Kwai chang caine
Hello at all
I'm happy several members try and talk about GO

Me too, i have try it, but have a strange behaviour.
When i create an APK with GOMOBILE, it run on emulator like bluestacks, but not on my samsung note.

I obtain just the title and a black screen.

Someone have a day this problem ?
Or perhaps know what is mine ?

Re: Google Go Language

Posted: Tue Nov 10, 2015 9:43 am
by ElementE
Official reason why the Go binaries are so large
https://golang.org/doc/faq#Why_is_my_tr ... rge_binary
Why is my trivial program such a large binary?

The linker in the gc tool chain creates statically-linked binaries by default. All Go binaries therefore include the Go run-time, along with the run-time type information necessary to support dynamic type checks, reflection, and even panic-time stack traces.

A simple C "hello, world" program compiled and linked statically using gcc on Linux is around 750 kB, including an implementation of printf. An equivalent Go program using fmt.Printf is around 2.3 MB, but that includes more powerful run-time support and type information.
Doesn't the PureBasic Debugger have something like a "stack trace"?

Re: Google Go Language

Posted: Tue Nov 17, 2015 5:40 pm
by netmaestro
@KCC: I'm new to the world of apps for devices and so my comments won't be worth much at this stage but a common cause of your troubles is code signing. If your code is signed properly it will run everywhere. Not signed and it will run in emulators but not on the final device. Something to look at anyway.

Re: Google Go Language

Posted: Tue Nov 17, 2015 6:01 pm
by Kwai chang caine
Hello Netmaestro happy to talk to you :D

Thanks to your explanation, i take care now about that 8)

Since this time, i have try on 3 mobile with Android
And that work now on a tablet samsung 3
But on Samsung note 1 and Samsung note 2 nothing, all black
They are not the same version of android on the tab and the phones, but the 2 phones have the same.
It's perhaps another pist

In fact, GOOGLE say GO is simple, but not really also simple :cry:
I believe GOOGLE must take several lessons with FRED for know what it is really simple... :mrgreen:

For the moment, it's not for me the language the problem...but how i can use and install it :lol:

Re: Google Go Language

Posted: Tue Nov 17, 2015 6:57 pm
by Danilo
@KCC:
If your devices have different versions of Android, it is important which
version of the Android SDK you use for compiling. Same for the version
of OpenGL ES - older devices don't support newer versions.
Check the GOMOBILE documentation about these specific topics, I only
know about it from MonkeyX, but it's things you need to take care of
with every Android development system.

Re: Google Go Language

Posted: Wed Nov 18, 2015 9:21 am
by Kwai chang caine
Aaaaah !!! i don't know this too :shock:
Thanks a lot for this tips 8)

More i do ANDROID and more i love PB and windows :|

Re: Google Go Language

Posted: Wed Nov 18, 2015 12:05 pm
by NicTheQuick
I like Go. At the university we had a lecture called "Multi-Core Programming on swarm-algorithms" where we had to solve different problems on a machine with 128 Cores, 256 Threads and 1 TB of RAM. The most complicated problem was creating a grammar by using an evolutionary algorithm. I chose Go as programming language because it has built-in support for concurrency.
It was fun because I had not to care about locks, conditions or synchronizing.

So if you want to program highly parallel algorithms Go is a good language to achieve good results in less time.

Re: Google Go Language

Posted: Wed Nov 18, 2015 12:29 pm
by Kwai chang caine
Cool a PB friend who use GO 8)

No me it's "just" to create utility (Button, Textfield, ListView, ImageView) and writing simple files txt
Also obviously use devices, Camera, light, phone, etc...

In fact i search to replace the JAVA, i hate it :twisted:

Since several month i try to find something simple, powerfull, portable (UsbStick)
A little bit PB but under ANDROID :D

I have try numerous things, heavy and big like VS2015, QT (Never works :oops:) and other other
I have also found RFO-Basic, it's a scripting language, he is cool, but it not really create APK, just fake of APK
And also several software directly on ANDROID, but the goal is to works on my PC
Even QBasic on DosBox, thanks to a friend he give to me the links :lol:

So after i have see GO, and GOOGLE promise the simplicity...but for the moment, the simplicity is not here :lol:
Much more ....GOOGLE also create "SIMPLE" for be again more simple...but never i have understand how run it just one time :oops:

I think GOOGLE have the chance to not know KCC....because what is simple for GOOGLE..is really not simple for KCC :oops:

Re: Google Go Language

Posted: Wed Nov 18, 2015 1:01 pm
by Danilo
Did you try b4a (Basic4Android), KCC?

GOMOBILE seems to be incomplete/experimental currently.