11 ms·
React.js, if you squint, is also a step in this direction – React.js on the client can bind to a DOM, or run in Node and stream strings to a socket. In other wo
by dustingetz 8y ago
React.js, if you squint, is also a step in this direction – React.js on the client can bind to a DOM, or run in Node and stream strings to a socket. In other words React decoupled HTML rendering from platform APIs by making it data driven. Data is universal and can be manipulated on any platform, even pencil and paper. What other platform APIs can be replaced by something data driven? I know from my study of Haskell that the answer is probably: all of them.
- threatofrain 8y agoI'm quite curious as to when types and methods are going to be shared across boundaries.
- dustingetz 8y agoI think that is a mistake, because data is universal but types and methods are not. Consider a value {"a": [42, 43]} - it could be mutable, immutable, persistent, optimized for ordered traversal, optimized for random access lookups, optimized for insertions.
- threatofrain 8y agoFrom one perspective types and methods aren't universal, but data is, because once information arrives over the wire you aren't even initially sure if it is what you think it is. However, when backend and frontend code exists in the same context for analysis, aren't there enough certainties to know the space of possibilities for what you're going to receive? How much uncertainty precludes the useful sharing of types and methods?
- dustingetz 8y agoWell if I have EDN or JSON on the wire, and have the same portable Clojure library running on both sides, doesn't that pretty much accomplish the same thing as serializing actual object instances? Or is that what you meant all along?