HomeFAQFQAOverviewSpecificationDesign

The Y# Language — Rationale

 
[BEGIN EDIT March, 29th, 2010]
Design Blog Update : "Imagine..." & The "REGARD" URI Scheme [/END EDIT]
[BEGIN EDIT December, 31st, 2009]
You should read this, as well. [/END EDIT]
[BEGIN EDIT December, 25th, 2009]
I intend to propose, not as matter of "proof" in the strict sense, but at least as matter of a more formal presentation, an elaboration about why and how Y#, to be a useful "sidekick" to Oslo's M language (be it aside, or an extension of the latter) cannot sufficiently deal only at the level of .NET's type system. That thesis will be inspired from this early draft of ideas, Tea Party "0", which is quite speculative, but has at least the "quality" of dealing with much better known/longer studied related topics, thanks to which authoritative research results/people can help spot flaws in the thesis' formalism and/or its conclusions. [/END EDIT]

In Context

Oslo's impact on the software development industry is going to be big, to say the least. For two reasons.

1 — Because the approach that Oslo is all about, effectively, is capable to turn the (so far) software factories "dream" into reality. At last. For I know it works. I tried it. And I am not alone to have done so — indeed. So that, should I be asked, I could maybe even explain why it works very fine (well, as far as I could figure how the "domain-specific looking glass" manages to do so).

2 — I am not the one implementing Oslo — though I'd love to have had the idea first. Instead, Microsoft is doing so — thus, they are many more than just one person — but, much more significantly, they have been working on that "vision" for long already; I would even say that the beginning of that Oslo "sentence" probably goes back to six or so years ago, actually. That "total" time spent by them investigating there how to build upon this approach really means something today, eventually.

No, Oslo is not just for all the buzz. Yes, it expects us to raise our level of abstraction. But it stays focused; it stays to the point : to face reality. And reality is, as of today, the software development industry doesn't need to raise its level of abstraction in the genericity for modeling and building software architectures up. No, what is needed is more adaptive abstraction in the design process, the models produced out of it, and the patterns, and tools used to generate useful artifacts that follow more tightly, stick better over time to the ever evolving, diversifying software technology's building blocks and business domains' needs.

Hence, the "new" (not so new, actually) and more suited "seed" : our refocusing on domain-specific devices. As I understand it, Oslo is first all about that, just stretching out this principle "to the max" : doing its best it can figure for us to build those devices ourselves, any time we figure we need to. This is to have us, possibly, hopefully, build our applications out of data eventually (i.e., data as found in our specific models' instances) — oh, and yes, for that by the way, Oslo also wants to come equipped with a repository, along with other nice things in the tooling. People enjoy cherries on top of the cakes.

This is how I read the history (just my view; not to be considered endorsed by anybody, obviously).

Now, Why Y#?

Anticipation

So, I think that Oslo is a very important step towards a whole new generation of domain-specific languages families and related tools. There, I anticipate a quick and massive adoption of Oslo (when it is released) by the software development industry. (And, well, if I'm eventually wrong, some will laugh at my current words, but I won't care much.) Which induces my other belief that this will make people invent, design, and implement many domain-specific languages for many different things, at all levels of their target software architectures.

[BEGIN EDIT October, 11th, 2009]
"... make people invent, design, and implement many..." : this has well started already, barely seven months after I wrote it; just have a look at this for people who start by "retargetting" their already existing/legacy favourites to M, and/or have a look at that for people playing around with more-or-less random ideas ("random" not in any bad sense, btw) of their own. [/END EDIT]

Some languages will die shortly after their birth, others will live longer. The "best ones" will eventually go into standard tracks. But anyway, we can expect a breaking change in our habits with software construction — as software designers / producers we will think more and more in terms of domain-customized notations (textual or graphical) — aside the other well-known general purpose ones, of course.

— As a side note, by the way :
at the time of this writing (mid February, 2009) I noticed that a lot of people tend to focus, are eager to play with / know more about M, Quadrant, M-down-to-SQL codegen and the likes, etc. While all of these will be strikingly important for sure when Oslo is shipped, I find personally that a most exciting and powerful dimension of the platform, which really should not be underestimated, is to be found in the surroundings of Mg (MGrammar)'s capabilities and the related tooling support.

Not to mention the very interesting (related) direction of, for example, the hopefully possible DSL domain model-to-Mg-specs mappings; definitely the sort of things I see very worth the investigation, sooner or later.
— It's only a matter of taste in the topics there, from different points of view, as usual.

But, all of Oslo is important actually.

DSL Breeding Issue

A Concern, Though

But now, unless I missed something, Oslo does not explicitly (or, at all) address this two-fold concern :

1 — The design consistency scalability across all those domain-specific languages to come — if there is no "formalized knowledge" available to DSL processing tools, in one form or another, about those DSLs' design intent;

2 — The ensuring that those DSLs will interoperate gracefully enough with each others, at the level of their design intent — as languages, through their respective supporting tools.

This seems to be out of Oslo's scope so far, about which the Oslo development team is of course with no doubt still very busy working at the design and implementation levels for their current priority features.

Language Design Intent

Meanwhile then, I figure an approach to address this concern above, by having us, DSL inventors / implementors, express our DSL's designed semantic "intent" — i.e., what should our DSL preferably be used for — what does an instance of it want to mean overall — with clues about how to properly give an interpretation when tools process its instances.

This is to ease, organize, the proper re-use and combining of our-DSL-based tools by / with other tools out of our direct control regarding their implementations.

Q: But, Should It Actually Be A Concern, Anyway? — A: This Concern Has A Background

Time will tell if I am right or wrong on that matter, but my feeling (intuitive, yes, but I speak with some experience, too) about domain-specific languages' design regarding their expected use cases, goes mainly like this :

While it is probably a bad idea — i.e., not really "dangerous", but rather, unrealistic and unconstructive — to try to control / restrain, organize, contractualize the semantic "openness" of general-purpose languages, it is likely to be a good idea to do it, conversely, when it comes to the more domain-specific languages.

Q: Could You Be More Specific? — A: I Know Software Dev. People, I Am One Of Them — They Will Want To Reuse And Combine DSLs And Processing Tools / Apps

Language Capability Discovery

On the constructive side of that above thinking, it is for the sake of helping to devise, build, and use more practical tools, thanks to the being informed about interesting "meta linguistic" capabilities of yet unconsidered DSLs — in respect to a given need for a specific tool, for a precise purpose.

Safer Language Reuse

And, on the more coercitive side of the thinking, it is for the sake of experiencing a lower probability in the building and use of tools that would choose to pick up and to process "the wrong" DSL for their actual purpose as tools vs. the DSL's inventor's intent for his / her DSL.

Q: How Did This Idea Come To You? — A: I Have Memory

Actually, I sort of realized "all of a sudden" that Oslo, by (hopefully) enabling an easy construction of languages and implementations, is shifting us into a new paradigm. And I don't mean it (paradigm) like someone from the marketing, just "for the hype". No, I really mean it : if Oslo has the success it is hoping for, it will really be a new paradigm. But, this shifting itself thus will have a big and unwanted side effect, "shortly" after the initial adoption and enthusiasm for Oslo (years? a decade? ... no idea there), if we don't acknowledge it and handle it, given the state of the current object-oriented paradigm we are in, and doing so properly, if possible.

Not acknowledged and not handled, that could lead Oslo to fail in its goal eventually "after a while", after a promising beginning. In my opinion, that would be a shame then because we could maybe be ending with putting the blame on a technology otherwise fairly sound and friendly, trying to replace it all with something else maybe. Who knows.

Anyway. Here it is :

This is all about the problem of transmitting the "intent" (or part of intent) of a provider towards its clients — when you have no proof system / checker to compute formally that intent.

By "intent" I think of it as a context-free generalization of the context-bound purpose : I mean, it is why the provider exists in the system we are considering, or, what for this provider is useful for the overall system's logics, and not just for a local (in time, space) utilization.

In our current object-oriented paradigm, "intent" comes from providers' implementations and is roughly a set of aspects of the providers' semantics (programs' or object-oriented type systems', as you wish).

But with Oslo's shift, which promotes languages/models as first-class objects, "intent" needs to be redefined; it is instead, I think, a set of aspects of those languages' definition itself.

The versioning problem in former paradigms was just a specific exhibition of this problem. I remembered those days where we knew "DLL Hell" — for which the versioning problem was not just about interfaces that evolve, it was also about evolving implementations behind interfaces (i.e., the so-called function "exports") that would not evolve, and then the core issue there, was then :

the "intent" brought by the new implementation (new version) — or, semantics, if you like — could not "breathe" / be exhibited to the clients — because there was no "signal" to alert the latters (i.e., not even an interface change).

And it has been pretty much the same problem later on with COM, though the paradigm in context was different (object-oriented, binary components-based, etc).

Today, things are fairly better with .NET (even without widespread use of software proof systems) precisely thanks to possible metadata, available to client implementations to adapt their behaviour according to those "markers" bound to, or queryable at-, their providers' implementations. Thus .NET's metadata allow us to transmit a part of the provider's intent. And in the metadata-equipped .NET, the use of metadata for that is critical in many layers, for transmitting this (partial) intent from providers to clients. We don't really want to go back in a state, where metadata would not be available for frameworks and applications, given the way we are now designing systems. It's too late : we are too much familiar with the use of it, for our analyzing problems and finding/designing solutions for them, in our brains.

Q: And So What? — A: The Stake Is To Have Oslo Scale Well — Just Like .NET Did

Now, Oslo moves us forward : in addition to the runtime type system present in .NET itself, we will have to deal with an abstract, "intangible", language system the objects of which are abstract and intangible because they are (domain-specific-)languages / models. But still, we will use them through DSL processing tools implemented with Mg and the likes. There, if we do nothing "by default" we will not allow those languages' clients to have clues about how (what) the languages are intended to be used (for) in the context of the client that is using them (i.e., processing an instance of them). Therefore, if we want to provide such clues (metadata) at their nature's level, we may need to do it through an object of the same nature : an instance (phrase) of a language — hence, Y#, to investigate for a solution accordingly to this idea.

And no, "I'm sorry", but such "metadata" cannot reasonably be represented using the .NET-based type system techniques we are familiar with. We need to think them differently, in the languages' dimension, not in the type systems' one.

Thus, not taking care of having metadata "in the right dimension" for languages will mean that we have sort of forgotten the DLL/COM issue fairly "fixed" by .NET, but coming back again because we will have entered a new paradigm where languages have been promoted as (practically) first-class citizens, just like types are now in the managed runtime.

Eventually, it would lead us to a usage of Oslo's technology regarding languages and models that cannot scale well (if I'm right). And, as we know, if we don't care much about the scalability of a technology, it still can do it for us for some time, but, soon or late, we will have to handle the problem... then, in a real world context of a likely bigger complexity, which is not quite friendly, usually...

Q: Assuming You Are Right With Your Concern If Nothing Is Done, What Do You Propose With Y#?

A: Read on.

The Proposal

Idea

I want to allow the DSL's designer to provide somewhere (formalized in Y#) what he/she considers to be the most important facets of his/her language's design intent, should the language be re-used or "extended" through the "looking glass" of processing tools other than the language's reference implementation(s).

I do not try to implement a semantic check / proof system of any kind. The simpler and easier plan I follow — for now — is just to provide means of expression of intended semantics' "clues" about the DSL at hand through annotations / metadata.

Scope

The use of metadata is not new to anyone, of course, be it even in the context of a meta language like Y# the domain of which is about help for the design and implementation of actual domain-specific languages.

The only one unusual aspect of Y# — as far as I know — as a meta language, is there, actually :

for its purpose, Y# doesn't need just to use the kind of (meta) language definition constructs we can encounter in Mg to define a language, for example — instead, Y# needs to use even higher level metadata-like constructs that "talk" about properties of the language (definition) itself (usually expressed in a Mg specification for most of it, but not exclusively).

Rather unusual, since we are talking here about attaching a form of "metadata" to / about the language itself, to express its intent (that you can also roughly see as the action of looking at the whole set of incompletely defined language's semantics — a rather "horrible" thing to look at, I do reckon — but still bringing, I think, useful information).

Purpose

Bear in mind that Y# is for now a lot less interested in formalizing the exact, comprehensive intended semantics' definition of the subject language (which is, granted, not easy, to say the least) — than, instead, just expressing a set of well-chosen(*), discrete, high-level annotations about the language definition's relevant properties regarding its design intent. That's what I called "meta linguistic" knowledge earlier, that Y# wants to provide to DSL processing tools and their users.

(*) that the DSL's inventor "picked up" from his/her point of view

Thus, Y# is obviously not able to automatically enforce the respect to such facets about the DSL's intended semantics in processing tools for that DSL. And, tool implementors will remain free to make profit or to just ignore that metadata exposed from that DSL's design statement thus expressed. But of course, when such information is available, I would strongly encourage them not to ignore it.

While I am aware that the last point can be seen as a weakness in the proposal, I would also say there that it is not as regretable as it seems. For, again, the idea is to be able at least — before doing hopefully better later(?) — to provide a set of formalized clues about the DSL's design intent — and instead of just doing nothing at all.

I believe that this "weaker" path chosen here for both practical and theoretical reasons is still useful enough to be followed.

"Conclusion"

By the Oslo's paradigm shift :

the DSL/model (design) intent is to the language/model's client (that is, the program/component that accepted the language/model and interprets it)

what

the .NET type's metadata usage is to the type's client — (that is, the program/component that loaded the type and invokes it)

For A Start — Y# 1.0

 

Last updated February 15, 2009

© Cyril Jandia 2008, 2009. All rights reserved.