Emacs Extensions for
GE Smallworld Magik Development
Screen-casts, tutorials, and productivity tools for Magik programmers who use Emacs. From tab-mode and code folding to the Magik Debugger and object inspector — explore features built by a developer, for developers.
Learn MoreNine screen-casts published between November 2010 and January 2011 — covering everything from ECB mode to the Tree Item GUI control. Read the story behind the project →
Get in Touch
About Magik Emacs
The site author has worked with Emacs since 1996, previously programming AutoCAD in Lisp. After using Emacs with Smallworld and Magik, he began adding features to improve development efficiency.
A Six Sigma Green Belt project at GE focused on Emacs customization, demonstrating quantified savings in development time and cost. The site shares features the author finds useful in daily work and continues to extend based on personal interest and user requests.
For consulting services, visit HydePark-Consulting.com.
The Magik programming language, central to GE Smallworld, offers a rich object-oriented environment where developers work with collections, records, and methods to manage complex geospatial data. Emacs provides an exceptional editing experience for Magik code, with features that streamline the manipulation of symbols, strings, and database elements. The synergy between Emacs and Magik enables efficient navigation through method definitions, field inspections, and debugging sessions. Developers familiar with the Smallworld environment find that Emacs extensions tailored for Magik significantly reduce the cognitive overhead of switching between tools, allowing for deeper focus on logic and data modeling rather than syntax management.
Understanding Magik's type system is essential for productive development. The language distinguishes between records, collections, and individual elements, each with specific behaviors for reading, writing, and transformation. Emacs tools designed for Magik help developers inspect these types at a glance, showing whether a variable holds a single record, a collection of records, or a simple string or symbol. This immediate feedback during coding reduces errors and accelerates the development cycle. When working with large datasets and complex object hierarchies, having clear visual cues about data types becomes invaluable for maintaining code quality.
Debugging Magik code in Smallworld often involves tracing method calls, inspecting object state, and understanding how data flows through collections and views. Emacs can be configured to display trace descriptions, highlight breakpoints, and present variable values in structured formats. The ability to set debugging variables and inspect the contents of datasets, cached elements, and database records directly from the editor transforms the debugging experience. Developers can move fluidly between writing code and examining runtime behavior without leaving their primary editing environment, which preserves concentration and reduces context switching.
Magik's method dispatch system relies on symbols and name resolution, making it important for developers to quickly locate method definitions and understand their signatures. Emacs provides symbol completion, method navigation, and source file referencing that integrate with Smallworld's environment. When working with derived fields, pseudo fields, and alternative method implementations, Emacs helps developers track which version of a method will execute at runtime. This becomes particularly valuable when maintaining large codebases where methods may be defined across multiple files and layers of inheritance.
Collections form the backbone of many Magik applications, handling everything from simple lists to complex dataset structures. Emacs extensions for Magik offer commands to inspect collection sizes, view elements, and understand the relationships between different collection types such as ropes, arrays, and database-backed collections. Developers can quickly evaluate expressions that return collections and examine their contents in organized buffers. This capability supports both development and operational troubleshooting, as the same tools work for both new code and legacy systems that may contain deeply nested or cached collection hierarchies.
The Smallworld database environment presents unique challenges for Emacs integration, particularly when working with replicas, primary databases, and development environments. Emacs tools can help developers manage database connections, view field definitions, and understand the structure of database tables and collections. Commands for inspecting the current database context, switching between environments, and examining replica status enable developers to work confidently across different deployment scenarios. This integration reduces the friction of moving between development, testing, and production database configurations.
String manipulation in Magik often involves substring operations, character encoding considerations, and formatting for output. Emacs provides powerful text editing capabilities that complement Magik's string handling, allowing developers to compose, test, and refine string expressions with immediate feedback. The editor's support for regular expressions, multi-line editing, and transformation commands pairs naturally with Magik's string methods. Whether building output strings for debugging purposes, constructing query parameters, or formatting data for display, the combination of Emacs editing power and Magik string functions creates a fluid development experience.
Version management and environment configuration are recurring themes in Smallworld development. Emacs can help developers maintain consistent settings across different projects and environments through customizable configuration files and project-local variables. The ability to define environment-specific settings for source file locations, database connections, and debugging options means developers can switch between projects without manual reconfiguration. This consistency reduces errors and ensures that development tools behave predictably regardless of which Smallworld environment is currently active, supporting both individual productivity and team collaboration.
Core Features
Tab Mode & ECB
Quick tab switching and Emacs Code Browsing mode for navigating Magik codebases efficiently.
Magik Smeller
Code analysis tool that helps identify potential issues in Magik source files.
Code Folding
Hide/Show mode for collapsing and expanding Magik code blocks to focus on what matters.
Visual Bookmarks
Quick visual bookmarks for jumping between key locations in your Smallworld session buffers.
Object Inspector
Inspect Magik objects and display them in an Emacs Deep Print buffer for detailed examination.
Magik Debugger
Set breakpoints and monitor slots and variables directly from within Emacs.
Development Tools
Direct links between Emacs and the Smallworld Development Tools application, including Click Monitor.
Screen-casts & Tutorials
Screen-cast 1: Tab Mode, ECB & More
Covers tab-mode, ECB, Magik Smeller, code folding, visual bookmarks, pragma toggling, moving code, external editor, and MS Explorer.
Screen-cast 5: Object Inspection & Deep Print
Inspect a Magik object, prompt for an expression evaluated within a Smallworld session, and display results in a Deep Print buffer.
Screen-cast 7: Magik Debugger
Useful tools for application developers: Object Inspector and Magik Debugger with breakpoints and slot/variable monitoring.
Screen-cast 9: Tree Item GUI Control
Tree Item is a GUI control providing extensive facilities for displaying lists with rows, columns, trees, and in-place editing.