MrcSnm / redub

Alternative implementation of dub, speed and consistency oriented
https://code.dlang.org/packages/redub
MIT License
37 stars 8 forks source link

Any plans for SDL support, or some kind of build script? #11

Closed ZILtoid1991 closed 2 weeks ago

ZILtoid1991 commented 6 months ago

I did think about writing my own SDL parser, as I use that a lot in my projects, and I also have appropriated the components of the old std.experimental.xml (now newxml) project, so I can use its lexer and take influences from the design of the XML DOM (current SDL DOM is primitive).

ichordev commented 6 months ago

As in dub.sdl? It’s already supported by internally using dub to convert to .json. Although removing the dependency on dub would be nice.

MrcSnm commented 6 months ago

If it is simple to do it, I may do it.

There are 2 ways to do it:

  1. SDL -> JSON parser
  2. Transform the JSON parser into an intermediate representation so anything can adhere to the principle.

IMHO, there is no reason for dub to have more than 1 format. This only makes its codebase more extensive and diverges community from following a standard. What I indeed think it would be better was using json with comments, but I don't want to diverge that much from what dub project done.

By the way, wha tdo you mean with "some kind of build script"?

ZILtoid1991 commented 6 months ago

Adding an option for some kind of build script. Most other build system have a pretty complex script system, that can do things. It would be nice for things like either getting it to download a binary for a C library, checking other dependencies, etc.

MrcSnm commented 6 months ago

Since I do that more or less of that in my build selector tool for Hipreme Engine, I really doubt that I would do that here. Also, doing languages is far harder than using APIs. I thought about making redub use plugin scripts, but since I don't have too many uses for it since I already use it as a library, I didn't do it.

MrcSnm commented 5 months ago

SDL support improved through dub's SDL -> JSON conversion caching. It will only ever do the conversion if SDL is newer than json or if JSON wasn't created

MrcSnm commented 1 month ago

Have got some ideas on how to integrate at least build plugins.

"plugins": {
  "genmodules": "some/path/genmodules.d"
}
"preBuildPlugins": {
  "genmodules": ["inputFile", "outputFile"]
}

Then it would work like this: import redub.api;

mixin entrypoint(!((ref ProjectDetails d)
{
    //modify project details here
    return true;
)};
MrcSnm commented 2 weeks ago

This issue was closed since v1.14.0 with the addition of redub plugins: https://github.com/MrcSnm/redub?tab=readme-ov-file#redub-plugins

With that , you got your custom build scripts (I've done that for removing rdmd from my engine also)