Google Go Language

For everything that's not in any way related to PureBasic. General chat etc...
uwekel
Enthusiast
Enthusiast
Posts: 740
Joined: Sat Dec 03, 2011 5:54 pm
Location: Oldenburg (Germany)

Google Go Language

Post 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
PB 5.70 LTS (x64) - Debian Testing, Gnome 3.30.2
RASHAD
PureBasic Expert
PureBasic Expert
Posts: 4991
Joined: Sun Apr 12, 2009 6:27 am

Re: Google Go Language

Post 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
Egypt my love
User avatar
Shield
Addict
Addict
Posts: 1021
Joined: Fri Jan 21, 2011 8:25 am
Location: 'stralia!
Contact:

Re: Google Go Language

Post 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.
Image
Blog: Why Does It Suck? (http://whydoesitsuck.com/)
"You can disagree with me as much as you want, but during this talk, by definition, anybody who disagrees is stupid and ugly."
- Linus Torvalds
uwekel
Enthusiast
Enthusiast
Posts: 740
Joined: Sat Dec 03, 2011 5:54 pm
Location: Oldenburg (Germany)

Re: Google Go Language

Post by uwekel »

@Shield: I used github.com\conformal\gotk3\gtk and the simple.go in the example folder. The filesize was 14251 KB.
PB 5.70 LTS (x64) - Debian Testing, Gnome 3.30.2
User avatar
fsw
Addict
Addict
Posts: 1603
Joined: Tue Apr 29, 2003 9:18 pm
Location: North by Northwest

Re: Google Go Language

Post 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.

I am to provide the public with beneficial shocks.
Alfred Hitshock
User avatar
TI-994A
Addict
Addict
Posts: 2751
Joined: Sat Feb 19, 2011 3:47 am
Location: Singapore
Contact:

Re: Google Go Language

Post 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
Texas Instruments TI-99/4A Home Computer: the first home computer with a 16bit processor, crammed into an 8bit architecture. Great hardware - Poor design - Wonderful BASIC engine. And it could talk too! Please visit my YouTube Channel :D
User avatar
Kwai chang caine
Always Here
Always Here
Posts: 5500
Joined: Sun Nov 05, 2006 11:42 pm
Location: Lyon - France

Re: Google Go Language

Post 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 ?
ImageThe happiness is a road...
Not a destination
ElementE
Enthusiast
Enthusiast
Posts: 139
Joined: Sun Feb 22, 2015 2:33 am

Re: Google Go Language

Post 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"?
Think Unicode!
User avatar
netmaestro
PureBasic Bullfrog
PureBasic Bullfrog
Posts: 8452
Joined: Wed Jul 06, 2005 5:42 am
Location: Fort Nelson, BC, Canada

Re: Google Go Language

Post 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.
BERESHEIT
User avatar
Kwai chang caine
Always Here
Always Here
Posts: 5500
Joined: Sun Nov 05, 2006 11:42 pm
Location: Lyon - France

Re: Google Go Language

Post 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:
ImageThe happiness is a road...
Not a destination
User avatar
Danilo
Addict
Addict
Posts: 3036
Joined: Sat Apr 26, 2003 8:26 am
Location: Planet Earth

Re: Google Go Language

Post 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.
User avatar
Kwai chang caine
Always Here
Always Here
Posts: 5500
Joined: Sun Nov 05, 2006 11:42 pm
Location: Lyon - France

Re: Google Go Language

Post 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 :|
ImageThe happiness is a road...
Not a destination
User avatar
NicTheQuick
Addict
Addict
Posts: 1527
Joined: Sun Jun 22, 2003 7:43 pm
Location: Germany, Saarbrücken
Contact:

Re: Google Go Language

Post 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.
The english grammar is freeware, you can use it freely - But it's not Open Source, i.e. you can not change it or publish it in altered way.
User avatar
Kwai chang caine
Always Here
Always Here
Posts: 5500
Joined: Sun Nov 05, 2006 11:42 pm
Location: Lyon - France

Re: Google Go Language

Post 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:
ImageThe happiness is a road...
Not a destination
User avatar
Danilo
Addict
Addict
Posts: 3036
Joined: Sat Apr 26, 2003 8:26 am
Location: Planet Earth

Re: Google Go Language

Post by Danilo »

Did you try b4a (Basic4Android), KCC?

GOMOBILE seems to be incomplete/experimental currently.
Post Reply