Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The build step was originally needed, because as much as I wanted to
just have
go run main.go
be rerun on save, it turns out that wasrather difficult to figure out how to do nicely.
The issue was that while I could kill the
go run main.go
, I could notkill the child processes that it spawns, so the end user would be left
with orphaned processes running that would hog system resources (like
ports).
So I did what all the other Go-based reloaders I had seen do, which is
to add a build step to compile the program, then another step to run it.
However, I wanted Tychus to be usable with other types of projects (like
Ruby for example) which had no build steps. So the usage felt wrong -
there were two camps. If you are in the "my program needs to be compiled
camp", well then the setup + running are completely different from the
dynamic language folks. And even then, there were some edge cases.
Rust's Cargo for example, worked just fine using
cargo run
without abuild step.
So to unify everything, I am removing the build step. I did manage a way
to make sure child and grandchild processes would die happily. So now
for Go projects, the end user can just run
tychus run go run main.go
.The unfortunate part is that these changes makes it more difficult to
port to Windows, so that work may have to come later.