ivyblog

Ma petite entreprise

Design logiciel et design d'interfaces

dimanche 22 mars 2009

JavaScript Meta-Language Frameworks

Par Sébastien Pierre, dimanche 22 mars 2009 à 17:37 :: Langages

In the quest for finding the proper "market positionning for Sugar", I just found a new candidate : "javascript meta-language frameworks".

It's actually from a presentation (starting at slide 51 here) that is featured in todays John Resig's blog post.

After the last presentation of Sugar (as you'll have understood, one I'm not really proud of), I realized I had to decouple Sugar and LambdaFactory, and position Sugar as a meta-language targetting JavaScript and LambdaFactory as a generic meta-programming framework. Meta-programming is still a hairy topic that few people are able to understand, and some of the deeper design decisions in LambdaFactory cannot be well communicated with only one example of front-end language -- I think I've been too excited by the possibilities offered by LambdaFactory and neglected presenting Sugar as a viable language, and focusing on it from a feature perspective.

My goal is to finish the PEG-based parsing library, so that I can ship Sugar without depending on C-based dparser, and then increase my guerilla-marketing efforts to promote Sugar as a better-JavaScript. Then maybe, if Sugar becomes more widely used, we'll see people starting to be interested in the underlying meta-programming framework and start writing and sharing transformation passes (like the dead-code removal pass I presented at YULHackers).

		

4 commentaires :: aucun trackback

dimanche 15 mars 2009

From JavaScript to Sugar: an example

Par Sébastien Pierre, dimanche 15 mars 2009 à 14:57 :: Langages

Lately I've been doing some back and forth between JavaScript and Sugar source code. In some places I rewrote the JavaScript in Sugar as I was expanding the code, and found myself removing syntactic elements -- the result is quite interesing. Here is the original JavaScript code

$(".do-save").click(function(){var l=;$("li").each(function(){l.push($(this).text())});save(l)})

And then the Sugar version

$ ".do-save" click { var l= ; $ "li" each {l push ($(target) text ())} ; save (l) }



The exercise of removing unnecessary syntax (like function()) and replacing parens by spaces was quite satisfying, and I think the result speaks for itself.

However, there is still some room for syntax simplification to be done on this part of the expression

$ "li" each {l push ($(target) text ())}

where I would like to see something along the lines of

$ "li" each {l push ( $ `target text ! )}

The additions made to the syntax would be

Although these two syntactic forms are not common, the backquote is used in Lisp to escape interpretation, and the exclamation denotes a command (an invocation).

I guess some people will say that we can't simplify something by adding new elements, but for lack of a better word this is still how I would discribe my goal in evolving Sugar's syntax. Being a visual person, I try to use a "visual" approach to designing Sugar's syntax, and make use of whitespace and simple punctuation elements to add more rhythm to reading the code. I often think of programming languages as textual interfaces, and in this respect, syntax deserves as much design as user interfaces do nowadays.

Then again, there are the questions of style (some people like indentation, some people like braces) and references (some people know Java, some people know Smalltalk). For me, what's important despite the contextual elements is consistency -- the first users of vi may have not liked its style or its references, but making the small effort of using it for some time, even if it looks and feel weird is sufficient to give you a feel that there is an underlying consistency build by careful design.

8 commentaires :: aucun trackback

samedi 7 mars 2009

Sugar presentation aftermath

Par Sébastien Pierre, samedi 7 mars 2009 à 17:11 :: Langages

So I'm just back from the FreeHackers' Montréal YULhackers unconference where I presented Sugar in front of a dozen of people (including some fellow Pythonistas from The Navarra Group).

I decided to use a three sections presentation of Sugar:

  1. The origins of Sugar, coming from my experience with common programming languages
  2. A practical overview of Sugar, from its design to its actual syntax
  3. Why Sugar is a good replacement to JavaScript for front-end web development

Overall, the feedback I got seemed to be a little bit mixed: some people were asking about the practical interest of using Sugar (which makes me think I did not make my point clearly), and there was little reaction to my demonstration of the meta-programming features of Sugar (which seem to me as the most interesting part).

I must say I expected a little bit more enthusiasm from the people there, but I then realized that I wasn't presenting to the LtU crowd, so it's kind of normal that I did not get too much feedback on such a hairy topic as meta-programming languages ;)

Interestingly, Riadh suggested to put more efforts into "marketing Sugar" so that its benefits would be more easily understandable by everybody. So far, my personal attitude towards "marketing my projects" was something along the lines of "it's working for me, I've open-sourced it so people can see if they can make us of it" -- which for some projects like Sugar does not really help their visibility.

More recently, I've started to publish projects like Sugar on github.com and to post announcements on programming.reddit, which is a great way to generate some buzz (it worked quite well for the trendy K7 project), so maybe I'll use this blog to post more "marketing material" for Sugar.

Anyway, the experience was interesting and it gave me a chance to create a presentation that will probably interest some of the regular readers here :)

UPDATE: The presentation got promoted on SlideShare and is now visible on site front page (for a limited period of time I guess) !

10 commentaires :: aucun trackback

vendredi 6 mars 2009

Go Netvibes !

Par Sébastien Pierre, vendredi 6 mars 2009 à 14:52 :: General

The current credit crisis is already a problem for a lot of small and medium businesses that need more funding to get things going -- and it's already a problem for a couple of startups, which were forced to shut down in spite of having a great product.

Read Write Web's published today an article on Netvibes that feels pretty much like "Netvibes bashing" (the actual title is "Netvibes appears to be dying"). As a Netvibes user I was intrigued by such a news, and reading the article I was quite puzzled by its rather subjective tone.

RWW's article feels like the author is trying to create "bad vibes" for Netvibes, and I really don't get why there's any need for that kind of attitude in the current context. Is there any reason for RWW to be that harsh toward a start-up, especially considering RWW's large audience ?

Anyway, Netvibes is with delicious.com, last.fm and github.com one the few services I use and continue to appreciate -- it's also one of the few French start-ups that have an international success... so go Netvibes, go !

2 commentaires :: aucun trackback

lundi 2 mars 2009

Sugar at Free Hackers's Union Montréal

Par Sébastien Pierre, lundi 2 mars 2009 à 08:44 :: Langages

So it's confirmed, I will be presenting Sugar this Saturday at Montréal Free Hacker's Union (see the announce here).

I'm still hesitating on the approach I will use for the presentation: so far I've advertised Sugar as a replacement to JavaScript for front-end web development (which is where it's most useful), but its actual goal is a bit different (Sugar is meant to be a practical meta-programming language). As a result, the presentation draft focuses as much on the conceptual background of Sugar as on its syntax and usage.

My intuition is that it's more interesting to do a presentation on things that people won't find in the Sugar source code, like its inception and design. The presentation being followed by a workshop, I have plenty of time to present Sugar in practice.

However, I know we're in North America here and that people would normally expect a "hands-on tutorial" rather than a theoretical overview followed by practical examples (which is more a French/European way of presenting). So this will be an experiment... I'll let you know how this went ;)

4 commentaires :: aucun trackback