-
Notifications
You must be signed in to change notification settings - Fork 2
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
Ideal Calder DSL Language Discussion, and pain points with current programs #98
Comments
Also we have #90 to deal with the matrix and quaternion things currently in the example code, so we can pretend those won't be there when thinking about syntax |
I'll start with my current pain points which I think could be improved. Please keep in mind this isn't an attack on the way anything was implemented, for example we didn't have the Current pain points1.
|
Ideal Calder DSL PropositionOverviewThis is an early proposition for my ideal Calder DSL for artists and animators. Much of this is subject to change, and I would encourage and welcome constructive feedback. The syntax is influenced by the languages Ruby, MoonScript, Haxe, and Qt QML. ReferenceVariable AssignmentAssigning to an undeclared name will cause it to be declared as a new local variable. The language is dynamically typed so you can assign any value to any variable. You can assign multiple names and values at once like in Lua or MoonScript.
Update Assignment
CommentsComments in Calder are prefixed with
String InterpolationYou can mix expressions into string literals like in Ruby using the
For LoopFor loops use the similar
Mapping
While Loops
Conditionals
|
This is a little out there, but what do you think of the idea of not using general lambdas for setup? When we're using them as setup blocks, we know the lambda is being used for a specific purpose (given an input, initialize it), so we don't need total freedom for parameters and return values. My proposal is to add a lambda syntax that reuses the key as the lambda input. Going even further, we can "overload" based on the provided keys so that we don't have redundant terms (like So it might look like this:
This isn't perfect (the |
As we talked about online, I think we should try to optimize for readability in this code. In large programs we see at work that modularize logic into functions, classes, and so on, we would take a DFS approach to reading code. However, I think this is a daunting prospect for new programmers, since this usually requires multiple passes to understand what the code is doing. I propose we design the syntax with the following assumptions:
We can relax some of those assumptions later (for example, we might want users to share code so we may want a simple package management system), but I think we can avoid thinking about those complexities at the start, since it should be possible to extend the language to support these (for example, we can support modularity and top-to-bottom readability by enforcing declare-before-use). |
For example, something like this:
For verbosity. We don't really see the |
@abhimadan I think since braces are a thing in CSS, it's maybe already familiar to the sorts of people who we're aiming this at (tech savvy but not programmers).
|
As per our discussion in the hangouts chat, here's a place we can discuss ideas for a Calder DSL, as well as pain points with the way we currently use the library.
Current Calder Code
The text was updated successfully, but these errors were encountered: