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

127 天前
 codigger

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.

849 次点击
所在节点    Vim
0 条回复

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/1066514

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX