Closed FroMage closed 11 years ago
Hah, strangely I was just thinking about that this morning!
I know it wasn't for M6 but I just wanted to add it.
Forgive me for not looking at the patches and figuring this out for myself, but does this also handle dependencies for which we have src but no car, or just the entry-point module?
Just the entry point seemed enough for now ;) Otherwise we're getting dangerously close to a build system's turf I think.
Well, I agree it just adds to the complexity, but it's also no going to be obvious to some people why it works in one case but not another.
And another thing worries me: What do we do when there's a car available, but one of the sources is newer? Should we recompile? Should we not recompile, but print a warning? Should we just ignore the new sources sliently? Do we need options to control this behaviour?
Btw, I didn't really explain what the run tool does now with all the changes:
If you you type ceylon run foo/1.0
the tool will first look up the binary artifact foo/1.0
, if it can't be found it will see if sources exist that define a module with that exact same name and versions and will try to compile it. If none of this works the tool will see if any other versions are available and show a list of suggestions if any are available and complain about a missing version, otherwise it will complain about a missing module.
If you type ceylon run foo
the tool will look up a list of available versions. If there are several including locally it will show a list of suggestions. If there are none or all are on remote servers and local source exists with the right name (not version) it will try to compile it. If none of this works it will complain about a missing module.
Except for the bit about compilation this is now the behaviour of all the tools that take a module[/version] argument.
That's a useful description. You going to hate me for saying this, but it really belongs in the documentation for all those tools it applies to. Since the tools were taken out of the spec that documentation is the only thing that really defines what the tools are supposed to do.
but it's also no going to be obvious to some people why it works in one case but not another.
You're right, but like I said, we're getting into build system territory. I don't think the run tool should be turned into a more powerful builder than the compiler itself, do you?
To me this is just a feature that saves you an extra command when no binary code is available. When you're worried about running the latest code you should definitely be using ceylon compile
. (Well if we're going to need a --nocompilation
option, we could also add a --forcecompilation
if that's what we want)
You going to hate me for saying this
No, I think you're right ;)
I don't think the run tool should be turned into a more powerful builder than the compiler itself, do you?
No I don't. But I'm concerned that in trying to make the run
tool more helpful, but in not wanting it to supplant or become more complex that the compile
tool, we're going to have a weird half-way house. I think it would be really counter-intuitive that the first time you run a car
less module it compiles it from source, but thereafter it ignores your source completely. And I don't think we should have to check for the sources every time we run, because in the usual case that just adds latency before executing the users code. One day I'm sure we can have a ceylon build --compile-and-run
tool which does this stuff right. In the meantime I just don't think the marginal extra utility of making run
do compilation is worth all the corner cases it introduces (I realise I'm saying this after you've done a load of work on making it work, and I'm sorry about that).
I guess I'm in the minority though.
Well the thing is that some people just expect ceylon run
to work (and ceylon build --compile-and-run
is just icky, we could better forget about all the subtools: ceylon --compile --run
). But it would work only for simply things where there are no uncompiled dependencies.
But I think that's good, that's only for people to get up to speed, for more complex situations they'll have to learn that you have to compile first (and we don't go compiling dependencies with newer source there either).
And I can somehow imagine going through the dependencies and compiling them as well if we really see people needing that, but I'd stop there, no checking of newer sources and recompiling.
We now show a message when we decide to compile from the runner.
Originally in the spec,
ceylon run
was supposed to invoke the compiler if the module could not be found but its sources could be found. As we've seen online after M5 got announced, it appears that some people expect that to just happen. We should look into getting it working.