4 ms·
I'm a few days late to the party but still wanted to add my comment. Contrarily to others in this thread, I get what the author is trying to do with the MyDef l
by TuringTest 12y ago
I'm a few days late to the party but still wanted to add my comment. Contrarily to others in this thread, I get what the author is trying to do with the MyDef library and I share that goal myself.
As I see it, such lightweight scripting (meta-)layer is not intended to replace a programming language in full. Instead, it acts as a general-purpose template language - a wrapper were you put in the ''easy'' parts of the program, which can then be written without the attention to detail that a true programming language forces upon you.
As others have said, the hard parts of a program still benefit from a non-ambiguous, utterly detailed syntax of a full PL. A templating meta-layer is not a good fit for those, that's why you should use them in combination - use something like MyData to write the "general picture" flow, dive in into the hard language to build the details. Then you get the best of both worlds.
It's no different to what it's commonly done with template languages for the web or user interfaces, expect that this library seems to be extendable to other business domains.
- hzhou321 12y agoThanks a lot for understanding. I am puzzled why most readers see MyDef as another language or library. Let's use Javascript for example, Coffee script or other language force you to re-learn and write in the new language, but with MyDef, we still write JavaScript and use the same pattern we acquired. It is not about re-learn, rather it is about growing. For example, `document.getElementById('name')`, which you learned the first time starting Javascript, you don't have to relearn; but in the meantime you don't want to write/think in so much detail, so with MyDef, you start write `$(id:name)` (one of the many ways you can come up). Here, you did not learn the new word, you grew it. Then, you start write `$(type:name)`, `$(value:name)`, `$(show:name)`, `$(hide:name)`, or `$(select:#name)`. Just like the word we use in daily life, when we say "go to school", we understand what we mean and (more importantly) we immediately get feedback on whether the reality (the kids walks to school bus) meets our expectation. In MyDef, we understand where these idioms are defined and the translated output is right there for us to verify (which is not much different from markdown). In comparison, when we use `$("#name)`, we only can learn the meaning; if we guess, there is nowhere to directly get feedback -- which forms a disconnect from your old acquired knowledge. Similar with most library and framework, you are disconnected from you old experience (I don't mean abandon, but a discontinuity) and re-learn a new set. MyDef is about grow, not re-learn, there isn't any barrier.