(note: I know nothing when it comes to health related issues like this so I'm assuming it's completely naive thought since I haven't seen anyone else mention anything similar)
53 karma · joined February 6, 2019
(note: I know nothing when it comes to health related issues like this so I'm assuming it's completely naive thought since I haven't seen anyone else mention anything similar)
I know OOP is out now-a-days, but bear with me cause I don't know of any equivalent functional papers/books to describe this idea as well. Elemental Design Patterns [1] shows a way of relating the formal lambda calculus of OOP relationships to design patterns by defining the set of the core operation relationships between types/objects/fns/etc. If you treat all objects/types/functions/etc as a cartesian grid, those core relationships define a basis vector that allows you to combine different operations that create the famous OOP design patterns. And in fact I've always thought of that basis vector the same way as the movements of a chess board, and I've wondered if there's other moves you could add to provide an easier way of hitting all squares.
Since a programming language selects specific syntax to navigate these relationships, if you could describe a language in terms of a lower level basis language, would it make it easier to see which patterns are missing from a language to help move from one concept to another? Could this help design committees select better language constructs that don't do the same things, or conflict in some way? And I'm going to go out here on a limb and hypothesize that a language is Turing Complete if it provides language constructs to allow you to hit every square on the grid, but again not enough skill to prove it myself.
Anyways, I've never thought about the modulo math of these operations like in the case of a Knight's move, so this was super interesting! Does anyone know of any good papers/talks on type theory mixed with modulo spaces, cause I'm certain you could build a different basis for more functional patterns using category theory, and now I'm curious how it might tie in.
[1] https://www.eecs.yorku.ca/course_archive/2006-07/F/6431/Stot..., https://www.amazon.ca/Elemental-Design-Patterns-Jason-Smith/...
As an anecdote for one project, while trying to speed up some neo4j queries myself, I decided to model a binary tree structure in the nodes (child/parent relations) and then compared the query times for using the simple cypher queries vs cypher queries with some embedded lib functions that would walk the tree exactly the way I wanted. The times were much faster for something that I hadn't even optimized much code wise.
The test got me thinking that if I could have a way of declaring more info about how the relationships are related, then maybe we could automatically have the db use more appropriate algs for a more appropriate data structure for certain node types. I think that's similar to what's happening here, it's automatically mapping out the simple graph relations to structured relational db tables. I hope in the future we'll be able to provide more input to that as well (or at least I haven't seen something like this yet). Let me annotate my schema to specify my parent/child relationship as a tree, or my word map nodes form a trie but the leaves should be some other type. Why can't we think of a db as having multiple datatypes beyond just a kv-store, or table, or graph?
Ya this looks like it could've definitely fit the bill. Too bad it never took off. And worse yet, both major browsers tried their own version and neither took off.
This just seems so easy an idea to get on board with, like VSCode solving the n-to-1 problem with their language server api. I don't understand why it fizzled out.
I think the most important piece of tech that Sandstorm was working on was the capability based security and the powerbox concepts (which I recognized as being similar to Android's capability apis but for the web). I don't see the decentralized data or local servers being an easy sell any time soon, but I can see the capabilities security working really well within the browser, and more importantly with existing SaaS ecosystems.
If we could get a new browser API for websites to offer to register available APIs for jsonschema based type defs through a manifest file, then users could allow those APIs to be included in their local browser registry. Other pages could request (or offer) data from those APIs, and with the user's permission, the browser could do the necessary oauth handshake and use the API, passing data to/from another service in a secure way behind the scenes.
As well since it would be a browser API, a webpage looking to call an API would be able to request provider info and show the appropriate in-app UI for selecting a service, which sounds like one of the problems Sandstorm had.
No one would have to worry about whether they implement a dropbox api or onedrive api, the page would just have to show the 'file service' selector and call the user selected api with a file. So I'd expect every SaaS out there would jump at the chance to provide an easy access way for users to use and pay for their service.
Furthermore, the browser could provide external connectors as well so I could have some native external app that registers a provider with the browser, allowing me to send my in browser data to an external native app (or vice versa). For example right click menu on a .drawio file and send to DrawIO or send to the currently opened Google Slide. Or send a contact from your fav web contact manager to the your native Skype app. Seriously I can think of so many uses for this! And it fits in perfectly with the existing file or clipboard apis as well.
I hope someone sees this excited rant and can make it happen! :)
I also really do hope the work that's been done in Sandstorm continues on and pushes things further for all of us. Thanks!
The fading doesn't have to work based on wall clock time. I'd probably start off with trying to make it fade over a distance of 10% of the screen height along the vertical time axis. But you could come up with a bunch of different ways to model your 0-1 fade boundaries.
It's also how sequence diagrams are normally drawn, and is how I'd normally think about running through them, so I think it's a great idea to show Rx streams. However, I was kind of confused from playing with the interface a bit and trying to track what was happening, but I think it's an excellent first start to see how everything interacts!
One suggestion for trying to help visualize the interactions between different streams, I'd like to see onion skinned lines attaching events between streams. ie as the timeline hits the moment an event triggers between two streams you draw a horizontal line between the events and then as time goes on the line fades (to a controllable limit). Then you'll be able to see all the actual interaction lines between streams without cluttering the view.
I've used the hooks myself and I like the composability, but I can also understand the vitriol from the community. And so far my biggest complaint is that I can't use them in classes as well. I think if you treat them as a more core/composable type of object then you can use them in the same paradigm as Component classes.
My example here changes the names of the typical lifecycle events for clarity but you could use the component lifecycle names instead. Point is it should match the component lifecycle and allow the user to hook into each one separately but wrap everything up into a meaningful collection. A hook must be declaratively defined as a property in another class (I use the @annotation syntax here but I realize it's not standard yet), and that allows react to keep a consistent ordering on how/when hooks are called during lifecycle events. It also allows the hook to register itself for the lifecycle of the owner.
<code> class UseWindowWidth extends Hook {
// normal style of using state
state = {
width: this.props.value
}
// or maybe use state hook for new style
//@hook(UseState, this.props.value)
//width;
handleResize = (evt) => {
this.width.set(window.innerWidth);
}
hookDidMount() {
window.addEventListener('resize', this.handleResize);
}
hookWillUnmount() {
window.removeEventListener('resize', this.handleResize)
}
getWidth() {
return this.state.width;
}
// other public methods here would allow owner to do things
// ? although this doesn't fit well with top-down props style
}class MyComponent extends Component {
// @hook registers the hook into lifecycle events and
// passes props to UseWindowWidth hook. Also, any changes
// to hook state should cause a forceUpdate of the component
@hook(UseWindowWidth, { value: window.innerWidth })
windowWidth;
render() {
let width = this.windowWidth.getWidth();
return (
<p>Window width is {width}</p>
);
}
}
</code>The 'props' concept might not make sense with the Hook object as I have it here, cause I can't see a nice way to declaratively update the props instead of just calling setters, but that might be ok for how these would be used.
I'm not in love with this yet, and there's some other things that would have to be ironed out (like coordination between hooks), but I think it opens some ways to allow hook use in class components as well.