-
Notifications
You must be signed in to change notification settings - Fork 0
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
DSL Design #1
Comments
here is syntax by idyll: https://idyll-lang.org/docs/components. |
Penrose also uses object-based DSL. But if we consider a dynamic process, the complexity increases significantly. |
the workflow to add a new object in this DSL:
|
the cons of such design:
|
Yeah, I think this approach is too code-heavy. And looks like python. Could you provide an example of how a "penrose" approach or "idyll" approach would look like in our case? There are other templating languages that we can draw inspirations from, e.g., https://pugjs.org/language/filters.html |
|
|
|
|
possible ideas: we can combine GUI manipulation with changes in code editor. e.g., in editing mode, the user can insert a new page by clicking a button, and it would copy the last page to the new page. They can then directly edit the rendered viz to change the value, or edit the code to change the value |
Here I propose an object-based DSL (python-like), using an array as an example:
object:
array
atomic element (smallest element consisting of this object):
array element
atomic operation (smallest operation one can do on the element):
1. color
2. arrow (with text)
3. display value
4. index
method (encapsulated atomic operations):
element operation + logical control:
the operations can work together with logical control (for/if/while)
examples:
why we have both element operation and object method?
element operations have much better expressive abilities, but are code-heavy (think of algorithm-visualizer: https://algorithm-visualizer.org/)
object method is code-free but lack flexibility (users can only use the method encapsulated by us, think of visualgo: https://visualgo.net/en )
Therefore we provide both methods.
How to generate animaitons?
for method:
it will be excapsulated into method. The method will be translated into a series of execuable code. The code to generate animation will be plug in (like algo-visualizer but hidden from users)
for element operation:
Use explicit declaration to make animation, here is an example:
example1:
// iterate and highlight the number can be divided by 3 in an array
example2:
// iterate an array
The text was updated successfully, but these errors were encountered: