Quantcast WoW addon with modern language and design patterns - WoWInterface
Thread Tools Display Modes
11-04-18, 10:11 AM   #1
wartoshika
A Murloc Raider
AddOn Author - Click to view addons
Join Date: May 2018
Posts: 8
Thumbs up 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

Last edited by wartoshika : 11-07-18 at 02:07 AM.
  Reply With Quote
11-04-18, 11:15 AM   #2
Rilgamon
Premium Member
 
Rilgamon's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Sep 2009
Posts: 726
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.
__________________
The cataclysm broke the world ... and the pandas could not fix it!
  Reply With Quote
11-04-18, 11:44 AM   #3
wartoshika
A Murloc Raider
AddOn Author - Click to view addons
Join Date: May 2018
Posts: 8
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!
  Reply With Quote
11-05-18, 09:00 PM   #4
kurapica.igas
A Warpwood Thunder Caller
Join Date: Aug 2011
Posts: 98
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)

Also with the nodejs, if you can provide a WYSIWYG IDE, It may be a most attractive project for the wow addon authors.
  Reply With Quote
11-06-18, 01:03 AM   #5
wartoshika
A Murloc Raider
AddOn Author - Click to view addons
Join Date: May 2018
Posts: 8
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

Last edited by wartoshika : 11-06-18 at 01:17 AM.
  Reply With Quote
11-07-18, 01:59 AM   #6
wartoshika
A Murloc Raider
AddOn Author - Click to view addons
Join Date: May 2018
Posts: 8
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.
  Reply With Quote
11-07-18, 07:16 PM   #7
MunkDev
A Scalebane Royal Guard
 
MunkDev's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2015
Posts: 417
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.
__________________
  Reply With Quote
11-08-18, 10:01 AM   #8
wartoshika
A Murloc Raider
AddOn Author - Click to view addons
Join Date: May 2018
Posts: 8
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
  Reply With Quote
11-09-18, 05:45 AM   #9
tonyis3l33t
A Cyclonian
 
tonyis3l33t's Avatar
AddOn Author - Click to view addons
Join Date: Jan 2006
Posts: 47
Originally Posted by wartoshika View Post
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.
  Reply With Quote
11-09-18, 05:58 AM   #10
myrroddin
A Molten Giant
 
myrroddin's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2008
Posts: 949
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.
  Reply With Quote
11-09-18, 10:34 AM   #11
wartoshika
A Murloc Raider
AddOn Author - Click to view addons
Join Date: May 2018
Posts: 8
@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
  Reply With Quote
11-09-18, 12:48 PM   #12
Resike
A Pyroguard Emberseer
AddOn Author - Click to view addons
Join Date: Mar 2010
Posts: 1,277
Originally Posted by tonyis3l33t View Post
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


Last edited by Resike : 11-09-18 at 12:58 PM.
  Reply With Quote
11-09-18, 01:16 PM   #13
wartoshika
A Murloc Raider
AddOn Author - Click to view addons
Join Date: May 2018
Posts: 8
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).

Attached Thumbnails
Click image for larger version

Name:	autocomplete_qhun_core_ts.png
Views:	78
Size:	150.6 KB
ID:	9174  Click image for larger version

Name:	autocomplete_qhun_core_ts2.png
Views:	5
Size:	69.1 KB
ID:	9177  

Last edited by wartoshika : 11-09-18 at 01:22 PM.
  Reply With Quote
11-09-18, 01:31 PM   #14
Lyak
A Cyclonian
Join Date: Jul 2018
Posts: 43
Originally Posted by Resike View Post
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
  Reply With Quote
11-09-18, 09:22 PM   #15
Resike
A Pyroguard Emberseer
AddOn Author - Click to view addons
Join Date: Mar 2010
Posts: 1,277
Originally Posted by Lyak View Post
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)
  Reply With Quote
11-09-18, 09:40 PM   #16
jlam
A Deviate Faerie Dragon
AddOn Author - Click to view addons
Join Date: Oct 2010
Posts: 16
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.
  Reply With Quote
11-09-18, 09:40 PM   #17
Resike
A Pyroguard Emberseer
AddOn Author - Click to view addons
Join Date: Mar 2010
Posts: 1,277
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.
Attached Files
File Type: lua APIMissing.lua (35.5 KB, 4 views)
File Type: lua APIC_Missing.lua (24.4 KB, 6 views)
  Reply With Quote
11-10-18, 12:52 AM   #18
wartoshika
A Murloc Raider
AddOn Author - Click to view addons
Join Date: May 2018
Posts: 8
@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 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.

Last edited by wartoshika : 11-10-18 at 01:38 AM.
  Reply With Quote

WoWInterface » Developer Discussions » General Authoring Discussion » WoW addon with modern language and design patterns

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off