Tuesday, April 29, 2008

... on scripting

Whenever one creates something, the question "who is my audience?" is pretty important. Even if you don't ask it explicitly, there is an answer implicit in your performance. It is one of those "no answer is an answer" scenarios; the answer can not be escaped even if the question is avoided.

So I like to ask myself that question explicitly... and a lot. The answer changes both from project to project as well as over time. I used to play music for other people to listen to, but these days I play it just for myself. (I'm pretty sure the world is a happier place for it, too. ;) Plasma, however, it meant as a public participation project and we have only bigger plans for it down the line. As such, it's always interesting to see other people's take on it, such as in this article by Brian Proffitt the other week. I can't tell anyone what Plasma is for them, really, and given that people have a variety of thoughts on that matter is pretty cool.

We talked about target audience a fair bit at Tokamak I. When it came to scripting, it was no exception. It turned out that I had a mildly different idea of the target audience for the scripting compared to others who are involved. This is probably in part due to the fact that I'm not an "interpreted languages guy". Don't get me wrong: I looove the ruby .. but I code mostly still in C++. So instead of coming at it from a "interpreted languages (IL) are awesome and a reason in and of themselves" I perhaps come at it from a slightly more cautious position that asks first and foremost: who is the audience?

With Plasma scripting, I see three audiences: libplasma, ninjas and myspacers. Ok, I'm sure none of that made any sense to most of you, so let me explain.

First off, I know that libplasma isn't a sentient being. Yet. ;) So when I say that libplasma is one of the audiences, I mean that libplasma itself needs to have a way to work with the scripting that isn't an afterthought or some transparent magical loading of scripts. The scripting interface needs to be purposeful, manageable, integrated with other parts of libplasma and possible to be made safe. I have been surprised at how the relationship to libplasma is often not even talked about when discussing scripting; perhaps the IL people are just too used to fending for themselves and not being considered seriously during the design phase.

The result of this awareness is a set of well defined interfaces between libplasma and the IL support. This allows for uniform and extremely flexible possibilities (in terms of language and exposed API) when it comes to IL support. It also means that we are designing whole areas of libplasma around the eventual use cases for interpreted languages in Plasma; in fact, the new widget API for 4.1 was designed 100% for the foundation of sane IL API exporting. In fact, it was designed by Richard Moore, the IL guy at Tokamak. This was not an accident: he was tasked with this specifically because he could design it from that perspective better than someone like poor old C++ me.

What about the other two audiences I mentioned: ninjas and myspacers? Well, now we're talking about real people again, at least in abstract terms.

Ninjas are people who are awesome at what they do. Unfortunately, most people aren't good at a given topic (though a lot of people, perhaps even most, are good at some topic). That means that if you pick a certain endeavor, there will be few ninjas of that sort. So it is that there are likely to be few widget making ninjas out there, relative to the size of the audience. Fortunately, they make awesome stuff that most of the user audience will want to pick up on.

By opening up Plasma to other widget systems such as SuperKaramba and MacOS Dashboard we widen our ninja audience. This is one reason having "libplasma" as an audience is so important.

However, we want Plasma Ninjas too. In fact, it would be great if there were evntually more Plasma Ninjas than other kinds of widget ninjas. (Yes, I know that will require market share to achieve. We're working on it ;) What do Plasma Ninjas need? More than anything else, they need a powerful API. I think they also will probably want a design studio, something we'll eventually get to working on. First comes the API, however. So we want to give these ninjas the ability to do much of what you could in C++, only faster, slicker and with fewer stupid details.

Now quickly move to the next audience: myspacers. That's my pet term for the kind of people who glom onto sites that let you easily modify an interface with a little bit of work. They looooove tinkering but their skill level is pretty low. They also tend not to create things very often that many other people would want to use. However, there are a lot of them.

What do the myspacers need? A stupidly simple API, and certainly a point and clicky designy thingy. Making a simple clicky designy thingy (a toy level design studio) requires a really simple API; Macromedia's flash studio tools are beyond this kind of person, generally. That gives you an idea of the simplicity required.

I don't think there's anything wrong with this either: there's nobody who stops you from buying paint and paintbrushes from the art supply store just because your painting skills are questionable. So there shouldn't be any reason to do similarly to people whose aesthetic or coding skills are similar (so long as we don't inflict their work on you, right? ;)

The value in the myspacer crowd is that they make products popular. More and more participation means winning when it comes to concepts such as these. I want to let the myspacers of the world make and share their probably pointless-in-the-big-picture but extremely personally satisfying (to them and their friends) things. Excuse the buzzwordy nature of this, but: democratizing creativity.

If you think that audience doesn't exist, I would ask you to go visit myspace for a moment. Or go hang out at a local hobby shop; check out how many hobbyist painters, fly tiers, sportsmen, etc there are out there. People are creative and put effort into things .. they just tend to be pretty mediocre at it. This audience is not only large but, from a human perspective, deserves the chance to play too.

Now we have a dilemma: we have two groups, both of whom it would be nice to service, but who have very different needs. Both are valuable, however, in terms of "audience" which is an aggregate of number of users of widgets and number of creators of widgets. Perhaps a picture sums it up best:



To optimize a widget system for one group will cut out the other one due to skill differences; either you'll get something too complex for the myspacers or too limiting and toy-like for the ninjas. Or worse, the API will cater to a group somewhere in the middle and instead of maximizing the audience the API will guarantee a minimizing.

Of course, API is just on part of the equation: support tools is another, but market share is probably the biggest. Myspacers are flockers and ninjas go for audience reach. But those are ingredients that must come after having the right scripting API.

The solution? Well, I don't know if there is just one solution per say, but here's mine: we're going to have two different kinds of APIs. One for ninjas. One for myspacers. Plasma's design allows for that, even using the same programming language for both since we differentiate based on target API not implementation language. As a neat side effect, it turns out that the myspacer style API is also a hell of a lot easier to secure.

So there you have it: my very long winded explanation for why there will be multiple scripting APIs in plasma. It all starts with the question of who our audience is and the moves on to how to stand a chance of capturing them.

Now I have to go to the airport to pick up Zack. *hugs*

18 comments:

Fabien said...

Interesting read :)
Have you been inspired by gOS ? (see http://dev.thinkgos.com/myspace)

But real myspace users won't use linux until the super fancy Windows Live Messenger(tm) 8.5 is available on linux, with his hyper cool full-screen smileys ! ahem... Ok that's quite off-topic ;)

Sander said...

The amount of thought you (and the other plasma devs) are putting into this is amazing. I really hope things will play out even half as awesome as you're telling us they will be :) Hats off to all of you!

Anonymous said...

A small FYI:

http://en.wikipedia.org/wiki/Per_se

Anonymous said...

"Now I have to go to the airport to pick up Zack. *hugs*"

Cool - Zackage again so soon! This is great, as you guys always accomplish interesting things when you get together. Have fun hacking!

Paulo Cesar said...

Hi, I just wanted to say that an API can be ridiculously easy to use and yet be powerful, one example on that is the Rails API. It's very easy to lern and work, and even when you think you mastered it, you just keep learning more and more stuff you can do with it..

Well, maybe my "ridiculously easy" isn't on this myspace level.. but I think you got my point

Lunatic said...

Nice comparison :)

rfunk said...

I love the fact that you're paying attention to interpreted languages. From my perspective it opens the doors of customization to programmers who don't want to recompile KDE or deal with its headers, expanding what became possible with dcop.

This dual-API thing sounds to me like a really bad idea though. You're not giving the "myspacers" (or as I prefer, hobbyists) a path to grow into "ninjas". Instead, someone who wants to become a ninja has to start over learning a new API. Why not have a single API with a learning curve that favors the "myspacers" but still lets them grow gradually into "ninjas" without having to start over?

Aaron J. Seigo said...

@Paulo: yes, a simple API can do crazy cool things. the API for ninjas won't be insanely complex, but on the flip side ruby-on-rails is really out of scope for the myspacers =) i still think we can give both qualities of the other: cool flexibility for myspacers, sleek API for ninjas. the exact proportions and what they look like exactly will be tuned for each.

@rfunk: that's a really good point and one we discussed extensively. first thing to realize is that if you look at that (made up ;) graph, the people in the middle are indeed the minority.

optimizing for learners who go from myspacers to ninjas is to optimize for one of the smallest groups out there.

honestly, most people who wish to join the ninjas, or even just play at being one, can manage with moderately capable (and therefore moderately complex) APIs. heck, we have these sorts of people already playing with (and producing nice results) with the C++ api.

the ninja's api isn't going to be rediculously difficult .. it's just going to be more complete and have more to learn about.

your equating of "myspacers" with "hobbyists" is not really accurate, however, as some hobbyists are ninjas, no doubt about it. additionally, i'm talking about a very specific type of mindset that creates simple things only. the people who popuplate myspace, with very few exceptions, will not go on to create ruby on rails apps.

that said, for those who do migrate between those two ends of the spectrum (and i half expect some people to use both APIs, depending on what they are trying to accomplish at that day) moving from one API style to another is not really all that difficult.

in fact, i'd suggest that starting out with a hand-holding API is a really great way to start getting a feel for things.

however, it is about optimizing for use cases. and if i have to choose, i'd rather optimize for the bulk of use cases rather than some marginal group.

that's why i drew up those little graphs showing where the bulk of people are. optimizing for a few people at the expense of the many (damn, i sound like a vulcan suddenly) doesn't serve us well.

Paulo Cesar said...

hmm you mean I think an API that even my wife can use (well, she's a plastic artist who already edited XMLs to make her custom flash gallery on web :P)

Well, I think that's really cool, if you could make an api that simple, it could be used even for stimulating kids and teenagers to program :)

very nice!

rfunk said...

OK, but I'm still not clear on why you think the number of "ninjas" is similar to the number of "myspacers", and greater than the number of intermediates. It seems more likely to me that the number of people would decrease in roughly inverse proportion to the skill level.

zbog said...

Is the API for myspacers going to be based on the API for ninjas?

That would also give people crossing over from myspacers to ninjas a set of examples to tinker with, right?

Aaron J. Seigo said...

@Paulo: that's exactly the idea.

@rfunk: "not clear on why you think the number of "ninjas" is similar to the number of "myspacers","

they aren't; there many more myspacers, but their audience is small. there are very few (relatively) ninjas, but their audience is huge.

so there are two audiences: creators and consumers. the former is made up mostly (numerically) of myspacers, while the consumers use mostly the work of the ninjas (because they make the most cool, beautiful and useful things)

so it's optimizing for both groups: a set of fairly low skill but numerically large (and if given the tools, eager) group of creators and a small group of creators who make things most people like to use.

too often we make things for the ninjas and forget that there's a huge audience of creators. that they exist at all is evidenced by sites such as myspace or the "blogosphere".

@zbog: "Is the API for myspacers going to be based on the API for ninjas"

somewhat. they both resolve down to libplasma and will follow similar conventions for naming, capabilities, etc. you'll have DataEngines and Visualizations (widgets) in both, for instance.

so yes, i think it's quite possible to transition, the learning curve on the ninja side is just a lot steeper as there's a lot more you can do with it. (essentially nearly anything you can do with Qt's API itself)

Anonymous said...

your diagram with users (y) and skill(x) shows as skill increases users increases exponentially. I don't think this is what you meant. From your post mentioning basic skills (low) this is where the users should be highest decreasing as skill increases. [d(users)/d(skill)]<0

Aaron J. Seigo said...

@anonymous: "as skill increases users increases exponentially"

users of the resulting creation increases dramatically (probably exponentially); people tend to use the really cool things. think of liquid weather versus other superkaramba themes ...

"basic skills (low) this is where the users should be highest"

this is where the audience of creators is the largest numerically.

and that's really the point: there are two types of audience ... creators and consumers.

the ninjas are few, but give you access to the bulk of the consumers.

the low skill creators are many, but don't have many consumers.

we want to target both groups, so we get both large numbers of creators but also large numbers of consumers.

one might even be so bold as to suggest that the armies of low skill creators and the sea of consumers have a large overlap, even.

once this point of reasoning is reached, then the next question is how to service both of those groups (myspacers versus ninjas) at the moment of creativity. they have competing needs: simplicity (don't confuse with 'elegance') vs power.

and so the multiple apis.

richmoore said...

@rfunk

Actually, the way I've designed the scripting API for the myspace group does provide a smooth upgrade path to the more complex API for the ninjas. They can take their 'simple' code and switch to the 'ninja mode' and it will still work. They then have access to the nativePointer() method of the API (see the draft spec Aaron linked to), using this nativePointer they can then add in additional funky stuff using the full Qt JS bindings.

Iuri Fiedoruk said...

exelent idea!
I'm waiting libplasma API freeze to start coding some plasmoids in Javascript or even PHP, a simpler API is good when almost all work is made on the script side and you just want to show them in plasma form.

Enderandrew said...

Audience is an interesting topic to bring up. The one thing I loved about KDE 3 the most is how even a stupid end-user with no prior knowledge of KDE, can fairly easily navigate around the UI, and configure the desktop to operate largely how they want it to operate. In KDE 4, the 4.0 iteration, and even the current iteration, many of these configuration options I love and depend on aren't there yet (or no GUI dialogs exist for them yet). In this, I feel you alienate arguably a large core audience of uers.

For developers, you have focused on Plasma, allowing them even greater flexibility to create apps and widgets to allow their desktop to operate how they want.

The "myspacers" aren't going to be developing apps, even if it is relatively simple to learn. They want to find content, drag it somewhere and have it just work. They want to be able to take web-browser based plasmoids, and drag them to their desktop. They want to drag apps from their desktop to the panel, etc.

If I see a jpg in a browser, and I drag that image to my desktop, I should be prompted to do a few things. Do I want to have that picture loaded in a photo plasmoid, save that picture as a file on my desktop, or make that photo my wallpaper?

I'm interested in seeing how the power of Plasma can be used to create an incredible user-interface, and by that I mean more than seeing the weather on my desktop.

Jake T said...

I'm sure you've already discussed this, but could the myspace API actually be just a front-end to the ninja API, just a tool that sits on top of the 'real' API to make it more accessible?