fluffos / fluffos

Actively maintained LPMUD driver (LPC interpreter, MudOS fork)
https://www.fluffos.info
Other
370 stars 191 forks source link

Feature request: Suggestions on LPC language governance and innovation #841

Closed cellboy closed 3 years ago

cellboy commented 3 years ago

LPC programming language has not developed for many years. In fact, the relationship between driver and LPC has always been the relationship between libc + compiler and C. Therefore, there are different implementation methods such as ldmud (many Efun similar to libc) and DGD mud.Fortunately, we are fluffos, a family inherited from the original MudOS.which is like the relationship between GCC and Visual C + +,just different implementations of C11 standard. According to fluffos's 2021 plan, it is very meaningful to upgrade the LPC language. Therefore, I highly agree with the use of ANSI C abi (C99 C11 C18) in LPC. In essence, LPC is a scripting language of C language and provides a single object-oriented programming capability object, inherit, but it is not enough. Therefore, it is suggested to absorb more C / C + + language features, especially more data types, language expression ability, complete object-oriented GC ability and other language features, so as to liberate the magic of LPC itself. Of course, the direction is for reference only. On the one hand, it provides a powerful JIT compiler from the interpretability of static language to improve performance. On the other hand, it links the driver with some C / C + + libraries to facilitate LPC programming to obtain more Efun through the native C / C + + extension library. H file. All these require hard work. If I can, I will try with people who support the same. All this is to contribute to the beloved lpmud.

thefallentree commented 3 years ago
  1. Similar stuff has been done before, PIKE is a formalized version of LPC, and as far as I can tell it is still being maintained. I think LDMUD or some other engine also has a JIT implementation

  2. LPC is not rocket science, it is not even a particular sharp knife. It is fundamentally a pretty normal structural programming language with very little extra features compare to other languages. (although being UTF8 native is a plus).

overall there are very little gain to "unify" LPC implementation, first of all we don't even have a good language toolchain built (formatter) for fluffos, so I would rather focus on tangible stuff before worrying about migrating other Mud engines. Similar to JIT, instead of trying to do one magical thing, it will be first good to implement a COW string , it will bring at least 20% performance gain , if not more, which I think is much more useful exercise.

Other idea includes:

  1. inline functions
  2. SSA transformation for IR
  3. more optimizing pass.

All of these are pretty interesting project ideas to choose from

cellboy commented 3 years ago

Maybe you are right,LPC is just an experimental product ~, especially the copyright issue. I learned about Pike language, which is really an interesting thing. It has developed to 8.0. In fact, I am also a craftsman of system layer development. I understand your idea very much. In fact, a little more practical progress is more valuable than an overhead ambition. Human life is limited.