Languages are the mechanism that links people and computers. Throughout their history, languages have always changed according to the needs of their users. Programming languages are no exception. Recent developments in modern programming languages provide powerful mechanisms, like modularity and polymorphic type systems, which allow us to structure programs and abstract from computations, thus changing the way we construct programs and, most importantly, improving our productivity. Programs are now easier to write, to reuse, and to manipulate. Developments in programming languages are also changing the way in which we construct such programs: naive text editors are now replaced by powerful programming language \myem{environments} which are specialized for the programming language under consideration and which help the user throughout the editing process. Helpful features like highlighting keywords of the language or maintaining a (pre-defined) beautified indentation of the \myem{program} being edited are now provided by several text editors. \myem{Language-based environments}, however, go a step ahead. They use \myem{knowledge} of the programming language to provide the users with more powerful mechanisms to develop their programs. This knowledge is based on the \myem{structure} and the \myem{meaning} of the language. To be more precise, it is based on the syntactic and (static) semantic characteristics of the language. Having this knowledge about a language, the language-based environment is not only able to highlight keywords and beautify programs, but it can also detect features of the programs being edited that, for example, violate the properties of the underlying language. Furthermore, a language-based environment may also give information to the user about properties of the program under consideration. Finally, it may hide from the user some peculiarities included in the language that are relevant only for the programs/computers that process/execute them. All these features make a language-based environment an effective mechanism to increase the productivity of users. After each interaction with the user, a language-based environment provides immediate feedback concerning whether such an interaction is legal or not. That is to say, the environment has to react and to provide answers in real-time. Consequently, the delay between the user interaction and the system response is an extremely important aspect in such interactive systems. Thus, one of the key features to handle such interactive environments is the ability to perform efficient {\em re-computations}. Although the complete exhaustive re-computation of the input after an interaction gives correct results, in practice, it provides bad time responses. Then, such environments should aim at reducing the amount of work they have to perform after an interaction. In other words, they require an {\em incremental computational model}. Another aim of language-based environments is to provide a good {\em user interface} so as to allow the users to easily interact with the environment and efficiently develop their programs. The development of an incremental engine, a good user interface and a possibly complex language processor, however, make the hand writing of a language-based environment a difficult and hard task. Although it is always possible to follow such an approach, it is more efficient to formally specify a language-based environment and to use tools, \ie, {\em environment generators} \cite{centaur,LMOW88,RT89b,klint93,lrc}, which automatically produce the environment from those specifications. All the (hard) work of defining the incremental engine, the user interface and the language processor, will have been implemented/moved to the environment generators. Thus, we need a formalism to specify languages and derive their environments. Attribute grammars, and particularly their higher-order variant, are a suitable formalism to specify such language-based environments. Furthermore, attribute grammars are executable, \ie, efficient implementations can be automatically obtained. This paper concerns the formal specification and efficient implementation of language-based environments. Purely functional attribute evaluators are the implementations we derive from the specifications, \ie, attribute grammars. The efficient implementation of language-based environments is achieved by using incremental attribute evaluation.