Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Remove build step #1

Merged
merged 1 commit into from
Jan 30, 2018
Merged

feat: Remove build step #1

merged 1 commit into from
Jan 30, 2018

Conversation

PatKoperwas
Copy link
Collaborator

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 was
rather difficult to figure out how to do nicely.

The issue was that while I could kill the go run main.go, I could not
kill 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 a
build 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.

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 was
rather difficult to figure out how to do nicely.

The issue was that while I could kill the `go run main.go`, I could not
kill 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 a
build 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.
@PatKoperwas PatKoperwas self-assigned this Jan 30, 2018
@PatKoperwas PatKoperwas merged commit cb6569f into master Jan 30, 2018
@PatKoperwas PatKoperwas deleted the remove-build-step branch January 31, 2018 00:43
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.

1 participant