archives

Spark: Modular, Composable Shaders for Graphics Hardware

If you are interested in the intersection of PL and computer graphics, I invite you to read our SIGGRAPH paper on Spark, a real-time shading language that aims to improve support for good software engineering practice. From the abstract:

In creating complex real-time shaders, programmers should be able to decompose code into independent, localized modules of their choosing. Current real-time shading languages, however, enforce a fixed decomposition into per-pipeline-stage procedures. Program concerns at other scales - including those that cross-cut multiple pipeline stages - cannot be expressed as reusable modules.

We present a shading language, Spark, and its implementation for modern graphics hardware that improves support for separation of concerns into modules. A Spark shader class can encapsulate code that maps to more than one pipeline stage, and can be extended and composed using object-oriented inheritance. In our tests, shaders written in Spark achieve performance within 2% of HLSL.

You can access the paper through either our Intel or Stanford pages. The Intel page also has a link to the source code for our system.

If you are in Vancouver this week for SIGGRAPH, you can catch my talk on Thursday.

Candle - a new script language that unifies XML technologies

Dear members of LtU,

I'm glad to announce the 0.9.1 beta release of Candle (Common ApplicatioN Development LanguagE). Candle is an open-source (MPL) scripting language that unifies the core features of many XML-related technologies (including XSLT, XQuery, XQuery Update, RELAX NG, BNF, XHTML, SVG and more). It can be used to develop command-line, desktop and Internet applications quickly.

Some of the advantages of Candle comparing to XSLT and XQuery are:
  • Candle is an unified language instead of two highly-overlapping languages. Candle uses scripting syntax instead of the highly verbose markup syntax of XSLT.
  • Candle's markup language is strongly-typed even without schema, whereas XML is only weakly-typed without schema.
  • Candle consists of a pattern language which cleanly unifies several pattern-related DSLs (including RegEx, BNF, RELAX NG, XQuery Sequence Type). It can easily match on sequence of items, nodes and characters.
  • Candle unifies functional and procedural programming. Through a mechanism I called separation-of-side-effects, Candle unifies two worlds in a more orderly manner then any existing multi-paradigm programming languages. In Candle, routines are divided into functions and methods. Functions are routines without side-effects and methods are routines with side-effects. The rule of separation-of-side-effects is that methods can call functions, but not vice versa. And expressions in Candle are always functional. In this way, pure functional islands are well-preserved in the vast sea of procedural code.
  • Candle is a general-purpose scripting language like Python, whereas XSLT and XQuery are just DSLs. Candle alone is sufficient to develop complex command-line, desktop and Internet applications, whereas XSLT and XQuery still need to integrate with other languages to develop a serious application.

For more information, you can visit the website (http://www.candlescript.org/) or the SourceForge project.

You can also read two blog articles Why I Invented Candle (I), Why I Invented Candle (II) and Towards the Grand Unification to understand the design rationales behind Candle.

Your feedback on Candle is highly appreciated.

Henry

--------------------------------------------------------------------
Candle App Platform - An unified platform for desktop and Internet apps.