Go for the desktop app

1,824 views
Skip to first unread message

Gour

unread,
Jun 4, 2014, 9:27:07 AM6/4/14
to golan...@googlegroups.com
Hello!

Hugo static site generator written in Go has made me interested for the
language and in last few days I watched severel Go-related presentations
from both FOSDEM-2014 as well as GopherCon.

I must say that I really like many aspects of the language which
provides complete development environment including building &
installing packages, formatting source code etc. up to concurrency
model.

There is still one aspect of the language which I'm not certain about
and that's whether Go is recommended to be used for 'classical'
(multi-platform) desktop applications?

Few days ago the author of go-qml (Gustavo) replied here that Qt-5.x is
good-enough for writing desktop apps, so it's great to see bindings for
it, but, although I see that there is sometimes mentioned that Go is
'general programming language', still in many talks, docs etc. it is
repeatead that the language is primarily created for another purpose.

Of course, considering we want to avoid using C(++), Rust seems to be
another candidate (there is wxRust project) and I here is the nice
comparison which I found on the Internet: "Go puts programmer
productivity on top, thus fast compilation, "zero-thinking" memory
management (thus global GC). They want the best from both fast but hard
C++ and elegant but slow Python.

Rust aims at low level, close to hardware, as fast as possible programs,
thus fine tuning for memory management (arenas, isolated GCs, choice
between GC and non-gc allocation), thus disallowance of implicit copying
even at cost of making language a bit harder etc."

I must say that Go's simplicity is tempting, but would still like to
hear some opinions and/or experiences about the attempts to use Go for
the desktop apps?


Sincerely,
Gour

--
Even a man of knowledge acts according to his own nature, for
everyone follows the nature he has acquired from the three modes.
What can repression accomplish?

Archos

unread,
Jun 4, 2014, 1:12:01 PM6/4/14
to golan...@googlegroups.com, go...@atmarama.net
Use Rust to handle stuff of low level where it's very important to avoid pauses from the GC (graphics, audio), and Go to handle the User Interface and application logic.

See the web browsers; they have code in C++ for audio,video,input (HTML5), then an API in javascript.

Gour

unread,
Jun 4, 2014, 1:16:21 PM6/4/14
to golan...@googlegroups.com
Archos <raul...@sent.com> writes:

> Use Rust to handle stuff of low level where it's very important to avoid
> pauses from the GC (graphics, audio), and Go to handle the User Interface
> and application logic.

If I'm supposed to use/glue two languages to write desktop app, then I
could consider other languages, so I simply prefer with the single one
(except GUI bindings).


Sincerely,
Gour

--
Those who are on this path are resolute in purpose,
and their aim is one. O beloved child of the Kurus,
the intelligence of those who are irresolute is many-branched.

Archos

unread,
Jun 4, 2014, 1:42:51 PM6/4/14
to golan...@googlegroups.com, go...@atmarama.net

Mateusz Czapliński

unread,
Jun 5, 2014, 4:58:10 AM6/5/14
to golan...@googlegroups.com, go...@atmarama.net
On Wednesday, June 4, 2014 3:27:07 PM UTC+2, Gour wrote:
There is still one aspect of the language which I'm not certain about
and that's whether Go is recommended to be used for 'classical'
(multi-platform) desktop applications?

Few days ago the author of go-qml (Gustavo) replied here that Qt-5.x is
good-enough for writing desktop apps, so it's great to see bindings for
it, but, although I see that there is sometimes mentioned that Go is
'general programming language', still in many talks, docs etc. it is
repeatead that the language is primarily created for another purpose.

[...]


I must say that Go's simplicity is tempting, but would still like to
hear some opinions and/or experiences about the attempts to use Go for
the desktop apps?

I don't really understand the question, I'm afraid. That Go was "primarily created for another purpose" - so what? Lua language was "primarily created" as "configuration language", or ".ini files on steroids"[1]. By total accident, it got used for scripting in one game, and then it spread like wildfire and now it's used probably in some 50% games in the world, or something; also, as "assembly language" targetted by a JavaScript compiler for fast execution on embedded systems[2]; also, has many, many other uses. So I don't really get this argument.

From my personal point of view, the only/main inconvenience is that Go has no good *native* (i.e. pure Go) cross-platform GUI library. But it's hard to claim if any language at all has such a library; making one is a difficult problem out of itself (neither even Qt, nor wxWidgets, is universally accepted as "conforming to UI idioms on all supported platforms"; which can change even from OS version to version, see e.g. Windows 3.11 vs. Windows 95 vs. Windows XP vs. Windows Vista/Aero vs. Windows 8/Metro...). So, if you're ok with using go-qml, then I'd say why not? Qt is I think one of the "best" (i.e. least bad) choices at the moment.

Also, I believe for writing a GUI app, deciding based on whether Rust or Go is by some unknown measure (about general benchmarking flaws, see "Your application is the ultimate benchmark"[3]) a few percent "faster" is misguided. You'll still be much faster than in Python, or Java, or else. And look at how many GUI apps are written in Python or Java. Argh, JavaScript even [shudder]. I'd say libs availability (and possibly their speed/responsiveness, as a function of used algorithms & approach & number of layers), cross-platformness, and general language qualities should be probably more important. And one can always botch his app and its speed in whichever language.

  [1]: http://www.lua.org/history.html
  [2]: http://thread.gmane.org/gmane.comp.lang.lua.general/102331
  [3]: http://benchmarksgame.alioth.debian.org/dont-jump-to-conclusions.php

Still, just my $0.02. As I said, I'm not sure if I understand the question, so sorry if my rant veered too much off topic. Um, or got too rant-ish or aggresive (?) in general :/

/Mateusz.

Gour

unread,
Jun 5, 2014, 9:23:50 AM6/5/14
to golan...@googlegroups.com
Mateusz Czapliński <czap...@gmail.com>
writes:

> I don't really understand the question, I'm afraid.

Well, it was more as (humble) request to "hear some opinions and/or
experiences about the attempts to use Go for the desktop apps!" ;)

> From my personal point of view, the only/main inconvenience is that Go has
> no good *native* (i.e. pure Go) cross-platform GUI library.

That would be ncie indeed, but I do not wish to hold my breath in
regard. :-)

> So, if you're ok with using go-qml, then I'd say why not? Qt is I
> think one of the "best" (i.e. least bad) choices at the moment.

Good.

> Still, just my $0.02. As I said, I'm not sure if I understand the question,
> so sorry if my rant veered too much off topic. Um, or got too rant-ish or
> aggresive (?) in general :/

Don't worry - it was helpful and in the meantime, after some more
Go-related reading, it seems that I'm steadily moving towards Go. ;)


Sincerely,
Gour

--
From wherever the mind wanders due to its flickering and unsteady
nature, one must certainly withdraw it and bring it back under
the control of the self.

Gustavo Niemeyer

unread,
Jun 5, 2014, 10:39:57 AM6/5/14
to Gour, golan...@googlegroups.com
On Wed, Jun 4, 2014 at 10:26 AM, Gour <go...@atmarama.net> wrote:
> I must say that Go's simplicity is tempting, but would still like to
> hear some opinions and/or experiences about the attempts to use Go for
> the desktop apps?

Have you seen Go QML:

https://gopkg.in/qml.v0
https://github.com/go-qml/qml

If you're interested, please join the mailing list and let us know how it goes:

https://groups.google.com/forum/#!forum/go-qml

Here are a few sample apps from a recent contest:

http://blog.labix.org/2014/04/25/qml-contest-results


gustavo @ http://niemeyer.net

Gour

unread,
Jun 5, 2014, 2:25:29 PM6/5/14
to golan...@googlegroups.com
Gustavo Niemeyer <gus...@niemeyer.net>
writes:

> Have you seen Go QML:

Sure. You answered my go-qml--related question the other day. ;)

> If you're interested, please join the mailing list and let us know how
> it goes:

I'm already there, but still wanted to hear some more
opinions/experiences.

Today I was watching 'Inside the Gopher Studio' and was very pleased to
see/hear that Andrew appreciates your work and looking forward to see Go
& desktop in the future. :-)


Sincerely,
Gour

p.s. Btw, any feedback from Gmane crew in regard to subscription?

--

Archos

unread,
Jun 5, 2014, 6:17:28 PM6/5/14
to golan...@googlegroups.com, go...@atmarama.net
Here you have a Platform-native GUI library for Go:

https://github.com/andlabs/ui


El miércoles, 4 de junio de 2014 14:27:07 UTC+1, Gour escribió:
Reply all
Reply to author
Forward
0 new messages