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
Encapsulated applications #492
Comments
If the |
I played with an initial implementation, but I am a bit disappointed. I'd hoped to build one application which could describe simulations, interactions, and collaborations... even eventually the reflex-based FRP interface from #486. But collaborations require StaticPtr arguments, and that scuttles the whole thing. We could leave out collaborations entirely, but that seems to defeat the point of unifying the API. The best idea I have is to offer these alternatives for the entry point.
In this world (oddly) If |
@nomeata Can we make that possible without exposing the guts of
|
Actually, you don't even need |
I'm reviving this idea because I'm becoming more convinced that I want to teach event handlers before time steps. Here's my current proposed API.
The non-abstract type for Another design choice could be to separate event handlers, such as:
This removes the need for one built-in algebraic data type (possibly balancing the addition of the new |
It's become clear that exposing the
The use of |
I have not been following closely, but that does not feel like CodeWorld any more... |
@nomeata Thanks for the impression. I'm a bit worried about this, too. That said, do you have a sense of what specifically you value about CodeWorld that's being lost here? I'm trying to distinguish between (in myself, as well) real concerns, versus general change aversion. The motivation, by the way, isn't actually about sound. It's about my grappling with how to teach interactions earlier in my middle school curriculum. I could add a new entry point with event but not step, but again, combinatorial explosion... |
Well, it is hard to pin-point exactly. “The simplest thing possible”. A single function without any data types around kinda qualifies there. It seems that there is much more to explain (or to sweep under the rag with “you don’t have to understand this now, just cargo-cult this pattern) before users can use interactions. |
unsupported, and just here to play around with. See #492
I'm still not sure what to do here. In the interest of having something to play around with, though: |
This allows a Rule to be transformed by a getter/setter pair, which allows for wrapping state. See #492
Remove the unnecessary special constructors for single-player events and pictures. See #492
Here's a version using |
Looks like this will evolve into |
Perhaps the requirements should be formally stated so that we can judge proposed solutions against those requirements |
The examples above look complicated for such a simple program. The list of rules looks like an imperative control loop, not like rules, because they seem to be executed in the order listed instead of triggered as needed. Also, how would you add randomness and external events, such as calendar time and date or URL parameters. These are not provided in the current interface, but planning for them in the new interface would help future-proofing it. |
@Gabriel439 I don't have a list of requirements, yet. This is all pretty speculative so far. I wonder where it goes. I will also implement the @fernando-alegre Good point that this can be understood as an imperative program. It's not, precisely: it doesn't matter what order different rule types appear in. But when you repeat a rule of the same type, it comes across that way. It's possible the |
New alternative: https://code.world/haskell#PyO-LM1sjEceGdn9yxghqmA |
My immediate goal in reviving this was to find a convenient way to teach event handling before time steps. For that purpose, we've settled on the new I'll try to catalog the remaining opportunity here.
Anyway, I don't consider this in active development any longer. I'll leave the experimental modules around for now, since they aren't hurting anything. |
Definitely a speculative proposal, but it might lead somewhere.
The proposal is to create an abstract type to encapsulate and build up simulations, interactions, etc. Something like:
The various event handlers, time steps, and visualization functions would all be run, in some defined order. Pictures would be stacked with the outermost picture on top.
Advantages:
The API is probably not right yet, but that's the idea.
The text was updated successfully, but these errors were encountered: