Skip to content

Conversation

Mightyjo
Copy link
Contributor

@Mightyjo Mightyjo commented Aug 8, 2025

I have a backend code emission system working and ready for comment. I'll need to write a filter to replace M4 in our stack to use it directly the in skeletons, but I have an idea for how to build that from our buffer library.

I need eyes on this for now to help me see where I've gone blind from staring at it too long. What do your linters say?

Issues that came up along the way and I'll split out for the real PR:

  • tests/array_nr was actually testing a reentrant case, so I renamed it array_r (important because of how the log_compilers use the suffixes)
  • parallel make was breaking above -j16 and I traced it back to the removal of BUILT_SOURCES. I'll explain more fully in a separate PR.
  • the Go backend was entirely fake so I turned it off for testing. It was just the C99 skeleton with C++ style comments.
    • I don't know Go well enough to write this skeleton myself. What other language do we want to support first?

Yes, structs of function pointers are hideous backdoor OOP. I used them as the least bad option I now. I'm open to learning better patterns.

Thanks all!

Mightyjo added 30 commits August 7, 2025 22:19
Add backend enumeration.
Reorganize backend lookup code around backend stack.
It was unused.
Those changes were made to fix failing tests, but the tests were acutally failing because the backend was missing.
TODO: found a timing issue where parse emits actions using the default backend before the language is set.
Either need to provide a delayed action emitter or initialize the backend stack earlier.
@westes
Copy link
Owner

westes commented Aug 8, 2025

I see that go has good standard and third party tooling for generating scanners, so please submit a pr to drop the go stuff as its own pr.

@westes
Copy link
Owner

westes commented Aug 8, 2025

tests/array_nr: Please submit this as its own pr.

@westes
Copy link
Owner

westes commented Aug 8, 2025

BUILT_SOURCES.: That'll teach me to go counter to what the automake manual recommends... I'm looking forward to that pr as well.

@westes
Copy link
Owner

westes commented Aug 8, 2025

replace M4 in our stack

We want that anyway, regardless of the work on this particular pr.

@Mightyjo
Copy link
Contributor Author

Mightyjo commented Aug 8, 2025

BUILT_SOURCES.: That'll teach me to go counter to what the automake manual recommends... I'm looking forward to that pr as well.

The automake manual isn't very clear on what this variable does anyway. They should add an alias SYNCHRONIZE_ON_SOURCES for it to use in new code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants