v0.2 (Done) #18
Replies: 3 comments 1 reply
-
Update on Refactor Compiler: Right now the compiler architecture is a bit complex and hard to understand. There's two high-level steps:
Executing sequenceDiagram
autonumber
bud->>./bud/.cli/...: generate ./bud/.cli packages
bud->>./bud/cli: go build ./bud/.cli/main.go
bud->>./bud/cli: execute ./bud/cli run
./bud/cli ->> ./bud/.app/...: generate ./bud/.app packages
./bud/cli ->> ./bud/app: go build ./bud/.app/main.go
./bud/cli ->> ./bud/app: execute ./bud/app
Note over ./bud/app: Ready to serve requests!
(Let me know if the diagram above doesn't make sense to you.) The reason for this double binary is that we want to be able to support:
I don't know what to call this process (pre-generate, expand?), but it's similar to expanding macros. Developers can define code that's run during the build step. One other stretch goal I'm keeping in mind is a way to eventually define your own expanding macros. We currently have Additionally, while not confirmed, I sense that custom commands (e.g. random scripts) could bloat the application binary, so having them separated out could be useful. There might be downsides I'm not considering though. The downside with the complexity above is:
I was hoping that Go plugins would be the answer to the double binary complexity, where you generate
So for now, I think I'm going to hit pause on the compiler refactor. Why fix what's not broken? What I'm going to do instead is focus efforts to improve the existing compiler with more tests. I'm also planning to co-locate the compiler and the generators together and add a note that these packages are subject to change and you really shouldn't import these packages directly. Hopefully this reduces the jumping around you need to do with the current directory structure and makes it slightly easier to explain to contributors. In the future, I could also see the pre-generation be a discrete step that runs and exits on boot, rather than a long-running process. The reason I went with long-running process is so that If you have any ideas on how to improve any of this, please share your thoughts! |
Beta Was this translation helpful? Give feedback.
-
I wanted to share a quick update on this. As you know, I've been trying to simplify the design of the framework described above to make it easier to understand, easier to contribute to, more performant and better tested. A large refactor is happening in this PR: #133. Sorry this is taking longer than I would have liked, but it's chugging along and I'm quite happy with the results. I wanted to get this abstraction right before moving on to focus on the code generators. Nothing should really change externally.
All-in-all, this is going to be a great simplification for the framework and get us in a good place to focus on features for the next few releases! |
Beta Was this translation helpful? Give feedback.
-
v0.2.0 is out now so we're closing this one down! |
Beta Was this translation helpful? Give feedback.
-
Goals
Deliverable
Tasks
Beta Was this translation helpful? Give feedback.
All reactions