next up previous contents index
Next: 1.1 Syntax Up: Contents Previous: Contents   Contents   Index


1. Onyx Language Tutorial

This manual includes a comprehensive Onyx Language Reference chapter, which explains the details of what Onyx is. However, that chapter is rather dry, and more importantly, it does not discuss how to best utilize Onyx. This chapter introduces concepts that are important when designing and implementing Onyx programs, though it is not a complete language tutorial. You will need to read the first several sections of Chapter 2 in order to absorb all of the information in this chapter. However, you should be able to read this chapter first, then come back to it and glean additional understanding after having read later chapters.

Onyx is a stack-based language, so although the ideas that are important to program design in other more traditional languages still apply in many cases, there are different ways of approaching certain problems that integrate better with the facilities provided by Onyx. The most obvious example of this is that Onyx programs are more efficient if written to use named variables as little as possible, relying instead on the power of the operand stack. Another example is error handling. It is possible to write procedures that check for every error condition, but Onyx provides a form of exception handling that, if used correctly, can significantly improve code readability and performance.

Accomplished PostScript programmers will find little new in this chapter; Onyx differs from PostScript in the details, but the concepts are very similar. Accomplished Forth programmers will already be comfortable with stack management, but the rest of the chapter discusses concepts that either have no Forth equivalent, or that are significantly different from Forth, as is the case for dictionaries.



Subsections
next up previous contents index
Next: 1.1 Syntax Up: Contents Previous: Contents   Contents   Index
Jason Evans 2005-03-16