Though I'm sure it's a problem that'll eventually go away – at present, 
loading large/complex modules potentially takes a *lot* of time. I've got 
some Julia code that produces various files, and I'd like to structure this 
as several small Julia programs/scripts where each is responsible for 
generating a given output file, and a common module that they can all use 
for shared functionality. This would play nicely with build systems such as 
make, for example. (An alternative would be to have one monolithic program, 
perhaps, and just rebuild all these file all the time – or have the program 
itself check what needed to be rebuilt. Would still be more hassle to 
combine with make.)

However, if I have lots of these files, and each one takes a looong time to 
run … well, that's not so nice. I'm open to any solution to the underlying 
problem, but I'll still make the question a bit more concrete. My current 
idea is to try to somehow share a single Julia process across several 
scripts. (Not really a pretty solution, I guess.) I've currently tried 
doing this by using a named pipe for Julia commands:

$ mkfifo juliacmd
$ tail -f juliacmd | julia &
$ echo 'println("Hello, world!")' > juliacmd
$ Hello, world!

$ echo 'exit()' > juliacmd && echo > juliacmd

Well, there are several issues with this. For one thing, while it stops the 
Julia process, it doesn't stop tail. (Sadly, my tail doesn't support the 
--pid switch, so I guess I'll have to kill it more manually.) For another, 
running Julia in the background basically means I need to wait for 
arbitrary amounts of time to make sure the files are produced before I try 
to use them. (C.f., the oddly placed greeting, above.)

So … I don't really have a functioning solution. And I guess dealing with 
startup time must be a common problem (given that some modules even have 
specific functionality for reloading, just to avoid it). I guess I *could* 
generate 
a single script and run that, though it might mess with the makefile 
structure a bit.

Suggestions? Thoughts? (The simplest solution would, I guess, be to just 
grit my teeth and bear the slow running time, as the files won't need to be 
rebuilt that often.)

Reply via email to