Feature: Multi-module support #157

Closed
opened 2023-08-27 12:16:58 +01:00 by deavmi · 211 comments
Owner

What is this?

We want to add multi-module support which means that we should be able to:

  1. Import other modules
  2. Have the resolver scan other modules for references
  3. Do dependency generation across multiple modules
  4. The Parser should be able to cache the information on which modules have been parsed already as to not parse them again and cycle forever

For points 2 and 3 we should make use of the Program type which should contain the Module[] array.

Todo

Fixes

  • Fix all unit tests which spawn a parser and provide them with a valid instance of the Compiler object
    • This can be done probably by using the Compiler as it is used on the command line, therefore we won't have to do a lot of the manual work

Parser

  • Require (not just optional args) that a module file path is provided in Parser's parse(string path = "") call
  • Add support for multi-imports on one line (i.e. import <module1>, <module2>;)
  • Takes in a Compiler instance so we can access its utilities and most importantly its Program instance (need this for managing modules)
  • Require that the module's file name and name (declared in header as module <name>;) match
  • Add proper visitation and Module object tracking
    • Implemented
    • Mark the entry point Module as already-visited
  • We need to be able to add the module itself without any weird duplication.
    • We have a problem that if we don't have any cycles then the current mechanism does not work all too well as it never adds the entry point module itself.

ModuleManager

  • Implement all routines in a ModuleManager
  • Document
    • How it works (resolution)
    • The build aspect of -DDBG_MODMAN
  • Resolution
    • Resolve all local modules (with optional downwards descent)
    • Search path integration via search(...)
    • Absolute-based path resolution ("many names for same module")

Configuration

  • Decide on the default paths to search in, and ensure a ConfigEntry() is added for these when defaultConfig() is called
    • Entry point's working directory
    • Standard system path
  • Document

Command-line

  • Add --paths which you can repeat and it tacks on to the search paths array
  • Allow specifying multiple modules on the command line
  • Document

Changesets

Below I show the tags one must look out for pertaining to big changes made within this branch (Note: These are in chronological order):

  1. multimodule/changeset1
    • Last fixes to get multi-modular at least compiling for debug mode
  2. multimodule/changeset2
    • Last fixes to get unittests to compile
## What is this? We want to add multi-module support which means that we should be able to: 1. Import other modules 2. Have the resolver scan other modules for references 3. Do dependency generation across multiple modules 4. The `Parser` should be able to cache the information on which modules have been parsed already as to not parse them again and cycle forever For points **2** and **3** we should make use of the `Program` type which should contain the `Module[]` array. ## Todo ### Fixes - [x] Fix all unit tests which spawn a parser and provide them with a valid instance of the `Compiler` object * This can be done probably by using the `Compiler` as it is used on the command line, therefore we won't have to do a lot of the manual work ### Parser - [x] **Require** (not just optional args) that a module file path is provided in `Parser`'s `parse(string path = "")` call - [x] Add support for multi-imports on one line (i.e. `import <module1>, <module2>;`) - [x] Takes in a `Compiler` instance so we can access its utilities and **most importantly** its `Program` instance (need this for managing modules) - [x] **Require** that the module's file name and name (declared in header as `module <name>;`) match - [x] Add proper visitation and `Module` object tracking - [x] Implemented - [x] Mark the entry point `Module` as already-visited - [x] ❗ We need to be able to add the module itself without any weird duplication. * We have a problem that if we don't have any cycles then the current mechanism does not work all too well as it never adds the entry point module itself. ### ModuleManager - [x] Implement all routines in a `ModuleManager` - [x] Document - [x] How it works (resolution) - [x] The build aspect of `-DDBG_MODMAN` - [x] Resolution - [x] Resolve all local modules (with optional downwards descent) - [x] Search path integration via `search(...)` - [ ] ~~Absolute-based path resolution (_"many names for same module"_)~~ ### Configuration - [x] Decide on the default paths to search in, and ensure a `ConfigEntry()` is added for these when `defaultConfig()` is called - [x] Entry point's working directory - [x] Standard system path - [x] Document ### Command-line - [x] Add `--paths` which you can repeat and it tacks on to the search paths array - [ ] ~~Allow specifying multiple modules on the command line~~ - [x] Document --- # Changesets Below I show the tags one must look out for pertaining to big changes made within this branch (**Note**: These are in chronological order): 1. `multimodule/changeset1` * Last fixes to get multi-modular at least compiling for `debug` mode 2. `multimodule/changeset2` * Last fixes to get `unittests` to compile
deavmi added the
dependency
resolution
parser
emit
labels 2023-08-27 12:17:27 +01:00
deavmi added this to the Basics milestone 2023-08-27 12:17:30 +01:00
deavmi added this to the Dependency tree, type-checking and codegen project 2023-08-27 12:17:33 +01:00
deavmi self-assigned this 2023-08-27 12:17:36 +01:00
deavmi added reference feature/multi_module 2023-08-27 12:30:22 +01:00
deavmi added the due date 2023-09-30 2023-08-27 12:31:22 +01:00
deavmi added spent time 2023-08-27 12:31:29 +01:00
1 hour
deavmi started working 2023-08-27 12:58:56 +01:00
deavmi modified the due date from 2023-09-30 to 2023-09-01 2023-08-27 13:06:25 +01:00
deavmi stopped working 2023-08-27 14:21:00 +01:00
1 hour 22 minutes
deavmi started working 2023-08-27 14:21:25 +01:00
Author
Owner

Okay, did some good stuff today. I know where I will need to continue during my free time this coming week.

The main stuff right now is coming up with smart ways to serach for available modules, then match those up to the modules wanting to be imported. Only then can we move onto the whole parsing, anti-cycle detection and so forth.

Okay, did some good stuff today. I know where I will need to continue during my free time this coming week. The main stuff right now is coming up with smart ways to serach for available modules, then match those up to the modules wanting to be imported. Only then can we move onto the whole parsing, anti-cycle detection and so forth.
deavmi stopped working 2023-08-27 16:38:35 +01:00
2 hours 17 minutes
deavmi modified the due date from 2023-09-01 to 2023-10-08 2023-10-26 18:34:17 +01:00
deavmi modified the due date from 2023-10-08 to 2023-10-26 2023-10-26 18:34:23 +01:00
deavmi modified the due date from 2023-10-26 to 2023-11-16 2023-10-26 18:34:33 +01:00
deavmi started working 2023-10-27 11:06:04 +01:00
Author
Owner

I should maybe start by first defining the search structure for a module.

I should maybe start by first defining the search structure for a module.
Author
Owner

Added a ModuleManager which is to aid in searching for modules and so forth.

This is still being worked on.

Added a `ModuleManager` which is to aid in searching for modules and so forth. This is still being worked on.
Author
Owner

Discussion 1 🚧

So I have a module a.t and it has:

module a;

import b;

Currently I think I am going to search the directory of the module where the current module (a.t) resides, then after that it should be based on the path or something of the name, I am not sure relative to what though. It's as if must find the most common directory and I have some ideas for that but want some input @gusmeyer

### Discussion 1 🚧 So I have a module `a.t` and it has: ```t module a; import b; ``` Currently I think I am going to search the directory of the module where the current module (a.t) resides, then after that it should be based on the path or something of the name, I am not sure relative to what though. It's as if must find the most common directory and I have some ideas for that but want some input @gusmeyer
Author
Owner

Discussion 2 🚧

Also thinking I will have to return a composite data type of file name (where it was found), probably should make that absolute when it is saved. And then the module name, that would be relative to the directory it was imported from.

image


Paging @gusmeyer for input. I am going ahead with this idea now as I think it may work, but it is still to be discussed as I may be missing things and your input is required.


Update 1

I have now ported over the searching code (has optional recursion):

[INFO] Program currently: 'Program [name: TODO, modules: []]'
[INFO] Current working directory is: '/home/deavmi/Documents/Projects/t/code/.'
[INFO] Current module's path: 'source/tlang/testing/modules/a.t'
[INFO] Working directory based on current module's path: 'source/tlang/testing/modules'
[INFO] Current module name: 'a'
[INFO] getModulesInDirectory(source/tlang/testing/modules): [ModuleEntry("/home/deavmi/Documents/Projects/t/code/source/tlang/testing/modules/b.t", "source.tlang.testing.modules.b"), ModuleEntry("/home/deavmi/Documents/Projects/t/code/source/tlang/testing/modules/z.t", "source.tlang.testing.modules.z"), ModuleEntry("/home/deavmi/Documents/Projects/t/code/source/tlang/testing/modules/a.t", "source.tlang.testing.modules.a")]
[WARNING] Modules found:
[INFO] ModuleEntry("/home/deavmi/Documents/Projects/t/code/source/tlang/testing/modules/b.t", "source.tlang.testing.modules.b")
[INFO] ModuleEntry("/home/deavmi/Documents/Projects/t/code/source/tlang/testing/modules/z.t", "source.tlang.testing.modules.z")
[INFO] ModuleEntry("/home/deavmi/Documents/Projects/t/code/source/tlang/testing/modules/a.t", "source.tlang.testing.modules.a")
[INFO] Module to import: 'b'

Unit tests to follow but this looks good.


Update 2

I have it generating the names of the ModuleEntry's correctly now it seems:

[INFO] Current module's path: 'source/tlang/testing/modules/a.t'
[INFO] Working directory based on current module's path: 'source/tlang/testing/modules'
[INFO] Current module name: 'a'
[INFO] getModulesInDirectory(source/tlang/testing/modules): [ModuleEntry("/home/deavmi/Documents/Projects/t/code/source/tlang/testing/modules/b.t", "b"), ModuleEntry("/home/deavmi/Documents/Projects/t/code/source/tlang/testing/modules/z.t", "z"), ModuleEntry("/home/deavmi/Documents/Projects/t/code/source/tlang/testing/modules/a.t", "a")]
[WARNING] Modules found:
[INFO] ModuleEntry("/home/deavmi/Documents/Projects/t/code/source/tlang/testing/modules/b.t", "b")
[INFO] ModuleEntry("/home/deavmi/Documents/Projects/t/code/source/tlang/testing/modules/z.t", "z")
[INFO] ModuleEntry("/home/deavmi/Documents/Projects/t/code/source/tlang/testing/modules/a.t", "a")
[INFO] Module to import: 'b'
[INFO] Recursing on source/tlang/testing/modules/niks...
[INFO] getModulesInDirectory(source/tlang/testing/modules/niks): [ModuleEntry("/home/deavmi/Documents/Projects/t/code/source/tlang/testing/modules/niks/c.t", "c")]
[INFO] Recursing on source/tlang/testing/modules/niks... [done]
[INFO] getModulesInDirectory(source/tlang/testing/modules): [ModuleEntry("/home/deavmi/Documents/Projects/t/code/source/tlang/testing/modules/b.t", "b"), ModuleEntry("/home/deavmi/Documents/Projects/t/code/source/tlang/testing/modules/z.t", "z"), ModuleEntry("/home/deavmi/Documents/Projects/t/code/source/tlang/testing/modules/a.t", "a"), ModuleEntry("/home/deavmi/Documents/Projects/t/code/source/tlang/testing/modules/niks/c.t", "c")]
[INFO] We found 'b' as 'ModuleEntry("/home/deavmi/Documents/Projects/t/code/source/tlang/testing/modules/b.t", "b")'
[INFO] findModulesInDirectory(source/tlang/testing/modules): ["source.tlang.testing.modules.b", "source.tlang.testing.modules.z", "source.tlang.testing.modules.a"]
### Discussion 2 🚧 Also thinking I will have to return a composite data type of file name (where it was found), probably should make that absolute when it is saved. And then the module name, that would be relative to the directory it was imported from. ![image](/attachments/c590a2b2-198f-473e-ba95-66e4caa9a0cd) --- Paging @gusmeyer for input. I am going ahead with this idea now as I think it may work, but it is **still to be discussed** as I may be missing things and your input is required. --- #### Update 1 I have now ported over the searching code (has optional recursion): ``` [INFO] Program currently: 'Program [name: TODO, modules: []]' [INFO] Current working directory is: '/home/deavmi/Documents/Projects/t/code/.' [INFO] Current module's path: 'source/tlang/testing/modules/a.t' [INFO] Working directory based on current module's path: 'source/tlang/testing/modules' [INFO] Current module name: 'a' [INFO] getModulesInDirectory(source/tlang/testing/modules): [ModuleEntry("/home/deavmi/Documents/Projects/t/code/source/tlang/testing/modules/b.t", "source.tlang.testing.modules.b"), ModuleEntry("/home/deavmi/Documents/Projects/t/code/source/tlang/testing/modules/z.t", "source.tlang.testing.modules.z"), ModuleEntry("/home/deavmi/Documents/Projects/t/code/source/tlang/testing/modules/a.t", "source.tlang.testing.modules.a")] [WARNING] Modules found: [INFO] ModuleEntry("/home/deavmi/Documents/Projects/t/code/source/tlang/testing/modules/b.t", "source.tlang.testing.modules.b") [INFO] ModuleEntry("/home/deavmi/Documents/Projects/t/code/source/tlang/testing/modules/z.t", "source.tlang.testing.modules.z") [INFO] ModuleEntry("/home/deavmi/Documents/Projects/t/code/source/tlang/testing/modules/a.t", "source.tlang.testing.modules.a") [INFO] Module to import: 'b' ``` Unit tests to follow but this looks good. --- #### Update 2 I have it generating the names of the `ModuleEntry`'s correctly now it seems: ``` [INFO] Current module's path: 'source/tlang/testing/modules/a.t' [INFO] Working directory based on current module's path: 'source/tlang/testing/modules' [INFO] Current module name: 'a' [INFO] getModulesInDirectory(source/tlang/testing/modules): [ModuleEntry("/home/deavmi/Documents/Projects/t/code/source/tlang/testing/modules/b.t", "b"), ModuleEntry("/home/deavmi/Documents/Projects/t/code/source/tlang/testing/modules/z.t", "z"), ModuleEntry("/home/deavmi/Documents/Projects/t/code/source/tlang/testing/modules/a.t", "a")] [WARNING] Modules found: [INFO] ModuleEntry("/home/deavmi/Documents/Projects/t/code/source/tlang/testing/modules/b.t", "b") [INFO] ModuleEntry("/home/deavmi/Documents/Projects/t/code/source/tlang/testing/modules/z.t", "z") [INFO] ModuleEntry("/home/deavmi/Documents/Projects/t/code/source/tlang/testing/modules/a.t", "a") [INFO] Module to import: 'b' [INFO] Recursing on source/tlang/testing/modules/niks... [INFO] getModulesInDirectory(source/tlang/testing/modules/niks): [ModuleEntry("/home/deavmi/Documents/Projects/t/code/source/tlang/testing/modules/niks/c.t", "c")] [INFO] Recursing on source/tlang/testing/modules/niks... [done] [INFO] getModulesInDirectory(source/tlang/testing/modules): [ModuleEntry("/home/deavmi/Documents/Projects/t/code/source/tlang/testing/modules/b.t", "b"), ModuleEntry("/home/deavmi/Documents/Projects/t/code/source/tlang/testing/modules/z.t", "z"), ModuleEntry("/home/deavmi/Documents/Projects/t/code/source/tlang/testing/modules/a.t", "a"), ModuleEntry("/home/deavmi/Documents/Projects/t/code/source/tlang/testing/modules/niks/c.t", "c")] [INFO] We found 'b' as 'ModuleEntry("/home/deavmi/Documents/Projects/t/code/source/tlang/testing/modules/b.t", "b")' [INFO] findModulesInDirectory(source/tlang/testing/modules): ["source.tlang.testing.modules.b", "source.tlang.testing.modules.z", "source.tlang.testing.modules.a"] ```
614 KiB
deavmi stopped working 2023-10-27 13:59:38 +01:00
2 hours 53 minutes
deavmi added spent time 2023-10-27 15:25:09 +01:00
3 minutes
deavmi started working 2023-10-27 15:25:11 +01:00
Author
Owner

I have made some good progress on module name resolution now. More is still to come...

I have made some good progress on module name resolution now. More is still to come...
deavmi stopped working 2023-10-27 15:29:25 +01:00
4 minutes 14 seconds
deavmi started working 2023-10-27 16:15:11 +01:00
deavmi stopped working 2023-10-27 22:17:33 +01:00
6 hours 2 minutes
Author
Owner

I have added a lot now, reworking the system actually.

I must now, however, sleep 💤 .

I have added a lot now, reworking the system actually. I must now, however, sleep 💤 .
deavmi added spent time 2023-10-29 12:40:27 +00:00
10 minutes
deavmi started working 2023-10-29 12:48:23 +00:00
deavmi stopped working 2023-10-29 12:55:24 +00:00
7 minutes 1 second
deavmi added spent time 2023-10-29 14:10:34 +00:00
2 minutes
deavmi started working 2023-10-29 14:10:37 +00:00
deavmi stopped working 2023-10-29 14:24:10 +00:00
13 minutes 33 seconds
deavmi added spent time 2023-10-29 14:30:38 +00:00
6 minutes
deavmi started working 2023-10-29 14:30:41 +00:00
deavmi stopped working 2023-10-29 14:32:10 +00:00
1 minute 28 seconds
deavmi started working 2023-10-29 14:32:53 +00:00
deavmi stopped working 2023-10-29 14:59:42 +00:00
26 minutes 48 seconds
deavmi removed the due date 2023-11-16 2023-10-29 15:00:50 +00:00
deavmi added the due date 2023-11-05 2023-10-29 15:00:57 +00:00
deavmi started working 2023-10-29 15:52:50 +00:00
deavmi stopped working 2023-10-29 16:43:10 +00:00
50 minutes 20 seconds
deavmi started working 2023-10-29 16:44:34 +00:00
Author
Owner

Somethings have not yet been committed, but I have the module's now being parsed with a adhoc LexerInterface and then Parser which are created in parseImport(string) for the sole purpose of parsing the module just read in.

There is some rudimentary visitation marking but it needs to be cleaned up and made nicer and also I need to do an early call to it for the entry point module.

image

Somethings have not yet been committed, but I have the module's now being parsed with a adhoc `LexerInterface` and then `Parser` which are created in `parseImport(string)` for the sole purpose of parsing the module just read in. There is some rudimentary visitation marking but it needs to be cleaned up and made nicer and also I need to do an early call to it for the entry point module. ![image](/attachments/f0d825f3-35d4-4462-a6bb-c229ae68c864)
200 KiB
Author
Owner

Done for today

Done for today
deavmi stopped working 2023-10-29 16:48:33 +00:00
3 minutes 59 seconds
deavmi started working 2023-10-29 16:54:17 +00:00
deavmi stopped working 2023-10-29 16:54:31 +00:00
15 seconds
deavmi started working 2023-10-29 18:46:45 +00:00
deavmi stopped working 2023-10-29 20:14:59 +00:00
1 hour 28 minutes
deavmi added spent time 2023-11-01 13:32:21 +00:00
1 hour 30 minutes
deavmi started working 2023-11-01 13:32:24 +00:00
deavmi stopped working 2023-11-01 13:50:50 +00:00
18 minutes 26 seconds
deavmi added spent time 2023-11-02 12:52:08 +00:00
10 minutes
deavmi started working 2023-11-02 12:52:10 +00:00
deavmi stopped working 2023-11-02 13:46:27 +00:00
54 minutes 16 seconds
deavmi added spent time 2023-11-02 14:01:28 +00:00
10 minutes
deavmi started working 2023-11-02 14:01:29 +00:00
Author
Owner

Updates

image

DMD, the only search path added is the containing directory of the module requesting to be compiled on the command line


image

And here similar, I am compiling it from outside and the only directory considered on search path is the containing directory of c.t, a.k.a. niks/

### Updates ![image](/attachments/a95aeb11-08d0-4ce6-8e09-45544895f022) DMD, the only search path added is the containing directory of the module requesting to be compiled on the command line --- ![image](/attachments/7d5afd79-2ea3-49f7-a8c6-6a709f9998b8) And here similar, I am compiling it from outside and the only directory considered on search path is the containing directory of c.t, a.k.a. niks/
269 KiB
180 KiB
Author
Owner

Automagic 🪄 path consideration

I am now doing the following, if direct lookup within the search paths fail, then what we do is we take any module who is requesting to be imported and contains .'s in its name and then we construct relative tacking-ons to each search path to try find it:

image

### Automagic 🪄 path consideration I am now doing the following, if direct lookup within the search paths fail, then what we do is we take any module who is requesting to be imported **and** contains `.`'s in its name and then we construct relative tacking-ons to each search path to try find it: ![image](/attachments/4f3290d4-dd3a-4992-8bb7-2ae2e24d33ff)
218 KiB
Author
Owner

Automagic 🪄 path consideration

I am now doing the following, if direct lookup within the search paths fail, then what we do is we take any module who is requesting to be imported and contains .'s in its name and then we construct relative tacking-ons to each search path to try find it:

image

I think it bloody works!!!!! :celebrate:

> ### Automagic 🪄 path consideration > > I am now doing the following, if direct lookup within the search paths fail, then what we do is we take any module who is requesting to be imported **and** contains `.`'s in its name and then we construct relative tacking-ons to each search path to try find it: > > ![image](/attachments/4f3290d4-dd3a-4992-8bb7-2ae2e24d33ff) I think it bloody works!!!!! :celebrate:
deavmi stopped working 2023-11-02 15:22:13 +00:00
1 hour 20 minutes
deavmi started working 2023-11-02 15:25:25 +00:00
deavmi stopped working 2023-11-02 15:30:24 +00:00
4 minutes 59 seconds
Author
Owner

I think it is working.

I think it is working.
deavmi started working 2023-11-02 15:31:17 +00:00
Author
Owner

Yes, looks good to me! Working on commit 41157158f241ca1cb6bde3d5305adeb610104d4a (forgot to switch over in the previous commit)

Yes, looks good to me! Working on commit `41157158f241ca1cb6bde3d5305adeb610104d4a` (forgot to switch over in the previous commit)
deavmi stopped working 2023-11-02 15:35:28 +00:00
4 minutes 11 seconds
deavmi added spent time 2023-11-02 20:11:09 +00:00
10 minutes
deavmi added spent time 2023-11-03 12:16:30 +00:00
10 minutes
deavmi started working 2023-11-03 12:16:32 +00:00
deavmi stopped working 2023-11-03 12:17:02 +00:00
30 seconds
deavmi started working 2023-11-05 19:14:04 +00:00
deavmi stopped working 2023-11-05 19:25:04 +00:00
11 minutes
deavmi started working 2023-11-05 19:40:01 +00:00
deavmi stopped working 2023-11-05 20:10:55 +00:00
30 minutes 53 seconds
deavmi started working 2023-11-06 08:33:11 +00:00
deavmi stopped working 2023-11-06 08:33:14 +00:00
3 seconds
deavmi added spent time 2023-11-06 08:33:20 +00:00
10 minutes
deavmi started working 2023-11-06 08:33:22 +00:00
Author
Owner

I would like to merge other changes first before I move onto changing other things, especially in DGen as that is where a lot of little things will need to be updated.

I would like to merge other changes first before I move onto changing other things, especially in `DGen` as that is where a lot of little things will need to be updated.
deavmi modified the due date from 2023-11-05 to 2023-12-04 2023-11-06 09:38:18 +00:00
deavmi added a new dependency 2023-11-06 09:38:26 +00:00
deavmi added a new dependency 2023-11-06 09:38:31 +00:00
deavmi added a new dependency 2023-11-06 09:38:39 +00:00
deavmi added a new dependency 2023-11-06 09:38:46 +00:00
deavmi added a new dependency 2023-11-06 09:38:59 +00:00
deavmi stopped working 2023-11-06 09:39:32 +00:00
1 hour 6 minutes
deavmi added spent time 2023-11-06 14:54:38 +00:00
10 minutes
deavmi started working 2023-11-06 14:54:41 +00:00
Author
Owner

I have added an addition after the entry point is parsed to add the entry. Still a work-in-progress.

I have added an addition after the entry point is parsed to add the entry. Still a work-in-progress.
deavmi stopped working 2023-11-06 14:55:15 +00:00
34 seconds
deavmi started working 2023-11-22 14:06:10 +00:00
deavmi stopped working 2023-11-22 14:06:13 +00:00
3 seconds
deavmi added spent time 2023-12-04 10:16:05 +00:00
1 hour 30 minutes
deavmi started working 2023-12-04 10:16:08 +00:00
Author
Owner

Lots of things I have not yet pushed but I am working on.

Lots of things I have not yet pushed but I am working on.
Author
Owner

Lots of things I have not yet pushed but I am working on.

Not yet pushed 🌬️

  • Updated checkContainerCollision(Container c) which now can check the entities of any container and ensure they do not match the names of any Module(s) defined within the current Program
> Lots of things I have not yet pushed but I am working on. ## Not yet pushed 🌬️ * Updated `checkContainerCollision(Container c)` which now can check the entities of any container and ensure they do not match the names of any `Module`(s) defined within the current `Program`
Author
Owner

We need to update the Resolver to support a Program and basically root itself to one of the Module, this does need some thought though in how we go about it.

We need to update the `Resolver` to support a `Program` and basically root itself to one of the `Module`, this does need some thought though in how we go about it.
Author
Owner

I need to actually do something that requires breaking in some new changes. Specifically this revolves around how we call the resolbeBest(Container, string) function. The reason for this is that we need to be able to look at, for example, the two modules below s1 and s2which make up a singularProgram`:

module s1;

int x;

and...

module s2;

int x;

And actually have a "current module" context we call it with such that we can easily resolve things like x relative to the current context Module, else the lookup would just scan till we get first match which is wrong as these are distinct.

We need a new dimension in the call

I need to actually do something that requires breaking in some new changes. Specifically this revolves around how we call the `resolbeBest(Container, string)` function. The reason for this is that we need to be able to look at, for example, the two modules below `s1 and `s2` which make up a singular `Program`: ```d module s1; int x; ``` and... ```d module s2; int x; ``` And actually have a _"current module"_ context we call it with such that we can easily resolve things like `x` **relative to** the current context `Module`, else the lookup would just scan till we get first match which is wrong as these are distinct. ❕We need a new dimension in the call
Author
Owner

I need to actually do something that requires breaking in some new changes. Specifically this revolves around how we call the resolbeBest(Container, string) function. The reason for this is that we need to be able to look at, for example, the two modules below s1 and s2which make up a singularProgram`:

module s1;

int x;

and...

module s2;

int x;

And actually have a "current module" context we call it with such that we can easily resolve things like x relative to the current context Module, else the lookup would just scan till we get first match which is wrong as these are distinct.

We need a new dimension in the call

So I think I have a fix for this, that would look something like:
image

> I need to actually do something that requires breaking in some new changes. Specifically this revolves around how we call the `resolbeBest(Container, string)` function. The reason for this is that we need to be able to look at, for example, the two modules below `s1 and `s2` which make up a singular `Program`: > > ```d > module s1; > > int x; > ``` > > and... > > ```d > module s2; > > int x; > ``` > > And actually have a _"current module"_ context we call it with such that we can easily resolve things like `x` **relative to** the current context `Module`, else the lookup would just scan till we get first match which is wrong as these are distinct. > > ❕We need a new dimension in the call So I think I have a fix for this, that would look something like: ![image](/attachments/8c569bda-12bb-4b30-bba7-32b33635856b)
Author
Owner

I need to actually do something that requires breaking in some new changes. Specifically this revolves around how we call the resolbeBest(Container, string) function. The reason for this is that we need to be able to look at, for example, the two modules below s1 and s2which make up a singularProgram`:

module s1;

int x;

and...

module s2;

int x;

And actually have a "current module" context we call it with such that we can easily resolve things like x relative to the current context Module, else the lookup would just scan till we get first match which is wrong as these are distinct.

We need a new dimension in the call

So I think I have a fix for this, that would look something like:
image

We just need to, however, fix the parenthood of expressions as that is what is causing problems with a particular test case of cat source/tlang/testing/typecheck/simple_function_call.t (with the nested test() call for processing FuncCall):

module simple;

int j = 1+func(3,test()+t2()+t2());
> > I need to actually do something that requires breaking in some new changes. Specifically this revolves around how we call the `resolbeBest(Container, string)` function. The reason for this is that we need to be able to look at, for example, the two modules below `s1 and `s2` which make up a singular `Program`: > > > > ```d > > module s1; > > > > int x; > > ``` > > > > and... > > > > ```d > > module s2; > > > > int x; > > ``` > > > > And actually have a _"current module"_ context we call it with such that we can easily resolve things like `x` **relative to** the current context `Module`, else the lookup would just scan till we get first match which is wrong as these are distinct. > > > > ❕We need a new dimension in the call > > So I think I have a fix for this, that would look something like: > ![image](/attachments/8c569bda-12bb-4b30-bba7-32b33635856b) We just need to, however, fix the parenthood of expressions as that is what is causing problems with a particular test case of `cat source/tlang/testing/typecheck/simple_function_call.t` (with the nested `test()` call for processing `FuncCall`): ```d module simple; int j = 1+func(3,test()+t2()+t2()); ```
Author
Owner

I need to actually do something that requires breaking in some new changes. Specifically this revolves around how we call the resolbeBest(Container, string) function. The reason for this is that we need to be able to look at, for example, the two modules below s1 and s2which make up a singularProgram`:

module s1;

int x;

and...

module s2;

int x;

And actually have a "current module" context we call it with such that we can easily resolve things like x relative to the current context Module, else the lookup would just scan till we get first match which is wrong as these are distinct.

We need a new dimension in the call

So I think I have a fix for this, that would look something like:
image

We just need to, however, fix the parenthood of expressions as that is what is causing problems with a particular test case of cat source/tlang/testing/typecheck/simple_function_call.t (with the nested test() call for processing FuncCall):

module simple;

int j = 1+func(3,test()+t2()+t2());

I need to do:

// TODO: Revursive parenthood apply

Whenever I call:

parentToContainer(Container, Statement)

And I must modify the parentToContainer function to do this for us on a per-Statement type basis.

> > > I need to actually do something that requires breaking in some new changes. Specifically this revolves around how we call the `resolbeBest(Container, string)` function. The reason for this is that we need to be able to look at, for example, the two modules below `s1 and `s2` which make up a singular `Program`: > > > > > > ```d > > > module s1; > > > > > > int x; > > > ``` > > > > > > and... > > > > > > ```d > > > module s2; > > > > > > int x; > > > ``` > > > > > > And actually have a _"current module"_ context we call it with such that we can easily resolve things like `x` **relative to** the current context `Module`, else the lookup would just scan till we get first match which is wrong as these are distinct. > > > > > > ❕We need a new dimension in the call > > > > So I think I have a fix for this, that would look something like: > > ![image](/attachments/8c569bda-12bb-4b30-bba7-32b33635856b) > > We just need to, however, fix the parenthood of expressions as that is what is causing problems with a particular test case of `cat source/tlang/testing/typecheck/simple_function_call.t` (with the nested `test()` call for processing `FuncCall`): > > ```d > module simple; > > int j = 1+func(3,test()+t2()+t2()); > ``` I need to do: ```d // TODO: Revursive parenthood apply ``` Whenever I call: ```d parentToContainer(Container, Statement) ``` And I must **modify** the `parentToContainer` function to do this for us on a per-`Statement` type basis.
deavmi stopped working 2023-12-05 08:29:56 +00:00
22 hours 13 minutes
deavmi started working 2023-12-05 08:30:00 +00:00
deavmi modified the due date from 2023-12-04 to 2023-12-10 2023-12-05 08:30:12 +00:00
Author
Owner

Continueing work now...

Continueing work now...
Author
Owner

Just got all unittests to pass 🤯

Just got all unittests to pass 🤯
deavmi stopped working 2023-12-05 09:47:21 +00:00
1 hour 17 minutes
deavmi started working 2023-12-05 11:01:12 +00:00
Author
Owner
  • extern_test.sh had #1/bin/bash instead of #! but fixed now.
* `extern_test.sh` had `#1/bin/bash` instead of `#!` but fixed now.
deavmi stopped working 2023-12-05 12:05:54 +00:00
1 hour 4 minutes
deavmi started working 2023-12-05 12:08:24 +00:00
Author
Owner

Going to continue working on the updated parentToContainer(Container, Statement, boolean allowRecursivePainting = true) method now

Going to continue working on the updated `parentToContainer(Container, Statement, boolean allowRecursivePainting = true)` method now
Author
Owner

Going to continue working on the updated parentToContainer(Container, Statement, boolean allowRecursivePainting = true) method now

Added code which, if the Statement incoming is a Branch, then when we extract the Expression-based condition and the body statements (Statement[]) then we must parent them But not to the incoming Container (container) but rather to the Branch itself (to maintain its ancestry tree).

> Going to continue working on the updated `parentToContainer(Container, Statement, boolean allowRecursivePainting = true)` method now Added code which, if the `Statement` incoming is a `Branch`, then when we extract the `Expression`-based **condition** and the **body statements** (`Statement[]`) then we must parent them **But** not to the incoming `Container` (`container`) but rather to the `Branch` itself (to maintain its ancestry tree).
Author
Owner

Pushed some changes for the Resolver that were needed to make sure name generation via generateName(Container, Entity) worked in the new Program-based paradigm.

Some other work is still being considered for some other methods such as resolveBest(Container, string)

Pushed some changes for the `Resolver` that were needed to make sure name generation via `generateName(Container, Entity)` worked in the new `Program`-based paradigm. Some other work is still being considered for some other methods such as `resolveBest(Container, string)`
Author
Owner

All resolution code has now been pushed

This includes the other work in resolveBest(Container, string) which has now been enabled (uncommented)

All resolution code has now been pushed ✅ > This **includes** the other work in `resolveBest(Container, string)` which has **now been enabled (uncommented)**
Author
Owner

Updates for Program have been pushed

Updates for `Program` have been pushed ✅
Author
Owner

I need to actually do something that requires breaking in some new changes. Specifically this revolves around how we call the resolbeBest(Container, string) function. The reason for this is that we need to be able to look at, for example, the two modules below s1 and s2which make up a singularProgram`:

module s1;

int x;

and...

module s2;

int x;

And actually have a "current module" context we call it with such that we can easily resolve things like x relative to the current context Module, else the lookup would just scan till we get first match which is wrong as these are distinct.

We need a new dimension in the call

So I think I have a fix for this, that would look something like:
image

Now that the Resolver has support for basically doing this, in the form of the below code in generateName(Container relativeTo, Entity entity):

// For that we must have a `getRoot` (use `findContainerOfType`
        // with the type set to `Module`) which resolves till it stops
        // at the top of the parenthood tree of `entity`, then we should
        // just early return `generateName_Internal(foundMod, entity)`
        //
        // Because as I said, a Program is not an Entity - IT HAS NO NAME!
        if(cast(Program)relativeTo)
        {
            Container potModC = findContainerOfType(Module.classinfo, entity);
            assert(potModC); // Should always be true (unless you butchered the AST)
            Module potMod = cast(Module)potModC;
            assert(potMod); // Should always be true (unless you butchered the AST)

            return generateName(potMod, entity);
        }

We no longer need to do this and can just call it like:
image

> > I need to actually do something that requires breaking in some new changes. Specifically this revolves around how we call the `resolbeBest(Container, string)` function. The reason for this is that we need to be able to look at, for example, the two modules below `s1 and `s2` which make up a singular `Program`: > > > > ```d > > module s1; > > > > int x; > > ``` > > > > and... > > > > ```d > > module s2; > > > > int x; > > ``` > > > > And actually have a _"current module"_ context we call it with such that we can easily resolve things like `x` **relative to** the current context `Module`, else the lookup would just scan till we get first match which is wrong as these are distinct. > > > > ❕We need a new dimension in the call > > So I think I have a fix for this, that would look something like: > ![image](/attachments/8c569bda-12bb-4b30-bba7-32b33635856b) Now that the `Resolver` has support for basically doing this, in the form of the below code in `generateName(Container relativeTo, Entity entity)`: ```d // For that we must have a `getRoot` (use `findContainerOfType` // with the type set to `Module`) which resolves till it stops // at the top of the parenthood tree of `entity`, then we should // just early return `generateName_Internal(foundMod, entity)` // // Because as I said, a Program is not an Entity - IT HAS NO NAME! if(cast(Program)relativeTo) { Container potModC = findContainerOfType(Module.classinfo, entity); assert(potModC); // Should always be true (unless you butchered the AST) Module potMod = cast(Module)potModC; assert(potMod); // Should always be true (unless you butchered the AST) return generateName(potMod, entity); } ``` We no longer need to do this and can just call it like: ![image](/attachments/daf685cc-424d-4158-b92d-544f5955d109)
deavmi stopped working 2023-12-05 13:34:29 +00:00
1 hour 26 minutes
deavmi added spent time 2023-12-05 13:37:37 +00:00
4 minutes
Author
Owner

I need to actually do something that requires breaking in some new changes. Specifically this revolves around how we call the resolbeBest(Container, string) function. The reason for this is that we need to be able to look at, for example, the two modules below s1 and s2which make up a singularProgram`:

module s1;

int x;

and...

module s2;

int x;

And actually have a "current module" context we call it with such that we can easily resolve things like x relative to the current context Module, else the lookup would just scan till we get first match which is wrong as these are distinct.

We need a new dimension in the call

So I think I have a fix for this, that would look something like:
image

Now that the Resolver has support for basically doing this, in the form of the below code in generateName(Container relativeTo, Entity entity):

// For that we must have a `getRoot` (use `findContainerOfType`
        // with the type set to `Module`) which resolves till it stops
        // at the top of the parenthood tree of `entity`, then we should
        // just early return `generateName_Internal(foundMod, entity)`
        //
        // Because as I said, a Program is not an Entity - IT HAS NO NAME!
        if(cast(Program)relativeTo)
        {
            Container potModC = findContainerOfType(Module.classinfo, entity);
            assert(potModC); // Should always be true (unless you butchered the AST)
            Module potMod = cast(Module)potModC;
            assert(potMod); // Should always be true (unless you butchered the AST)

            return generateName(potMod, entity);
        }

We no longer need to do this and can just call it like:
image

I have converted to this in all situations but one, so where it makes sense. FunctionCall obviously needs it as it is resolving the Function itself.

> > > I need to actually do something that requires breaking in some new changes. Specifically this revolves around how we call the `resolbeBest(Container, string)` function. The reason for this is that we need to be able to look at, for example, the two modules below `s1 and `s2` which make up a singular `Program`: > > > > > > ```d > > > module s1; > > > > > > int x; > > > ``` > > > > > > and... > > > > > > ```d > > > module s2; > > > > > > int x; > > > ``` > > > > > > And actually have a _"current module"_ context we call it with such that we can easily resolve things like `x` **relative to** the current context `Module`, else the lookup would just scan till we get first match which is wrong as these are distinct. > > > > > > ❕We need a new dimension in the call > > > > So I think I have a fix for this, that would look something like: > > ![image](/attachments/8c569bda-12bb-4b30-bba7-32b33635856b) > > Now that the `Resolver` has support for basically doing this, in the form of the below code in `generateName(Container relativeTo, Entity entity)`: > > ```d > // For that we must have a `getRoot` (use `findContainerOfType` > // with the type set to `Module`) which resolves till it stops > // at the top of the parenthood tree of `entity`, then we should > // just early return `generateName_Internal(foundMod, entity)` > // > // Because as I said, a Program is not an Entity - IT HAS NO NAME! > if(cast(Program)relativeTo) > { > Container potModC = findContainerOfType(Module.classinfo, entity); > assert(potModC); // Should always be true (unless you butchered the AST) > Module potMod = cast(Module)potModC; > assert(potMod); // Should always be true (unless you butchered the AST) > > return generateName(potMod, entity); > } > ``` > > We no longer need to do this and can just call it like: > ![image](/attachments/daf685cc-424d-4158-b92d-544f5955d109) I have converted to this in all situations but one, so where it makes sense. `FunctionCall` obviously needs it as it is resolving the `Function` itself.
deavmi started working 2023-12-05 13:46:12 +00:00
Author
Owner

Pushed updated Compiler code

Pushed updated `Compiler` code ✅
Author
Owner

All for now, will continue tonight

All for now, will continue tonight
deavmi stopped working 2023-12-05 13:54:41 +00:00
8 minutes 29 seconds
deavmi added spent time 2023-12-05 16:05:40 +00:00
10 minutes
deavmi added spent time 2023-12-05 19:56:43 +00:00
20 minutes
deavmi started working 2023-12-05 19:56:46 +00:00
Author
Owner

Working on this again now...

Working on this again now...
Author
Owner

Pushed updated code for Parser

Pushed updated code for `Parser` ✅
Author
Owner

I think everything is done now in terms of moving that over!

Next up: Deprecate and remove getModule() such that we can start leaning more heavily on this.program!

I think everything is done now in terms of moving that over! ✅ Next up: Deprecate and remove `getModule()` such that we can start leaning more heavily on `this.program`!
Author
Owner

Next few things

DGen

We need to make some changes to the emitter:

  • emitHeaderComment(string headerPhrase = "")
    • Well now we basically need to call this several times and then also emit several files and then link the generated object files all together
    • Solution: We need to pass in a Module to methods such as these
## Next few things ### DGen We need to make some changes to the emitter: - [ ] `emitHeaderComment(string headerPhrase = "")` * Well now we basically need to call this several times **and** then also emit several files **and** then link the generated object files all together * **Solution:** We need to pass in a `Module` to methods such as these
deavmi stopped working 2023-12-05 20:36:13 +00:00
39 minutes 27 seconds
deavmi added spent time 2023-12-06 08:07:30 +00:00
10 minutes
deavmi started working 2023-12-06 08:07:35 +00:00
Author
Owner

Continueing work on this now...

Continueing work on this now...
Author
Owner

Continueing work on this now...

Got some basic fixes in, I think first we focus in the following order:

  1. TypeChecker
  2. Dependency
    • Very important as this affects the steps that come afterwards
  3. CodeEmitter
  4. DGen
> Continueing work on this now... Got some basic fixes in, I think first we focus in the following order: 1. `TypeChecker` 2. `Dependency` * Very important as this affects the steps that come afterwards 3. `CodeEmitter` 4. `DGen`
Author
Owner

Pushed updated code for builtins

Pushed updated code for `builtins` ✅
Author
Owner

Pushed updated code for the TypeChecker

Pushed updated code for the `TypeChecker` ✅
Author
Owner

Lots of work must be done now in the Dependency module as we need to have a proper root set and all, I will probably have to rework or restudy some stuff on it but it shouldn't be too bad, perhaps the ability for a clean up will thus be enforced upon me 🧠

Lots of work must be done now in the `Dependency` module as we need to have a proper `root` set and all, I will probably have to rework or restudy some stuff on it but it shouldn't be too bad, perhaps the ability for a clean up will thus be enforced upon me 🧠
Author
Owner

Lots of work must be done now in the Dependency module as we need to have a proper root set and all, I will probably have to rework or restudy some stuff on it but it shouldn't be too bad, perhaps the ability for a clean up will thus be enforced upon me 🧠

Honestly now is probably a good time to put a pause on this particular PR, and maybe I should/can pivot to a new branch solely focused on cleaning up the dependency generator as I think that would be a good thing to spend time on, looking at #41 (comment)

> Lots of work must be done now in the `Dependency` module as we need to have a proper `root` set and all, I will probably have to rework or restudy some stuff on it but it shouldn't be too bad, perhaps the ability for a clean up will thus be enforced upon me 🧠 Honestly now is probably a good time to put a pause on this particular PR, and maybe I should/can pivot to a new branch solely focused on cleaning up the dependency generator as I think that would be a good thing to spend time on, looking at https://deavmi.assigned.network/git/tlang/tlang/issues/41#issuecomment-2907
deavmi stopped working 2023-12-06 09:12:20 +00:00
1 hour 4 minutes
Author
Owner

Lots of work must be done now in the Dependency module as we need to have a proper root set and all, I will probably have to rework or restudy some stuff on it but it shouldn't be too bad, perhaps the ability for a clean up will thus be enforced upon me 🧠

Honestly now is probably a good time to put a pause on this particular PR, and maybe I should/can pivot to a new branch solely focused on cleaning up the dependency generator as I think that would be a good thing to spend time on, looking at #41 (comment)

Going to work on #161 now then.

> > Lots of work must be done now in the `Dependency` module as we need to have a proper `root` set and all, I will probably have to rework or restudy some stuff on it but it shouldn't be too bad, perhaps the ability for a clean up will thus be enforced upon me 🧠 > > Honestly now is probably a good time to put a pause on this particular PR, and maybe I should/can pivot to a new branch solely focused on cleaning up the dependency generator as I think that would be a good thing to spend time on, looking at https://deavmi.assigned.network/git/tlang/tlang/issues/41#issuecomment-2907 Going to work on #161 now then.
deavmi added a new dependency 2023-12-06 19:08:42 +00:00
deavmi started working 2023-12-10 10:12:21 +00:00
Author
Owner

Fixing CI/CD pipeline...

Fixing CI/CD pipeline...
Author
Owner

Fixing CI/CD pipeline...

Ah probably just build issue, nevermind :)

> Fixing CI/CD pipeline... Ah probably just build issue, nevermind :)
deavmi stopped working 2023-12-10 10:13:42 +00:00
1 minute 21 seconds
Author
Owner

Will continue to work on this throughout these holidays...

Will continue to work on this throughout these holidays...
deavmi modified the due date from 2023-12-10 to 2024-01-31 2023-12-23 17:55:17 +00:00
deavmi added spent time 2023-12-27 06:32:09 +00:00
2 minutes
deavmi added spent time 2024-02-25 17:20:58 +00:00
30 minutes
Author
Owner

Just looked into working with gcc (or any cc for that matter) to be able to generate static ELF libraries and also link that against a object file with a valid (extisting) main symbol.

Just looked into working with `gcc` (or _any_ `cc` for that matter) to be able to generate static ELF libraries and also link that against a object file with a valid (extisting) `main` symbol.
deavmi removed the due date 2024-01-31 2024-02-25 17:21:42 +00:00
deavmi added the due date 2024-05-12 2024-02-25 17:21:50 +00:00
deavmi added spent time 2024-02-25 19:53:07 +00:00
10 minutes
deavmi started working 2024-02-25 19:53:10 +00:00
Author
Owner

Placed some ideas in the new module tlang.compiler.codegen.mapper.api 🧠

Placed some ideas in the new module `tlang.compiler.codegen.mapper.api` 🧠
deavmi stopped working 2024-02-25 19:53:36 +00:00
26 seconds
deavmi added spent time 2024-02-26 08:18:34 +00:00
1 hour
Author
Owner

Been working on sorting out DGen now. What I have started doing is to now make all the emit(...) functions take in both a File modOut (for which the emitting must be written to) and a Module mod of which specifies the current Module being processed.

I have also been working on new SymbolMapperV2 implementations which can be used for properly mapping the symbols.

Been working on sorting out `DGen` now. What I have started doing is to now make all the `emit(...)` functions take in both a `File modOut` (for which the emitting must be written to) and a `Module mod` of which specifies the current `Module` being processed. I have also been working on new `SymbolMapperV2` implementations which can be used for properly mapping the symbols.
deavmi started working 2024-02-26 08:25:07 +00:00
Author
Owner

Most errors in in DGen are now gone, but not yet committed as I will only do that once testing passes.

I have also done the same for CollidingNameException.

Most errors in in `DGen` are now gone, but not yet committed as I will only do that once testing passes. I have also done the same for `CollidingNameException`.
deavmi stopped working 2024-02-26 09:27:06 +00:00
1 hour 1 minute
deavmi started working 2024-02-26 09:37:50 +00:00
Author
Owner

Looks like everything compiles now (not yet unittests) so now I am going to begin to test things.

Looks like everything compiles now (not yet unittests) so now I am going to begin to test things.
Author
Owner

Next thing to work on is the call to the compiler, that needs some work.

Next thing to work on is the call to the compiler, that needs some work.
deavmi stopped working 2024-02-26 09:51:21 +00:00
13 minutes 31 seconds
deavmi added spent time 2024-02-26 11:17:58 +00:00
10 minutes
Author
Owner

More work in DGen done on generating .o object files

More work in `DGen` done on generating `.o` object files
Author
Owner

More work in DGen done on generating .o object files

Looks like it works, for uni-modules (singular modules). Things will definitely be breaking when we move onto multi-module as we are not done yet and things still need to be done for it within the DNodeGenerator.

> More work in `DGen` done on generating `.o` object files Looks like it works, for uni-modules (singular modules). Things will *definitely* be breaking when we move onto multi-module as we are not done yet and things still need to be done for it within the `DNodeGenerator`.
deavmi added spent time 2024-02-26 11:32:11 +00:00
13 minutes
deavmi added spent time 2024-02-26 11:49:10 +00:00
16 minutes
deavmi started working 2024-02-26 11:49:15 +00:00
Author
Owner

Working now on simplifying the finalize() implementation in DGen. I am working on adding cleanup routines to clean up generated .c and .o files

Working now on simplifying the `finalize()` implementation in `DGen`. I am working on adding cleanup routines to clean up generated `.c` and `.o` files
deavmi stopped working 2024-02-26 12:05:05 +00:00
15 minutes 50 seconds
deavmi added spent time 2024-02-27 06:50:35 +00:00
2 minutes
deavmi started working 2024-02-27 06:50:38 +00:00
Author
Owner

Threw in a DNode with null (because we don't have a special DNode for Program types yet (which notably are NOT a kind-of Statement)).

We can see everything still works as is because the DFS/linearization works as expected. The Program pseudo DNode at the end is just ignored:

image


You can see it ignored here:

image

Threw in a `DNode` with `null` (because we don't have a special `DNode` for `Program` types yet (which notably are *NOT* a kind-of `Statement`)). We can see everything still works as is because the DFS/linearization works as expected. The `Program` pseudo DNode at the end is just ignored: ![image](/attachments/d9f04d96-d7d3-44ba-aaf7-b8de504b1a7e) --- You can see it **ignored** here: ![image](/attachments/561b4ed8-d876-4ee6-b835-0e88b8c0114d)
Author
Owner

Pushed first round of changes.

Pushed first round of changes.
deavmi stopped working 2024-02-27 07:02:33 +00:00
11 minutes 55 seconds
deavmi started working 2024-02-27 07:08:54 +00:00
deavmi stopped working 2024-02-27 07:08:57 +00:00
3 seconds
deavmi added spent time 2024-02-27 07:09:04 +00:00
4 minutes
deavmi started working 2024-02-27 07:09:07 +00:00
Author
Owner

Trying to sort out unittests now, compilation errors

Trying to sort out unittests now, compilation errors
Author
Owner

Compilation errors solved, runtime errors now (tests failing ⚔️)

Compilation errors solved, runtime errors now (tests failing ⚔️)
Author
Owner

Compilation errors solved, runtime errors now (tests failing ⚔️)

We are getting:

[ERROR] resolveBest(Program root): Could not find module 'a' for ANCHORED access
[INFO] resolveBest: Container is program (Program [name: TODO, modules: [Module [name: y]]])
[INFO] resolveBest(moduleHorizontal): Module [name: y]
[ERROR] resolveBest(Program root): Could not find module 'a' for ANCHORED access
[INFO] defined: Class (Name: c, Parents (Class/Interfaces): [])
[INFO] container: null
core.exception.AssertError@source/tlang/compiler/typecheck/core.d(3466): unittest failure
----------------
??:? _d_unittestp [0x672469]
source/tlang/compiler/typecheck/core.d:3466 void tlang.compiler.typecheck.core.__unittest_L3426_C1() [0x64a7ee]
??:? void tlang.compiler.typecheck.core.__modtest() [0x64cfca]
??:? int core.runtime.runModuleUnitTests().__foreachbody6(object.ModuleInfo*) [0x6906ae]
??:? int object.ModuleInfo.opApply(scope int delegate(object.ModuleInfo*)).__lambda2(immutable(object.ModuleInfo*)) [0x66981b]
??:? int rt.minfo.moduleinfos_apply(scope int d

For program:

module y;

class a
{
    class b
    {
        class c
        {
            class c
            {

            }
        }
    }
}

Implying resolver is BROKEN!

> Compilation errors solved, runtime errors now (tests failing ⚔️) We are getting: ``` [ERROR] resolveBest(Program root): Could not find module 'a' for ANCHORED access [INFO] resolveBest: Container is program (Program [name: TODO, modules: [Module [name: y]]]) [INFO] resolveBest(moduleHorizontal): Module [name: y] [ERROR] resolveBest(Program root): Could not find module 'a' for ANCHORED access [INFO] defined: Class (Name: c, Parents (Class/Interfaces): []) [INFO] container: null core.exception.AssertError@source/tlang/compiler/typecheck/core.d(3466): unittest failure ---------------- ??:? _d_unittestp [0x672469] source/tlang/compiler/typecheck/core.d:3466 void tlang.compiler.typecheck.core.__unittest_L3426_C1() [0x64a7ee] ??:? void tlang.compiler.typecheck.core.__modtest() [0x64cfca] ??:? int core.runtime.runModuleUnitTests().__foreachbody6(object.ModuleInfo*) [0x6906ae] ??:? int object.ModuleInfo.opApply(scope int delegate(object.ModuleInfo*)).__lambda2(immutable(object.ModuleInfo*)) [0x66981b] ??:? int rt.minfo.moduleinfos_apply(scope int d ``` For program: ```d module y; class a { class b { class c { class c { } } } } ``` **Implying** resolver is **BROKEN**!
deavmi stopped working 2024-02-27 07:13:36 +00:00
4 minutes 29 seconds
deavmi started working 2024-02-27 07:13:50 +00:00
Author
Owner

Compilation errors solved, runtime errors now (tests failing ⚔️)

We are getting:

[ERROR] resolveBest(Program root): Could not find module 'a' for ANCHORED access
[INFO] resolveBest: Container is program (Program [name: TODO, modules: [Module [name: y]]])
[INFO] resolveBest(moduleHorizontal): Module [name: y]
[ERROR] resolveBest(Program root): Could not find module 'a' for ANCHORED access
[INFO] defined: Class (Name: c, Parents (Class/Interfaces): [])
[INFO] container: null
core.exception.AssertError@source/tlang/compiler/typecheck/core.d(3466): unittest failure
----------------
??:? _d_unittestp [0x672469]
source/tlang/compiler/typecheck/core.d:3466 void tlang.compiler.typecheck.core.__unittest_L3426_C1() [0x64a7ee]
??:? void tlang.compiler.typecheck.core.__modtest() [0x64cfca]
??:? int core.runtime.runModuleUnitTests().__foreachbody6(object.ModuleInfo*) [0x6906ae]
??:? int object.ModuleInfo.opApply(scope int delegate(object.ModuleInfo*)).__lambda2(immutable(object.ModuleInfo*)) [0x66981b]
??:? int rt.minfo.moduleinfos_apply(scope int d

For program:

module y;

class a
{
    class b
    {
        class c
        {
            class c
            {

            }
        }
    }
}

Implying resolver is BROKEN!

No wait, my test update is wrong, let me rollback.

> > Compilation errors solved, runtime errors now (tests failing ⚔️) > > We are getting: > > ``` > [ERROR] resolveBest(Program root): Could not find module 'a' for ANCHORED access > [INFO] resolveBest: Container is program (Program [name: TODO, modules: [Module [name: y]]]) > [INFO] resolveBest(moduleHorizontal): Module [name: y] > [ERROR] resolveBest(Program root): Could not find module 'a' for ANCHORED access > [INFO] defined: Class (Name: c, Parents (Class/Interfaces): []) > [INFO] container: null > core.exception.AssertError@source/tlang/compiler/typecheck/core.d(3466): unittest failure > ---------------- > ??:? _d_unittestp [0x672469] > source/tlang/compiler/typecheck/core.d:3466 void tlang.compiler.typecheck.core.__unittest_L3426_C1() [0x64a7ee] > ??:? void tlang.compiler.typecheck.core.__modtest() [0x64cfca] > ??:? int core.runtime.runModuleUnitTests().__foreachbody6(object.ModuleInfo*) [0x6906ae] > ??:? int object.ModuleInfo.opApply(scope int delegate(object.ModuleInfo*)).__lambda2(immutable(object.ModuleInfo*)) [0x66981b] > ??:? int rt.minfo.moduleinfos_apply(scope int d > ``` > > For program: > > ```d > module y; > > class a > { > class b > { > class c > { > class c > { > > } > } > } > } > ``` > > **Implying** resolver is **BROKEN**! No wait, my test update is wrong, let me rollback.
Author
Owner

Compilation errors solved, runtime errors now (tests failing ⚔️)

We are getting:

[ERROR] resolveBest(Program root): Could not find module 'a' for ANCHORED access
[INFO] resolveBest: Container is program (Program [name: TODO, modules: [Module [name: y]]])
[INFO] resolveBest(moduleHorizontal): Module [name: y]
[ERROR] resolveBest(Program root): Could not find module 'a' for ANCHORED access
[INFO] defined: Class (Name: c, Parents (Class/Interfaces): [])
[INFO] container: null
core.exception.AssertError@source/tlang/compiler/typecheck/core.d(3466): unittest failure
----------------
??:? _d_unittestp [0x672469]
source/tlang/compiler/typecheck/core.d:3466 void tlang.compiler.typecheck.core.__unittest_L3426_C1() [0x64a7ee]
??:? void tlang.compiler.typecheck.core.__modtest() [0x64cfca]
??:? int core.runtime.runModuleUnitTests().__foreachbody6(object.ModuleInfo*) [0x6906ae]
??:? int object.ModuleInfo.opApply(scope int delegate(object.ModuleInfo*)).__lambda2(immutable(object.ModuleInfo*)) [0x66981b]
??:? int rt.minfo.moduleinfos_apply(scope int d

For program:

module y;

class a
{
    class b
    {
        class c
        {
            class c
            {

            }
        }
    }
}

Implying resolver is BROKEN!

No wait, my test update is wrong, let me rollback.

Fixed .

Now a having an exception related to DGen's call to cc exiting not-nicely:

[INFO] Compiling now with arguments: ["clang", "-c", "simple_conditions.c", "-o", "simple_conditions.o"]
/usr/bin/ld: /usr/bin/../lib/gcc/x86_64-redhat-linux/13/../../../../lib64/crt1.o: in function `_start':
(.text+0x1b): undefined reference to `main'
clang: error: linker command failed with exit code 1 (use -v to see invocation)
object.Exception@source/tlang/compiler/codegen/emit/dgen.d(1552): The CC exited with a non-zero exit code (1)
----------------
source/tlang/compiler/codegen/emit/dgen.d:1552 void tlang.compiler.codegen.emit.dgen.DCodeEmitter.finalize() [0x614ed3]
source/tlang/compiler/core.d:291 void tlang.compiler.core.Compiler.doEmit() [0x618f98]
source/tlang/compiler/core.d:306 void tlang.compiler.core.Compiler.compile() [0x618ff3]
source/tlang/compiler/core.d:365 void tlang.compiler.core.beginCompilation(immutable(char)[][]) [0x619468]
source/tlang/compiler/core.d:415 void tlang.compiler.core.__unittest_L378_C1() [0x6197bb]
??:? void tlang.compiler.core.__modtest() [0x61a2d0]
??:? int core.runtime.runModuleUnitTests().__foreachbody6(object.ModuleInfo*) [0x69059e]
??:? int object.ModuleInfo.opApply(scope int delegate(object.ModuleInfo*)).__lambda2(immutable(object.ModuleInfo*)) [0x66970b]
??:? int rt.minfo.moduleinfos_apply(scope int delegate(immutable(object.ModuleInfo*))).__foreachbody2(ref rt.sections_elf_shared.DSO) [0x678bd3]
??:? int rt.sections_elf_shared.DSO.opApply(scope int delegate(ref rt.sections_elf_shared.DSO)) [0x678d5d]
??:? int rt.minfo.moduleinfos_apply(scope int delegate(immutable(object.ModuleInfo*))) [0x678b61]
??:? int object.ModuleInfo.opApply(scope int delegate(object.ModuleInfo*)) [0x6696dd]
??:? runModuleUnitTests [0x6903d3]
??:? void rt.dmain2._d_run_main2(char[][], ulong, extern (C) int function(char[][])*).runAll() [0x67422c]
??:? void rt.dmain2._d_run_main2(char[][], ulong, extern (C) int function(char[][])*).tryExec(scope void delegate()) [0x6741b9]
??:? _d_run_main2 [0x674122]
??:? _d_run_main [0x673f0b]
/usr/include/dmd/druntime/import/core/internal/entrypoint.d:29 main [0x57145d]
??:? [0x7f5387c0f149]
??:? __libc_start_main [0x7f5387c0f20a]
??:? _start [0x570a14]
> > > Compilation errors solved, runtime errors now (tests failing ⚔️) > > > > We are getting: > > > > ``` > > [ERROR] resolveBest(Program root): Could not find module 'a' for ANCHORED access > > [INFO] resolveBest: Container is program (Program [name: TODO, modules: [Module [name: y]]]) > > [INFO] resolveBest(moduleHorizontal): Module [name: y] > > [ERROR] resolveBest(Program root): Could not find module 'a' for ANCHORED access > > [INFO] defined: Class (Name: c, Parents (Class/Interfaces): []) > > [INFO] container: null > > core.exception.AssertError@source/tlang/compiler/typecheck/core.d(3466): unittest failure > > ---------------- > > ??:? _d_unittestp [0x672469] > > source/tlang/compiler/typecheck/core.d:3466 void tlang.compiler.typecheck.core.__unittest_L3426_C1() [0x64a7ee] > > ??:? void tlang.compiler.typecheck.core.__modtest() [0x64cfca] > > ??:? int core.runtime.runModuleUnitTests().__foreachbody6(object.ModuleInfo*) [0x6906ae] > > ??:? int object.ModuleInfo.opApply(scope int delegate(object.ModuleInfo*)).__lambda2(immutable(object.ModuleInfo*)) [0x66981b] > > ??:? int rt.minfo.moduleinfos_apply(scope int d > > ``` > > > > For program: > > > > ```d > > module y; > > > > class a > > { > > class b > > { > > class c > > { > > class c > > { > > > > } > > } > > } > > } > > ``` > > > > **Implying** resolver is **BROKEN**! > > No wait, my test update is wrong, let me rollback. Fixed ✅. Now a having an exception related to `DGen`'s call to `cc` exiting not-nicely: ``` [INFO] Compiling now with arguments: ["clang", "-c", "simple_conditions.c", "-o", "simple_conditions.o"] /usr/bin/ld: /usr/bin/../lib/gcc/x86_64-redhat-linux/13/../../../../lib64/crt1.o: in function `_start': (.text+0x1b): undefined reference to `main' clang: error: linker command failed with exit code 1 (use -v to see invocation) object.Exception@source/tlang/compiler/codegen/emit/dgen.d(1552): The CC exited with a non-zero exit code (1) ---------------- source/tlang/compiler/codegen/emit/dgen.d:1552 void tlang.compiler.codegen.emit.dgen.DCodeEmitter.finalize() [0x614ed3] source/tlang/compiler/core.d:291 void tlang.compiler.core.Compiler.doEmit() [0x618f98] source/tlang/compiler/core.d:306 void tlang.compiler.core.Compiler.compile() [0x618ff3] source/tlang/compiler/core.d:365 void tlang.compiler.core.beginCompilation(immutable(char)[][]) [0x619468] source/tlang/compiler/core.d:415 void tlang.compiler.core.__unittest_L378_C1() [0x6197bb] ??:? void tlang.compiler.core.__modtest() [0x61a2d0] ??:? int core.runtime.runModuleUnitTests().__foreachbody6(object.ModuleInfo*) [0x69059e] ??:? int object.ModuleInfo.opApply(scope int delegate(object.ModuleInfo*)).__lambda2(immutable(object.ModuleInfo*)) [0x66970b] ??:? int rt.minfo.moduleinfos_apply(scope int delegate(immutable(object.ModuleInfo*))).__foreachbody2(ref rt.sections_elf_shared.DSO) [0x678bd3] ??:? int rt.sections_elf_shared.DSO.opApply(scope int delegate(ref rt.sections_elf_shared.DSO)) [0x678d5d] ??:? int rt.minfo.moduleinfos_apply(scope int delegate(immutable(object.ModuleInfo*))) [0x678b61] ??:? int object.ModuleInfo.opApply(scope int delegate(object.ModuleInfo*)) [0x6696dd] ??:? runModuleUnitTests [0x6903d3] ??:? void rt.dmain2._d_run_main2(char[][], ulong, extern (C) int function(char[][])*).runAll() [0x67422c] ??:? void rt.dmain2._d_run_main2(char[][], ulong, extern (C) int function(char[][])*).tryExec(scope void delegate()) [0x6741b9] ??:? _d_run_main2 [0x674122] ??:? _d_run_main [0x673f0b] /usr/include/dmd/druntime/import/core/internal/entrypoint.d:29 main [0x57145d] ??:? [0x7f5387c0f149] ??:? __libc_start_main [0x7f5387c0f20a] ??:? _start [0x570a14] ```
deavmi stopped working 2024-02-27 07:21:46 +00:00
7 minutes 56 seconds
deavmi started working 2024-02-27 07:37:34 +00:00
Author
Owner

Just upstreamed #162 into here, investigating quickly failing unittests

Just upstreamed #162 into here, investigating quickly failing unittests
Author
Owner

Just upstreamed #162 into here, investigating quickly failing unittests

Ah it seems it was just same issue as before.

> Just upstreamed #162 into here, investigating quickly failing unittests Ah it seems it was just same issue as before.
deavmi stopped working 2024-02-27 07:39:06 +00:00
1 minute 33 seconds
deavmi started working 2024-02-27 07:52:36 +00:00
Author
Owner

Just upstreamed #162 into here, investigating quickly failing unittests

Ah it seems it was just same issue as before.

Fixing these now.

> > Just upstreamed #162 into here, investigating quickly failing unittests > > Ah it seems it was just same issue as before. Fixing these now.
Author
Owner

Just upstreamed #162 into here, investigating quickly failing unittests

Ah it seems it was just same issue as before.

Fixing these now.

Just switched back to using an else for such cases.

> > > Just upstreamed #162 into here, investigating quickly failing unittests > > > > Ah it seems it was just same issue as before. > > Fixing these now. Just switched back to using an `else` for such cases.
deavmi stopped working 2024-02-27 08:10:32 +00:00
17 minutes 56 seconds
Author
Owner

Busy upstreaming #161 into here...

Busy upstreaming #161 into here...
deavmi started working 2024-02-27 08:34:11 +00:00
Author
Owner

Busy upstreaming #161 into here...

Done and unittests pass

> Busy upstreaming #161 into here... Done and unittests pass ✅
Author
Owner

Busy upstreaming #161 into here...

Done and unittests pass

CI/CD also passing

> > Busy upstreaming #161 into here... > > Done and unittests pass ✅ CI/CD also passing ✅
deavmi stopped working 2024-02-27 08:44:31 +00:00
10 minutes 20 seconds
deavmi added spent time 2024-02-28 06:09:12 +00:00
2 minutes
deavmi started working 2024-02-28 06:09:16 +00:00
Author
Owner

Now working on updating what the DNodeGenerator returns when we call generate() and also how we handle this in the TypeChecker.

What I am planning on doing is getting all immediate dependencies of the Program (which would be DNodes of solely Module types) and then using that as part of the per-module typechecking/code-generation.

Now working on updating what the `DNodeGenerator` returns when we call `generate()` and **also** how we handle this in the `TypeChecker`. What I am planning on doing is getting all immediate dependencies of the `Program` (which would be `DNode`s of solely `Module` types) and then using that as part of the per-module typechecking/code-generation.
Author
Owner

Just added:

  1. ProgramDepNode
Just added: 1. `ProgramDepNode`
Author
Owner

Now working on updating what the DNodeGenerator returns when we call generate() and also how we handle this in the TypeChecker.

What I am planning on doing is getting all immediate dependencies of the Program (which would be DNodes of solely Module types) and then using that as part of the per-module typechecking/code-generation.

So far so good, we are getting there:

image


We still need to do the following:

  • Module-based queue selection in DGen/CodeEmitter
  • Module-based code queue generation and function defs in TypeChecker
> Now working on updating what the `DNodeGenerator` returns when we call `generate()` and **also** how we handle this in the `TypeChecker`. > > What I am planning on doing is getting all immediate dependencies of the `Program` (which would be `DNode`s of solely `Module` types) and then using that as part of the per-module typechecking/code-generation. So far so good, we are getting there: ![image](/attachments/5f04c3e0-006f-423d-a02f-b63fb712a0ac) --- We still need to do the following: - [ ] Module-based queue selection in `DGen`/`CodeEmitter` - [ ] Module-based code queue generation and function defs in `TypeChecker`
deavmi stopped working 2024-02-28 06:40:36 +00:00
31 minutes 20 seconds
deavmi started working 2024-02-28 07:19:53 +00:00
deavmi stopped working 2024-02-28 07:19:57 +00:00
4 seconds
deavmi added spent time 2024-02-28 07:20:03 +00:00
1 minute
deavmi started working 2024-02-28 07:20:07 +00:00
Author
Owner

Some work has been done now to add Module-based ownership of FunctionData for function definitions. Still very much a work-in-progress though.

Some work has been done now to add `Module`-based ownership of `FunctionData` for function definitions. Still very much a work-in-progress though.
deavmi stopped working 2024-02-28 07:33:31 +00:00
13 minutes 24 seconds
deavmi started working 2024-02-28 11:44:29 +00:00
Author
Owner

Now busy with code queue work in the TypeChecker...

Now busy with code queue work in the `TypeChecker`...
Author
Owner

Now busy with code queue work in the TypeChecker...

Going to use a mapping structure like:

private struct ModuleQueue
    {
        private Module owner;
        private Instruction[] instructions;

        this(Module owner, Instruction[] instructions)
        {
            this.owner = owner;
            this.instructions = instructions;
        }
    }
> Now busy with code queue work in the `TypeChecker`... Going to use a mapping structure like: ```d private struct ModuleQueue { private Module owner; private Instruction[] instructions; this(Module owner, Instruction[] instructions) { this.owner = owner; this.instructions = instructions; } } ```
Author
Owner

Now busy with code queue work in the TypeChecker...

Going to use a mapping structure like:

private struct ModuleQueue
    {
        private Module owner;
        private Instruction[] instructions;

        this(Module owner, Instruction[] instructions)
        {
            this.owner = owner;
            this.instructions = instructions;
        }
    }

Updated to this:

/** 
     * Associates various instruction
     * sets with a given `Module`
     */
    private struct ModuleQueue
    {
        private Module owner;
        private Instruction[] codeInstrs;

        this(Module owner)
        {
            this.owner = owner;
        }

        public void setCode(Instruction[] instructions)
        {
            this.codeInstrs = instructions;
        }
    }
> > Now busy with code queue work in the `TypeChecker`... > > Going to use a mapping structure like: > > ```d > private struct ModuleQueue > { > private Module owner; > private Instruction[] instructions; > > this(Module owner, Instruction[] instructions) > { > this.owner = owner; > this.instructions = instructions; > } > } > ``` Updated to this: ```d /** * Associates various instruction * sets with a given `Module` */ private struct ModuleQueue { private Module owner; private Instruction[] codeInstrs; this(Module owner) { this.owner = owner; } public void setCode(Instruction[] instructions) { this.codeInstrs = instructions; } } ```
Author
Owner

Now busy with code queue work in the TypeChecker...

Going to use a mapping structure like:

private struct ModuleQueue
    {
        private Module owner;
        private Instruction[] instructions;

        this(Module owner, Instruction[] instructions)
        {
            this.owner = owner;
            this.instructions = instructions;
        }
    }

Updated to this:

/** 
     * Associates various instruction
     * sets with a given `Module`
     */
    private struct ModuleQueue
    {
        private Module owner;
        private Instruction[] codeInstrs;

        this(Module owner)
        {
            this.owner = owner;
        }

        public void setCode(Instruction[] instructions)
        {
            this.codeInstrs = instructions;
        }
    }

Almost done, just static init it seems (which needs to be done). Now the errors only appear within the DGen.

> > > Now busy with code queue work in the `TypeChecker`... > > > > Going to use a mapping structure like: > > > > ```d > > private struct ModuleQueue > > { > > private Module owner; > > private Instruction[] instructions; > > > > this(Module owner, Instruction[] instructions) > > { > > this.owner = owner; > > this.instructions = instructions; > > } > > } > > ``` > > Updated to this: > > ```d > /** > * Associates various instruction > * sets with a given `Module` > */ > private struct ModuleQueue > { > private Module owner; > private Instruction[] codeInstrs; > > this(Module owner) > { > this.owner = owner; > } > > public void setCode(Instruction[] instructions) > { > this.codeInstrs = instructions; > } > } > ``` Almost done, just static init it seems (which needs to be done). Now the errors only appear within the `DGen`.
deavmi stopped working 2024-02-28 15:35:13 +00:00
3 hours 50 minutes
deavmi started working 2024-02-28 18:00:02 +00:00
Author
Owner

Looking at now updating the CodeEmitter for the code queu updates.

Looking at now updating the `CodeEmitter` for the code queu updates.
Author
Owner

Looking at now updating the CodeEmitter for the code queu updates.

Easy changes, DGen next

> Looking at now updating the `CodeEmitter` for the code queu updates. Easy changes, `DGen` next
Author
Owner

Quick finish up tonight

  • CodeEmitter
    • Changes to make it select queues correctly
    • Documentaiton
  • DGen
    • Pass in the Module
  • TypeChecker
    • initQueue needs to be correctly generated with respective ModuleQueue
## Quick finish up tonight - [ ] `CodeEmitter` * Changes to make it select queues correctly * Documentaiton - [ ] `DGen` * Pass in the `Module` - [x] `TypeChecker` * `initQueue` needs to be correctly generated with respective `ModuleQueue`
Author
Owner

For CodeEmitter I need to select the correct map or something and then the correct sub-function definition, need to think a little bit about this.

For `CodeEmitter` I need to select the correct map or something and then the correct sub-function definition, need to think a little bit about this.
Author
Owner

For CodeEmitter I need to select the correct map or something and then the correct sub-function definition, need to think a little bit about this.

Actually, I think we have this is fine, we use TypeChecker to get a Instruction[][string] map which we select by Module, then we get a funcName -> InstructionQueue map of function definition groupings.

This is fine. Then we loop over each and there we must select the queue.

> For `CodeEmitter` I need to select the correct map or something and then the correct sub-function definition, need to think a little bit about this. Actually, I think we have this is fine, we use `TypeChecker` to get a `Instruction[][string]` map which we select by `Module`, then we get a `funcName -> InstructionQueue` map of function definition groupings. This is fine. Then we loop over each and **there** we must select the queue.
Author
Owner

For CodeEmitter I need to select the correct map or something and then the correct sub-function definition, need to think a little bit about this.

Actually, I think we have this is fine, we use TypeChecker to get a Instruction[][string] map which we select by Module, then we get a funcName -> InstructionQueue map of function definition groupings.

This is fine. Then we loop over each and there we must select the queue.

Nah wait, we got a problem. Undoing changes, we use methods that get function names but these are not yet using Module, I need to update this. Maybe no undoing is needed, just changing it will make IDE show where updates are needed

> > For `CodeEmitter` I need to select the correct map or something and then the correct sub-function definition, need to think a little bit about this. > > Actually, I think we have this is fine, we use `TypeChecker` to get a `Instruction[][string]` map which we select by `Module`, then we get a `funcName -> InstructionQueue` map of function definition groupings. > > This is fine. Then we loop over each and **there** we must select the queue. Nah wait, we got a problem. Undoing changes, we use methods that get function names but these are not yet using `Module`, I need to update this. Maybe no undoing is needed, just changing it will make IDE show where updates are needed
Author
Owner

For CodeEmitter I need to select the correct map or something and then the correct sub-function definition, need to think a little bit about this.

Actually, I think we have this is fine, we use TypeChecker to get a Instruction[][string] map which we select by Module, then we get a funcName -> InstructionQueue map of function definition groupings.

This is fine. Then we loop over each and there we must select the queue.

Nah wait, we got a problem. Undoing changes, we use methods that get function names but these are not yet using Module, I need to update this. Maybe no undoing is needed, just changing it will make IDE show where updates are needed

Compiles, unittests pass - holy kak!

> > > For `CodeEmitter` I need to select the correct map or something and then the correct sub-function definition, need to think a little bit about this. > > > > Actually, I think we have this is fine, we use `TypeChecker` to get a `Instruction[][string]` map which we select by `Module`, then we get a `funcName -> InstructionQueue` map of function definition groupings. > > > > This is fine. Then we loop over each and **there** we must select the queue. > > Nah wait, we got a problem. Undoing changes, we use methods that get function names but these are not yet using `Module`, I need to update this. Maybe no undoing is needed, just changing it will make IDE show where updates are needed Compiles, unittests pass - holy kak!
Author
Owner

We are making money moves

(Also if @rany is seeintg this, then mashallah)

image
image
image

We are making money moves (Also if @rany is seeintg this, then mashallah) ![image](/attachments/a9e1a0f5-4bab-40f8-9462-ae1394f1f76c) ![image](/attachments/904794dc-9a57-422f-824d-3895e4513564) ![image](/attachments/e8f3a29f-d838-4153-9f58-df3d0dbfd92a)
137 KiB
110 KiB
131 KiB
deavmi stopped working 2024-02-28 18:30:45 +00:00
30 minutes 43 seconds
deavmi added spent time 2024-02-28 18:55:38 +00:00
10 minutes
deavmi started working 2024-02-28 18:55:43 +00:00
Author
Owner

Parser stuff now just needs to be sorted (it causes multiple compilations of entry module), hence linker fails, which makes sense:

image

`Parser` stuff now just needs to be sorted (it causes multiple compilations of entry module), hence linker fails, which makes sense: ![image](/attachments/f29b98a4-27fa-4e20-abdb-2719fb1384d5)
deavmi stopped working 2024-02-28 19:02:59 +00:00
7 minutes 16 seconds
deavmi started working 2024-02-29 11:13:17 +00:00
Author
Owner

Parser stuff now just needs to be sorted (it causes multiple compilations of entry module), hence linker fails, which makes sense:

image

All changes that got us to this point have now been committed

> `Parser` stuff now just needs to be sorted (it causes multiple compilations of entry module), hence linker fails, which makes sense: > > ![image](/attachments/f29b98a4-27fa-4e20-abdb-2719fb1384d5) All changes that got us to this point have now been committed ✅
deavmi stopped working 2024-02-29 11:39:19 +00:00
26 minutes 2 seconds
deavmi added a new dependency 2024-02-29 17:17:18 +00:00
deavmi started working 2024-03-10 10:47:45 +00:00
Author
Owner

I now need to work on updating the Resolver to have a generic reslver method that takes in basically a predicate. I should probably do this on another branch maybe.

I now need to work on updating the `Resolver` to have a generic reslver method that takes in basically a predicate. I should probably do this on another branch maybe.
Author
Owner

I now need to work on updating the Resolver to have a generic reslver method that takes in basically a predicate. I should probably do this on another branch maybe.

See #166

> I now need to work on updating the `Resolver` to have a generic reslver method that takes in basically a predicate. I should probably do this on another branch maybe. See #166
deavmi added a new dependency 2024-03-10 10:52:29 +00:00
deavmi stopped working 2024-03-10 11:03:38 +00:00
15 minutes 53 seconds
deavmi started working 2024-03-12 16:53:08 +00:00
Author
Owner

Got the latest Resolver code in here now. Now I can begin work on the emitting (for DGen) of all public (should be extern) entities

Got the latest `Resolver` code in here now. Now I can begin work on the emitting (for `DGen`) of all public (should be `extern`) entities
Author
Owner

I actually need a sort of find-all mode, needs a change to the Resolver therefore

I actually need a sort of find-all mode, needs a change to the `Resolver` therefore
deavmi stopped working 2024-03-12 17:13:39 +00:00
20 minutes 31 seconds
Author
Owner

I actually need a sort of find-all mode, needs a change to the Resolver therefore

Got this now

> I actually need a sort of find-all mode, needs a change to the `Resolver` therefore Got this now
deavmi started working 2024-03-12 17:31:09 +00:00
deavmi stopped working 2024-03-12 19:30:51 +00:00
1 hour 59 minutes
deavmi added spent time 2024-03-12 19:59:26 +00:00
10 minutes
deavmi started working 2024-03-12 19:59:31 +00:00
Author
Owner

Working on the ModuleExternSet stuff now

Working on the `ModuleExternSet` stuff now
deavmi stopped working 2024-03-12 20:23:52 +00:00
24 minutes 21 seconds
deavmi added spent time 2024-03-12 21:02:34 +00:00
10 minutes
Author
Owner

Will take a look at this again this weekend.

Will take a look at this again this weekend.
Author
Owner

Next fx is for when we run:

./tlang compile source/tlang/testing/modules/a.t

We get:

[INFO] transform(): const(tlang.compiler.codegen.instruction.Instruction)
[INFO] type: FuncCallInstr
[INFO] resolveBest(cntnr=Function (Name: main, ReturnType: int, Args: ), name=doThing) Entered
[INFO] resolveUp(c=Function (Name: main, ReturnType: int, Args: ), pred=bool delegate(Entity))
[INFO] resolveUp(c=Function (Name: main, ReturnType: int, Args: ), pred=bool delegate(Entity)) within-search returned 'null'
[INFO] resolveUp(c=Function (Name: main, ReturnType: int, Args: ), pred=bool delegate(Entity)) cur container typeid: Function (Name: main, ReturnType: int, Args: )
[INFO] resolveUp(c=Function (Name: main, ReturnType: int, Args: ), pred=bool delegate(Entity)) possible parent: Module [name: a]
[INFO] resolveUp(c=Module [name: a], pred=bool delegate(Entity))
[INFO] resolveUp(c=Module [name: a], pred=bool delegate(Entity)) within-search returned 'null'
[INFO] resolveUp(c=Module [name: a], pred=bool delegate(Entity)) cur container typeid: Module [name: a]
[INFO] resolveUp(c=Module [name: a], pred=bool delegate(Entity)) possible parent: null
[INFO] resolveUp(c=Module [name: a], pred=bool delegate(Entity)) Simply not found
Next fx is for when we run: ```bash ./tlang compile source/tlang/testing/modules/a.t ``` We get: ``` [INFO] transform(): const(tlang.compiler.codegen.instruction.Instruction) [INFO] type: FuncCallInstr [INFO] resolveBest(cntnr=Function (Name: main, ReturnType: int, Args: ), name=doThing) Entered [INFO] resolveUp(c=Function (Name: main, ReturnType: int, Args: ), pred=bool delegate(Entity)) [INFO] resolveUp(c=Function (Name: main, ReturnType: int, Args: ), pred=bool delegate(Entity)) within-search returned 'null' [INFO] resolveUp(c=Function (Name: main, ReturnType: int, Args: ), pred=bool delegate(Entity)) cur container typeid: Function (Name: main, ReturnType: int, Args: ) [INFO] resolveUp(c=Function (Name: main, ReturnType: int, Args: ), pred=bool delegate(Entity)) possible parent: Module [name: a] [INFO] resolveUp(c=Module [name: a], pred=bool delegate(Entity)) [INFO] resolveUp(c=Module [name: a], pred=bool delegate(Entity)) within-search returned 'null' [INFO] resolveUp(c=Module [name: a], pred=bool delegate(Entity)) cur container typeid: Module [name: a] [INFO] resolveUp(c=Module [name: a], pred=bool delegate(Entity)) possible parent: null [INFO] resolveUp(c=Module [name: a], pred=bool delegate(Entity)) Simply not found ```
deavmi added spent time 2024-03-15 16:53:10 +00:00
10 minutes
deavmi started working 2024-03-15 16:53:17 +00:00
Author
Owner

Next fx is for when we run:

./tlang compile source/tlang/testing/modules/a.t

We get:

[INFO] transform(): const(tlang.compiler.codegen.instruction.Instruction)
[INFO] type: FuncCallInstr
[INFO] resolveBest(cntnr=Function (Name: main, ReturnType: int, Args: ), name=doThing) Entered
[INFO] resolveUp(c=Function (Name: main, ReturnType: int, Args: ), pred=bool delegate(Entity))
[INFO] resolveUp(c=Function (Name: main, ReturnType: int, Args: ), pred=bool delegate(Entity)) within-search returned 'null'
[INFO] resolveUp(c=Function (Name: main, ReturnType: int, Args: ), pred=bool delegate(Entity)) cur container typeid: Function (Name: main, ReturnType: int, Args: )
[INFO] resolveUp(c=Function (Name: main, ReturnType: int, Args: ), pred=bool delegate(Entity)) possible parent: Module [name: a]
[INFO] resolveUp(c=Module [name: a], pred=bool delegate(Entity))
[INFO] resolveUp(c=Module [name: a], pred=bool delegate(Entity)) within-search returned 'null'
[INFO] resolveUp(c=Module [name: a], pred=bool delegate(Entity)) cur container typeid: Module [name: a]
[INFO] resolveUp(c=Module [name: a], pred=bool delegate(Entity)) possible parent: null
[INFO] resolveUp(c=Module [name: a], pred=bool delegate(Entity)) Simply not found

Just added:

// Parent the given Module to the Program
mod.parentTo(this);
// (TODO: Should this not be explctly done within the parser)

To the Program in data.d:

// TODO: Clean up
    public void setModule(ModuleEntry ent, Module mod)
    {
        // TODO: Sanity check for already present?
        this.modsMap[ent.getName()] = mod;
        this.insertOrds ~= mod;
        this.modules ~= mod;

        // Parent the given Module to the Program
        mod.parentTo(this);
        // (TODO: Should this not be explctly done within the parser)
}
> Next fx is for when we run: > > > ```bash > ./tlang compile source/tlang/testing/modules/a.t > ``` > > We get: > > > ``` > [INFO] transform(): const(tlang.compiler.codegen.instruction.Instruction) > [INFO] type: FuncCallInstr > [INFO] resolveBest(cntnr=Function (Name: main, ReturnType: int, Args: ), name=doThing) Entered > [INFO] resolveUp(c=Function (Name: main, ReturnType: int, Args: ), pred=bool delegate(Entity)) > [INFO] resolveUp(c=Function (Name: main, ReturnType: int, Args: ), pred=bool delegate(Entity)) within-search returned 'null' > [INFO] resolveUp(c=Function (Name: main, ReturnType: int, Args: ), pred=bool delegate(Entity)) cur container typeid: Function (Name: main, ReturnType: int, Args: ) > [INFO] resolveUp(c=Function (Name: main, ReturnType: int, Args: ), pred=bool delegate(Entity)) possible parent: Module [name: a] > [INFO] resolveUp(c=Module [name: a], pred=bool delegate(Entity)) > [INFO] resolveUp(c=Module [name: a], pred=bool delegate(Entity)) within-search returned 'null' > [INFO] resolveUp(c=Module [name: a], pred=bool delegate(Entity)) cur container typeid: Module [name: a] > [INFO] resolveUp(c=Module [name: a], pred=bool delegate(Entity)) possible parent: null > [INFO] resolveUp(c=Module [name: a], pred=bool delegate(Entity)) Simply not found > ``` Just added: ```d // Parent the given Module to the Program mod.parentTo(this); // (TODO: Should this not be explctly done within the parser) ``` To the `Program` in `data.d`: ```d // TODO: Clean up public void setModule(ModuleEntry ent, Module mod) { // TODO: Sanity check for already present? this.modsMap[ent.getName()] = mod; this.insertOrds ~= mod; this.modules ~= mod; // Parent the given Module to the Program mod.parentTo(this); // (TODO: Should this not be explctly done within the parser) } ```
Author
Owner

Next fx is for when we run:

./tlang compile source/tlang/testing/modules/a.t

We get:

[INFO] transform(): const(tlang.compiler.codegen.instruction.Instruction)
[INFO] type: FuncCallInstr
[INFO] resolveBest(cntnr=Function (Name: main, ReturnType: int, Args: ), name=doThing) Entered
[INFO] resolveUp(c=Function (Name: main, ReturnType: int, Args: ), pred=bool delegate(Entity))
[INFO] resolveUp(c=Function (Name: main, ReturnType: int, Args: ), pred=bool delegate(Entity)) within-search returned 'null'
[INFO] resolveUp(c=Function (Name: main, ReturnType: int, Args: ), pred=bool delegate(Entity)) cur container typeid: Function (Name: main, ReturnType: int, Args: )
[INFO] resolveUp(c=Function (Name: main, ReturnType: int, Args: ), pred=bool delegate(Entity)) possible parent: Module [name: a]
[INFO] resolveUp(c=Module [name: a], pred=bool delegate(Entity))
[INFO] resolveUp(c=Module [name: a], pred=bool delegate(Entity)) within-search returned 'null'
[INFO] resolveUp(c=Module [name: a], pred=bool delegate(Entity)) cur container typeid: Module [name: a]
[INFO] resolveUp(c=Module [name: a], pred=bool delegate(Entity)) possible parent: null
[INFO] resolveUp(c=Module [name: a], pred=bool delegate(Entity)) Simply not found

Just added:

// Parent the given Module to the Program
mod.parentTo(this);
// (TODO: Should this not be explctly done within the parser)

To the Program in data.d:

// TODO: Clean up
    public void setModule(ModuleEntry ent, Module mod)
    {
        // TODO: Sanity check for already present?
        this.modsMap[ent.getName()] = mod;
        this.insertOrds ~= mod;
        this.modules ~= mod;

        // Parent the given Module to the Program
        mod.parentTo(this);
        // (TODO: Should this not be explctly done within the parser)
}

Updated assertion in resolveUp(..., ...): assert(cast(Entity) currentContainer || cast(Program)currentContainer);

> > Next fx is for when we run: > > > > > > ```bash > > ./tlang compile source/tlang/testing/modules/a.t > > ``` > > > > We get: > > > > > > ``` > > [INFO] transform(): const(tlang.compiler.codegen.instruction.Instruction) > > [INFO] type: FuncCallInstr > > [INFO] resolveBest(cntnr=Function (Name: main, ReturnType: int, Args: ), name=doThing) Entered > > [INFO] resolveUp(c=Function (Name: main, ReturnType: int, Args: ), pred=bool delegate(Entity)) > > [INFO] resolveUp(c=Function (Name: main, ReturnType: int, Args: ), pred=bool delegate(Entity)) within-search returned 'null' > > [INFO] resolveUp(c=Function (Name: main, ReturnType: int, Args: ), pred=bool delegate(Entity)) cur container typeid: Function (Name: main, ReturnType: int, Args: ) > > [INFO] resolveUp(c=Function (Name: main, ReturnType: int, Args: ), pred=bool delegate(Entity)) possible parent: Module [name: a] > > [INFO] resolveUp(c=Module [name: a], pred=bool delegate(Entity)) > > [INFO] resolveUp(c=Module [name: a], pred=bool delegate(Entity)) within-search returned 'null' > > [INFO] resolveUp(c=Module [name: a], pred=bool delegate(Entity)) cur container typeid: Module [name: a] > > [INFO] resolveUp(c=Module [name: a], pred=bool delegate(Entity)) possible parent: null > > [INFO] resolveUp(c=Module [name: a], pred=bool delegate(Entity)) Simply not found > > ``` > > Just added: > > > ```d > // Parent the given Module to the Program > mod.parentTo(this); > // (TODO: Should this not be explctly done within the parser) > ``` > > To the `Program` in `data.d`: > > ```d > // TODO: Clean up > public void setModule(ModuleEntry ent, Module mod) > { > // TODO: Sanity check for already present? > this.modsMap[ent.getName()] = mod; > this.insertOrds ~= mod; > this.modules ~= mod; > > // Parent the given Module to the Program > mod.parentTo(this); > // (TODO: Should this not be explctly done within the parser) > } > ``` Updated assertion in `resolveUp(..., ...)`: `assert(cast(Entity) currentContainer || cast(Program)currentContainer);`
Author
Owner

Next fx is for when we run:

./tlang compile source/tlang/testing/modules/a.t

We get:

[INFO] transform(): const(tlang.compiler.codegen.instruction.Instruction)
[INFO] type: FuncCallInstr
[INFO] resolveBest(cntnr=Function (Name: main, ReturnType: int, Args: ), name=doThing) Entered
[INFO] resolveUp(c=Function (Name: main, ReturnType: int, Args: ), pred=bool delegate(Entity))
[INFO] resolveUp(c=Function (Name: main, ReturnType: int, Args: ), pred=bool delegate(Entity)) within-search returned 'null'
[INFO] resolveUp(c=Function (Name: main, ReturnType: int, Args: ), pred=bool delegate(Entity)) cur container typeid: Function (Name: main, ReturnType: int, Args: )
[INFO] resolveUp(c=Function (Name: main, ReturnType: int, Args: ), pred=bool delegate(Entity)) possible parent: Module [name: a]
[INFO] resolveUp(c=Module [name: a], pred=bool delegate(Entity))
[INFO] resolveUp(c=Module [name: a], pred=bool delegate(Entity)) within-search returned 'null'
[INFO] resolveUp(c=Module [name: a], pred=bool delegate(Entity)) cur container typeid: Module [name: a]
[INFO] resolveUp(c=Module [name: a], pred=bool delegate(Entity)) possible parent: null
[INFO] resolveUp(c=Module [name: a], pred=bool delegate(Entity)) Simply not found

Just added:

// Parent the given Module to the Program
mod.parentTo(this);
// (TODO: Should this not be explctly done within the parser)

To the Program in data.d:

// TODO: Clean up
    public void setModule(ModuleEntry ent, Module mod)
    {
        // TODO: Sanity check for already present?
        this.modsMap[ent.getName()] = mod;
        this.insertOrds ~= mod;
        this.modules ~= mod;

        // Parent the given Module to the Program
        mod.parentTo(this);
        // (TODO: Should this not be explctly done within the parser)
}

Updated assertion in resolveUp(..., ...): assert(cast(Entity) currentContainer || cast(Program)currentContainer);

Feel as though I need seperate handling in this case.

> > > Next fx is for when we run: > > > > > > > > > ```bash > > > ./tlang compile source/tlang/testing/modules/a.t > > > ``` > > > > > > We get: > > > > > > > > > ``` > > > [INFO] transform(): const(tlang.compiler.codegen.instruction.Instruction) > > > [INFO] type: FuncCallInstr > > > [INFO] resolveBest(cntnr=Function (Name: main, ReturnType: int, Args: ), name=doThing) Entered > > > [INFO] resolveUp(c=Function (Name: main, ReturnType: int, Args: ), pred=bool delegate(Entity)) > > > [INFO] resolveUp(c=Function (Name: main, ReturnType: int, Args: ), pred=bool delegate(Entity)) within-search returned 'null' > > > [INFO] resolveUp(c=Function (Name: main, ReturnType: int, Args: ), pred=bool delegate(Entity)) cur container typeid: Function (Name: main, ReturnType: int, Args: ) > > > [INFO] resolveUp(c=Function (Name: main, ReturnType: int, Args: ), pred=bool delegate(Entity)) possible parent: Module [name: a] > > > [INFO] resolveUp(c=Module [name: a], pred=bool delegate(Entity)) > > > [INFO] resolveUp(c=Module [name: a], pred=bool delegate(Entity)) within-search returned 'null' > > > [INFO] resolveUp(c=Module [name: a], pred=bool delegate(Entity)) cur container typeid: Module [name: a] > > > [INFO] resolveUp(c=Module [name: a], pred=bool delegate(Entity)) possible parent: null > > > [INFO] resolveUp(c=Module [name: a], pred=bool delegate(Entity)) Simply not found > > > ``` > > > > Just added: > > > > > > ```d > > // Parent the given Module to the Program > > mod.parentTo(this); > > // (TODO: Should this not be explctly done within the parser) > > ``` > > > > To the `Program` in `data.d`: > > > > ```d > > // TODO: Clean up > > public void setModule(ModuleEntry ent, Module mod) > > { > > // TODO: Sanity check for already present? > > this.modsMap[ent.getName()] = mod; > > this.insertOrds ~= mod; > > this.modules ~= mod; > > > > // Parent the given Module to the Program > > mod.parentTo(this); > > // (TODO: Should this not be explctly done within the parser) > > } > > ``` > > Updated assertion in `resolveUp(..., ...)`: `assert(cast(Entity) currentContainer || cast(Program)currentContainer);` Feel as though I need seperate handling in this case.
deavmi stopped working 2024-03-15 17:09:35 +00:00
16 minutes 18 seconds
deavmi started working 2024-03-15 17:20:55 +00:00
Author
Owner

Not the only problem, anther needs to properly root when a module name is encountered.

Not the only problem, anther needs to properly root when a module name is encountered.
Author
Owner

Okay problem is name being queried is not jhow can I say. Basically the functoin s being lked up on its name. Determined to be as so in the FuncCallInstr when looked up using b.doThing in typecheck/codegen. So we need to maybe adjust the context or do something like that.

Better yet, we should leave the name in the FuncCallInstr maybe?

Okay problem is name being queried is not jhow can I say. Basically the functoin s being lked up on its name. Determined to be as so in the `FuncCallInstr` when looked up _using_ `b.doThing` in typecheck/codegen. So we need to maybe adjust the context or do something like that. Better yet, we should leave the name in the `FuncCallInstr` maybe?
Author
Owner

Okay problem is name being queried is not jhow can I say. Basically the functoin s being lked up on its name. Determined to be as so in the FuncCallInstr when looked up using b.doThing in typecheck/codegen. So we need to maybe adjust the context or do something like that.

Better yet, we should leave the name in the FuncCallInstr maybe?

Wait, we do that already, maybe generate full name. Let me take a look.

> Okay problem is name being queried is not jhow can I say. Basically the functoin s being lked up on its name. Determined to be as so in the `FuncCallInstr` when looked up _using_ `b.doThing` in typecheck/codegen. So we need to maybe adjust the context or do something like that. > > Better yet, we should leave the name in the `FuncCallInstr` maybe? Wait, we _do_ that **already**, maybe generate full name. Let me take a look.
Author
Owner

Okay problem is name being queried is not jhow can I say. Basically the functoin s being lked up on its name. Determined to be as so in the FuncCallInstr when looked up using b.doThing in typecheck/codegen. So we need to maybe adjust the context or do something like that.

Better yet, we should leave the name in the FuncCallInstr maybe?

Wait, we do that already, maybe generate full name. Let me take a look.

Eays fix by using funcCall.getName() which has full AST name from the expression itself. let's use that and not the getname() of the Function looked up from there.

> > Okay problem is name being queried is not jhow can I say. Basically the functoin s being lked up on its name. Determined to be as so in the `FuncCallInstr` when looked up _using_ `b.doThing` in typecheck/codegen. So we need to maybe adjust the context or do something like that. > > > > Better yet, we should leave the name in the `FuncCallInstr` maybe? > > Wait, we _do_ that **already**, maybe generate full name. Let me take a look. Eays fix by using `funcCall.getName()` which has full AST name from the expression itself. let's use that and not the `getname()` of the `Function` looked up from there.
Author
Owner

Okay problem is name being queried is not jhow can I say. Basically the functoin s being lked up on its name. Determined to be as so in the FuncCallInstr when looked up using b.doThing in typecheck/codegen. So we need to maybe adjust the context or do something like that.

Better yet, we should leave the name in the FuncCallInstr maybe?

Wait, we do that already, maybe generate full name. Let me take a look.

Eays fix by using funcCall.getName() which has full AST name from the expression itself. let's use that and not the getname() of the Function looked up from there.

This seems to fix it, gets to the actual gcc call now, good prog.

This is GOOD! 🎊 :

image

> > > Okay problem is name being queried is not jhow can I say. Basically the functoin s being lked up on its name. Determined to be as so in the `FuncCallInstr` when looked up _using_ `b.doThing` in typecheck/codegen. So we need to maybe adjust the context or do something like that. > > > > > > Better yet, we should leave the name in the `FuncCallInstr` maybe? > > > > Wait, we _do_ that **already**, maybe generate full name. Let me take a look. > > Eays fix by using `funcCall.getName()` which has full AST name from the expression itself. let's use that and not the `getname()` of the `Function` looked up from there. This seems to fix it, gets to the actual `gcc` call now, good prog. This is **GOOD**! 🎊 : ![image](/attachments/9e97b096-9a15-40e1-a5b3-3ac9639242ec)
Author
Owner

Okay problem is name being queried is not jhow can I say. Basically the functoin s being lked up on its name. Determined to be as so in the FuncCallInstr when looked up using b.doThing in typecheck/codegen. So we need to maybe adjust the context or do something like that.

Better yet, we should leave the name in the FuncCallInstr maybe?

Wait, we do that already, maybe generate full name. Let me take a look.

Eays fix by using funcCall.getName() which has full AST name from the expression itself. let's use that and not the getname() of the Function looked up from there.

This seems to fix it, gets to the actual gcc call now, good prog.

This is GOOD! 🎊 :

image

Okay, now looks like symbol mapper stuff is what we need to sort out now.

> > > > Okay problem is name being queried is not jhow can I say. Basically the functoin s being lked up on its name. Determined to be as so in the `FuncCallInstr` when looked up _using_ `b.doThing` in typecheck/codegen. So we need to maybe adjust the context or do something like that. > > > > > > > > Better yet, we should leave the name in the `FuncCallInstr` maybe? > > > > > > Wait, we _do_ that **already**, maybe generate full name. Let me take a look. > > > > Eays fix by using `funcCall.getName()` which has full AST name from the expression itself. let's use that and not the `getname()` of the `Function` looked up from there. > > This seems to fix it, gets to the actual `gcc` call now, good prog. > > This is **GOOD**! 🎊 : > > ![image](/attachments/9e97b096-9a15-40e1-a5b3-3ac9639242ec) Okay, now looks like symbol mapper stuff is what we need to sort out now.
Author
Owner

Okay problem is name being queried is not jhow can I say. Basically the functoin s being lked up on its name. Determined to be as so in the FuncCallInstr when looked up using b.doThing in typecheck/codegen. So we need to maybe adjust the context or do something like that.

Better yet, we should leave the name in the FuncCallInstr maybe?

Wait, we do that already, maybe generate full name. Let me take a look.

Eays fix by using funcCall.getName() which has full AST name from the expression itself. let's use that and not the getname() of the Function looked up from there.

This seems to fix it, gets to the actual gcc call now, good prog.

This is GOOD! 🎊 :

image

Okay, now looks like symbol mapper stuff is what we need to sort out now.

Have to check some stuff now, but dinner time! 🍷

Symbol mapping stuff still being worked on and tested

> > > > > Okay problem is name being queried is not jhow can I say. Basically the functoin s being lked up on its name. Determined to be as so in the `FuncCallInstr` when looked up _using_ `b.doThing` in typecheck/codegen. So we need to maybe adjust the context or do something like that. > > > > > > > > > > Better yet, we should leave the name in the `FuncCallInstr` maybe? > > > > > > > > Wait, we _do_ that **already**, maybe generate full name. Let me take a look. > > > > > > Eays fix by using `funcCall.getName()` which has full AST name from the expression itself. let's use that and not the `getname()` of the `Function` looked up from there. > > > > This seems to fix it, gets to the actual `gcc` call now, good prog. > > > > This is **GOOD**! 🎊 : > > > > ![image](/attachments/9e97b096-9a15-40e1-a5b3-3ac9639242ec) > > Okay, now looks like symbol mapper stuff is what we need to sort out now. Have to check some stuff now, but dinner time! 🍷 Symbol mapping stuff still being worked on and tested
deavmi stopped working 2024-03-15 18:00:57 +00:00
40 minutes 3 seconds
deavmi started working 2024-03-15 18:14:25 +00:00
Author
Owner

Sorted it out, sticking to one ScopeType for now. Now the symbols match and the C compiler is happy.

Sorted it out, sticking to **one** `ScopeType` for now. Now the symbols match and the C compiler is happy.
deavmi stopped working 2024-03-15 20:13:42 +00:00
1 hour 59 minutes
Author
Owner

Going to continue on this today.

Going to continue on this today.
deavmi started working 2024-03-17 10:24:31 +00:00
Author
Owner

Trying to figure out now why I have a certain unittest in the Parser failing:

[INFO] Program [name: TODO, modules: [Module [name: myModule]]]
/home/deavmi/Documents/Projects/t/code/tlang-test-library(_D4core7runtime18runModuleUnitTestsUZ19unittestSegvHandlerUNbNiiPSQCm3sys5posix6signal9siginfo_tPvZv+0x2d)[0x6a9f1d]
/lib64/libc.so.6(+0x3dbb0)[0x7f3d702c5bb0]
/home/deavmi/Documents/Projects/t/code/tlang-test-library(_D5tlang8compiler7symbols4data9Statement8parentOfMFZCQBzQBwQBq10containers9Container+0x16)[0x653fe6]
/home/deavmi/Documents/Projects/t/code/tlang-test-library(_D5tlang8compiler9typecheck10resolution8Resolver9resolveUpMFCQChQCe7symbols10containers9ContainerDFCQDuQDrQBn4data6EntityZbZQz+0x13f)[0x66e03f]
/home/deavmi/Documents/Projects/t/code/tlang-test-library(_D5tlang8compiler9typecheck10resolution8Resolver9resolveUpMFCQChQCe7symbols10containers9ContainerDFCQDuQDrQBn4data6EntityZbZQz+0x1d8)[0x66e0d8]
/home/deavmi/Documents/Projects/t/code/tlang-test-library(_D5tlang8compiler9typecheck10resolution8Resolver9resolveUpMFCQChQCe7symbols10containers9ContainerDFCQDuQDrQBn4data6EntityZbZQz+0x1d8)[0x66e0d8]
/home/deavmi/Documents/Projects/t/code/tlang-test-library(_D5tlang8compiler9typecheck10resolution8Resolver9resolveUpMFCQChQCe7symbols10containers9ContainerAyaZCQDwQDtQBp4data6Entity+0x46)[0x66e16a]
/home/deavmi/Documents/Projects/t/code/tlang-test-library(_D5tlang8compiler9typecheck10resolution8Resolver11resolveBestMFCQCkQCh7symbols10containers9ContainerAyaZCQDzQDwQBp4data6Entity+0x75f)[0x66ea6f]
/home/deavmi/Documents/Projects/t/code/tlang-test-library(_D5tlang8compiler7parsing4core19__unittest_L2778_C1FZv+0xb4b)[0x64a2f3]
/home/deavmi/Documents/Projects/t/code/tlang-test-library(_D5tlang8compiler7parsing4core9__modtestFZv+0x13)[0x64d3d7]
/home/deavmi/Documents/Projects/t/code/tlang-test-library(_D4core7runtime18runModuleUnitTestsUZ14__foreachbody6MFPS6object10ModuleInfoZi+0x53)[0x6a9f8b]
/home/deavmi/Documents/Projects/t/code/tlang-test-library(_D6object10ModuleInfo7opApplyFMDFPSQBhQBdZiZ9__lambda2MFyPSQCfQCbZi+0x28)[0x683204]
/home/deavmi/Documents/Projects/t/code/tlang-test-library(_D2rt5minfo17moduleinfos_applyFMDFyPS6object10ModuleInfoZiZ14__foreachbody2MFKSQCz19sections_elf_shared3DSOZi+0x54)[0x6925c0]
/home/deavmi/Documents/Projects/t/code/tlang-test-library(_D2rt19sections_elf_shared3DSO7opApplyFMDFKSQBqQBqQyZiZi+0x4a)[0x69274a]
/home/deavmi/Documents/Projects/t/code/tlang-test-library(_D2rt5minfo17moduleinfos_applyFMDFyPS6object10ModuleInfoZiZi+0x22)[0x69254e]
/home/deavmi/Documents/Projects/t/code/tlang-test-library(_D6object10ModuleInfo7opApplyFMDFPSQBhQBdZiZi+0x22)[0x6831d6]
/home/deavmi/Documents/Projects/t/code/tlang-test-library(runModuleUnitTests+0x13c)[0x6a9dc0]
/home/deavmi/Documents/Projects/t/code/tlang-test-library(_D2rt6dmain212_d_run_main2UAAamPUQgZiZ6runAllMFZv+0x25)[0x68dc19]
/home/deavmi/Documents/Projects/t/code/tlang-test-library(_D2rt6dmain212_d_run_main2UAAamPUQgZiZ7tryExecMFMDFZvZv+0x22)[0x68dba6]
/home/deavmi/Documents/Projects/t/code/tlang-test-library(_d_run_main2+0x1fb)[0x68db0f]
/home/deavmi/Documents/Projects/t/code/tlang-test-library(_d_run_main+0xb8)[0x68d8f8]
/home/deavmi/Documents/Projects/t/code/tlang-test-library(main+0x22)[0x57d4fe]
/lib64/libc.so.6(+0x27b8a)[0x7f3d702afb8a]
/lib64/libc.so.6(__libc_start_main+0x8b)[0x7f3d702afc4b]
/home/deavmi/Documents/Projects/t/code/tlang-test-library(_start+0x25)[0x57ca15]
Error Program exited with code -11
Trying to figure out now why I have a certain unittest in the `Parser` failing: ``` [INFO] Program [name: TODO, modules: [Module [name: myModule]]] /home/deavmi/Documents/Projects/t/code/tlang-test-library(_D4core7runtime18runModuleUnitTestsUZ19unittestSegvHandlerUNbNiiPSQCm3sys5posix6signal9siginfo_tPvZv+0x2d)[0x6a9f1d] /lib64/libc.so.6(+0x3dbb0)[0x7f3d702c5bb0] /home/deavmi/Documents/Projects/t/code/tlang-test-library(_D5tlang8compiler7symbols4data9Statement8parentOfMFZCQBzQBwQBq10containers9Container+0x16)[0x653fe6] /home/deavmi/Documents/Projects/t/code/tlang-test-library(_D5tlang8compiler9typecheck10resolution8Resolver9resolveUpMFCQChQCe7symbols10containers9ContainerDFCQDuQDrQBn4data6EntityZbZQz+0x13f)[0x66e03f] /home/deavmi/Documents/Projects/t/code/tlang-test-library(_D5tlang8compiler9typecheck10resolution8Resolver9resolveUpMFCQChQCe7symbols10containers9ContainerDFCQDuQDrQBn4data6EntityZbZQz+0x1d8)[0x66e0d8] /home/deavmi/Documents/Projects/t/code/tlang-test-library(_D5tlang8compiler9typecheck10resolution8Resolver9resolveUpMFCQChQCe7symbols10containers9ContainerDFCQDuQDrQBn4data6EntityZbZQz+0x1d8)[0x66e0d8] /home/deavmi/Documents/Projects/t/code/tlang-test-library(_D5tlang8compiler9typecheck10resolution8Resolver9resolveUpMFCQChQCe7symbols10containers9ContainerAyaZCQDwQDtQBp4data6Entity+0x46)[0x66e16a] /home/deavmi/Documents/Projects/t/code/tlang-test-library(_D5tlang8compiler9typecheck10resolution8Resolver11resolveBestMFCQCkQCh7symbols10containers9ContainerAyaZCQDzQDwQBp4data6Entity+0x75f)[0x66ea6f] /home/deavmi/Documents/Projects/t/code/tlang-test-library(_D5tlang8compiler7parsing4core19__unittest_L2778_C1FZv+0xb4b)[0x64a2f3] /home/deavmi/Documents/Projects/t/code/tlang-test-library(_D5tlang8compiler7parsing4core9__modtestFZv+0x13)[0x64d3d7] /home/deavmi/Documents/Projects/t/code/tlang-test-library(_D4core7runtime18runModuleUnitTestsUZ14__foreachbody6MFPS6object10ModuleInfoZi+0x53)[0x6a9f8b] /home/deavmi/Documents/Projects/t/code/tlang-test-library(_D6object10ModuleInfo7opApplyFMDFPSQBhQBdZiZ9__lambda2MFyPSQCfQCbZi+0x28)[0x683204] /home/deavmi/Documents/Projects/t/code/tlang-test-library(_D2rt5minfo17moduleinfos_applyFMDFyPS6object10ModuleInfoZiZ14__foreachbody2MFKSQCz19sections_elf_shared3DSOZi+0x54)[0x6925c0] /home/deavmi/Documents/Projects/t/code/tlang-test-library(_D2rt19sections_elf_shared3DSO7opApplyFMDFKSQBqQBqQyZiZi+0x4a)[0x69274a] /home/deavmi/Documents/Projects/t/code/tlang-test-library(_D2rt5minfo17moduleinfos_applyFMDFyPS6object10ModuleInfoZiZi+0x22)[0x69254e] /home/deavmi/Documents/Projects/t/code/tlang-test-library(_D6object10ModuleInfo7opApplyFMDFPSQBhQBdZiZi+0x22)[0x6831d6] /home/deavmi/Documents/Projects/t/code/tlang-test-library(runModuleUnitTests+0x13c)[0x6a9dc0] /home/deavmi/Documents/Projects/t/code/tlang-test-library(_D2rt6dmain212_d_run_main2UAAamPUQgZiZ6runAllMFZv+0x25)[0x68dc19] /home/deavmi/Documents/Projects/t/code/tlang-test-library(_D2rt6dmain212_d_run_main2UAAamPUQgZiZ7tryExecMFMDFZvZv+0x22)[0x68dba6] /home/deavmi/Documents/Projects/t/code/tlang-test-library(_d_run_main2+0x1fb)[0x68db0f] /home/deavmi/Documents/Projects/t/code/tlang-test-library(_d_run_main+0xb8)[0x68d8f8] /home/deavmi/Documents/Projects/t/code/tlang-test-library(main+0x22)[0x57d4fe] /lib64/libc.so.6(+0x27b8a)[0x7f3d702afb8a] /lib64/libc.so.6(__libc_start_main+0x8b)[0x7f3d702afc4b] /home/deavmi/Documents/Projects/t/code/tlang-test-library(_start+0x25)[0x57ca15] Error Program exited with code -11 ```
Author
Owner

Trying to figure out now why I have a certain unittest in the Parser failing:

[INFO] Program [name: TODO, modules: [Module [name: myModule]]]
/home/deavmi/Documents/Projects/t/code/tlang-test-library(_D4core7runtime18runModuleUnitTestsUZ19unittestSegvHandlerUNbNiiPSQCm3sys5posix6signal9siginfo_tPvZv+0x2d)[0x6a9f1d]
/lib64/libc.so.6(+0x3dbb0)[0x7f3d702c5bb0]
/home/deavmi/Documents/Projects/t/code/tlang-test-library(_D5tlang8compiler7symbols4data9Statement8parentOfMFZCQBzQBwQBq10containers9Container+0x16)[0x653fe6]
/home/deavmi/Documents/Projects/t/code/tlang-test-library(_D5tlang8compiler9typecheck10resolution8Resolver9resolveUpMFCQChQCe7symbols10containers9ContainerDFCQDuQDrQBn4data6EntityZbZQz+0x13f)[0x66e03f]
/home/deavmi/Documents/Projects/t/code/tlang-test-library(_D5tlang8compiler9typecheck10resolution8Resolver9resolveUpMFCQChQCe7symbols10containers9ContainerDFCQDuQDrQBn4data6EntityZbZQz+0x1d8)[0x66e0d8]
/home/deavmi/Documents/Projects/t/code/tlang-test-library(_D5tlang8compiler9typecheck10resolution8Resolver9resolveUpMFCQChQCe7symbols10containers9ContainerDFCQDuQDrQBn4data6EntityZbZQz+0x1d8)[0x66e0d8]
/home/deavmi/Documents/Projects/t/code/tlang-test-library(_D5tlang8compiler9typecheck10resolution8Resolver9resolveUpMFCQChQCe7symbols10containers9ContainerAyaZCQDwQDtQBp4data6Entity+0x46)[0x66e16a]
/home/deavmi/Documents/Projects/t/code/tlang-test-library(_D5tlang8compiler9typecheck10resolution8Resolver11resolveBestMFCQCkQCh7symbols10containers9ContainerAyaZCQDzQDwQBp4data6Entity+0x75f)[0x66ea6f]
/home/deavmi/Documents/Projects/t/code/tlang-test-library(_D5tlang8compiler7parsing4core19__unittest_L2778_C1FZv+0xb4b)[0x64a2f3]
/home/deavmi/Documents/Projects/t/code/tlang-test-library(_D5tlang8compiler7parsing4core9__modtestFZv+0x13)[0x64d3d7]
/home/deavmi/Documents/Projects/t/code/tlang-test-library(_D4core7runtime18runModuleUnitTestsUZ14__foreachbody6MFPS6object10ModuleInfoZi+0x53)[0x6a9f8b]
/home/deavmi/Documents/Projects/t/code/tlang-test-library(_D6object10ModuleInfo7opApplyFMDFPSQBhQBdZiZ9__lambda2MFyPSQCfQCbZi+0x28)[0x683204]
/home/deavmi/Documents/Projects/t/code/tlang-test-library(_D2rt5minfo17moduleinfos_applyFMDFyPS6object10ModuleInfoZiZ14__foreachbody2MFKSQCz19sections_elf_shared3DSOZi+0x54)[0x6925c0]
/home/deavmi/Documents/Projects/t/code/tlang-test-library(_D2rt19sections_elf_shared3DSO7opApplyFMDFKSQBqQBqQyZiZi+0x4a)[0x69274a]
/home/deavmi/Documents/Projects/t/code/tlang-test-library(_D2rt5minfo17moduleinfos_applyFMDFyPS6object10ModuleInfoZiZi+0x22)[0x69254e]
/home/deavmi/Documents/Projects/t/code/tlang-test-library(_D6object10ModuleInfo7opApplyFMDFPSQBhQBdZiZi+0x22)[0x6831d6]
/home/deavmi/Documents/Projects/t/code/tlang-test-library(runModuleUnitTests+0x13c)[0x6a9dc0]
/home/deavmi/Documents/Projects/t/code/tlang-test-library(_D2rt6dmain212_d_run_main2UAAamPUQgZiZ6runAllMFZv+0x25)[0x68dc19]
/home/deavmi/Documents/Projects/t/code/tlang-test-library(_D2rt6dmain212_d_run_main2UAAamPUQgZiZ7tryExecMFMDFZvZv+0x22)[0x68dba6]
/home/deavmi/Documents/Projects/t/code/tlang-test-library(_d_run_main2+0x1fb)[0x68db0f]
/home/deavmi/Documents/Projects/t/code/tlang-test-library(_d_run_main+0xb8)[0x68d8f8]
/home/deavmi/Documents/Projects/t/code/tlang-test-library(main+0x22)[0x57d4fe]
/lib64/libc.so.6(+0x27b8a)[0x7f3d702afb8a]
/lib64/libc.so.6(__libc_start_main+0x8b)[0x7f3d702afc4b]
/home/deavmi/Documents/Projects/t/code/tlang-test-library(_start+0x25)[0x57ca15]
Error Program exited with code -11

Conirmed that it is the unittest in parsing/core.d with the myModuleFr which is crashing:

/**
* Naming test for Entity recognition
*/
unittest
{
    string sourceCode = `
module myModuleFr;

class myClass1
{
    class myClass1_1
    {
        int entity;
    }

    class myClass2
    {
        int inner;
    }
}

class myClass2
{
    int outer;
}
`;
> Trying to figure out now why I have a certain unittest in the `Parser` failing: > > ``` > [INFO] Program [name: TODO, modules: [Module [name: myModule]]] > /home/deavmi/Documents/Projects/t/code/tlang-test-library(_D4core7runtime18runModuleUnitTestsUZ19unittestSegvHandlerUNbNiiPSQCm3sys5posix6signal9siginfo_tPvZv+0x2d)[0x6a9f1d] > /lib64/libc.so.6(+0x3dbb0)[0x7f3d702c5bb0] > /home/deavmi/Documents/Projects/t/code/tlang-test-library(_D5tlang8compiler7symbols4data9Statement8parentOfMFZCQBzQBwQBq10containers9Container+0x16)[0x653fe6] > /home/deavmi/Documents/Projects/t/code/tlang-test-library(_D5tlang8compiler9typecheck10resolution8Resolver9resolveUpMFCQChQCe7symbols10containers9ContainerDFCQDuQDrQBn4data6EntityZbZQz+0x13f)[0x66e03f] > /home/deavmi/Documents/Projects/t/code/tlang-test-library(_D5tlang8compiler9typecheck10resolution8Resolver9resolveUpMFCQChQCe7symbols10containers9ContainerDFCQDuQDrQBn4data6EntityZbZQz+0x1d8)[0x66e0d8] > /home/deavmi/Documents/Projects/t/code/tlang-test-library(_D5tlang8compiler9typecheck10resolution8Resolver9resolveUpMFCQChQCe7symbols10containers9ContainerDFCQDuQDrQBn4data6EntityZbZQz+0x1d8)[0x66e0d8] > /home/deavmi/Documents/Projects/t/code/tlang-test-library(_D5tlang8compiler9typecheck10resolution8Resolver9resolveUpMFCQChQCe7symbols10containers9ContainerAyaZCQDwQDtQBp4data6Entity+0x46)[0x66e16a] > /home/deavmi/Documents/Projects/t/code/tlang-test-library(_D5tlang8compiler9typecheck10resolution8Resolver11resolveBestMFCQCkQCh7symbols10containers9ContainerAyaZCQDzQDwQBp4data6Entity+0x75f)[0x66ea6f] > /home/deavmi/Documents/Projects/t/code/tlang-test-library(_D5tlang8compiler7parsing4core19__unittest_L2778_C1FZv+0xb4b)[0x64a2f3] > /home/deavmi/Documents/Projects/t/code/tlang-test-library(_D5tlang8compiler7parsing4core9__modtestFZv+0x13)[0x64d3d7] > /home/deavmi/Documents/Projects/t/code/tlang-test-library(_D4core7runtime18runModuleUnitTestsUZ14__foreachbody6MFPS6object10ModuleInfoZi+0x53)[0x6a9f8b] > /home/deavmi/Documents/Projects/t/code/tlang-test-library(_D6object10ModuleInfo7opApplyFMDFPSQBhQBdZiZ9__lambda2MFyPSQCfQCbZi+0x28)[0x683204] > /home/deavmi/Documents/Projects/t/code/tlang-test-library(_D2rt5minfo17moduleinfos_applyFMDFyPS6object10ModuleInfoZiZ14__foreachbody2MFKSQCz19sections_elf_shared3DSOZi+0x54)[0x6925c0] > /home/deavmi/Documents/Projects/t/code/tlang-test-library(_D2rt19sections_elf_shared3DSO7opApplyFMDFKSQBqQBqQyZiZi+0x4a)[0x69274a] > /home/deavmi/Documents/Projects/t/code/tlang-test-library(_D2rt5minfo17moduleinfos_applyFMDFyPS6object10ModuleInfoZiZi+0x22)[0x69254e] > /home/deavmi/Documents/Projects/t/code/tlang-test-library(_D6object10ModuleInfo7opApplyFMDFPSQBhQBdZiZi+0x22)[0x6831d6] > /home/deavmi/Documents/Projects/t/code/tlang-test-library(runModuleUnitTests+0x13c)[0x6a9dc0] > /home/deavmi/Documents/Projects/t/code/tlang-test-library(_D2rt6dmain212_d_run_main2UAAamPUQgZiZ6runAllMFZv+0x25)[0x68dc19] > /home/deavmi/Documents/Projects/t/code/tlang-test-library(_D2rt6dmain212_d_run_main2UAAamPUQgZiZ7tryExecMFMDFZvZv+0x22)[0x68dba6] > /home/deavmi/Documents/Projects/t/code/tlang-test-library(_d_run_main2+0x1fb)[0x68db0f] > /home/deavmi/Documents/Projects/t/code/tlang-test-library(_d_run_main+0xb8)[0x68d8f8] > /home/deavmi/Documents/Projects/t/code/tlang-test-library(main+0x22)[0x57d4fe] > /lib64/libc.so.6(+0x27b8a)[0x7f3d702afb8a] > /lib64/libc.so.6(__libc_start_main+0x8b)[0x7f3d702afc4b] > /home/deavmi/Documents/Projects/t/code/tlang-test-library(_start+0x25)[0x57ca15] > Error Program exited with code -11 > ``` Conirmed that it is the unittest in `parsing/core.d` with the `myModuleFr` which is crashing: ``` /** * Naming test for Entity recognition */ unittest { string sourceCode = ` module myModuleFr; class myClass1 { class myClass1_1 { int entity; } class myClass2 { int inner; } } class myClass2 { int outer; } `; ```
Author
Owner

Trying to figure out now why I have a certain unittest in the Parser failing:

[INFO] Program [name: TODO, modules: [Module [name: myModule]]]
/home/deavmi/Documents/Projects/t/code/tlang-test-library(_D4core7runtime18runModuleUnitTestsUZ19unittestSegvHandlerUNbNiiPSQCm3sys5posix6signal9siginfo_tPvZv+0x2d)[0x6a9f1d]
/lib64/libc.so.6(+0x3dbb0)[0x7f3d702c5bb0]
/home/deavmi/Documents/Projects/t/code/tlang-test-library(_D5tlang8compiler7symbols4data9Statement8parentOfMFZCQBzQBwQBq10containers9Container+0x16)[0x653fe6]
/home/deavmi/Documents/Projects/t/code/tlang-test-library(_D5tlang8compiler9typecheck10resolution8Resolver9resolveUpMFCQChQCe7symbols10containers9ContainerDFCQDuQDrQBn4data6EntityZbZQz+0x13f)[0x66e03f]
/home/deavmi/Documents/Projects/t/code/tlang-test-library(_D5tlang8compiler9typecheck10resolution8Resolver9resolveUpMFCQChQCe7symbols10containers9ContainerDFCQDuQDrQBn4data6EntityZbZQz+0x1d8)[0x66e0d8]
/home/deavmi/Documents/Projects/t/code/tlang-test-library(_D5tlang8compiler9typecheck10resolution8Resolver9resolveUpMFCQChQCe7symbols10containers9ContainerDFCQDuQDrQBn4data6EntityZbZQz+0x1d8)[0x66e0d8]
/home/deavmi/Documents/Projects/t/code/tlang-test-library(_D5tlang8compiler9typecheck10resolution8Resolver9resolveUpMFCQChQCe7symbols10containers9ContainerAyaZCQDwQDtQBp4data6Entity+0x46)[0x66e16a]
/home/deavmi/Documents/Projects/t/code/tlang-test-library(_D5tlang8compiler9typecheck10resolution8Resolver11resolveBestMFCQCkQCh7symbols10containers9ContainerAyaZCQDzQDwQBp4data6Entity+0x75f)[0x66ea6f]
/home/deavmi/Documents/Projects/t/code/tlang-test-library(_D5tlang8compiler7parsing4core19__unittest_L2778_C1FZv+0xb4b)[0x64a2f3]
/home/deavmi/Documents/Projects/t/code/tlang-test-library(_D5tlang8compiler7parsing4core9__modtestFZv+0x13)[0x64d3d7]
/home/deavmi/Documents/Projects/t/code/tlang-test-library(_D4core7runtime18runModuleUnitTestsUZ14__foreachbody6MFPS6object10ModuleInfoZi+0x53)[0x6a9f8b]
/home/deavmi/Documents/Projects/t/code/tlang-test-library(_D6object10ModuleInfo7opApplyFMDFPSQBhQBdZiZ9__lambda2MFyPSQCfQCbZi+0x28)[0x683204]
/home/deavmi/Documents/Projects/t/code/tlang-test-library(_D2rt5minfo17moduleinfos_applyFMDFyPS6object10ModuleInfoZiZ14__foreachbody2MFKSQCz19sections_elf_shared3DSOZi+0x54)[0x6925c0]
/home/deavmi/Documents/Projects/t/code/tlang-test-library(_D2rt19sections_elf_shared3DSO7opApplyFMDFKSQBqQBqQyZiZi+0x4a)[0x69274a]
/home/deavmi/Documents/Projects/t/code/tlang-test-library(_D2rt5minfo17moduleinfos_applyFMDFyPS6object10ModuleInfoZiZi+0x22)[0x69254e]
/home/deavmi/Documents/Projects/t/code/tlang-test-library(_D6object10ModuleInfo7opApplyFMDFPSQBhQBdZiZi+0x22)[0x6831d6]
/home/deavmi/Documents/Projects/t/code/tlang-test-library(runModuleUnitTests+0x13c)[0x6a9dc0]
/home/deavmi/Documents/Projects/t/code/tlang-test-library(_D2rt6dmain212_d_run_main2UAAamPUQgZiZ6runAllMFZv+0x25)[0x68dc19]
/home/deavmi/Documents/Projects/t/code/tlang-test-library(_D2rt6dmain212_d_run_main2UAAamPUQgZiZ7tryExecMFMDFZvZv+0x22)[0x68dba6]
/home/deavmi/Documents/Projects/t/code/tlang-test-library(_d_run_main2+0x1fb)[0x68db0f]
/home/deavmi/Documents/Projects/t/code/tlang-test-library(_d_run_main+0xb8)[0x68d8f8]
/home/deavmi/Documents/Projects/t/code/tlang-test-library(main+0x22)[0x57d4fe]
/lib64/libc.so.6(+0x27b8a)[0x7f3d702afb8a]
/lib64/libc.so.6(__libc_start_main+0x8b)[0x7f3d702afc4b]
/home/deavmi/Documents/Projects/t/code/tlang-test-library(_start+0x25)[0x57ca15]
Error Program exited with code -11

Conirmed that it is the unittest in parsing/core.d with the myModuleFr which is crashing:

/**
* Naming test for Entity recognition
*/
unittest
{
    string sourceCode = `
module myModuleFr;

class myClass1
{
    class myClass1_1
    {
        int entity;
    }

    class myClass2
    {
        int inner;
    }
}

class myClass2
{
    int outer;
}
`;

Okay the problem seems to be when searching for an entity which does not exist. We know that nthere is nothing named inner inside the myClass2 (the one declared at the module-level):

innerVariable = tc.getResolver().resolveBest(c_myClass2, "inner");

But this crashes the Resolver it seems. We need to therefore fix that.

> > Trying to figure out now why I have a certain unittest in the `Parser` failing: > > > > ``` > > [INFO] Program [name: TODO, modules: [Module [name: myModule]]] > > /home/deavmi/Documents/Projects/t/code/tlang-test-library(_D4core7runtime18runModuleUnitTestsUZ19unittestSegvHandlerUNbNiiPSQCm3sys5posix6signal9siginfo_tPvZv+0x2d)[0x6a9f1d] > > /lib64/libc.so.6(+0x3dbb0)[0x7f3d702c5bb0] > > /home/deavmi/Documents/Projects/t/code/tlang-test-library(_D5tlang8compiler7symbols4data9Statement8parentOfMFZCQBzQBwQBq10containers9Container+0x16)[0x653fe6] > > /home/deavmi/Documents/Projects/t/code/tlang-test-library(_D5tlang8compiler9typecheck10resolution8Resolver9resolveUpMFCQChQCe7symbols10containers9ContainerDFCQDuQDrQBn4data6EntityZbZQz+0x13f)[0x66e03f] > > /home/deavmi/Documents/Projects/t/code/tlang-test-library(_D5tlang8compiler9typecheck10resolution8Resolver9resolveUpMFCQChQCe7symbols10containers9ContainerDFCQDuQDrQBn4data6EntityZbZQz+0x1d8)[0x66e0d8] > > /home/deavmi/Documents/Projects/t/code/tlang-test-library(_D5tlang8compiler9typecheck10resolution8Resolver9resolveUpMFCQChQCe7symbols10containers9ContainerDFCQDuQDrQBn4data6EntityZbZQz+0x1d8)[0x66e0d8] > > /home/deavmi/Documents/Projects/t/code/tlang-test-library(_D5tlang8compiler9typecheck10resolution8Resolver9resolveUpMFCQChQCe7symbols10containers9ContainerAyaZCQDwQDtQBp4data6Entity+0x46)[0x66e16a] > > /home/deavmi/Documents/Projects/t/code/tlang-test-library(_D5tlang8compiler9typecheck10resolution8Resolver11resolveBestMFCQCkQCh7symbols10containers9ContainerAyaZCQDzQDwQBp4data6Entity+0x75f)[0x66ea6f] > > /home/deavmi/Documents/Projects/t/code/tlang-test-library(_D5tlang8compiler7parsing4core19__unittest_L2778_C1FZv+0xb4b)[0x64a2f3] > > /home/deavmi/Documents/Projects/t/code/tlang-test-library(_D5tlang8compiler7parsing4core9__modtestFZv+0x13)[0x64d3d7] > > /home/deavmi/Documents/Projects/t/code/tlang-test-library(_D4core7runtime18runModuleUnitTestsUZ14__foreachbody6MFPS6object10ModuleInfoZi+0x53)[0x6a9f8b] > > /home/deavmi/Documents/Projects/t/code/tlang-test-library(_D6object10ModuleInfo7opApplyFMDFPSQBhQBdZiZ9__lambda2MFyPSQCfQCbZi+0x28)[0x683204] > > /home/deavmi/Documents/Projects/t/code/tlang-test-library(_D2rt5minfo17moduleinfos_applyFMDFyPS6object10ModuleInfoZiZ14__foreachbody2MFKSQCz19sections_elf_shared3DSOZi+0x54)[0x6925c0] > > /home/deavmi/Documents/Projects/t/code/tlang-test-library(_D2rt19sections_elf_shared3DSO7opApplyFMDFKSQBqQBqQyZiZi+0x4a)[0x69274a] > > /home/deavmi/Documents/Projects/t/code/tlang-test-library(_D2rt5minfo17moduleinfos_applyFMDFyPS6object10ModuleInfoZiZi+0x22)[0x69254e] > > /home/deavmi/Documents/Projects/t/code/tlang-test-library(_D6object10ModuleInfo7opApplyFMDFPSQBhQBdZiZi+0x22)[0x6831d6] > > /home/deavmi/Documents/Projects/t/code/tlang-test-library(runModuleUnitTests+0x13c)[0x6a9dc0] > > /home/deavmi/Documents/Projects/t/code/tlang-test-library(_D2rt6dmain212_d_run_main2UAAamPUQgZiZ6runAllMFZv+0x25)[0x68dc19] > > /home/deavmi/Documents/Projects/t/code/tlang-test-library(_D2rt6dmain212_d_run_main2UAAamPUQgZiZ7tryExecMFMDFZvZv+0x22)[0x68dba6] > > /home/deavmi/Documents/Projects/t/code/tlang-test-library(_d_run_main2+0x1fb)[0x68db0f] > > /home/deavmi/Documents/Projects/t/code/tlang-test-library(_d_run_main+0xb8)[0x68d8f8] > > /home/deavmi/Documents/Projects/t/code/tlang-test-library(main+0x22)[0x57d4fe] > > /lib64/libc.so.6(+0x27b8a)[0x7f3d702afb8a] > > /lib64/libc.so.6(__libc_start_main+0x8b)[0x7f3d702afc4b] > > /home/deavmi/Documents/Projects/t/code/tlang-test-library(_start+0x25)[0x57ca15] > > Error Program exited with code -11 > > ``` > > Conirmed that it is the unittest in `parsing/core.d` with the `myModuleFr` which is crashing: > > ``` > /** > * Naming test for Entity recognition > */ > unittest > { > string sourceCode = ` > module myModuleFr; > > class myClass1 > { > class myClass1_1 > { > int entity; > } > > class myClass2 > { > int inner; > } > } > > class myClass2 > { > int outer; > } > `; > ``` Okay the problem seems to be when searching for an entity which does not exist. We know that nthere is nothing named `inner` inside the `myClass2` (the one declared at the module-level): ```d innerVariable = tc.getResolver().resolveBest(c_myClass2, "inner"); ``` But this crashes the `Resolver` it seems. We need to therefore fix that.
Author
Owner

Okay I hjave an idea what the problem is, It is within resolveUp(Container, Predicate)... looking into it now

Okay I hjave an idea what the problem is, It is within `resolveUp(Container, Predicate)`... looking into it now
Author
Owner

Okay I hjave an idea what the problem is, It is within resolveUp(Container, Predicate)... looking into it now

This is the fix, and now it seems to work:

/**
         * If nothing was found (and current container is `Program`)
         * then there is no further up we can go
         */
        else if(cast(Program)currentContainer)
        {
            gprintln
            (
                format
                (
                    "resolveUp(cntr=%s, pred=%s) Entity was not found and we cannot crawl any further up as we are at the Program container now",
                    currentContainer,
                    predicate
                )
            );

            return null;
        }
> Okay I hjave an idea what the problem is, It is within `resolveUp(Container, Predicate)`... looking into it now This is the fix, and now it seems to work: ```d /** * If nothing was found (and current container is `Program`) * then there is no further up we can go */ else if(cast(Program)currentContainer) { gprintln ( format ( "resolveUp(cntr=%s, pred=%s) Entity was not found and we cannot crawl any further up as we are at the Program container now", currentContainer, predicate ) ); return null; } ```
Author
Owner

Time to write a commit message, clean up the print statements I now have scattered everywhere and so on

Time to write a commit message, clean up the print statements I now have scattered everywhere and so on
Author
Owner

Pushed fixes for that. Builds will still be failing because of things not yet pushed (unrelated to the data.d and resolution.d stuff).

Pushed fixes for that. Builds will still be failing because of things not yet pushed (unrelated to the `data.d` and `resolution.d` stuff).
Author
Owner

Pushed the fix for the HashMapper

Also includes fixed unittest for it

Pushed the fix for the `HashMapper` ✅ Also includes fixed unittest for it
Author
Owner

Pushed:

CodeEmitter

  • Now makes use of SymbolMapperV2 for the mapper

Compiler

  • Now uses the new HashMapper and LebanonMapper.
  • Along with this it also now uses the SymbolmapperV2 API
Pushed: CodeEmitter - Now makes use of `SymbolMapperV2` for the mapper Compiler - Now uses the new `HashMapper` and `LebanonMapper`. - Along with this it also now uses the `SymbolmapperV2` API
Author
Owner

Now what remains is just updates to DGen and the TypeChecker... I will clean these up and push when I can.

Now what remains is just updates to `DGen` and the `TypeChecker`... I will clean these up and push when I can.
deavmi stopped working 2024-03-17 11:49:21 +00:00
1 hour 24 minutes
deavmi started working 2024-03-17 15:09:09 +00:00
Author
Owner

Just pushed:

DGen

  • Now takes in a SymbolMapperV2
  • We now have made use of the new symbol mapping facilities and (for now) we are mapping everything with a GLOBAL ScopeType. n this case have added comments above each mapping request to reconsider which scope type should be used on a case-by-case basis.
  • We now first call emitStdint(..., ...) prior to emitExterns(..., ...) because the latter uses types defined in the former (think of well, the uint32_t types for example)
  • Defined a new type ModuleExternSet which holds a Module and its respetcive publically accessible Function(s) and Variable(s)
  • Implemented generateExternsForModule(Module mod) which generates a ModuleExternSet for the given Module
  • Updated emitExterns(File modOut, Module mod) to now determine all Module[] except the incoming mod itself and then generate ModuleExternSet()s for each. These are then looped through and extern statements are generated for each ModuleExternSet's pubFns()and (soon) we will also add support for thepubVars()` of each
Just pushed: DGen - Now takes in a `SymbolMapperV2` - We now have made use of the new symbol mapping facilities and (for now) we are mapping everything with a `GLOBAL` `ScopeType`. n this case have added comments above each mapping request to reconsider which scope type should be used on a case-by-case basis. - We now first call `emitStdint(..., ...)` prior to `emitExterns(..., ...)` because the latter uses types defined in the former (think of well, the `uint32_t` types for example) - Defined a new type `ModuleExternSet` which holds a `Module` and its respetcive publically accessible `Function`(s) and `Variable`(s) - Implemented `generateExternsForModule(Module mod)` which generates a `ModuleExternSet` for the given `Module` - Updated `emitExterns(File modOut, Module mod)` to now determine all `Module[]` except the incoming `mod` itself and then generate `ModuleExternSet`()s for each. These are then looped through and extern statements are generated for each `ModuleExternSet's `pubFns()` and (soon) we will also add support for the `pubVars()` of each
Author
Owner

Just the fix for TypeChecker that I need to add

Just the fix for `TypeChecker` that I need to add
Author
Owner

Just pushed:

TypeChecker

  • When pro0cessing a DNode which contains a Statement of which is a FunctionCall we now will generate the corresponding FuncCallInstr using the name that is refered to in the FunctionCall (i.e. using getname() on the FunctionCall) INSTEAD of using the getName() method from the Function looked up CVIA the FunctionCall's getName() method. This ensures that the full path expression is passed into the FuncCallInstr. Remember it is looked up later in the emitter but having this name fixed a lto of problems. i.e. having a b.doThing() call in module a now works. Previously it would look up just doThng() as that is all that was all whic was saved within the FuncCallInstr.
  • Rule of thumb when deating any sort of Instruction whic refers to some entity using a name, save-what-you-see. Don't eaergly lookup stuff and re-generate names because the name y7ou see is normally syntactically correct from the user.
Just pushed: TypeChecker - When pro0cessing a `DNode` which contains a `Statement` of which is a `FunctionCall` we now will generate the corresponding `FuncCallInstr` using the name that is refered to in the `FunctionCall` (i.e. using `getname()` on the `FunctionCall`) INSTEAD of using the `getName()` method from the `Function` looked up CVIA the `FunctionCall`'s `getName()` method. This ensures that the full path expression is passed into the `FuncCallInstr`. Remember it is looked up later in the emitter but having this name fixed a lto of problems. i.e. having a `b.doThing()` call in module `a` now works. Previously it would look up just `doThng()` as that is all that was all whic was saved within the `FuncCallInstr`. - Rule of thumb when deating any sort of `Instruction` whic refers to some entity using a name, save-what-you-see. Don't eaergly lookup stuff and re-generate names because the name y7ou see is normally syntactically correct from the user.
Author
Owner

Compilation is working and tested semantics is all good with something like simple_functions.t. Unittests also pass.

Waiting on Github CI/CD....

Compilation is working and tested semantics is all good with something like `simple_functions.t`. Unittests also pass. Waiting on Github CI/CD....
Author
Owner

Compilation is working and tested semantics is all good with something like simple_functions.t. Unittests also pass.

Waiting on Github CI/CD....

CI/CD passed

Also to note coverage is back up where the coverage tracker expected it to be (for an improvement to have been marked or at least recovered to the highest it has tracked yet).

> Compilation is working and tested semantics is all good with something like `simple_functions.t`. Unittests also pass. > > Waiting on Github CI/CD.... CI/CD passed ✅ Also to note coverage is back up where the coverage tracker expected it to be (for an improvement to have been marked or at least recovered to the highest it has tracked yet).
deavmi stopped working 2024-03-17 15:20:46 +00:00
11 minutes 38 seconds
Author
Owner

Parser fixes are what is now next.

When we are closer to being done e should also document everything to some degree. I definately think documenting the Resolver with its new updates would be worth while

`Parser` fixes are what is now next. When we are closer to being done e should also document everything to some degree. I definately think documenting the `Resolver` with its new updates would be worth while
Author
Owner

Things to do for Resolver

  • Test various other methods with the new Program to try trigger any buggy code
  • Updated documentation once it is stabalised
## Things to do for `Resolver` - [x] Test various other methods with the new `Program` to try trigger any buggy code - [ ] Updated documentation once it is stabalised
deavmi started working 2024-03-17 15:34:11 +00:00
Author
Owner

Things to do for Resolver

  • Test various other methods with the new Program to try trigger any buggy code
  • Updated documentation once it is stabalised

Working on the former now and there is already a bad implementation of resolveUp(..., ...) for Program-rooted rsearches. This was never tested so am glad I am doing it now. can already see some of the problems with it. If it has path.length==1 then it tries to find firstly if it is the nqame of a Mdoule however when not matching it returns null. It should fall through and see what else is named with the given name, because that is not right (obviously).

> ## Things to do for `Resolver` > > - [ ] Test various other methods with the new `Program` to try trigger any buggy code > - [ ] Updated documentation once it is stabalised Working on the former now and there is already a bad implementation of `resolveUp(..., ...)` for `Program`-rooted rsearches. This was never tested so am glad I am doing it now. can already see some of the problems with it. If it has `path.length==1` then it tries to find firstly if it is the nqame of a `Mdoule` however when not matching it returns `null`. It should fall through and see what else is named with the given name, because that is not right (obviously).
Author
Owner

Things to do for Resolver

  • Test various other methods with the new Program to try trigger any buggy code
  • Updated documentation once it is stabalised

Working on the former now and there is already a bad implementation of resolveUp(..., ...) for Program-rooted rsearches. This was never tested so am glad I am doing it now. can already see some of the problems with it. If it has path.length==1 then it tries to find firstly if it is the nqame of a Mdoule however when not matching it returns null. It should fall through and see what else is named with the given name, because that is not right (obviously).

Look, actually it is odd to want to resolve stuff in this manner to be qute honest as the results will not be that predicatble. It should probably return null and that probably makes the most sense actually.

> > ## Things to do for `Resolver` > > > > - [ ] Test various other methods with the new `Program` to try trigger any buggy code > > - [ ] Updated documentation once it is stabalised > > Working on the former now and there is already a bad implementation of `resolveUp(..., ...)` for `Program`-rooted rsearches. This was never tested so am glad I am doing it now. can already see some of the problems with it. If it has `path.length==1` then it tries to find firstly if it is the nqame of a `Mdoule` however when not matching it returns `null`. It should fall through and see what else is named with the given name, because that is not right (obviously). Look, actually it is odd to want to resolve stuff in this manner to be qute honest as the results will not be that predicatble. It should probably return `null` and that probably makes the most sense actually.
Author
Owner

Need to fix is descendant, assert(tc.getResolver().isDescendant(cast(Container)program, myModule)); fails

Need to fix is descendant, `assert(tc.getResolver().isDescendant(cast(Container)program, myModule));` fails
Author
Owner

Need to fix is descendant, assert(tc.getResolver().isDescendant(cast(Container)program, myModule)); fails

This is fine now it seems.

> Need to fix is descendant, `assert(tc.getResolver().isDescendant(cast(Container)program, myModule));` fails This is fine now it seems.
Author
Owner

Now fixing genwerateNameBest(Entity) with a sim,ilar sort of issue. May rewrite it, I don't like the while l,oop instead of a dfo-while loop.

Now fixing `genwerateNameBest(Entity)` with a sim,ilar sort of issue. May rewrite it, I don't like the while l,oop instead of a dfo-while loop.
Author
Owner

Now fixing genwerateNameBest(Entity) with a sim,ilar sort of issue. May rewrite it, I don't like the while l,oop instead of a dfo-while loop.

Such an easy fix by using findContainerOfType(..., ...)

> Now fixing `genwerateNameBest(Entity)` with a sim,ilar sort of issue. May rewrite it, I don't like the while l,oop instead of a dfo-while loop. Such an easy fix by using `findContainerOfType(..., ...)`
Author
Owner

UIp to 92% coverage on the resolver now....

UIp to 92% coverage on the resolver now....
Author
Owner

Pushed now

Pushed now ✅
Author
Owner

Everything is passing

Everything is passing ✅
deavmi stopped working 2024-03-17 16:32:06 +00:00
57 minutes 55 seconds
Author
Owner

Gustav idea for unique single parse for any given module import/visitation startergy:

Gustav idea for unique single parse for any given module import/visitation startergy: ![](https://deavmi.assigned.network/git/attachments/f7beca25-dffe-4416-942e-314a4c823268)
deavmi added spent time 2024-03-20 21:53:13 +00:00
1 hour 30 minutes
Author
Owner

Did some clean up

Did some clean up
deavmi added spent time 2024-03-26 16:27:14 +00:00
5 minutes
Author
Owner

Gustav idea for unique single parse for any given module import/visitation startergy:

Will do this tomorrow

> Gustav idea for unique single parse for any given module import/visitation startergy: > > ![](https://deavmi.assigned.network/git/attachments/f7beca25-dffe-4416-942e-314a4c823268) > > Will do this tomorrow
deavmi started working 2024-03-26 18:37:21 +00:00
Author
Owner

Gustav idea for unique single parse for any given module import/visitation startergy:

Will do this tomorrow

Slight variation on this, we can actually do it from within the call to parse() when it has already constructed an empty Module and we also get the main thing, the ability to know the module's name.

In any case this is way cleaner and what I wanted from the beginning, therefore I shall add it as so. The way we will do this is with a default parameter to parse(string) as parse(string, bool isEntrypoint = false). And the only time we shall set isEntrypoint to true is when we call parser.parse() from the Compiler's doParse() code (this is the entry point to the entire parsing process anyways).

> > Gustav idea for unique single parse for any given module import/visitation startergy: > > > > ![](https://deavmi.assigned.network/git/attachments/f7beca25-dffe-4416-942e-314a4c823268) > > > > > > Will do this tomorrow Slight variation on this, we can actually do it from **within** the call to `parse()` when it has already constructed an empty `Module` _and_ we also get the main thing, the ability to know the module's name. In any case this is way cleaner and what I wanted from the beginning, therefore I shall add it as so. The way we will do this is with a default parameter to `parse(string)` as `parse(string, bool isEntrypoint = false)`. And the only time we shall set `isEntrypoint` to `true` is when we call `parser.parse()` from the `Compiler`'s `doParse()` code (this is the entry point to the entire parsing process anyways).
Author
Owner

Gustav idea for unique single parse for any given module import/visitation startergy:

Will do this tomorrow

Slight variation on this, we can actually do it from within the call to parse() when it has already constructed an empty Module and we also get the main thing, the ability to know the module's name.

In any case this is way cleaner and what I wanted from the beginning, therefore I shall add it as so. The way we will do this is with a default parameter to parse(string) as parse(string, bool isEntrypoint = false). And the only time we shall set isEntrypoint to true is when we call parser.parse() from the Compiler's doParse() code (this is the entry point to the entire parsing process anyways).

This is done and it works! 🎊

> > > Gustav idea for unique single parse for any given module import/visitation startergy: > > > > > > ![](https://deavmi.assigned.network/git/attachments/f7beca25-dffe-4416-942e-314a4c823268) > > > > > > > > > > Will do this tomorrow > > Slight variation on this, we can actually do it from **within** the call to `parse()` when it has already constructed an empty `Module` _and_ we also get the main thing, the ability to know the module's name. > > In any case this is way cleaner and what I wanted from the beginning, therefore I shall add it as so. The way we will do this is with a default parameter to `parse(string)` as `parse(string, bool isEntrypoint = false)`. And the only time we shall set `isEntrypoint` to `true` is when we call `parser.parse()` from the `Compiler`'s `doParse()` code (this is the entry point to the entire parsing process anyways). This is done and it works! ✅ 🎊
deavmi stopped working 2024-03-26 19:29:23 +00:00
52 minutes 3 seconds
Author
Owner

Local tests pass and CI/CD

Semantic local test passes too, will update the GitHub CI test to check for exit code to ensure automatic testing of it

Local tests pass and CI/CD Semantic local test passes too, will update the GitHub CI test to check for exit code to ensure automatic testing of it
deavmi started working 2024-03-27 15:26:06 +00:00
Author
Owner

Writing documentation now

Writing documentation now
Author
Owner

Todo

  • Write automated semantic tests
  • Documentation (initial)
### Todo - [x] Write automated semantic tests - [x] Documentation (initial)
deavmi stopped working 2024-03-27 16:12:47 +00:00
46 minutes 41 seconds
deavmi started working 2024-03-27 19:22:52 +00:00
Author
Owner

Will continue working on docs after I shower 🚿

Both updating in-code docs whilst I type up the actual docs - win-win.

Will continue working on docs after I shower 🚿 Both updating in-code docs whilst I type up the **actual** docs - win-win.
deavmi stopped working 2024-03-27 19:32:04 +00:00
9 minutes 12 seconds
deavmi added spent time 2024-03-27 20:04:52 +00:00
10 minutes
deavmi started working 2024-03-27 20:04:57 +00:00
deavmi stopped working 2024-03-28 06:23:57 +00:00
10 hours 19 minutes
deavmi added spent time 2024-03-28 11:55:40 +00:00
1 minute
Author
Owner

Added documentation on how the ModuleManager searches for modules, that is almost done.

Also fixed up some inefficient parts of the code for that.

Should probs get to that testing now but I just wanna finish up the docs real quick.

Added documentation on how the `ModuleManager` searches for modules, that is almost done. Also fixed up some inefficient parts of the code for that. Should probs get to that testing now but I just wanna finish up the docs real quick.
deavmi started working 2024-03-28 19:21:19 +00:00
Author
Owner

The ModuleManager and the ModMasn module (at large) is all code-documented now.

I also believe that the docs written are all done and now available in a file named small_doc_mopdules.md.

The `ModuleManager` and the `ModMasn` module (at large) is all code-documented now. I also believe that the docs written are all done and now available in a file named `small_doc_mopdules.md`.
Author
Owner

Ah, it seems that there is a part on Progeram and Module, I feel that should be done earlier ina secrtion on the Resolver. Will begin work on that now.

Ah, it seems that there is a part on `Progeram` and `Module`, I feel that should be done earlier ina secrtion on the `Resolver`. Will begin work on that now.
Author
Owner

Ah, it seems that there is a part on Progeram and Module, I feel that should be done earlier ina secrtion on the Resolver. Will begin work on that now.

Removed those parts, they will be done in the section on resolution.

> Ah, it seems that there is a part on `Progeram` and `Module`, I feel that should be done earlier ina secrtion on the `Resolver`. Will begin work on that now. Removed those parts, they will be done in the section on resolution.
Author
Owner

ModMan docs are done and moved into the docs repo as well

ModMan docs are done and moved into the docs repo as well
Author
Owner

Will do resolver tomorrow, time to sleep now 💤

Will do resolver tomorrow, time to sleep now 💤
deavmi stopped working 2024-03-28 21:20:33 +00:00
1 hour 59 minutes
deavmi added spent time 2024-03-29 08:48:40 +00:00
10 minutes
deavmi started working 2024-03-29 08:48:51 +00:00
Author
Owner

Will do resolver tomorrow, time to sleep now 💤

Resolution docs are being worked on now

> Will do resolver tomorrow, time to sleep now 💤 Resolution docs are being worked on now
Author
Owner

Will do resolver tomorrow, time to sleep now 💤

Resolution docs are being worked on now

This is progressing, only a few more mthods left.

There are also code improvements coming along with this.

> > Will do resolver tomorrow, time to sleep now 💤 > > Resolution docs are being worked on now This is progressing, only a few more mthods left. There are also code improvements coming along with this.
Author
Owner

Good Friday

Good Friday
Author
Owner

The name generation methods are documented now and there are some code changes as well which will be commited soon ☑️


The next set of methods requiering overview and documentation are those relating to pertforming resolution.

The name generation methods are documented now and there are some code changes as well which will be commited soon ☑️ --- The next set of methods requiering overview and documentation are those relating to pertforming resolution.
deavmi stopped working 2024-03-29 14:56:12 +00:00
6 hours 7 minutes
deavmi started working 2024-03-29 14:59:00 +00:00
Author
Owner

Just pushed:

Resolver

  • Fixed the typos in some documentation
  • generateNameBest(Entity entity) now relies on generateName(Container, Entity)'s special handling of Program's in order to achieve its goal.
  • Cleaned up generateName(Container, Entity)
  • generateName_Internal(...) is now generateName0(...)
Just pushed: Resolver - Fixed the typos in some documentation - `generateNameBest(Entity entity)` now relies on `generateName(Container, Entity)`'s special handling of `Program`'s in order to achieve its goal. - Cleaned up `generateName(Container, Entity)` - `generateName_Internal(...)` is now `generateName0(...)`
Author
Owner

Done for now, more fixes to come code wise and also finish up resolution docs

Done for now, more fixes to come code wise and also finish up resolution docs
deavmi stopped working 2024-03-29 15:03:00 +00:00
4 minutes
deavmi started working 2024-03-29 18:34:26 +00:00
deavmi stopped working 2024-03-29 20:19:20 +00:00
1 hour 44 minutes
deavmi started working 2024-03-30 09:49:35 +00:00
Author
Owner

Doing some more documentation work now

Doing some more documentation work now
Author
Owner

Doing some more documentation work now

Done for now, will continue later

> Doing some more documentation work now Done for now, will continue later
deavmi stopped working 2024-03-30 11:06:52 +00:00
1 hour 17 minutes
deavmi started working 2024-03-31 18:03:19 +01:00
Author
Owner

Cleaning up resolveBest(..., ...) now

Cleaning up `resolveBest(..., ...)` now
deavmi stopped working 2024-03-31 18:22:47 +01:00
19 minutes 27 seconds
deavmi started working 2024-03-31 18:26:40 +01:00
deavmi stopped working 2024-03-31 18:55:55 +01:00
29 minutes 15 seconds
deavmi started working 2024-03-31 19:10:02 +01:00
Author
Owner

Documentation for the resolver is basicallly done

Documentation for the resolver is basicallly done ✅
Author
Owner

The resolver code is also done being reviewed

The resolver code is also done being reviewed ✅
Author
Owner

Parsing (unittests)

  • Added a test which tests out the multi-module support by testing a.t/b.t and niks/c.t in a unittest itself
Parsing (unittests) - Added a test which tests out the multi-module support by testing `a.t`/`b.t` and `niks/c.t` in a unittest itself
Author
Owner

Todo

  • Write automated semantic tests
  • Documentation (initial)

Pipelines

  • Added test for a.t (multi-module) test
> ### Todo > > - [ ] Write automated semantic tests > - [x] Documentation (initial) Pipelines - Added test for `a.t` (multi-module) test
Author
Owner

Todo

  • Write automated semantic tests
  • Documentation (initial)

Looks like automated test working as expected, took some time to get it right in the GitHub pipelines file d.yml

> ### Todo > > - [ ] Write automated semantic tests > - [x] Documentation (initial) Looks like automated test working as expected, took some time to get it right in the GitHub pipelines file `d.yml` ✅
deavmi stopped working 2024-03-31 20:31:05 +01:00
1 hour 21 minutes
deavmi started working 2024-03-31 20:34:30 +01:00
Author
Owner

Parser

  • Make doImport(string) now use doImports(string[])
  • parseImport() now supports multi-line imports
Parser - Make `doImport(string)` now use `doImports(string[])` - `parseImport()` now supports multi-line imports
Author
Owner

Multi-line import support added

Multi-line import support added ✅
deavmi stopped working 2024-03-31 21:09:34 +01:00
35 minutes 4 seconds
Author
Owner

image

![image](/attachments/c60937fd-d857-4f46-86b1-d7eda9c1ec4f)
174 KiB
deavmi started working 2024-03-31 21:21:56 +01:00
deavmi stopped working 2024-03-31 21:27:50 +01:00
5 minutes 54 seconds
deavmi started working 2024-03-31 21:43:22 +01:00
deavmi stopped working 2024-03-31 21:45:45 +01:00
2 minutes 24 seconds
deavmi started working 2024-03-31 21:46:32 +01:00
Author
Owner

What is this?

We want to add multi-module support which means that we should be able to:

  1. Import other modules
  2. Have the resolver scan other modules for references
  3. Do dependency generation across multiple modules
  4. The Parser should be able to cache the information on which modules have been parsed already as to not parse them again and cycle forever

For points 2 and 3 we should make use of the Program type which should contain the Module[] array.

Todo

Fixes

  • Fix all unit tests which spawn a parser and provide them with a valid instance of the Compiler object
    • This can be done probably by using the Compiler as it is used on the command line, therefore we won't have to do a lot of the manual work

Parser

  • Require (not just optional args) that a module file path is provided in Parser's parse(string path = "") call
  • Add support for multi-imports on one line (i.e. import <module1>, <module2>;)
  • Takes in a Compiler instance so we can access its utilities and most importantly its Program instance (need this for managing modules)
  • Require that the module's file name and name (declared in header as module <name>;) match
  • Add proper visitation and Module object tracking
    • Implemented
    • Mark the entry point Module as already-visited
  • We need to be able to add the module itself without any weird duplication.
    • We have a problem that if we don't have any cycles then the current mechanism does not work all too well as it never adds the entry point module itself.

ModuleManager

  • Implement all routines in a ModuleManager
  • Document
    • How it works (resolution)
    • The build aspect of -DDBG_MODMAN
  • Resolution
    • Resolve all local modules (with optional downwards descent)
    • Search path integration via search(...)
    • Absolute-based path resolution ("many names for same module")

Configuration

  • Decide on the default paths to search in, and ensure a ConfigEntry() is added for these when defaultConfig() is called
    • Current working directory
    • Standard system path
  • Document

Command-line

  • Add --paths which you can repeat and it tacks on to the search paths array
  • Allow specifying multiple modules on the command line
  • Document

Changesets

Below I show the tags one must look out for pertaining to big changes made within this branch ( Note: These are in chronological order):

  1. multimodule/changeset1
    • Last fixes to get multi-modular at least compiling for debug mode
  2. multimodule/changeset2
    • Last fixes to get unittests to compile

Require that the module's file name and name (declared in header as module ;) match

Working on this now, will make it disabled by default first though - just for now because it breaks unittests if enabledd by default

> ## What is this? > > We want to add multi-module support which means that we should be able to: > > 1. Import other modules > 2. Have the resolver scan other modules for references > 3. Do dependency generation across multiple modules > 4. The `Parser` should be able to cache the information on which modules have been parsed already as to not parse them again and cycle forever > > For points **2** and **3** we should make use of the `Program` type which should contain the `Module[]` array. > > ## Todo > > ### Fixes > > - [x] Fix all unit tests which spawn a parser and provide them with a valid instance of the `Compiler` object > * This can be done probably by using the `Compiler` as it is used on the command line, therefore we won't have to do a lot of the manual work > > ### Parser > > - [ ] **Require** (not just optional args) that a module file path is provided in `Parser`'s `parse(string path = "")` call > - [x] Add support for multi-imports on one line (i.e. `import <module1>, <module2>;`) > - [x] Takes in a `Compiler` instance so we can access its utilities and **most importantly** its `Program` instance (need this for managing modules) > - [ ] **Require** that the module's file name and name (declared in header as `module <name>;`) match > - [x] Add proper visitation and `Module` object tracking > - [x] Implemented > - [x] Mark the entry point `Module` as already-visited > - [x] ❗ We need to be able to add the module itself without any weird duplication. > * We have a problem that if we don't have any cycles then the current mechanism does not work all too well as it never adds the entry point module itself. > > > ### ModuleManager > > - [x] Implement all routines in a `ModuleManager` > - [ ] Document > - [x] How it works (resolution) > - [ ] The build aspect of `-DDBG_MODMAN` > - [ ] Resolution > - [x] Resolve all local modules (with optional downwards descent) > - [x] Search path integration via `search(...)` > - [ ] Absolute-based path resolution (_"many names for same module"_) > ### Configuration > > - [ ] Decide on the default paths to search in, and ensure a `ConfigEntry()` is added for these when `defaultConfig()` is called > - [ ] Current working directory > - [ ] Standard system path > - [ ] Document > > ### Command-line > > - [ ] Add `--paths` which you can repeat and it tacks on to the search paths array > - [ ] Allow specifying multiple modules on the command line > - [x] Document > > --- > > # Changesets > > Below I show the tags one must look out for pertaining to big changes made within this branch (**Note**: These are in chronological order): > > 1. `multimodule/changeset1` > * Last fixes to get multi-modular at least compiling for `debug` mode > 2. `multimodule/changeset2` > * Last fixes to get `unittests` to compile > Require that the module's file name and name (declared in header as module <name>;) match Working on this now, will make it disabled by default first though - just for now because it breaks unittests if enabledd by default
Author
Owner

What is this?

We want to add multi-module support which means that we should be able to:

  1. Import other modules
  2. Have the resolver scan other modules for references
  3. Do dependency generation across multiple modules
  4. The Parser should be able to cache the information on which modules have been parsed already as to not parse them again and cycle forever

For points 2 and 3 we should make use of the Program type which should contain the Module[] array.

Todo

Fixes

  • Fix all unit tests which spawn a parser and provide them with a valid instance of the Compiler object
    • This can be done probably by using the Compiler as it is used on the command line, therefore we won't have to do a lot of the manual work

Parser

  • Require (not just optional args) that a module file path is provided in Parser's parse(string path = "") call
  • Add support for multi-imports on one line (i.e. import <module1>, <module2>;)
  • Takes in a Compiler instance so we can access its utilities and most importantly its Program instance (need this for managing modules)
  • Require that the module's file name and name (declared in header as module <name>;) match
  • Add proper visitation and Module object tracking
    • Implemented
    • Mark the entry point Module as already-visited
  • We need to be able to add the module itself without any weird duplication.
    • We have a problem that if we don't have any cycles then the current mechanism does not work all too well as it never adds the entry point module itself.

ModuleManager

  • Implement all routines in a ModuleManager
  • Document
    • How it works (resolution)
    • The build aspect of -DDBG_MODMAN
  • Resolution
    • Resolve all local modules (with optional downwards descent)
    • Search path integration via search(...)
    • Absolute-based path resolution ("many names for same module")

Configuration

  • Decide on the default paths to search in, and ensure a ConfigEntry() is added for these when defaultConfig() is called
    • Current working directory
    • Standard system path
  • Document

Command-line

  • Add --paths which you can repeat and it tacks on to the search paths array
  • Allow specifying multiple modules on the command line
  • Document

Changesets

Below I show the tags one must look out for pertaining to big changes made within this branch ( Note: These are in chronological order):

  1. multimodule/changeset1
    • Last fixes to get multi-modular at least compiling for debug mode
  2. multimodule/changeset2
    • Last fixes to get unittests to compile

Require that the module's file name and name (declared in header as module ;) match

Working on this now, will make it disabled by default first though - just for now because it breaks unittests if enabledd by default

There are some unavoidable unittests that need fixing too now.

> > ## What is this? > > > > We want to add multi-module support which means that we should be able to: > > > > 1. Import other modules > > 2. Have the resolver scan other modules for references > > 3. Do dependency generation across multiple modules > > 4. The `Parser` should be able to cache the information on which modules have been parsed already as to not parse them again and cycle forever > > > > For points **2** and **3** we should make use of the `Program` type which should contain the `Module[]` array. > > > > ## Todo > > > > ### Fixes > > > > - [x] Fix all unit tests which spawn a parser and provide them with a valid instance of the `Compiler` object > > * This can be done probably by using the `Compiler` as it is used on the command line, therefore we won't have to do a lot of the manual work > > > > ### Parser > > > > - [ ] **Require** (not just optional args) that a module file path is provided in `Parser`'s `parse(string path = "")` call > > - [x] Add support for multi-imports on one line (i.e. `import <module1>, <module2>;`) > > - [x] Takes in a `Compiler` instance so we can access its utilities and **most importantly** its `Program` instance (need this for managing modules) > > - [ ] **Require** that the module's file name and name (declared in header as `module <name>;`) match > > - [x] Add proper visitation and `Module` object tracking > > - [x] Implemented > > - [x] Mark the entry point `Module` as already-visited > > - [x] ❗ We need to be able to add the module itself without any weird duplication. > > * We have a problem that if we don't have any cycles then the current mechanism does not work all too well as it never adds the entry point module itself. > > > > > > ### ModuleManager > > > > - [x] Implement all routines in a `ModuleManager` > > - [ ] Document > > - [x] How it works (resolution) > > - [ ] The build aspect of `-DDBG_MODMAN` > > - [ ] Resolution > > - [x] Resolve all local modules (with optional downwards descent) > > - [x] Search path integration via `search(...)` > > - [ ] Absolute-based path resolution (_"many names for same module"_) > > ### Configuration > > > > - [ ] Decide on the default paths to search in, and ensure a `ConfigEntry()` is added for these when `defaultConfig()` is called > > - [ ] Current working directory > > - [ ] Standard system path > > - [ ] Document > > > > ### Command-line > > > > - [ ] Add `--paths` which you can repeat and it tacks on to the search paths array > > - [ ] Allow specifying multiple modules on the command line > > - [x] Document > > > > --- > > > > # Changesets > > > > Below I show the tags one must look out for pertaining to big changes made within this branch (**Note**: These are in chronological order): > > > > 1. `multimodule/changeset1` > > * Last fixes to get multi-modular at least compiling for `debug` mode > > 2. `multimodule/changeset2` > > * Last fixes to get `unittests` to compile > > > > Require that the module's file name and name (declared in header as module <name>;) match > > Working on this now, will make it disabled by default first though - just for now because it breaks unittests if enabledd by default There are some unavoidable unittests that need fixing too now.
Author
Owner

Cleaned out two unused methods in modman.d

Cleaned out two unused methods in `modman.d`
Author
Owner

What is this?

We want to add multi-module support which means that we should be able to:

  1. Import other modules
  2. Have the resolver scan other modules for references
  3. Do dependency generation across multiple modules
  4. The Parser should be able to cache the information on which modules have been parsed already as to not parse them again and cycle forever

For points 2 and 3 we should make use of the Program type which should contain the Module[] array.

Todo

Fixes

  • Fix all unit tests which spawn a parser and provide them with a valid instance of the Compiler object
    • This can be done probably by using the Compiler as it is used on the command line, therefore we won't have to do a lot of the manual work

Parser

  • Require (not just optional args) that a module file path is provided in Parser's parse(string path = "") call
  • Add support for multi-imports on one line (i.e. import <module1>, <module2>;)
  • Takes in a Compiler instance so we can access its utilities and most importantly its Program instance (need this for managing modules)
  • Require that the module's file name and name (declared in header as module <name>;) match
  • Add proper visitation and Module object tracking
    • Implemented
    • Mark the entry point Module as already-visited
  • We need to be able to add the module itself without any weird duplication.
    • We have a problem that if we don't have any cycles then the current mechanism does not work all too well as it never adds the entry point module itself.

ModuleManager

  • Implement all routines in a ModuleManager
  • Document
    • How it works (resolution)
    • The build aspect of -DDBG_MODMAN
  • Resolution
    • Resolve all local modules (with optional downwards descent)
    • Search path integration via search(...)
    • Absolute-based path resolution ("many names for same module")

Configuration

  • Decide on the default paths to search in, and ensure a ConfigEntry() is added for these when defaultConfig() is called
    • Current working directory
    • Standard system path
  • Document

Command-line

  • Add --paths which you can repeat and it tacks on to the search paths array
  • Allow specifying multiple modules on the command line
  • Document

Changesets

Below I show the tags one must look out for pertaining to big changes made within this branch ( Note: These are in chronological order):

  1. multimodule/changeset1
    • Last fixes to get multi-modular at least compiling for debug mode
  2. multimodule/changeset2
    • Last fixes to get unittests to compile

Require that the module's file name and name (declared in header as module ;) match

Working on this now, will make it disabled by default first though - just for now because it breaks unittests if enabledd by default

There are some unavoidable unittests that need fixing too now.

Sorted out.

The comments tests are disabled for now because we don't yet associate comments with AST nodes (which is needed therefore). 🐤

But other tests was fixed which now uses a Compiler as intended

> > > ## What is this? > > > > > > We want to add multi-module support which means that we should be able to: > > > > > > 1. Import other modules > > > 2. Have the resolver scan other modules for references > > > 3. Do dependency generation across multiple modules > > > 4. The `Parser` should be able to cache the information on which modules have been parsed already as to not parse them again and cycle forever > > > > > > For points **2** and **3** we should make use of the `Program` type which should contain the `Module[]` array. > > > > > > ## Todo > > > > > > ### Fixes > > > > > > - [x] Fix all unit tests which spawn a parser and provide them with a valid instance of the `Compiler` object > > > * This can be done probably by using the `Compiler` as it is used on the command line, therefore we won't have to do a lot of the manual work > > > > > > ### Parser > > > > > > - [ ] **Require** (not just optional args) that a module file path is provided in `Parser`'s `parse(string path = "")` call > > > - [x] Add support for multi-imports on one line (i.e. `import <module1>, <module2>;`) > > > - [x] Takes in a `Compiler` instance so we can access its utilities and **most importantly** its `Program` instance (need this for managing modules) > > > - [ ] **Require** that the module's file name and name (declared in header as `module <name>;`) match > > > - [x] Add proper visitation and `Module` object tracking > > > - [x] Implemented > > > - [x] Mark the entry point `Module` as already-visited > > > - [x] ❗ We need to be able to add the module itself without any weird duplication. > > > * We have a problem that if we don't have any cycles then the current mechanism does not work all too well as it never adds the entry point module itself. > > > > > > > > > ### ModuleManager > > > > > > - [x] Implement all routines in a `ModuleManager` > > > - [ ] Document > > > - [x] How it works (resolution) > > > - [ ] The build aspect of `-DDBG_MODMAN` > > > - [ ] Resolution > > > - [x] Resolve all local modules (with optional downwards descent) > > > - [x] Search path integration via `search(...)` > > > - [ ] Absolute-based path resolution (_"many names for same module"_) > > > ### Configuration > > > > > > - [ ] Decide on the default paths to search in, and ensure a `ConfigEntry()` is added for these when `defaultConfig()` is called > > > - [ ] Current working directory > > > - [ ] Standard system path > > > - [ ] Document > > > > > > ### Command-line > > > > > > - [ ] Add `--paths` which you can repeat and it tacks on to the search paths array > > > - [ ] Allow specifying multiple modules on the command line > > > - [x] Document > > > > > > --- > > > > > > # Changesets > > > > > > Below I show the tags one must look out for pertaining to big changes made within this branch (**Note**: These are in chronological order): > > > > > > 1. `multimodule/changeset1` > > > * Last fixes to get multi-modular at least compiling for `debug` mode > > > 2. `multimodule/changeset2` > > > * Last fixes to get `unittests` to compile > > > > > > > Require that the module's file name and name (declared in header as module <name>;) match > > > > Working on this now, will make it disabled by default first though - just for now because it breaks unittests if enabledd by default > > There are some unavoidable unittests that need fixing too now. Sorted out. The comments tests are disabled for now because we don't yet associate comments with AST nodes (which is needed therefore). 🐤 But other tests was fixed which now uses a `Compiler` as intended ✅
Author
Owner

Require that the module's file name and name (declared in header as module ;) match

This is now done ✅ 
>Require that the module's file name and name (declared in header as module <name>;) match This is now done ✅
Author
Owner

What is this?

We want to add multi-module support which means that we should be able to:

  1. Import other modules
  2. Have the resolver scan other modules for references
  3. Do dependency generation across multiple modules
  4. The Parser should be able to cache the information on which modules have been parsed already as to not parse them again and cycle forever

For points 2 and 3 we should make use of the Program type which should contain the Module[] array.

Todo

Fixes

  • Fix all unit tests which spawn a parser and provide them with a valid instance of the Compiler object
    • This can be done probably by using the Compiler as it is used on the command line, therefore we won't have to do a lot of the manual work

Parser

  • Require (not just optional args) that a module file path is provided in Parser's parse(string path = "") call
  • Add support for multi-imports on one line (i.e. import <module1>, <module2>;)
  • Takes in a Compiler instance so we can access its utilities and most importantly its Program instance (need this for managing modules)
  • Require that the module's file name and name (declared in header as module <name>;) match
  • Add proper visitation and Module object tracking
    • Implemented
    • Mark the entry point Module as already-visited
  • We need to be able to add the module itself without any weird duplication.
    • We have a problem that if we don't have any cycles then the current mechanism does not work all too well as it never adds the entry point module itself.

ModuleManager

  • Implement all routines in a ModuleManager
  • Document
    • How it works (resolution)
    • The build aspect of -DDBG_MODMAN
  • Resolution
    • Resolve all local modules (with optional downwards descent)
    • Search path integration via search(...)
    • Absolute-based path resolution ("many names for same module")

Configuration

  • Decide on the default paths to search in, and ensure a ConfigEntry() is added for these when defaultConfig() is called
    • Current working directory
    • Standard system path
  • Document

Command-line

  • Add --paths which you can repeat and it tacks on to the search paths array
  • Allow specifying multiple modules on the command line
  • Document

Changesets

Below I show the tags one must look out for pertaining to big changes made within this branch ( Note: These are in chronological order):

  1. multimodule/changeset1
    • Last fixes to get multi-modular at least compiling for debug mode
  2. multimodule/changeset2
    • Last fixes to get unittests to compile

Require (not just optional args) that a module file path is provided in Parser's parse(string path = "") call

This is now done

> ## What is this? > > We want to add multi-module support which means that we should be able to: > > 1. Import other modules > 2. Have the resolver scan other modules for references > 3. Do dependency generation across multiple modules > 4. The `Parser` should be able to cache the information on which modules have been parsed already as to not parse them again and cycle forever > > For points **2** and **3** we should make use of the `Program` type which should contain the `Module[]` array. > > ## Todo > > ### Fixes > > - [x] Fix all unit tests which spawn a parser and provide them with a valid instance of the `Compiler` object > * This can be done probably by using the `Compiler` as it is used on the command line, therefore we won't have to do a lot of the manual work > > ### Parser > > - [ ] **Require** (not just optional args) that a module file path is provided in `Parser`'s `parse(string path = "")` call > - [x] Add support for multi-imports on one line (i.e. `import <module1>, <module2>;`) > - [x] Takes in a `Compiler` instance so we can access its utilities and **most importantly** its `Program` instance (need this for managing modules) > - [x] **Require** that the module's file name and name (declared in header as `module <name>;`) match > - [x] Add proper visitation and `Module` object tracking > - [x] Implemented > - [x] Mark the entry point `Module` as already-visited > - [x] ❗ We need to be able to add the module itself without any weird duplication. > * We have a problem that if we don't have any cycles then the current mechanism does not work all too well as it never adds the entry point module itself. > > > ### ModuleManager > > - [x] Implement all routines in a `ModuleManager` > - [ ] Document > - [x] How it works (resolution) > - [ ] The build aspect of `-DDBG_MODMAN` > - [ ] Resolution > - [x] Resolve all local modules (with optional downwards descent) > - [x] Search path integration via `search(...)` > - [ ] Absolute-based path resolution (_"many names for same module"_) > ### Configuration > > - [ ] Decide on the default paths to search in, and ensure a `ConfigEntry()` is added for these when `defaultConfig()` is called > - [ ] Current working directory > - [ ] Standard system path > - [ ] Document > > ### Command-line > > - [ ] Add `--paths` which you can repeat and it tacks on to the search paths array > - [ ] Allow specifying multiple modules on the command line > - [x] Document > > --- > > # Changesets > > Below I show the tags one must look out for pertaining to big changes made within this branch (**Note**: These are in chronological order): > > 1. `multimodule/changeset1` > * Last fixes to get multi-modular at least compiling for `debug` mode > 2. `multimodule/changeset2` > * Last fixes to get `unittests` to compile >Require (not just optional args) that a module file path is provided in Parser's parse(string path = "") call This is now done ✅
Author
Owner

Last few things

  • Document language usage
  • Document config options
  • Document --paths
  • Document the parser implementation

Last bugs 🐞

  • Do not give up to early when searching directories

As we can see below when we added /usr/lib to the search path then it errored on the first try of not being able to find a niks/ in there (presumably for niks/c.t):

[INFO] Request to find module 'c' in directories: ["/usr/lib/niks/", "/home/deavmi/Documents/Projects/t/code/source/tlang/testing/modules/niks/"]
[ERROR] /usr/lib/niks/: No such file or directory
255
### Last few things - [x] Document language _usage_ - [x] Document config options - [x] Document `--paths` - [x] Document the _parser implementation_ ### Last bugs 🐞 - [x] Do not give up to early when searching directories As we can see below when we added `/usr/lib` to the search path then it errored on the first try of not being able to find a `niks/` in there (presumably for `niks/c.t`): ``` [INFO] Request to find module 'c' in directories: ["/usr/lib/niks/", "/home/deavmi/Documents/Projects/t/code/source/tlang/testing/modules/niks/"] [ERROR] /usr/lib/niks/: No such file or directory 255 ```
deavmi stopped working 2024-03-31 22:47:17 +01:00
1 hour
deavmi added spent time 2024-03-31 23:02:42 +01:00
10 minutes
deavmi started working 2024-03-31 23:02:59 +01:00
deavmi stopped working 2024-04-01 12:15:09 +01:00
13 hours 12 minutes
deavmi started working 2024-04-01 12:15:53 +01:00
Author
Owner

Last few things

  • Document language usage
  • Document config options
  • Document --paths
  • Document the parser implementation

Last bugs 🐞

  • Do not give up to early when searching directories

As we can see below when we added /usr/lib to the search path then it errored on the first try of not being able to find a niks/ in there (presumably for niks/c.t):

[INFO] Request to find module 'c' in directories: ["/usr/lib/niks/", "/home/deavmi/Documents/Projects/t/code/source/tlang/testing/modules/niks/"]
[ERROR] /usr/lib/niks/: No such file or directory
255

Do not give up to early when searching directories

This will actually require a rework of some of the code in the module manager, so I need to work on this today.

> ### Last few things > > - [ ] Document language _usage_ > - [x] Document config options > - [ ] Document `--paths` > - [ ] Document the _parser implementation_ > > ### Last bugs 🐞 > > - [ ] Do not give up to early when searching directories > > As we can see below when we added `/usr/lib` to the search path then it errored on the first try of not being able to find a `niks/` in there (presumably for `niks/c.t`): > > ``` > [INFO] Request to find module 'c' in directories: ["/usr/lib/niks/", "/home/deavmi/Documents/Projects/t/code/source/tlang/testing/modules/niks/"] > [ERROR] /usr/lib/niks/: No such file or directory > 255 > ``` >Do not give up to early when searching directories This will actually require a rework of some of the code in the module manager, so I need to work on this today.
Author
Owner

Last few things

  • Document language usage
  • Document config options
  • Document --paths
  • Document the parser implementation

Last bugs 🐞

  • Do not give up to early when searching directories

As we can see below when we added /usr/lib to the search path then it errored on the first try of not being able to find a niks/ in there (presumably for niks/c.t):

[INFO] Request to find module 'c' in directories: ["/usr/lib/niks/", "/home/deavmi/Documents/Projects/t/code/source/tlang/testing/modules/niks/"]
[ERROR] /usr/lib/niks/: No such file or directory
255

Do not give up to early when searching directories

This will actually require a rework of some of the code in the module manager, so I need to work on this today.

Wait no it is fine me thinks?

> > ### Last few things > > > > - [ ] Document language _usage_ > > - [x] Document config options > > - [ ] Document `--paths` > > - [ ] Document the _parser implementation_ > > > > ### Last bugs 🐞 > > > > - [ ] Do not give up to early when searching directories > > > > As we can see below when we added `/usr/lib` to the search path then it errored on the first try of not being able to find a `niks/` in there (presumably for `niks/c.t`): > > > > ``` > > [INFO] Request to find module 'c' in directories: ["/usr/lib/niks/", "/home/deavmi/Documents/Projects/t/code/source/tlang/testing/modules/niks/"] > > [ERROR] /usr/lib/niks/: No such file or directory > > 255 > > ``` > > >Do not give up to early when searching directories > > This will actually require a rework of some of the code in the module manager, so I need to work on this today. Wait no it is fine me thinks?
Author
Owner

Last few things

  • Document language usage
  • Document config options
  • Document --paths
  • Document the parser implementation

Last bugs 🐞

  • Do not give up to early when searching directories

As we can see below when we added /usr/lib to the search path then it errored on the first try of not being able to find a niks/ in there (presumably for niks/c.t):

[INFO] Request to find module 'c' in directories: ["/usr/lib/niks/", "/home/deavmi/Documents/Projects/t/code/source/tlang/testing/modules/niks/"]
[ERROR] /usr/lib/niks/: No such file or directory
255

Do not give up to early when searching directories

This will actually require a rework of some of the code in the module manager, so I need to work on this today.

Wait no it is fine me thinks?

Actually no, we do need to do this it seems. Just been busy sorting out adding support for --paths on the command-line.

> > > ### Last few things > > > > > > - [ ] Document language _usage_ > > > - [x] Document config options > > > - [ ] Document `--paths` > > > - [ ] Document the _parser implementation_ > > > > > > ### Last bugs 🐞 > > > > > > - [ ] Do not give up to early when searching directories > > > > > > As we can see below when we added `/usr/lib` to the search path then it errored on the first try of not being able to find a `niks/` in there (presumably for `niks/c.t`): > > > > > > ``` > > > [INFO] Request to find module 'c' in directories: ["/usr/lib/niks/", "/home/deavmi/Documents/Projects/t/code/source/tlang/testing/modules/niks/"] > > > [ERROR] /usr/lib/niks/: No such file or directory > > > 255 > > > ``` > > > > >Do not give up to early when searching directories > > > > This will actually require a rework of some of the code in the module manager, so I need to work on this today. > > Wait no it is fine me thinks? Actually no, we do need to do this it seems. Just been busy sorting out adding support for `--paths` on the command-line.
Author
Owner

Last few things

  • Document language usage
  • Document config options
  • Document --paths
  • Document the parser implementation

Last bugs 🐞

  • Do not give up to early when searching directories

As we can see below when we added /usr/lib to the search path then it errored on the first try of not being able to find a niks/ in there (presumably for niks/c.t):

[INFO] Request to find module 'c' in directories: ["/usr/lib/niks/", "/home/deavmi/Documents/Projects/t/code/source/tlang/testing/modules/niks/"]
[ERROR] /usr/lib/niks/: No such file or directory
255

Do not give up to early when searching directories

This will actually require a rework of some of the code in the module manager, so I need to work on this today.

Wait no it is fine me thinks?

Actually no, we do need to do this it seems. Just been busy sorting out adding support for --paths on the command-line.

Found the error. It was the findAllTFilesShallow(string) which called dirEntries(string) without firstly checking if such a path was valid on the file system or, if so, if it even is a directory

> > > > ### Last few things > > > > > > > > - [ ] Document language _usage_ > > > > - [x] Document config options > > > > - [ ] Document `--paths` > > > > - [ ] Document the _parser implementation_ > > > > > > > > ### Last bugs 🐞 > > > > > > > > - [ ] Do not give up to early when searching directories > > > > > > > > As we can see below when we added `/usr/lib` to the search path then it errored on the first try of not being able to find a `niks/` in there (presumably for `niks/c.t`): > > > > > > > > ``` > > > > [INFO] Request to find module 'c' in directories: ["/usr/lib/niks/", "/home/deavmi/Documents/Projects/t/code/source/tlang/testing/modules/niks/"] > > > > [ERROR] /usr/lib/niks/: No such file or directory > > > > 255 > > > > ``` > > > > > > >Do not give up to early when searching directories > > > > > > This will actually require a rework of some of the code in the module manager, so I need to work on this today. > > > > Wait no it is fine me thinks? > > Actually no, we do need to do this it seems. Just been busy sorting out adding support for `--paths` on the command-line. Found the error. It was the `findAllTFilesShallow(string)` which called `dirEntries(string)` without firstly checking if such a path was valid on the file system or, if so, if it even **is** a directory
Author
Owner

Last few things

  • Document language usage
  • Document config options
  • Document --paths
  • Document the parser implementation

Last bugs 🐞

  • Do not give up to early when searching directories

As we can see below when we added /usr/lib to the search path then it errored on the first try of not being able to find a niks/ in there (presumably for niks/c.t):

[INFO] Request to find module 'c' in directories: ["/usr/lib/niks/", "/home/deavmi/Documents/Projects/t/code/source/tlang/testing/modules/niks/"]
[ERROR] /usr/lib/niks/: No such file or directory
255

Do not give up to early when searching directories

This will actually require a rework of some of the code in the module manager, so I need to work on this today.

Wait no it is fine me thinks?

Actually no, we do need to do this it seems. Just been busy sorting out adding support for --paths on the command-line.

Found the error. It was the findAllTFilesShallow(string) which called dirEntries(string) without firstly checking if such a path was valid on the file system or, if so, if it even is a directory

This bug has been fixed

> > > > > ### Last few things > > > > > > > > > > - [ ] Document language _usage_ > > > > > - [x] Document config options > > > > > - [ ] Document `--paths` > > > > > - [ ] Document the _parser implementation_ > > > > > > > > > > ### Last bugs 🐞 > > > > > > > > > > - [ ] Do not give up to early when searching directories > > > > > > > > > > As we can see below when we added `/usr/lib` to the search path then it errored on the first try of not being able to find a `niks/` in there (presumably for `niks/c.t`): > > > > > > > > > > ``` > > > > > [INFO] Request to find module 'c' in directories: ["/usr/lib/niks/", "/home/deavmi/Documents/Projects/t/code/source/tlang/testing/modules/niks/"] > > > > > [ERROR] /usr/lib/niks/: No such file or directory > > > > > 255 > > > > > ``` > > > > > > > > >Do not give up to early when searching directories > > > > > > > > This will actually require a rework of some of the code in the module manager, so I need to work on this today. > > > > > > Wait no it is fine me thinks? > > > > Actually no, we do need to do this it seems. Just been busy sorting out adding support for `--paths` on the command-line. > > Found the error. It was the `findAllTFilesShallow(string)` which called `dirEntries(string)` without firstly checking if such a path was valid on the file system or, if so, if it even **is** a directory This bug has been fixed ✅
Author
Owner

Last few things

  • Document language usage
  • Document config options
  • Document --paths
  • Document the parser implementation

Last bugs 🐞

  • Do not give up to early when searching directories

As we can see below when we added /usr/lib to the search path then it errored on the first try of not being able to find a niks/ in there (presumably for niks/c.t):

[INFO] Request to find module 'c' in directories: ["/usr/lib/niks/", "/home/deavmi/Documents/Projects/t/code/source/tlang/testing/modules/niks/"]
[ERROR] /usr/lib/niks/: No such file or directory
255

Do not give up to early when searching directories

This will actually require a rework of some of the code in the module manager, so I need to work on this today.

Wait no it is fine me thinks?

Actually no, we do need to do this it seems. Just been busy sorting out adding support for --paths on the command-line.

Found the error. It was the findAllTFilesShallow(string) which called dirEntries(string) without firstly checking if such a path was valid on the file system or, if so, if it even is a directory

This bug has been fixed

I lie, it kinda is fine but validation needs the same fix

> > > > > > ### Last few things > > > > > > > > > > > > - [ ] Document language _usage_ > > > > > > - [x] Document config options > > > > > > - [ ] Document `--paths` > > > > > > - [ ] Document the _parser implementation_ > > > > > > > > > > > > ### Last bugs 🐞 > > > > > > > > > > > > - [ ] Do not give up to early when searching directories > > > > > > > > > > > > As we can see below when we added `/usr/lib` to the search path then it errored on the first try of not being able to find a `niks/` in there (presumably for `niks/c.t`): > > > > > > > > > > > > ``` > > > > > > [INFO] Request to find module 'c' in directories: ["/usr/lib/niks/", "/home/deavmi/Documents/Projects/t/code/source/tlang/testing/modules/niks/"] > > > > > > [ERROR] /usr/lib/niks/: No such file or directory > > > > > > 255 > > > > > > ``` > > > > > > > > > > >Do not give up to early when searching directories > > > > > > > > > > This will actually require a rework of some of the code in the module manager, so I need to work on this today. > > > > > > > > Wait no it is fine me thinks? > > > > > > Actually no, we do need to do this it seems. Just been busy sorting out adding support for `--paths` on the command-line. > > > > Found the error. It was the `findAllTFilesShallow(string)` which called `dirEntries(string)` without firstly checking if such a path was valid on the file system or, if so, if it even **is** a directory > > This bug has been fixed ✅ I lie, it kinda is fine but validation needs the same fix
Author
Owner

Last few things

  • Document language usage
  • Document config options
  • Document --paths
  • Document the parser implementation

Last bugs 🐞

  • Do not give up to early when searching directories

As we can see below when we added /usr/lib to the search path then it errored on the first try of not being able to find a niks/ in there (presumably for niks/c.t):

[INFO] Request to find module 'c' in directories: ["/usr/lib/niks/", "/home/deavmi/Documents/Projects/t/code/source/tlang/testing/modules/niks/"]
[ERROR] /usr/lib/niks/: No such file or directory
255

Do not give up to early when searching directories

This will actually require a rework of some of the code in the module manager, so I need to work on this today.

Wait no it is fine me thinks?

Actually no, we do need to do this it seems. Just been busy sorting out adding support for --paths on the command-line.

Found the error. It was the findAllTFilesShallow(string) which called dirEntries(string) without firstly checking if such a path was valid on the file system or, if so, if it even is a directory

This bug has been fixed

I lie, it kinda is fine but validation needs the same fix

Yes, so find shallow is a silent failure as it needed to check if something could exist before enumerating files in such a directory, validation - rather - has to do with the starting path - if an initial path passed on the --paths command-line flag is valid to start with.

> > > > > > > ### Last few things > > > > > > > > > > > > > > - [ ] Document language _usage_ > > > > > > > - [x] Document config options > > > > > > > - [ ] Document `--paths` > > > > > > > - [ ] Document the _parser implementation_ > > > > > > > > > > > > > > ### Last bugs 🐞 > > > > > > > > > > > > > > - [ ] Do not give up to early when searching directories > > > > > > > > > > > > > > As we can see below when we added `/usr/lib` to the search path then it errored on the first try of not being able to find a `niks/` in there (presumably for `niks/c.t`): > > > > > > > > > > > > > > ``` > > > > > > > [INFO] Request to find module 'c' in directories: ["/usr/lib/niks/", "/home/deavmi/Documents/Projects/t/code/source/tlang/testing/modules/niks/"] > > > > > > > [ERROR] /usr/lib/niks/: No such file or directory > > > > > > > 255 > > > > > > > ``` > > > > > > > > > > > > >Do not give up to early when searching directories > > > > > > > > > > > > This will actually require a rework of some of the code in the module manager, so I need to work on this today. > > > > > > > > > > Wait no it is fine me thinks? > > > > > > > > Actually no, we do need to do this it seems. Just been busy sorting out adding support for `--paths` on the command-line. > > > > > > Found the error. It was the `findAllTFilesShallow(string)` which called `dirEntries(string)` without firstly checking if such a path was valid on the file system or, if so, if it even **is** a directory > > > > This bug has been fixed ✅ > > I lie, it kinda is fine but validation needs the same fix Yes, so find shallow is a silent failure as it needed to check if something could exist before enumerating files in such a directory, validation - rather - has to do with the starting path - if an initial path passed on the `--paths` command-line flag is valid to start with.
Author
Owner

Last few things

  • Document language usage
  • Document config options
  • Document --paths
  • Document the parser implementation

Last bugs 🐞

  • Do not give up to early when searching directories

As we can see below when we added /usr/lib to the search path then it errored on the first try of not being able to find a niks/ in there (presumably for niks/c.t):

[INFO] Request to find module 'c' in directories: ["/usr/lib/niks/", "/home/deavmi/Documents/Projects/t/code/source/tlang/testing/modules/niks/"]
[ERROR] /usr/lib/niks/: No such file or directory
255

Do not give up to early when searching directories

This will actually require a rework of some of the code in the module manager, so I need to work on this today.

Wait no it is fine me thinks?

Actually no, we do need to do this it seems. Just been busy sorting out adding support for --paths on the command-line.

Found the error. It was the findAllTFilesShallow(string) which called dirEntries(string) without firstly checking if such a path was valid on the file system or, if so, if it even is a directory

This bug has been fixed

I lie, it kinda is fine but validation needs the same fix

Yes, so find shallow is a silent failure as it needed to check if something could exist before enumerating files in such a directory, validation - rather - has to do with the starting path - if an initial path passed on the --paths command-line flag is valid to start with.

Fixed

> > > > > > > > ### Last few things > > > > > > > > > > > > > > > > - [ ] Document language _usage_ > > > > > > > > - [x] Document config options > > > > > > > > - [ ] Document `--paths` > > > > > > > > - [ ] Document the _parser implementation_ > > > > > > > > > > > > > > > > ### Last bugs 🐞 > > > > > > > > > > > > > > > > - [ ] Do not give up to early when searching directories > > > > > > > > > > > > > > > > As we can see below when we added `/usr/lib` to the search path then it errored on the first try of not being able to find a `niks/` in there (presumably for `niks/c.t`): > > > > > > > > > > > > > > > > ``` > > > > > > > > [INFO] Request to find module 'c' in directories: ["/usr/lib/niks/", "/home/deavmi/Documents/Projects/t/code/source/tlang/testing/modules/niks/"] > > > > > > > > [ERROR] /usr/lib/niks/: No such file or directory > > > > > > > > 255 > > > > > > > > ``` > > > > > > > > > > > > > > >Do not give up to early when searching directories > > > > > > > > > > > > > > This will actually require a rework of some of the code in the module manager, so I need to work on this today. > > > > > > > > > > > > Wait no it is fine me thinks? > > > > > > > > > > Actually no, we do need to do this it seems. Just been busy sorting out adding support for `--paths` on the command-line. > > > > > > > > Found the error. It was the `findAllTFilesShallow(string)` which called `dirEntries(string)` without firstly checking if such a path was valid on the file system or, if so, if it even **is** a directory > > > > > > This bug has been fixed ✅ > > > > I lie, it kinda is fine but validation needs the same fix > > Yes, so find shallow is a silent failure as it needed to check if something could exist before enumerating files in such a directory, validation - rather - has to do with the starting path - if an initial path passed on the `--paths` command-line flag is valid to start with. Fixed ✅
deavmi stopped working 2024-04-01 13:03:02 +01:00
47 minutes 9 seconds
deavmi started working 2024-04-01 16:04:34 +01:00
Author
Owner

Everything is done

Everything is done ✅
deavmi stopped working 2024-04-01 16:08:45 +01:00
4 minutes 11 seconds
Author
Owner

Not just yet done, few more things.

Not just yet done, few more things.
deavmi started working 2024-04-01 16:16:33 +01:00
Author
Owner

Last few things

  • Document language usage
  • Document config options
  • Document --paths
  • Document the parser implementation

Last bugs 🐞

  • Do not give up to early when searching directories

As we can see below when we added /usr/lib to the search path then it errored on the first try of not being able to find a niks/ in there (presumably for niks/c.t):

[INFO] Request to find module 'c' in directories: ["/usr/lib/niks/", "/home/deavmi/Documents/Projects/t/code/source/tlang/testing/modules/niks/"]
[ERROR] /usr/lib/niks/: No such file or directory
255

Document language usage

Done

> ### Last few things > > - [x] Document language _usage_ > - [x] Document config options > - [x] Document `--paths` > - [ ] Document the _parser implementation_ > > ### Last bugs 🐞 > > - [x] Do not give up to early when searching directories > > As we can see below when we added `/usr/lib` to the search path then it errored on the first try of not being able to find a `niks/` in there (presumably for `niks/c.t`): > > ``` > [INFO] Request to find module 'c' in directories: ["/usr/lib/niks/", "/home/deavmi/Documents/Projects/t/code/source/tlang/testing/modules/niks/"] > [ERROR] /usr/lib/niks/: No such file or directory > 255 > ``` >Document language usage Done ✅
deavmi removed the due date 2024-05-12 2024-04-01 16:26:53 +01:00
deavmi added the due date 2024-04-05 2024-04-01 16:27:09 +01:00
deavmi stopped working 2024-04-01 16:27:22 +01:00
10 minutes 49 seconds
deavmi started working 2024-04-01 18:23:51 +01:00
Author
Owner

Just finished the parser docs

Just finished the parser docs ✅
Author
Owner

Last few things

  • Document language usage
  • Document config options
  • Document --paths
  • Document the parser implementation

Last bugs 🐞

  • Do not give up to early when searching directories

As we can see below when we added /usr/lib to the search path then it errored on the first try of not being able to find a niks/ in there (presumably for niks/c.t):

[INFO] Request to find module 'c' in directories: ["/usr/lib/niks/", "/home/deavmi/Documents/Projects/t/code/source/tlang/testing/modules/niks/"]
[ERROR] /usr/lib/niks/: No such file or directory
255

Everything here is now done

> ### Last few things > > - [x] Document language _usage_ > - [x] Document config options > - [x] Document `--paths` > - [ ] Document the _parser implementation_ > > ### Last bugs 🐞 > > - [x] Do not give up to early when searching directories > > As we can see below when we added `/usr/lib` to the search path then it errored on the first try of not being able to find a `niks/` in there (presumably for `niks/c.t`): > > ``` > [INFO] Request to find module 'c' in directories: ["/usr/lib/niks/", "/home/deavmi/Documents/Projects/t/code/source/tlang/testing/modules/niks/"] > [ERROR] /usr/lib/niks/: No such file or directory > 255 > ``` Everything here is now done ✅
deavmi stopped working 2024-04-01 19:57:43 +01:00
1 hour 33 minutes
Author
Owner

Okay there are a few more things to work on maybe,.... but these are low priority, so I can stop working on this PR for now at least


Last few things

  • DGen to emit extern variables (not just functions)
  • All extern-like statements must become automatically private. This will stop them from being accessible outside to other modules which would cause them to get double externed. I mean, is that a problem. We could maybe handle it. But maybe not for now? #168
  • Fix merge conflicts from vardec_varass_dependency
Okay there are a few more things to work on maybe,.... but these are low priority, so I can stop working on this PR for now at least --- ### Last few things - [x] `DGen` to emit extern variables (not **just** functions) - [x] All `extern`-like statements must become automatically `private`. This will stop them from being accessible outside to other modules which would cause them to get double externed. I mean, is that a problem. We could _maybe_ handle it. But maybe not for now? #168 - [x] Fix merge conflicts from `vardec_varass_dependency`
deavmi started working 2024-04-01 21:00:00 +01:00
Author
Owner

Dgen

  • Added generateSignature_Variable(Variable var) which generates JUST a variable signature (with symbol mapping)
  • emitExterns(File modOut, Module mod) now also generates extern statements for global variables
Dgen - Added `generateSignature_Variable(Variable var)` which generates JUST a variable signature (with symbol mapping) - `emitExterns(File modOut, Module mod)` now also generates extern statements for global variables
Author
Owner

We should make all extern evar/efunc statements simply private so that nobody can have them as something to export.

We should make all `extern evar/efunc` statements simply `private` so that nobody can have them as something to export.
deavmi stopped working 2024-04-01 21:26:18 +01:00
26 minutes 18 seconds
deavmi started working 2024-04-01 21:27:31 +01:00
deavmi pinned this 2024-04-01 21:28:21 +01:00
deavmi stopped working 2024-04-01 21:28:29 +01:00
58 seconds
deavmi started working 2024-04-07 11:05:40 +01:00
deavmi modified the due date from 2024-04-05 to 2024-04-30 2024-04-07 11:06:11 +01:00
Author
Owner

Busy sorting out merge conflicts now...

Busy sorting out merge conflicts now...
Author
Owner

Busy sorting out merge conflicts now...

All synced up, pushed
Local unittests pass

> Busy sorting out merge conflicts now... All synced up, pushed ✅ Local unittests pass ✅
Author
Owner

Cleaned up symbol mapping modules.

Cleaned up symbol mapping modules.
Author
Owner

Okay there are a few more things to work on maybe,.... but these are low priority, so I can stop working on this PR for now at least


Last few things

  • DGen to emit extern variables (not just functions)
  • All extern-like statements must become automatically private. This will stop them from being accessible outside to other modules which would cause them to get double externed. I mean, is that a problem. We could maybe handle it. But maybe not for now? #168
  • Fix merge conflicts from vardec_varass_dependency

With regards to the second item in this list I think it actually may not require much work to get right. Look when we generate the externs for module import system we do so by placing extern <type> <name>, where <name> is the Entity's name regardless of whether it isExternal() or not.

Hence it should just work. The only part we must worry about is that we must NOT symbol map the Entity's (Variables) which are extern.


So basically this:

string signature;

// Extract the Variable's type
Type varType = typeChecker.getType(var.context.container, var.getType());

// Decide on the symbol's name
string symbolName;

// If it is NOT extern then map it
if(!var.isExternal())
{
	// FIXME: Set proper scope type
    symbolName = mapper.map(var, ScopeType.GLOBAL);
}
// If it is extern, then leave it as such
else
{
	symbolName = var.getName()
}

// <type> <name>
signature = typeTransform(varType)~" "~symbolName;

return signature;
> Okay there are a few more things to work on maybe,.... but these are low priority, so I can stop working on this PR for now at least > > --- > > ### Last few things > > - [x] `DGen` to emit extern variables (not **just** functions) > - [ ] All `extern`-like statements must become automatically `private`. This will stop them from being accessible outside to other modules which would cause them to get double externed. I mean, is that a problem. We could _maybe_ handle it. But maybe not for now? #168 > - [x] Fix merge conflicts from `vardec_varass_dependency` With regards to the second item in this list I think it actually _may_ not require much work to get right. Look when we generate the externs for module import system we do so by placing `extern <type> <name>`, where `<name>` is the `Entity`'s name regardless of whether it `isExternal()` or not. Hence it _should_ just work. The only part we must worry about is that we must **NOT** symbol map the `Entity`'s (`Variable`s) which **are extern**. --- So basically this: ```d string signature; // Extract the Variable's type Type varType = typeChecker.getType(var.context.container, var.getType()); // Decide on the symbol's name string symbolName; // If it is NOT extern then map it if(!var.isExternal()) { // FIXME: Set proper scope type symbolName = mapper.map(var, ScopeType.GLOBAL); } // If it is extern, then leave it as such else { symbolName = var.getName() } // <type> <name> signature = typeTransform(varType)~" "~symbolName; return signature; ```
Author
Owner

Okay there are a few more things to work on maybe,.... but these are low priority, so I can stop working on this PR for now at least


Last few things

  • DGen to emit extern variables (not just functions)
  • All extern-like statements must become automatically private. This will stop them from being accessible outside to other modules which would cause them to get double externed. I mean, is that a problem. We could maybe handle it. But maybe not for now? #168
  • Fix merge conflicts from vardec_varass_dependency

With regards to the second item in this list I think it actually may not require much work to get right. Look when we generate the externs for module import system we do so by placing extern <type> <name>, where <name> is the Entity's name regardless of whether it isExternal() or not.

Hence it should just work. The only part we must worry about is that we must NOT symbol map the Entity's (Variables) which are extern.


So basically this:

string signature;

// Extract the Variable's type
Type varType = typeChecker.getType(var.context.container, var.getType());

// Decide on the symbol's name
string symbolName;

// If it is NOT extern then map it
if(!var.isExternal())
{
	// FIXME: Set proper scope type
    symbolName = mapper.map(var, ScopeType.GLOBAL);
}
// If it is extern, then leave it as such
else
{
	symbolName = var.getName()
}

// <type> <name>
signature = typeTransform(varType)~" "~symbolName;

return signature;

Okay but wait, this is fine and all but technically if we request a signature for a variable then it should also place the extern in front of it.

This is where the problemo lies. Who's resposibility. I say this because the function siganture generator does this and therefore, to stay consistent, so should the Variable-based one.

So:

// If if is external then it needs `extern ...`
if(var.isExternal())
{
    signature = "extern "~signature;
}
> > Okay there are a few more things to work on maybe,.... but these are low priority, so I can stop working on this PR for now at least > > > > --- > > > > ### Last few things > > > > - [x] `DGen` to emit extern variables (not **just** functions) > > - [ ] All `extern`-like statements must become automatically `private`. This will stop them from being accessible outside to other modules which would cause them to get double externed. I mean, is that a problem. We could _maybe_ handle it. But maybe not for now? #168 > > - [x] Fix merge conflicts from `vardec_varass_dependency` > > With regards to the second item in this list I think it actually _may_ not require much work to get right. Look when we generate the externs for module import system we do so by placing `extern <type> <name>`, where `<name>` is the `Entity`'s name regardless of whether it `isExternal()` or not. > > Hence it _should_ just work. The only part we must worry about is that we must **NOT** symbol map the `Entity`'s (`Variable`s) which **are extern**. > > --- > > So basically this: > > ```d > string signature; > > // Extract the Variable's type > Type varType = typeChecker.getType(var.context.container, var.getType()); > > // Decide on the symbol's name > string symbolName; > > // If it is NOT extern then map it > if(!var.isExternal()) > { > // FIXME: Set proper scope type > symbolName = mapper.map(var, ScopeType.GLOBAL); > } > // If it is extern, then leave it as such > else > { > symbolName = var.getName() > } > > // <type> <name> > signature = typeTransform(varType)~" "~symbolName; > > return signature; > ``` Okay but wait, this _is_ fine and all but technically if we request a signature for a `variable` then it _should_ also place the `extern` in front of it. This is where the problemo lies. Who's resposibility. I say this because the function siganture generator does this and therefore, to stay consistent, so should the `Variable`-based one. So: ```d // If if is external then it needs `extern ...` if(var.isExternal()) { signature = "extern "~signature; } ```
Author
Owner

And now we shall run into expected problems that should be fixed in the ModuleExternStmts thing.

And now we shall run into expected problems that _should_ be fixed in the `ModuleExternStmts` thing.
Author
Owner

And now we shall run into expected problems that should be fixed in the ModuleExternStmts thing.

Heheh:

extern extern uint8_t p;
> And now we shall run into expected problems that _should_ be fixed in the `ModuleExternStmts` thing. Heheh: ```c extern extern uint8_t p; ```
Author
Owner

And now we shall run into expected problems that should be fixed in the ModuleExternStmts thing.

Heheh:

extern extern uint8_t p;

Okay, but now that it is fixed we could also then do checks in the ModExternSttmsd that yanks out the extern part if is knows the entity the signature is requested for is extern.

This would then make the following evar/efuncs:

extern extern uint8_t p;
extern extern uint8_t s();

into:

extern uint8_t p;
extern uint8_t s();

The checks are therefore basically like this:

// Emit public functions
foreach(Function func; mos.funcs())
{
	// Generate signature
	string signature = generateSignature(func);

	// Decide whether or not `extern` is needed
	string externPart = func.isExternal() ? "" : "extern ";

	// Generate the emit
	string externEmit = format("%s%s;", externPart, signature);

	gprintln(format("FuncExternEmit: '%s'", externEmit));
	modOut.writeln(externEmit);
}

// Emit public variables
foreach(Variable var; mos.vars())
{
	// Generate signature
	string signature = generateSignature_Variable(var);

	// Decide whether or not `extern` is needed
	string externPart = var.isExternal() ? "" : "extern ";

	// Generate the emit
	string externEmit = format("%s%s;", externPart, signature);

	gprintln(format("VarExternEmit: '%s'", externEmit));
	modOut.writeln(externEmit);
}
> > And now we shall run into expected problems that _should_ be fixed in the `ModuleExternStmts` thing. > > Heheh: > > > ```c > extern extern uint8_t p; > ``` Okay, but now that it _is_ fixed we could also then do checks in the `ModExternSttmsd` that yanks out the `extern` part if is _knows_ the entity the signature is requested for is `extern`. This would then make the following `evar`/`efunc`s: ```c extern extern uint8_t p; extern extern uint8_t s(); ``` into: ```c extern uint8_t p; extern uint8_t s(); ``` --- The checks are therefore basically like this: ```d // Emit public functions foreach(Function func; mos.funcs()) { // Generate signature string signature = generateSignature(func); // Decide whether or not `extern` is needed string externPart = func.isExternal() ? "" : "extern "; // Generate the emit string externEmit = format("%s%s;", externPart, signature); gprintln(format("FuncExternEmit: '%s'", externEmit)); modOut.writeln(externEmit); } // Emit public variables foreach(Variable var; mos.vars()) { // Generate signature string signature = generateSignature_Variable(var); // Decide whether or not `extern` is needed string externPart = var.isExternal() ? "" : "extern "; // Generate the emit string externEmit = format("%s%s;", externPart, signature); gprintln(format("VarExternEmit: '%s'", externEmit)); modOut.writeln(externEmit); } ```
Author
Owner

And now we shall run into expected problems that should be fixed in the ModuleExternStmts thing.

Heheh:

extern extern uint8_t p;

Okay, but now that it is fixed we could also then do checks in the ModExternSttmsd that yanks out the extern part if is knows the entity the signature is requested for is extern.

This would then make the following evar/efuncs:

extern extern uint8_t p;
extern extern uint8_t s();

into:

extern uint8_t p;
extern uint8_t s();

The checks are therefore basically like this:

// Emit public functions
foreach(Function func; mos.funcs())
{
	// Generate signature
	string signature = generateSignature(func);

	// Decide whether or not `extern` is needed
	string externPart = func.isExternal() ? "" : "extern ";

	// Generate the emit
	string externEmit = format("%s%s;", externPart, signature);

	gprintln(format("FuncExternEmit: '%s'", externEmit));
	modOut.writeln(externEmit);
}

// Emit public variables
foreach(Variable var; mos.vars())
{
	// Generate signature
	string signature = generateSignature_Variable(var);

	// Decide whether or not `extern` is needed
	string externPart = var.isExternal() ? "" : "extern ";

	// Generate the emit
	string externEmit = format("%s%s;", externPart, signature);

	gprintln(format("VarExternEmit: '%s'", externEmit));
	modOut.writeln(externEmit);
}

Looks like this solution works.

> > > And now we shall run into expected problems that _should_ be fixed in the `ModuleExternStmts` thing. > > > > Heheh: > > > > > > ```c > > extern extern uint8_t p; > > ``` > > Okay, but now that it _is_ fixed we could also then do checks in the `ModExternSttmsd` that yanks out the `extern` part if is _knows_ the entity the signature is requested for is `extern`. > > This would then make the following `evar`/`efunc`s: > > ```c > extern extern uint8_t p; > extern extern uint8_t s(); > ``` > > into: > > ```c > extern uint8_t p; > extern uint8_t s(); > ``` > > --- > > The checks are therefore basically like this: > > > ```d > // Emit public functions > foreach(Function func; mos.funcs()) > { > // Generate signature > string signature = generateSignature(func); > > // Decide whether or not `extern` is needed > string externPart = func.isExternal() ? "" : "extern "; > > // Generate the emit > string externEmit = format("%s%s;", externPart, signature); > > gprintln(format("FuncExternEmit: '%s'", externEmit)); > modOut.writeln(externEmit); > } > > // Emit public variables > foreach(Variable var; mos.vars()) > { > // Generate signature > string signature = generateSignature_Variable(var); > > // Decide whether or not `extern` is needed > string externPart = var.isExternal() ? "" : "extern "; > > // Generate the emit > string externEmit = format("%s%s;", externPart, signature); > > gprintln(format("VarExternEmit: '%s'", externEmit)); > modOut.writeln(externEmit); > } > ``` Looks like this solution works. ✅
Author
Owner

Okay there are a few more things to work on maybe,.... but these are low priority, so I can stop working on this PR for now at least


Last few things

  • DGen to emit extern variables (not just functions)
  • All extern-like statements must become automatically private. This will stop them from being accessible outside to other modules which would cause them to get double externed. I mean, is that a problem. We could maybe handle it. But maybe not for now? #168
  • Fix merge conflicts from vardec_varass_dependency

Second item is now done, making this list now entirely done

> Okay there are a few more things to work on maybe,.... but these are low priority, so I can stop working on this PR for now at least > > --- > > ### Last few things > > - [x] `DGen` to emit extern variables (not **just** functions) > - [x] All `extern`-like statements must become automatically `private`. This will stop them from being accessible outside to other modules which would cause them to get double externed. I mean, is that a problem. We could _maybe_ handle it. But maybe not for now? #168 > - [x] Fix merge conflicts from `vardec_varass_dependency` Second item is now done, making this list now entirely done ✅
deavmi stopped working 2024-04-07 12:33:22 +01:00
1 hour 27 minutes
deavmi started working 2024-04-07 12:39:50 +01:00
Author
Owner

Just last few things that I want to document and then I will move this into the queue pending a merge...

Just last few things that I want to document and then I will move this into the queue pending a merge...
Author
Owner

Just last few things that I want to document and then I will move this into the queue pending a merge...

Done

> Just last few things that I want to document and then I will move this into the queue pending a merge... Done ✅
Author
Owner

Just finishing up parser docs now...

Just finishing up parser docs now...
deavmi stopped working 2024-04-07 12:46:02 +01:00
6 minutes 12 seconds
deavmi removed the due date 2024-04-30 2024-04-07 12:46:27 +01:00
deavmi added the due date 2024-04-09 2024-04-07 12:46:41 +01:00
deavmi started working 2024-04-07 13:13:55 +01:00
Author
Owner

Still working on this...

Just finishing up parser docs now...

Still working on this... > Just finishing up parser docs now...
Author
Owner

Parsing

  • Added notes on parsing, all done now
Parsing - Added notes on parsing, all done now
deavmi locked and limited conversation to collaborators 2024-04-07 13:31:13 +01:00
deavmi unlocked this conversation 2024-04-07 13:31:31 +01:00
Author
Owner

Okay, pretty much happy with this now

Okay, pretty much happy with this now
deavmi stopped working 2024-04-07 13:36:04 +01:00
22 minutes 9 seconds
deavmi started working 2024-04-08 11:42:42 +01:00
Author
Owner

Merging...

Merging...
Author
Owner

Merged

Merged ✅
Author
Owner

Merging docs...

Merging docs...
deavmi stopped working 2024-04-08 11:44:30 +01:00
1 minute 48 seconds
Author
Owner

Done

Done ✅
deavmi removed a dependency 2024-04-08 11:48:20 +01:00
deavmi removed a dependency 2024-04-08 11:48:35 +01:00
deavmi started working 2024-04-08 11:48:53 +01:00
deavmi removed a dependency 2024-04-08 11:49:18 +01:00
deavmi removed a dependency 2024-04-08 11:49:23 +01:00
deavmi stopped working 2024-04-08 11:51:37 +01:00
2 minutes 44 seconds
deavmi unpinned this 2024-04-08 16:00:47 +01:00
Sign in to join this conversation.
No Milestone
No Assignees
1 Participants
Notifications
Total Time Spent: 5 days 1 hour
deavmi
5 days 1 hour
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

2024-04-09

Depends on
You do not have permission to read 3 dependencies
Reference: tlang/tlang#157
No description provided.