<p>We've all seen in-browser rich text editors, which allow you to edit colored/styled text in a WYSIWYG manner. But what about code editors, which automatically highlight code based on language rules as you type? Think Eclipse in a textarea (but without the refactoring support).</p>

<p>Do such things exist? I imagine scaling would be a problem - larger files would be difficult  to edit efficiently.</p>

The
editArea
javascript library does a pretty good job. It's used by the
OpenCMS
content management system as it's in-place JSP and JavaScript editor. The colorization gets a bit confused when the file is > 2000 lines or so.
The feature list from their page is:
Easy to integrate, only one script include and one function call
Tab support (allow to write well formated source code)
Search and replace (with regexp)
Customizable real-time syntax highlighting (currently: PHP, CSS, Javascript, Python, HTML, XML, VB, C, CPP, SQL, Pascal, Basic, Brainf*ck)
Auto-indenting new lines
Line numbering
Multilanguage support (currently: Croatian, Danish, English, French, German, Italian, Japanese, Polish, Portuguese)
Full screen mode
Can work in the same environment than "protype" and "mootools"'s like libraries.