» Home

  » Developer Guide


Brass SSE Developer Guide - An Introduction

 

Want to see a demo before you dive right in? Not sure how easy it will be to make a plugin?

Click here for a Flash movie that shows you how - you'll be amazed how easy it is!

 

What are SSE's?

"SSE" stands for "ShinySource Executable", small programs that run inside Brass as plugins just like Newsgrinder, Dilbert Daily and all the other plugins. But slightly differently ;)

It's very easy to write an SSE plugin for Brass, even if you have no programming experience at all. Anyone with even a basic understanding of programming in BASIC or C will be able to write their first plugin after just a few minutes of reading.

If you can't program, don't worry! You can use a graphical development environment to simply drag and drop components for your plugin!

Since version 0.2 Brass has had it's own language called "Shiny". This language works just like BASIC or C and has access to all of Brass' functionality. To create an SSE simply write the code in the supplied SSEdit tool, compile it and send it to Brass.

 

It's own language? Won't that be hard to learn?

Not at all. There are only 30 or so "commands" in the language, all very easy to use and remember. The language also supports implicit type conversion - this means you can assign non-similar types to each other. For example, let's say you want to display the current day of the month on screen. In most languages you would be forced to convert the day from a number type to a string type then join 2 strings to get the final result you want. Shiny does away with all that. Here's some sample code in Shiny:

number MyHouseNumber = 30;
drawtext
("My house number is " + MyHouseNumber);

Shiny can convert between all its core types without any extra work for you.

Shiny also has some amazing extended functionality. Here's all the code you need to download a file from a website:

webdlfile("http://some.site.com/file.zip", "c:\downloads\file.zip");

One single line of code to download a file! The same simple system is used for drawing images on the screen, displaying text, reading data from websites and much more.

 

Wow, that's easy! How do I learn?

In the developer section of the website are tutorials as well as lots of sample programs for you to use, change and learn from. And of course you can always post on the Brass forum if you need help with your code.

 

Can you explain SSE's in a bit more detail?

Sure! All SSE's start out the same way, as an SSN (ShinySource Node) in the SSEdit tool. SSEdit is a specially developed editor that understands the Shiny language and is installed along with Brass. You'll find it in your Start menu in the Brass program group.

 

Within SSEdit is a "wizardbar" that lists all the handlers Brass knows about. To build an SSE you simply select the handler you want to, er, handle, and add some code to it. The principle is exactly the same as Visual Basic, MFC or any other GUI development system.

Once you've written code for the handlers (for example, text display in the "Render" handler), you compile your code to a ShinySource Executable (the SSE!).

 

The compiler produces the SSE for you, which you then deploy to the Brass SSE folder. That's all there is to it!

 

Hold on, you said compiler?

You just noticed the most technically important part of the entire system. Most applications use a "script interpreter" to provide the same kind of functionality. Creating a script interpreter is easy for the developers but it has serious implications. Scripting languages are extremely slow. When the application runs a script it must first interpret the code it finds, then execute that interpreted code. This makes it very, very slow. Javascript is a classic example of a scripting language - it was originally designed to provide some extra functionality for websites. Unfortunately it's been incredibly abused and misused as a scripting language for desktop applications.

Shiny is not an interpreted script language. The Shiny compiler takes your source code and compiles it into "bytecode". This bytecode is then run in a virtual stack machine inside Brass itself. This is the same technique used by commercial development languages such as Java, and it makes SSE's extremely fast.

SSEdit and Brass hide all of these details from you though, so if you're not really sure what those 2 paragraphs meant then don't worry! It's time to start the tutorials!