WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   General Authoring Discussion (https://www.wowinterface.com/forums/forumdisplay.php?f=20)
-   -   WoW addon with modern language and design patterns (https://www.wowinterface.com/forums/showthread.php?t=56829)

wartoshika 11-04-18 10:11 AM

WoW addon with modern language and design patterns
 
Hello everyone,

I am currently developing a transpiler that allows to convert the language Typescript into a WoW compatiable LUA (@wartoshika/qhun-transpiler). With a powerfull transpiler in my back, i started developing a modern framework as a base for other developers and as a starting point to take a look at existing source code (@wartoshika/wow-QhunCoreTS).

There is currently no existing complete documentation because i am still in the heavy developement phase. I will add them when both projects become stable released.

My questions are now related to both of the projects.
  • Do you think, that using a different language for LUA can harm the performance of addons?
  • Do you think, that the generated LUA sourcecode is good enough (performance and quallity perspective)?
  • One important thing is that typescript does not support multi return values but there is an easy way with full type safety to get all return values. Does this argument mattern?
  • When you hear about decorators, classes, static typing... Can an average addon developer benifit from a setup and language that introduces more powerfull paradigms? (Those, that are used by Typescript are common for every larger object orientated programming language, and a wow addon dev is in most cases no addon dev only and knows about those paradigms (or others))
  • Are thinks like reactive programming with observables and promises, repositories for quering the saved variable database... a bit to much?
  • The developing environment should be a node-js capable client witch can download the transpiler, framework and autocompletion for the WoW-Api from the node repository online (even other existing projects using typescript can be used in the wow context)

I can provide example files or a gist with generated LUA source code if you like.

My daily business is the full stack development of web applications. Those things are everywhere in this environment. But this may not be the case for addon developing in an environment that is not my daily business.

I appreciate every comment or thought of yours. One goal of this is to gain a base knowledge of this community of developers and if my idea can fit into this place.

Regards
wartoshika

Rilgamon 11-04-18 11:15 AM

We've seen many frameworks created but not many are in active use. Putting a framework into another language with restrictions not in Lua does not sound too tempting to try it. If you enjoy it have fun.
When it comes to addons it shows that the smaller the better and the longer they will work once the authors stop supporting them.

wartoshika 11-04-18 11:44 AM

Thanks for your answer.

I will keep in mind that developers needs a way to shrink complex constructs into maintainable source code. This should keep the required work for updates small and the support time longer. Great point Rilgamon!

kurapica.igas 11-05-18 09:00 PM

Since the Lua is a language with the least grammar, it may not attract the addon authors with Lua experiences, but it may attract authors from the web development.

With my exp, unlike web apps, the addons are smaller and more simple. With libs, the authors should focused on the functions not the class structure.

I failed for my first lib because it's too complex to be learned and started a new one - Scorpio A new addon framework, it's designed to hide the details of the OOP system and allow authors create addons with only functions.(you may find a complex OOP system is not always welcome in that thread:D)

Also with the nodejs, if you can provide a WYSIWYG IDE, It may be a most attractive project for the wow addon authors.

wartoshika 11-06-18 01:03 AM

Procedural written addons will gain a huge complexity when writing more and more lines of code. Authors must be very skilled in order lower cognitive complexity and keep maintainability.

I unterstand your point kurapica.igas. In my opinion a WYSIWYG editor is targeted to users with below average skill in programming/scripting. Such software will be very complex to write and unterstand if i want support window anchoring, dynamic inheriting of parent frames, user defined properties... (But i will keep this idea in mind for UI creation).

I may overthink my target group of people using this framework / transpiler. It's current cognitive complexity is low when you allready know standards of web development and OOP system but high if you dont.

Wish you best of luck for your Scorpio framework :)

wartoshika 11-07-18 01:59 AM

I am starting to write the documentation for the current stage of development. This can be found here.

This documentation is targetted to developers that understands the basic programming context. They do not know that Typescript or Node.js is. This may improve the acceptance of non web developers who are interested in writing addons in a more modern way.

I have decided to target people who want to write more complex addons. Small addons should be either transpiled without this framework, or should keep the LUA context. This decision reduces the amount of people that may want to use this tools, but as a developer with OOP in heart i can not simplify it to a LUA only context.

QhunCore has been my test framework with LUA base. In my opinion there is to much boilerplate code nessesary to accomplish a mid to large addon with a good maintainability.

Still I appreciate every comment/thought to alter the framework to improve the acceptance more.

MunkDev 11-07-18 07:16 PM

OOP constructs are built into the utilities in the UI code, and are heavily used in modern UI code. As someone who maintains a project with more than 30k lines of code, I just want to say I wouldn't use this. It's introducing a lot of constraints that Lua doesn't have natively. Lua's quirks and dynamic typing are sometimes useful to solve certain problems.

I understand where you're coming from, though. A lot of my older code is rather bad, and could've benefited massively from writing templates to inherit from, rather than building from scratch for somewhat similar scenarios. A novice programmer is also likely to introduce bugs due to dynamic typing. If you're committed to finishing this project out of passion, by all means go ahead. Just don't expect it to be a popular way to write addons.

wartoshika 11-08-18 10:01 AM

I dont want any kind of revolution, i would just be happy if there are some developers out there who benifit from this. And if there arent any, i can still use it for myself :)

There is still a lot of work todo, especially in documenting the wow api to be available via autocomplete. When i release the first stable version, i can look at the acceptance criterias in order to improve the usability.

Thanks for your reply MunkDev, every thought helps to understand the core developers of the addon community. My commitment to finish this project is still there!

More than this, i have more ideas that needs a solid transpiler and framework base to work. This idea will mock the ingame api and allow unit testing the latest api from within your IDE.

If this project ist just a way of passing the time, it is a good way in my opinion ;)

tonyis3l33t 11-09-18 05:45 AM

Quote:

Originally Posted by wartoshika (Post 330795)
There is still a lot of work todo, especially in documenting the wow api to be available via autocomplete.

This alone would be more than Blizz offers us. Dropping updates on wow.gamepedia.com or an IDE autocomplete plugin would be time well spent.

myrroddin 11-09-18 05:58 AM

Minor quibble, but since you need to document... Lua is the name, it is Portuguese for "Moon", and it is not an acronym, meaning it is not LUA.

Not related to your project, but it is just like the development library is Ace3, not ACE3. It doesn't stand for anything, it is just a name.

wartoshika 11-09-18 10:34 AM

@tonyis3l33t:

The current stage of documenting the API is public visible via its GitHub repository and via nodejs (@wartoshika/wow-declarations).

This is a Typescript specific documentation type allowing to use it for autocompletion and method based documentation in the IDE. Together with the transpiler and the framework it should be a solid base.

Since a developer need low latency when autocompleting a function, where is no time to query the existing API on gamepedia.com. I prefer to mirror the existing documentation and update missing information on gamepedia.com by hand. Since the online documentation is in verry different formats, i cannot write a parser that can automaticly pick up the correct function arguments and types. But a public available repository on GitHub is a good base to share improvements that can be merged into gamepedia.com.

An other advantage on mirroring it to TypeScript declaration files is that every IDE can use the autocomplete and documentation data, no plugin is needed for a specific IDE.

@myrroddin:

I will keep this in mind when completing the documentation to use the name Lua correctly. Thanks for this information :)

Resike 11-09-18 12:48 PM

Quote:

Originally Posted by tonyis3l33t (Post 330799)
This alone would be more than Blizz offers us. Dropping updates on wow.gamepedia.com or an IDE autocomplete plugin would be time well spent.

https://github.com/Resike/WoWDevelopment


wartoshika 11-09-18 01:16 PM

2 Attachment(s)
I see your point. When talking about Lua this is a good dev tool.

Since my target is TypeScript i need to add some more declarations. Like having an object of type eg. WowFrame.

See this picture of the qhun-core-ts framework in Visual Studio Code. And the declarations of the API will work in every IDE that understands TypeScript (there are a lot).


Lyak 11-09-18 01:31 PM

Quote:

Originally Posted by Resike (Post 330807)

Any future plans to bring this project to Visual Studio Code?

I have recently switched from Sublime Text 3 to Visual Studio Code and I am missing your wow development package :(

Resike 11-09-18 09:22 PM

Quote:

Originally Posted by Lyak (Post 330809)
Any future plans to bring this project to Visual Studio Code?

I have recently switched from Sublime Text 3 to Visual Studio Code and I am missing your wow development package :(

Sadly that's not possbile since i switched for a special stack based syntax highlight and scope definition language that only works with Sublime, it's also the only editor that can keep it's highlight scopes even with newlines in between them. (See the example)

jlam 11-09-18 09:40 PM

I wonder if you have seen this project already?

https://github.com/wowts

There is a TypeScript-to-Lua transpiler as well as a Lua-to-TypeScript transpiler under that project umbrella. It is currently in use to develop the Ovale WoW addon.

Resike 11-09-18 09:40 PM

2 Attachment(s)
wartoshika

I would be intereseted sharing parametered global API methods with you. I have a lot of ready to go but also lots of missing ones.

wartoshika 11-10-18 12:52 AM

@Resike:

These are 7.0.1+ functions. When i come to this stage of documenting them, i'll let you know (WoWInterface or GitHub).

@jlam:

Quote:

Quote from GitHub: Its targets are World of Warcraft addons, that use Lua 5.1. In the current form, it only intend to support a subset of Typescript
Yes, i have tried to develop some test addons with this tool but unfortunately there is only some basic TypeScript support. My goal with the qhun-transpiler was to support every aspect of TypeScript.

I want decorators, bitops, complex type transpiling, JavaScript function support when transpiling, type reflection for eg. dependency injection.


All times are GMT -6. The time now is 10:05 AM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI