Skip to content

[RFC] Resolve Circular Dependency Problem on Wren CLI building #101

@clsource

Description

@clsource

In the #80 conversation, it was noted that if in the future we would want to replace python with wren files for building wren_cli, it would be needed to compile a wren_cli before compiling the final version. Hence creating a need for having a wren_cli before having a wren_cli.

One possibility for solving this is using a cached versions of the wren_cli modules. That way a transitional wren_cli can be built only for executing the future wren scripts needed for compilation:

util
├── generate_projects.wren
├── metrics.wren
├── test.wren
└── wren_to_c_string.wren

cached modules can be called inside modules.c with a compiler flag.

// modules.c
#ifdef USE_MODULES_CACHE
  #include "modules_cache.h"
#else
  #include "io.wren.inc"
  #include "os.wren.inc"
  #include "repl.wren.inc"
  #include "scheduler.wren.inc"
  #include "timer.wren.inc"
#endif

A possible value for modules_cache.h

modules_cache.h

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions