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.
I'm guessing a lot of people take issue with the term because it feels out of place. Software engineering doesn't use a lot of greek derived terminology like mathematics, chemistry, etc... Rather it seems to primarily use English derived terminology.
I'm opposed to sloppy uses that don't really apply except in the most trivial sense and don't actually convey any useful information. It's a buzzword now and I'm embarrassed for programming.
It absolutely conveys useful information. At least... when used correctly.
It's talking about applications that share a similar structure and composition. An isomorphic application is one that is structured similarly on the server and the client (often sharing most of the code) but will not have all the code the same.
For example - server side code may deal with Auth or routing whereas the client is more data driven.
This is quite different to a 100% server rendered page OR a client-rendered page. It shares some features with both. This is also quite different from the implication of a universal application - which would imply both the client and server run the exact same code (otherwise how can it be called universal?).
So it's very information rich compared to any alternative.
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?
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.
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.
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.
First, you would not describe a web application as “isomorphic” if it’s an abstraction over a client and a server which both share the same code. The proper way to use this term would be to say that there is an isomorphism between the client and the server (and again, that web application is not the isomorphism), or you could say that the client and server are isomorphic with respect to one another. A thing cannot be isomorphic, it can only be isomorphic with respect to another thing. But it cannot be isomorphic because it is a morphism between two things in an isomorphism.
Second, and more importantly, the client and the server do not share an isomorphism under this paradigm. An isomorphism describes two objects which have a mapping between them such that, for all intents and purposes, they are equivalent. “Equivalence” is a specific mathematical term distinct from equality: 5 and 7 are not equal, but under a function that outputs the same number for all odd inputs, 5 and 7 are equivalent.
More precisely, you cannot tell two objects apart using only their properties if they are isomorphic to each other. If we were to define a client and a server in a category theoretic sense, the client and the server would have to have all the same properties that can be used to draw morphisms, which means a bijective function could be drawn between them such that they have equivalent outputs when used as the inputs for other functions. In other words, it must be possible for the client to be the server for this web application and vice versa.
This is obviously not the case just because they share all the same code, for a variety of examples. Let’s say a client and a server share an isomorphism. Then a web application hosted by the server is also hosted by the client, and all the users of the server could equivalently (in the mathematical sense) log in to, and interface with, the client as if it were the server. Then the client and the server are not equal, but they are equivalent. But this framework does not enable that capability.
It’s just not a correct use of the word. I personally don’t mind the use of mathematical terminology in a colloquial sense, but only if that terminology is used in an audience-appropriate and correct way. Here’s an example: in a peer to peer file transfer relationship, two peers share an isomorphism via their peer connection if they both have all the same properties (i.e. same file transfer protocol, same internet speed, same files, etc) germane to a particular morphism (which we’ll in this case define as a function to get a download from a peer). Then Peer A and Peer B are isomorphic with respect to one another; you could drop in Peer A’s IP address to download the same files, at the same speed, etc as if you dropped in Peer B’s IP address.
It seems like it's pretty common to refer to something as Isomorphic X if it's an instance or implementation of X which relies heavily on the concept Isomorphism. For example, in homomorphic encryption the homomorphism is really describing the relationship between the encrypted text and the clear text. Not the encryption itself, so really a pedantically correct name would be "encryption in which the clear text and encrypted text are homomorphic with respect to certain operations" but "homomorphic encryption" serves as shorthand for that.
> Second, and more importantly, the client and the server do not share an isomorphism under this paradigm. An isomorphism describes two objects which have a mapping between them such that, for all intents and purposes, they are equivalent. “Equivalence” is a specific mathematical term distinct from equality: 5 and 7 are not equal, but under a function that outputs the same number for all odd inputs, 5 and 7 are equivalent.
I disagree that they don't share an isomorphism and also disagree with your terms here. The standard definitions of isomorphism, at least the ones I found, do not seem to use the notion of equivalence, I'd be interested to see a link to one that does. Furthermore "equivalence" by itself isn't a specific mathematical term, again I'd be interested to see a link its definition but neither Mathworld or Wikipedia seem to have definitions. Equivalence Relation is defined but there are other uses of equivalence in math.
> More precisely, you cannot tell two objects apart using only their properties
Yes, and this seems to apply very well to the Client and Server because you can't tell them apart by running Go code on them since they both will give you the same answer. You can tell them apart by doing other things to them, but that's true of all isomorphisms. For example the groups ({0}, +) and ({1}, *). (0 under addition and 1 under multiplication.) Are clearly isomorphic since they're both just a group with their identity element. But you can also obviously tell them apart in other ways.
"monoglot" might be a more accurate term, but "isomorphic" seems to have the mind share.
"isomorphic" would seem to imply having the same structural composition - eg. big ball of mud on the front end and back end, or broken into services implemented as objects (sequential) or actors (concurrent).
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.
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.
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.
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."
ah, i see, so compile some golang/template code into javascript? makes sense to me now, but i never liked the gwt type constructs, i for one actually like the fact that you have ui people working with javascript or whatever languages/frameworks they like and the backend guys doing what they like, and the contract between them is an api.
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.
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...
"isomorphic" came from the JS community using it as a buzzword meaning that the same code runs on the client and server side and can be shared or reused.
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.
> 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.
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.
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.
50 comments
[ 2.3 ms ] story [ 101 ms ] threadBecause it’s a perfectly applicable usage when used outside of mathematics
At least that's my reading of the situation.
It's talking about applications that share a similar structure and composition. An isomorphic application is one that is structured similarly on the server and the client (often sharing most of the code) but will not have all the code the same.
For example - server side code may deal with Auth or routing whereas the client is more data driven.
This is quite different to a 100% server rendered page OR a client-rendered page. It shares some features with both. This is also quite different from the implication of a universal application - which would imply both the client and server run the exact same code (otherwise how can it be called universal?).
So it's very information rich compared to any alternative.
In this example, it's not just "some other relationship" after the mapping, but involves c, also mapped.
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.
First, you would not describe a web application as “isomorphic” if it’s an abstraction over a client and a server which both share the same code. The proper way to use this term would be to say that there is an isomorphism between the client and the server (and again, that web application is not the isomorphism), or you could say that the client and server are isomorphic with respect to one another. A thing cannot be isomorphic, it can only be isomorphic with respect to another thing. But it cannot be isomorphic because it is a morphism between two things in an isomorphism.
Second, and more importantly, the client and the server do not share an isomorphism under this paradigm. An isomorphism describes two objects which have a mapping between them such that, for all intents and purposes, they are equivalent. “Equivalence” is a specific mathematical term distinct from equality: 5 and 7 are not equal, but under a function that outputs the same number for all odd inputs, 5 and 7 are equivalent.
More precisely, you cannot tell two objects apart using only their properties if they are isomorphic to each other. If we were to define a client and a server in a category theoretic sense, the client and the server would have to have all the same properties that can be used to draw morphisms, which means a bijective function could be drawn between them such that they have equivalent outputs when used as the inputs for other functions. In other words, it must be possible for the client to be the server for this web application and vice versa.
This is obviously not the case just because they share all the same code, for a variety of examples. Let’s say a client and a server share an isomorphism. Then a web application hosted by the server is also hosted by the client, and all the users of the server could equivalently (in the mathematical sense) log in to, and interface with, the client as if it were the server. Then the client and the server are not equal, but they are equivalent. But this framework does not enable that capability.
It’s just not a correct use of the word. I personally don’t mind the use of mathematical terminology in a colloquial sense, but only if that terminology is used in an audience-appropriate and correct way. Here’s an example: in a peer to peer file transfer relationship, two peers share an isomorphism via their peer connection if they both have all the same properties (i.e. same file transfer protocol, same internet speed, same files, etc) germane to a particular morphism (which we’ll in this case define as a function to get a download from a peer). Then Peer A and Peer B are isomorphic with respect to one another; you could drop in Peer A’s IP address to download the same files, at the same speed, etc as if you dropped in Peer B’s IP address.
It seems like it's pretty common to refer to something as Isomorphic X if it's an instance or implementation of X which relies heavily on the concept Isomorphism. For example, in homomorphic encryption the homomorphism is really describing the relationship between the encrypted text and the clear text. Not the encryption itself, so really a pedantically correct name would be "encryption in which the clear text and encrypted text are homomorphic with respect to certain operations" but "homomorphic encryption" serves as shorthand for that.
> Second, and more importantly, the client and the server do not share an isomorphism under this paradigm. An isomorphism describes two objects which have a mapping between them such that, for all intents and purposes, they are equivalent. “Equivalence” is a specific mathematical term distinct from equality: 5 and 7 are not equal, but under a function that outputs the same number for all odd inputs, 5 and 7 are equivalent.
I disagree that they don't share an isomorphism and also disagree with your terms here. The standard definitions of isomorphism, at least the ones I found, do not seem to use the notion of equivalence, I'd be interested to see a link to one that does. Furthermore "equivalence" by itself isn't a specific mathematical term, again I'd be interested to see a link its definition but neither Mathworld or Wikipedia seem to have definitions. Equivalence Relation is defined but there are other uses of equivalence in math.
> More precisely, you cannot tell two objects apart using only their properties
Yes, and this seems to apply very well to the Client and Server because you can't tell them apart by running Go code on them since they both will give you the same answer. You can tell them apart by doing other things to them, but that's true of all isomorphisms. For example the groups ({0}, +) and ({1}, *). (0 under addition and 1 under multiplication.) Are clearly isomorphic since they're both just a group with their identity element. But you can also obviously tell them apart in other ways.
"isomorphic" would seem to imply having the same structural composition - eg. big ball of mud on the front end and back end, or broken into services implemented as objects (sequential) or actors (concurrent).
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.
https://medium.com/gopherjs/surprises-in-gopherjs-performanc...
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."
Really, the page explains what "isomorphic" means in this context...
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.
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/