-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Another lament on Redbin limitations, or why sparse designs are bound to be reinvented until complete #155
Comments
??
|
That was not part of Redbin goal, which was to provide a way to serialize local Red data accurately without pulling the entirety of the global context (== whole Red runtime environment). Even in its current form, Redbin is already pulling some parts of the global context, which is not always desirable. A possible evolution of Redbin could include a way to control how "far" it pulls references, so the user can scale it for its specific needs. |
Thanks for correcting me, I've removed natives and actions from that list.
I understand, yes. But local data may include global words that need to be saved, or it may contain words like |
Perhaps the easiest patch would be to let it accept a callback, either to handle all values, or only those it can't save, rather than failing. And some But these are just some thoughts and a use case to inform the big picture. |
I had other thoughts on Redbin generality here |
The big picture thinking, and a real use case like this, is great. Thanks @hiiamboris. 👍 |
Another illustration of how bad it gets - saving two scalar values, carrying over the whole runtime:
Output:
I have to use text for state files module, because Redbin is a no-go. Of course that bears another risk. |
That last example looks like a bug where the words in the map are wrongly pulling their context instead of being processed just as symbols. |
Is it a bug in Redbin not having a special case for maps, or in maps for not removing words binding then? |
I'm pretty sure that's by design of >> map: to map! bind [foo: 'bar] context [foo: 'baz]
== #[
foo: 'bar
]
>> get probe last keys-of map
foo
== baz
>> unset? :foo
== true
Which it evidently does, judging by the example above 🤷♂️
For the record, at the time of implementation I didn't know there supposed to be one. IIRC all there is to |
WRT inability to encode global values, I think it can be rectified by collecting them in a separate context, which would serve as a localized substitute for >> foo: 'bar
== bar
>> save/as #{} [foo] 'redbin Would be the same as: >> save/as #{} bind [foo] context [foo: system/words/foo] 'redbin As for the other possibility, with unmarshaling values from Redbin payload straight into |
In my recent work on ParSEE visualization tool I've encountered the need to save the dump of all Parse events, to later load it in the GUI tool to analyze.
Reasons for such split design are:
mold
implementation, hacked console, and many exports)While point 1 could in theory be addressed in some far far future by a solid module system that could provide enough convenience and isolation, points 2-3 will remain valid, validating the whole need for backend/frontend separation.
Saved dump consists of thousands of events, each including
input
Parse is working on andrule
processing the input:Traditional mold/load cycle is inappropriate as it would destroy both sameness and offsets of all series:
Redbin was supposed to be of help here, but its shortcomings make it a kludge rather than a solution.
Current Redbin implementation cannot save:
routine! handle! event! op!
system/words
contextSo when I try to save such dump of values I only receive an error most of the time.
To force Redbin to save the dump I had to recursively preprocess whole tree of values (including both input and events dump) in the following manner:
For more general preprocessing I would also need include objects, maps and functions into the deeply preprocessed data set.
In essence, it's a slow high-level reinvention of the logic of Redbin, which by my observation is also quite hard to get done correctly and reasonably fast. It would thus be nice if Redbin didn't require invention of such kludges in order to just use it.
The text was updated successfully, but these errors were encountered: