yesod devel strangeness

I like the simplicity that 'yesod devel' provides, however it has one fatal flaw. Specifically it doesn't seem to work (or I'm not using it correctly...). When I invoke it it correctly builds and starts serving my application, and when I make changes to the files it depends on it rebuilds the modules that were affected, however it seems to me that it doesn't actually load the changes, it just compiles them and the devel server continues to serve the original application, ignoring my changes. Is this something wrong with my machine specifically? Are others having this sort of trouble? I'm on a macbook pro running OS 10.6.7 with the Haskell Platform 2011.2 installed. Thanks, Matias

Wow, this does seem to be a problem. It appears that loadDynamic never
loads a new version of the app. I can think of two approaches for
fixing this:
* Start the web server as a separate process, and kill/restart that
process each time a compile is successful (easier route).
* Ditch direct-plugins and write some code that loads the application
directly from the dist folder, hopefully avoiding this caching in the
process.
The first approach is probably easier to hack together, but the second
is better as a long-term strategy, since we want to avoid the need to
install apps anyway. I have no experience with dynamic code loading
besides the direct-plugins and plugins packages, so if anyone has
recommendations, I'm happy to hear them.
Michael
On Sun, Apr 24, 2011 at 6:01 AM, Matias Eyzaguirre
I like the simplicity that 'yesod devel' provides, however it has one fatal flaw. Specifically it doesn't seem to work (or I'm not using it correctly...).
When I invoke it it correctly builds and starts serving my application, and when I make changes to the files it depends on it rebuilds the modules that were affected, however it seems to me that it doesn't actually load the changes, it just compiles them and the devel server continues to serve the original application, ignoring my changes.
Is this something wrong with my machine specifically? Are others having this sort of trouble?
I'm on a macbook pro running OS 10.6.7 with the Haskell Platform 2011.2 installed.
Thanks, Matias _______________________________________________ web-devel mailing list web-devel@haskell.org http://www.haskell.org/mailman/listinfo/web-devel

I'm curious as to why direct-plugins was used instead of hs-plugins like yi uses. I have not actually had any experience with either, but from what I can tell it seems like hs-plugins is a bit simpler to work with, and it doesn't seem to require that packages be installed. perhaps that would be an easier route? But again, as I said I have never actually used either of the two packages, so my opinion is based entirely on hearsay and not on actual hands on experience. On Apr 23, 2011, at 11:39 PM, Michael Snoyman wrote:
Wow, this does seem to be a problem. It appears that loadDynamic never loads a new version of the app. I can think of two approaches for fixing this:
* Start the web server as a separate process, and kill/restart that process each time a compile is successful (easier route). * Ditch direct-plugins and write some code that loads the application directly from the dist folder, hopefully avoiding this caching in the process.
The first approach is probably easier to hack together, but the second is better as a long-term strategy, since we want to avoid the need to install apps anyway. I have no experience with dynamic code loading besides the direct-plugins and plugins packages, so if anyone has recommendations, I'm happy to hear them.
Michael

I *did* try using the plugins package in the past, but ran into two problems:
1) Couldn't get it installed on Windows, which (for better or worse)
is a supported platform for Yesod development.
2) The whole thing crashed when trying to load the app.
Point 2 might be solved by our switch to Dynamic, and maybe the
Windows issue can also be fixed somehow. But my experience so far
would definitely categorize direct-plugins as the simpler of the two.
Michael
On Mon, Apr 25, 2011 at 12:13 AM, Matias Eyzaguirre
I'm curious as to why direct-plugins was used instead of hs-plugins like yi uses. I have not actually had any experience with either, but from what I can tell it seems like hs-plugins is a bit simpler to work with, and it doesn't seem to require that packages be installed. perhaps that would be an easier route?
But again, as I said I have never actually used either of the two packages, so my opinion is based entirely on hearsay and not on actual hands on experience.
On Apr 23, 2011, at 11:39 PM, Michael Snoyman wrote:
Wow, this does seem to be a problem. It appears that loadDynamic never loads a new version of the app. I can think of two approaches for fixing this:
* Start the web server as a separate process, and kill/restart that process each time a compile is successful (easier route). * Ditch direct-plugins and write some code that loads the application directly from the dist folder, hopefully avoiding this caching in the process.
The first approach is probably easier to hack together, but the second is better as a long-term strategy, since we want to avoid the need to install apps anyway. I have no experience with dynamic code loading besides the direct-plugins and plugins packages, so if anyone has recommendations, I'm happy to hear them.
Michael

Ah, I'm not a windows guy so I was unaware of that. And having it crash when trying to do what it's supposed to do is most definitely undesirable. One thought that I had (without knowing how direct-plugins does it's stuff) is that it doesn't like it when you reload stuff. Perhaps when you try to reload the application direct plugins doesn't load it because it can see that those modules are already loaded? Would explicitly unloading the app first solve the problem? Just a thought. On Apr 25, 2011, at 11:53 AM, Michael Snoyman wrote:
I *did* try using the plugins package in the past, but ran into two problems:
1) Couldn't get it installed on Windows, which (for better or worse) is a supported platform for Yesod development. 2) The whole thing crashed when trying to load the app.
Point 2 might be solved by our switch to Dynamic, and maybe the Windows issue can also be fixed somehow. But my experience so far would definitely categorize direct-plugins as the simpler of the two.

On Tue, Apr 26, 2011 at 2:07 PM, Matias Eyzaguirre
Ah, I'm not a windows guy so I was unaware of that. And having it crash when trying to do what it's supposed to do is most definitely undesirable.
One thought that I had (without knowing how direct-plugins does it's stuff) is that it doesn't like it when you reload stuff. Perhaps when you try to reload the application direct plugins doesn't load it because it can see that those modules are already loaded? Would explicitly unloading the app first solve the problem?
That would probably work, but the main point of the recent changes was to avoid re-loading the entire application, which does not scale as the application gets bigger.
Just a thought.
On Apr 25, 2011, at 11:53 AM, Michael Snoyman wrote:
I *did* try using the plugins package in the past, but ran into two problems:
1) Couldn't get it installed on Windows, which (for better or worse) is a supported platform for Yesod development. 2) The whole thing crashed when trying to load the app.
Point 2 might be solved by our switch to Dynamic, and maybe the Windows issue can also be fixed somehow. But my experience so far would definitely categorize direct-plugins as the simpler of the two.
_______________________________________________ web-devel mailing list web-devel@haskell.org http://www.haskell.org/mailman/listinfo/web-devel

On Apr 26, 2011, at 3:25 PM, Greg Weber wrote:
That would probably work, but the main point of the recent changes was to avoid re-loading the entire application, which does not scale as the application gets bigger.
Ah, that is true. What about only (un/re)loading the modules that changed? Or more specifically the modules that got recompiled?
participants (3)
-
Greg Weber
-
Matias Eyzaguirre
-
Michael Snoyman