Implementing Operators and Built-In Functions
New programming languages are invented because, occasionally, new ideas and new computational capabilities are needed to solve problems in new application domains. Libraries of functions or classes are the most common means of extending mainstream languages with additional computational capabilities, but adding a library is not always sufficient.
This chapter describes how to support very high-level and domain-specific language features by adding operators and functions that are built into the language. The following chapter will discuss adding control structures.
Adding operators and built-in functions may shorten and reduce what programmers must write to solve certain problems in your language, improve its performance, or enable language semantics that would otherwise be difficult. This chapter illustrates the ideas within the context of Jzero, emphasizing the string and array types. By way of comparison, the later sections describe...