-
Notifications
You must be signed in to change notification settings - Fork 702
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
Enhancement: dynamic recompilation manager ... ? #26
Comments
There really is no reason for this to be part of the web.go framework tbh. This sort of stuff belongs to your code environment/IDE. |
I generally dislike bulky IDE solutions. I do realise, though, that there's not really anything specific to web.go here apart from the use case. Is there any current generic tool that will watch do what I describe? |
There was a thread about this on the mailing list: In summary - I'd like to have a 'runwebgo' command but the hard part would be figuring out how to compile the web projct. It would need a generic way to compile go sources. This wouldn't be too hard if there was some kind of config file that describes the structure of the project, but it's this kind of scaffolding that I'm trying to avoid. |
Fortunately we already have an automatic Go builder with incremental builds http://groups.google.com/group/golang-nuts/browse_thread/thread/1cca9738287302 |
There is still no clean way to automatically recompile apps. Closing for now |
This is (almost) my first experience with web development using a compiled language. I've become extremely used to being able to just change my code, and when I refresh the page, it runs differently. I do this literally more than once a minute.
Compiling a binary every time I want to see a change, even if compilation is almost instantaneous, is hard work. I don't think it's a fundamental issue with compiled languages, though -- how about if some scheme like the following was followed:
The system is aware of the source from which it is compiled, and tracks those files for changes. When a new HTTP request comes in, if changes to the source have been made, it dies, recompiles, starts again, and then handles the request. There'd be issues if you're storing application state in memory, but ... I don't.
I should say, this management would be done by another binary rather than the app itself. Let's call it
runwebgo
, and I can call it as with any other binary. And let's say for my application, calledblog
, I provide a plaintext file called.runwebgo
, which contains:make
)Now, instead of running
make
and then./blog
every time, I just runrunwebgo
in the top level of my app directory.runwebgo
then:.runwebgo
file for the list of files, the command, and the portchanged
flag when a file changeschanged
flag. If things have changed, it kills my app, recompiles it, re-runs it. In either case, it then sends on the request to the port of my app.It could also observe changes to the
.runwebgo
file itself, and dynamically update the source list if I resave it.I imagine creating this would not be too hard or use anything outside the standard library. The upshot IMO is massive: I just run one command and leave it for my whole coding session.
The text was updated successfully, but these errors were encountered: