
Isomorphic Go - ingve
https://isomorphicgo.org/
======
anonacct37
I'm actually building my latest project this way. Not using this project
though.

I actually really enjoy it. I have all of my go test stuff running in
subpackages, and a fairly thin main package that hooks my models up to vue.js
and builds some frappe charts. I very much enjoy taking the workflow I use to
build efficient services and using it to build my simple frontends.

two-way data binding on a go struct is actually kind of magical and not
something you could really go without javascript since (I assume) it relies on
Object.observe and go doesn't really have properties. Goroutines and channels
in javascript are also really magical.

~~~
mzzter
Are you using GopherJS? What’s the performance of Go in the browser?

~~~
anonacct37
Yes I'm using gopherjs. It actually performs really well. For a taste check
out this article on raw numeric perf where gopherjs beats native go. Of course
there's a catch/explanation but it's interesting to see how well it can
perform even on tight numeric loops.

[https://medium.com/gopherjs/surprises-in-gopherjs-
performanc...](https://medium.com/gopherjs/surprises-in-gopherjs-
performance-4a0a49b04ecd)

------
spullara
Google already did this with Java & GWT right?

Edit: I was responding to their claim "Up until the release of Isomorphic Go,
JavaScript had been the only game in town providing the capability to create
truly isomorphic web applications."

~~~
paulddraper
Or ScalaJS w/ ScalaTags?

~~~
philwelch
I’m pretty sure you could do similar things with Clojure and ClojureScript.

------
epynonymous
totally confused by the use of the word isomorphic, isnt this what we used to
call a dynamic web app where the server side renders template files and then
javascript embedded in the generated html files, most likely, does additional
client side work? i’m confused, it mentions saving time by leveraging code for
both server and client side, this sounds a bit like nodejs, but i have no idea
how golang code gets run in the browser, confused, i must be missing
something...

~~~
abritinthebay
It means isomorphic in the biology/crystal sense.

Two apps - server & client - that share an extremely similar structure (and
code).

It’s not the same as mathematical isomorphism but it’s a perfect description
of the dynamics at play if you understand the _other_ meanings of the term.

~~~
isomorphic
It still feels a little like abuse of the (more common) mathematical usage of
the term, but the same sort of abuse is ongoing with the term "serverless."
These things have moved into developer vernacular, so there's no point
fighting it, even if I'm a little biased.

~~~
abritinthebay
I mean... it’s _explicitly_ not the mathematical usage so that feeling is
something you’re bringing to the table, not the users of it.

------
eadmund
> Up until the release of Isomorphic Go, JavaScript had been the only game in
> town providing the capability to create truly isomorphic web applications.

Ummm, Parenscript[0] has been around for eight years.

Not to take anything away from Isomorphic Go, which definitely looks cool.

[0] [https://common-lisp.net/project/parenscript/](https://common-
lisp.net/project/parenscript/)

~~~
nameless912
Not to mention recent efforts to do Clojure/Clojurescript stacks. Not to call
someone full of shit, but this guy has drunk the Go kool-aid a _little_ hard.

------
ktpsns
What's the advantage of the term "isomorphic" in contrast to "full stack
framework"? I acknowledge that, using go, this is another paradigm in contrast
to what people call a "framework". But it feels like inventing cool terms.

~~~
skybrian
You can share logic between the client and server, and render pages on the
server for better SEO.

~~~
ktpsns
This is exactly what full stack frameworks such as
[https://www.meteor.com/](https://www.meteor.com/) provide.

------
frwhlr
It's an ad!

~~~
innagadadavida
The risk with reading framework books is that it is obsolete before you finish
reading them, also there are too many of them.

------
rebhan
Unfortunately the windows build of gopherjs stopped working since the
developers only work with Mac/Lin machines, and the main developer moved on to
create a Webassembly Backend for the Go compiler.

------
eximius
Is it really isomorphic if Go isn't running in the client?

~~~
kristianp
Go code is, in effect, running on the client, I assume it's compiled to
javascript using gopherjs.

------
MrBingley
Web dev, the beast that consumes all. Nothing is sacred.

~~~
anonacct37
I think the change is going the other direction. Native code and clean libs
that don't depend on window/document globals are coming to the web via
projects like this and the other 1/2 dozen ways the browser now has of running
gcc/llvm target output.

~~~
MrBingley
I was referring more to its use (abuse?) of the word "isomorphic", which
already has a well-established meaning in mathematics.

------
opportune
pedantic, but I don't like this application of the term "isomorphic"

~~~
jdoliner
What's wrong with it? Generally speaking in mathematics isomorphisms are
mappings that admit inverses. That seems like a fairly accurate description of
what's going on in that you can map code from server to client and back again
without changing its meaning. What word would you use?

~~~
hyperpallium
Mappings that admit inverses are _bijections_. An _isomorphism_ is a special
kind of bijection in which, if two things have some relationship before the
mapping, they have some other relationship after the mapping. e.g.

    
    
        if a*b = c, then ln(a)+ln(b) = ln(c)
    

EDIT The isomorphism is the mapping from _x_ to _ln(x)_ ; the two things
before the mapping are _a_ and _b_ ; their relationship before the mapping is
that their product is _c_ ; the two things after the mapping are _ln(a)_ and
_ln(b)_ ; and their new relationship is that their sum is _ln(c)_.

In this example, it's not just "some other relationship" after the mapping,
but involves _c_ , also mapped.

~~~
jdoliner
Right, particularly they're homomorphisms that admit inverses. I confused
myself into thinking that the fact that they admit an inverse implies that
they're structure preserving but that obviously isn't true. Still I don't see
anything here that doesn't basically apply to running the same code on client
and server. Since the entire point is that you are preserving structure, Go is
supposed to have exactly the same semantics on client and server.

~~~
hyperpallium
Yep. But as others have said, it's not really isomorphism in a mathematical
sense. The article defines "Isomorphic web applications" as "where the web
server and the web browser (the client), may share all, or some parts of the
web application code." Just, "same shape" on both sides.

If it was identical code, I would (mathematically) call it an identity (which,
to be fair, is an isomorphism).

But it's not identical; they transpile go to js ("GopherJS - A compiler from
Go to JavaScript"). This compilation itself is arguably an isomorphic mapping,
with the same code doing equivalent things on both sides. e.g. equivalent
assignments between equivalent variables.

Two problems with this interpretation (1) a transpiler doesn't have to be
isomorphic (e.g. could use different idioms); (2) that's not really the aspect
they're referring to.

------
everyone
Bah. I thought this was the game 'go'. Isomorphic go (the game) sounded
awesome!

~~~
opportune
You could probably do some very interesting work with Go and lattice theory.
It's a very symmetric game

~~~
everyone
I like go and I make games. I have considered making a go client with loads of
mad options that you can configure at will. Eg. More than 2 players,
triangular or hex grids, toroidal, play at same time, analog (place stone
wherever) etc.

