vwkd / stan Goto Github PK
View Code? Open in Web Editor NEWA modern, modular and extensible ERP
License: MIT License
A modern, modular and extensible ERP
License: MIT License
How do we access past state? How do we access direct state or accumulated state, for a certain point in time or a duration in time?
Golem likely stores the sequence of input/output calls of a component since time 0
to be able to restore its present state by replaying them. To access direct state for a certain point in time, Golem could offer an API to create a new temporary component with replayed component state until time t
that can then be called. But doing this for every point in time over a duration seems to be inefficient. Also, for accumulated state we would need to push the calculation to the client which could be error prone. For example, calculate the total incoming/outgoing cash flow over a duration by summing the cash account balance at each point in time over the duration.
This would work for state components that store the state internally. But what for workflow components where state are the executions itself? For example, the number of fulfilled orders is the number of successful executions of the order component. Golem likely doesn't store this history directly.
Make the whole component bundle run locally.
We could compose them manually with wasm-tools
and run with wasmtime
. Or we could wait for cargo component run
to implement cross-component imports1.
todo...
Currently we use global variables to store state in a library crate. Is there a better way?
The Golem Cloud apparently uses a single thread1 but if we use tests we have to worry about multiple threads.
We currently use an immutable global variable with a Mutex
while the Golem Cloud documentation uses a mutable global variable with unsafe
.
"When running a Golem component you don’t have to care about concurrent access of global state - each worker based on the template runs completely separated." golem.cloud ↩
Come up with a better name.
Currently we identify resources using an ID which we pass across components and the API boundary. Is there a better way?
Having to maintain an ID is painful. We need to resolve the ID to the resource each time we cross a boundary.
Should we instead pass a resource handle? Currently this seems to be a Rust reference &
. Does this introduce lifetime issues? Also, what if a smart pointers like Arc
would be better suited than a reference? For example, a state component could export a delete
function to delete an item which drops the Arc
, but any dependency components can still use as long as needed.
But we'll ultimately need some sort of ID when leaving the component cloud and pass the API boundary to the frontend.
Currently we use a increasing u64
and use it as index into a Vec
. The advantage over a string
is to have a natural order, not worry about generating a unique one without conflicts, and to not need to allocate every time we cross a boundary. The disadvantage is that Vec
wants a platform-dependent usize
which Wasm doesn't support, so using a u64
limits us to 64-bit and we panic if we run anywhere else. Also, we need to worry about never remove
an item from the Vec
or otherwise mutate the sequence which would change the IDs. Since we can't really delete, we can at most store an Option
and replace the value with None
, at the cost of complicating error handling.
Maybe some sort of hybrid between the two? Resource handles for internal cross-component boundaries, IDs for the API boundary?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.