No video

Building modern desktop apps in Go

  Рет қаралды 55,244

FOSDEM

FOSDEM

5 жыл бұрын

by Serge Zaitsev
At: FOSDEM 2019
video.fosdem.o...
I'll show how to quickly build a simple desktop app with Go+HTML5, that doesn't look like it's from the 90s, neither it feels bloated like Electron. User interfaces have come a long way from punch cards and command line to post-WIMP era with touch screens and voice input. Modern UI is expected to be fast, responsive and smooth, with high-quality typefaces, rich images, animations, accessibility. HTML5 handles it all very well, and with GPU acceleration it has decent visual performance. Go may have stated itself as a language for writing services, but with Redux architecture GUI apps are not much different from request/response model. Having excellent performance, Go is a perfect fit for writing core app logic. The only thing that's missing is a link between HTML5 and Go, so that Go code could be called from the UI, and UI could be manipulated from Go.
HTML5 is often considered heavy because it requires a browser engine. We don't want to ship browser runtime with each and every app. One solution is to reuse the native OS runtime. Another is to use some pre-installed browser in the standalone app mode. Both end up with small, fast, self-contained binaries that are easy to build and to distribute.
I would like to briefly explain how each approach works, and how to choose one that fits better for your needs.
I'll introduce Webview1 and Lorca2 libraries and show how to build a quick desktop app in Go with either of those. I'll cover bootstrapping the new app, communication between Go and UI layer, debugging UI, building and packaging the app. I'll do the demonstration on Linux, but will show how to prepare the same app for Windows/MacOS.
Room: UD2.120 (Chavanne)
Scheduled start: 2019-02-02 11:00:00+01

Пікірлер: 30
@danijelpremus5177
@danijelpremus5177 4 жыл бұрын
I'm using Go, but for desktop GUI application my favorite is Lazarus. Same as in Go you can compile the same source code for different platforms (Linux, macOS, Windows...) and you get a native single binary executable.
@marc_frank
@marc_frank 6 ай бұрын
but it looks so old and the multi form ide is annoying
@NatoBoram
@NatoBoram 4 жыл бұрын
"Electron is bad" \*Promotes another Chromium Frankenstein*
@GergiH
@GergiH 4 жыл бұрын
Yea, I fail to see the reason for this. If someone has any idea why this is better than Electron feel free to elaborate since I'm genuinely curious since this seems like the same thing (besides it uses the OS's browser which I wouldn't really call a big of an improvement from Electron if any)
@JimmyLinPhD
@JimmyLinPhD 4 жыл бұрын
Gergely H These solutions use the web browser you already have on your computer. So the download size is much smaller, since you don’t have to ship an entire HTML engine as well. If you assume that launching a HTML renderer built into the OS takes less resources than launching an external one, then Webview should take up less resources too.
@llothar68
@llothar68 3 жыл бұрын
@@GergiH Because Go > JS .... at least this is his opinion, not mine
@JonathanRintala
@JonathanRintala 5 жыл бұрын
Great video!
@llothar68
@llothar68 3 жыл бұрын
This is fixing problems that aren't the problems of modern desktop GUI applications. It doesn't fix the problem of large data sets in models, multithreading, complicated text (Atom had to implemented the all in C++ and using HTML just like a Pango Text Layout replacement). The only problem with modern desktop GUI apps is that you barely find good developers who know to program GTK, WinUI3 and Cocoa.
@codelucky
@codelucky 4 жыл бұрын
1973 there were no GUI. Please correct it.
@RobertLugg
@RobertLugg 4 жыл бұрын
What is the baseline library for writing GUI apps in Go? For instance, for Python it is Tkinter.
@tillorrly1128
@tillorrly1128 4 жыл бұрын
None. Probably because Go has it's roots in server backends.
@tetlamed
@tetlamed 4 жыл бұрын
None, because Go likes having a small, minimal standard library and leaving the rest of the control to the user
@morgengabe1
@morgengabe1 3 жыл бұрын
@@tetlamed tkinter isn’t in python’s standard library.
@tetlamed
@tetlamed 3 жыл бұрын
@@morgengabe1 I think you might've tagged the wrong person here
@morgengabe1
@morgengabe1 3 жыл бұрын
@@tetlamed No, I believe it is you who are the one accusing my beloved python of failing to omit chaff from its standard library. Humph! And a big finger wag at you!
@emilie1977
@emilie1977 5 жыл бұрын
"Electron is bad" exactly
@FPChris
@FPChris 2 жыл бұрын
Make Lorca for pure C
@eddie2378
@eddie2378 3 жыл бұрын
I would rather combine Golang with QtQuick/QML.
@bitcode_
@bitcode_ 4 жыл бұрын
he said java, lol i got to agree that this person is much smarter than me, and I could not do public speaking... but he said java
@Snailsxd
@Snailsxd 4 жыл бұрын
ikr
@christophernuzzi2780
@christophernuzzi2780 5 жыл бұрын
Apple could not have published their human-computer interaction guidelines in 1973 - Apple didn't exist yet! Does this guy mean Xerox? Or maybe Apple in 1983?
@ER_aka_RAM
@ER_aka_RAM 4 жыл бұрын
Don’t be condescending douche .... it was already in the works after PARC, which didn’t have a clue or the vision of what was to come. So no, Serge wouldn’t refer to Xerox as the WIMP source. You’re stuck on the mouse 🤦🏽‍♂️
@scottstensland
@scottstensland 4 жыл бұрын
yes he meant Apple in 1983 my first mac was 1985
@farjona
@farjona 5 жыл бұрын
'Electron is bad.'...... owhkee
@vitisanity
@vitisanity 4 жыл бұрын
No drag n drop for GUI, forget it.
@mstroven
@mstroven 3 жыл бұрын
The presenter doesn't seem to know much about the actual history of mobile devices and user interfaces... Have a look at Newton circa 1994.
@johnemory7485
@johnemory7485 5 жыл бұрын
F1 not helpful? Well, in comparison to a man page, I suppose it's not, but that wasn't the claim. If you can't take time to read about the program you're using, you're either being lazy or you're under 10 years old. When I was that young, I had time to just explore and learn on my own time. After that, man pages or bust.
@llothar68
@llothar68 3 жыл бұрын
Man pages or any documentation doesn't work well with 30 day sprints in the modern agile world.
Twelve Go Best Practices - Francesc Campoy
49:27
Esri R&D Center
Рет қаралды 70 М.
Stay on your way 🛤️✨
00:34
A4
Рет қаралды 32 МЛН
ПОМОГЛА НАЗЫВАЕТСЯ😂
00:20
Chapitosiki
Рет қаралды 26 МЛН
WORLD'S SHORTEST WOMAN
00:58
Stokes Twins
Рет қаралды 178 МЛН
managed to catch #tiktok
00:16
Анастасия Тарасова
Рет қаралды 19 МЛН
Using docker in unusual ways
12:58
Dreams of Code
Рет қаралды 437 М.
When RESTful architecture isn't enough...
21:02
Dreams of Code
Рет қаралды 269 М.
The Story of Next.js
12:13
uidotdev
Рет қаралды 563 М.
Gio UI: Cross-Platform Accelerated Graphics in Go
1:32:15
Ubuntu OnAir
Рет қаралды 1,8 М.
7 Essential Command Line Tools (2022)
9:12
Tech Craft
Рет қаралды 207 М.
Go + Microservices = Go Kit [I] - Peter Bourgon, Go Kit
38:49
CNCF [Cloud Native Computing Foundation]
Рет қаралды 102 М.
Building a Bank with Go
53:22
InfoQ
Рет қаралды 118 М.
Harder Drive: Hard drives we didn't want or need
36:47
suckerpinch
Рет қаралды 1,6 МЛН
Gopherfest 2015 | Go Proverbs with Rob Pike
22:29
The Go Programming Language
Рет қаралды 246 М.
Stay on your way 🛤️✨
00:34
A4
Рет қаралды 32 МЛН