-
Notifications
You must be signed in to change notification settings - Fork 0
Home
WebIDL is a variant of IDL more or less finetuned for browser vendors. Nidium is not a browser perse, but the arguments to use WebIDL are still valid.
In the nidium project a lot of c++ code is bounded with the spidermonkey javascript engine. Traditionally this has been done manual by coding carefully. This approach has several disadvantages:
- Activating and upgrading to new spidermonkey versions is a real hassle.
- Adding new c++ classes (e.g. for modules) means a lot of repetition, which is error-prone and 'dumb'
- And concerning the long term plans of the nidium team is to be independent of the spidermonkey library.
By carefully planning and designing and abstraction of the interface logic, time can be saved and quality can be increased.
The nidium code base has been structured with c++ namespaces. The classes in the 'Nidium::Binding' namespace will be ref. The base classes in nidium will be split in:
- a 'JSXXX_Base' class which handles other classes (e.g. 'Nidium::Net:HTTP')
- and a corresponding 'sm_JSXXX' class which inherrits of the 'JSXXX_Base' clase
The 'sm_JSXXX' class will be generated based on an 'XXX.idl' file.
NOTE: the 'sm_' is just a prefix indicating that the generated code is meant for the spidermonkey runtime.
Due to the many classes, a step by step approach will be taken:
- Research:
- Improve and review documentation.
- Determine the common situation in the current codebase.
- Determine the edge cases in the current codebase.
- Design a rough template to generate the 'sm_JSXXX' classes from WebIDL files.
-
Preparations:
- Serveral IDL files will be generated based on the documentation.
- The build process will be adapted for convienient handling.
- The buildprocess, the templates that genererate the code and the IDL files will be in the version contol. The generated code will not be part of the source-code version.
- Some IDL will be changed manuallly acourding to the notes from step 1.
- Several classes in the 'Nidium::Binding' namespace will need refractoring.
- Syncrounously enhance, the buildprocess, the WebIDL files and the templates until the generated code behaves as it did before. This will be done Class for Class. This could also lead to further corrections in the documentation.
- Unit testing
Status: Draft Link: Nidium WebIDL spec