sponsor Vim development Vim logo Vim Book Ad

The ObjectSense Programming Language : An object-oriented reincarnation of VimL

 script karma  Rating 8/2, Downloaded by 46  Comments, bugs, improvements  Vim wiki

created by
Yiu Wing
script type
ObjectSense is a superset of VimL8, and has all the main features of a modern object-oriented language, such as data encapsulation, polymorphism, inheritance, etc.  On top of the language implementation, rose - a module manager is provided, which is also built into the language runtime.  It's very developer friendly, especially for those who already have a working knowledge of VimL8 can effortlessly expand their skills to code in ObjectSense.  

As a bonus feature, polyglot programming is easily doable in ObjectSense.  Currently vim8 and vim9 are supported, with minimal work the list can grow longer to include other languages, such as, python, ruby, lua, etc.  However, as far as the operating system is concerned, only Linux and MacOS are supported at the moment.  There is a user-defined command, UT, for doing unit tests of the current class.  It's very convenient for accessing class data in unit tests.  No need for finding workaround to the language barrier when accessing such data in white box testing.  Every component can be properly tested! Pure and simple!  By following a few simple conventions and thanks to the built-in modular mechanism in the language runtime, ObjectSense programs are very scalable and development work can be distributed comfortably among team members.

In a more programming linguistic point of view, ObjectSense is of imperative paradigm on the surface, but carries functional programming abilities.  In the language runtime, each object has its own data and functions, there's nothing shared.  An object is entirely in its own universe just like functional programming.  Because the lack of time, we haven't explored such property of the language much.  Hopefully, the community can shed new lights on such nice combination.

This is a strong demonstration of what VimL8 is capable of.  ObjectSense takes less than 5000 lines of code for the core of the language implementation.  Although it's a superset of an existing language, it's very hard to imagine using such little code for implementing a non-trivial programming language.  VimL8 has a lot of unrealised potentials, people really shouldn't jump off the bandwagon too quickly.

The best argument for vim9 is performance.  We have found a way kind of 'compile' or speedup the load time for ObjectSense. In practice, we could really compile such code into binary and wire it with the language runtime, and without asking developers to learn a completely new language, i.e., being 100% compatible with existing VimL8 syntax and have the acclaimed performance at the same time.  However, in our scenario ObjectSense performance issues have been tackled by the semi-compile approach, so no effort was directed to do the real compiling work which could bloat the code base exponentially.

Please download and untar the tarball, start from object/doc/readme.txt.
install details
1.  move the downloaded tarball to ~/.vim directory, and untar it
        mv onecloud-object-sense.tar.gz ~/.vim
        cd ~/.vim
        tar -xvf onecloud-object-sense.tar.gz

2.  open .vimrc and add a line
        so ~/.vim/object/ObjectSense.vim

3.  add the following in .vimrc for doing ObjectSense development
        const g:OBJECT_SENSE_DEV = 1

4.  to get a taste of the language, check out ~/.vim/object/demo subdirectories

rate this script Life Changing Helpful Unfulfilling 
script versions (upload new version)

Click on the package to download.

package script version date Vim version user release notes
onecloud-object-sense-1.1.4.tar.gz 1.1.4 2022-09-10 8.2 Yiu Wing 1. 'rose test' is able to give a line-based test coverage report and
    highlight the lines that are not covered by test

    For example, run the test coverage on rose package that comes with ObjectSense,
        cd object
        rose test rose -c
    Open the browser and visit the generated html.

2.  supported polyglot in QuickStart

3.  introduce UnitTestBelow directive which prevents loading unit test code in
     production environment

4.  refactor quite a few number of variable and function names

5.  tighten up some loose logic and fixed a bunch of bugs

6.  provide object.Runtime class to work with the modules at runtime
onecloud-object-sense-1.1.3.tar.gz 1.1.3 2022-08-14 8.2 Yiu Wing Initial upload
ip used for rating:

If you have questions or remarks about this site, visit the vimonline development pages. Please use this site responsibly.
Questions about Vim should go to the maillist. Help Bram help Uganda.