If you are a power user, you have a complicated relationship with VimL (Vim Script).
On one hand, it’s the soul of the editor. It’s blazing fast, integrates perfectly with the buffer, and lets you perform complex text surgery with just a few lines of code.
On the other hand, let's be honest: it hits a hard ceiling.
When you stop writing simple plugins and try to build large-scale applications, VimL becomes a nightmare. It’s a fantastic scripting tool, but it’s a terrible system architect.
This series explores ObjectSense, a project that attempts a different evolutionary path. Instead of accepting VimL as just a scripting tool, it asks: What if VimL grew up and embraced modern engineering?
In this first part, we look at how ObjectSense refactors the language from the inside out.
The "Fake" OOP Problem
VimL 8 tried to address modern needs by introducing dict functions. This allows you to use the self keyword to simulate Object-Oriented Programming.
But let’s call a spade a spade: It’s just dictionary manipulation.
It’s not a true class-based structure. You are essentially manually wiring functions to dictionaries. On top of that, standard VimL lacks native Packages or Imports. This forces developers to dump everything into a global namespace "soup," relying on fragile naming conventions (like unite#...) to avoid collisions.
It works, but it’s boiler-plate heavy and hard to maintain.
Keeping the Core, Fixing the Skeleton
ObjectSense doesn't throw the baby out with the bathwater. According to its documentation, it retains the lightweight, sub-1000-line core of VimL to ensure performance remains high.
However, it injects a proper OOP skeleton into that body. Here is how it changes the game.
- From Dictionary Hacks to Real Classes
In standard VimL, you have to manage dictionary references manually to create something that looks like an object. ObjectSense introduces Class and Inherits as first-class keywords.
The Old Way (Standard VimL):
function! s:Person.getName() dict
return self.name
endfunction
let g:Person = { 'name': 'VimL', 'getName': function('s:Person.getName') }
The New Way (ObjectSense):
It looks significantly cleaner, resembling modern languages like Ruby or Python. It supports inheritance out of the box.
Package oop
Class Human
" @accessible
function! s:Work()
return "Go to work"
endfun
End
Class Index Inherits Human, Car
" ...
End
- Solving the Namespace Nightmare
The biggest pain point in large VimL projects is dependency management. ObjectSense kills the global namespace pollution by introducing standard Package and Import mechanisms.
This allows you to modularize logic without worrying about function name clashes.
Package oop
Class Human
" @accessible
function! s:Work()
return "Go to work"
endfun
End
Class Index Inherits Human, Car
" ...
End
What's Next?
By introducing Class, Inherits, Package, and Import, ObjectSense effectively bridges the gap between a configuration script and a modern, object-oriented language. It keeps the syntax familiar but removes the architectural headaches.
However, syntax is only half the battle. For a language to truly thrive, it needs to break free from its host (the editor) and stand on its own.
In Part 2, we will dive into how ObjectSense handles the ecosystem—compilers, cross-platform capabilities, and the tooling required to run independent of Vim.

Top comments (0)