Nano-Sheets: A Small But Mighty Spreadsheet Engine in REBOL
Even in today's big-computing environment, not everything useful has to be big. This article shows you how to build a tiny and basicbut powerfulGUI spreadsheet engine in REBOL, using fewer than 1500 bytes of code.
by Steve Shireman and Gregg Irwin
March 7, 2005
his article explores the design of a GUI spreadsheet, called Nano-Sheets. In its most basic form, the code for Nano-Sheets requires fewer than 1,500 bytes of code, which prints easily on a single sheet of paper. It is a very basic, but fully functional, spreadsheet engine with a working GUI.
Why is it so small?
It is built using REBOL, a compact, portable, messaging language designed for the semantic exchange of information between people and machines.
The code generates the main GUI worksheet dynamically.
The REBOL language is available for direct use in cell formulas. That means you don't have to write your own expression evaluator or macro language, yet you can still easily extend the worksheets with custom code.
There are no features beyond basic spreadsheet functionality. This is an important design aspect. As you'll see, Nano-Sheets can be extended with specific features as necessary in an application, but also inherits the rich macro language that REBOL provides for cell formulas.
Many modern software developers think a spreadsheet has to be a multi-Megabyte program whose empty data files are 10K or more in size. Even after adding features such as the ability to load and save files, HTML export, and some custom worksheet functions, Nano-Sheets will still be only about 10K of code (3.5K in ".rap" formthat is, compressed and encryptedon REBOL/IOS. IOS stands for "Internet Operating System," which provides secure distributed messaging between Reblets similar to Nano-Sheets. You do need to install REBOL/View (about a 300K download) to run the samples.
It's quick, easy and you get access to all the articles on DevX.
This registration/login is to allow you to read articles on devx.com. Already a member?
To become a member of DevX.com create your Member Profile by completing the form below. Membership is free!