Add `acton` frontend
This is a proposal to add a new acton binary which would effectively take on the roll that actonc currently has... and then some.
It could initially be realized by just renaming actonc into acton since it wouldn't do anything more and we've discussed the name in the past. acton is better than actonc as it shouldn't be just a compiler. We don't want multiple frontends, like rustc and cargo or ghc and stack. Rather, package management should be integrated with compilation, as should testing etc etc. Even deploying applications to remote hosts should be done through acton. Anyhow, while the compiler is written in Haskell and so far we've expanded on what actonc can do by.. well, extending the capabilities of actonc itself. I think it would be good to build a new acton, written in Acton, that would start to take on some of these new tasks and it would in turn call actonc when appropriate. I am not suggesting to reimplement the compiler.
I've disliked calling other processes but seeing how zig makes extensive use of calling itself, I've pondered it more and gotten quite attached to the idea. It's perfectly OK and it would allow us to combine our existing Haskell code base with writing more parts of the acton tool in Acton itself. This is of course a good thing since we want to attract people that like writing Acton and also, dogfooding is good!
First step is simple, merely pass through to existing actonc - just send all the args and wait for process to finish, then propagate exit code. Any stdout etc is also passed across. We could hide away actonc in the acton system directory, so it still exists but it's not in users paths. actonc is a symlink today in the users path to the acton-system-directory/bin/actonc and similarly, the new acton would be a symlink. Thus the only user visible tool is acton and there are no tab completion conflicts (well, there is with actondb but that's a separate topic).
I think the second step is to start doing argument parsing since then we can decide when to pass through to actonc and when to perform some actions ourselves in acton. Things like package management, with automatic download of dependencies sort of come to mind.
- [x] create basic
actonbinary- [x] use our process module to run
actonc - [x] just pass through all arguments
- [x] use our process module to run
- [x] make sure we wait for actonc to exit
- [x] pass through errors etc?
- [x] do argument parsing in
actonusingargparsemodule - [ ] add handling of ctrl to interrupt & abort ongoing work
- [ ] do concurrent compilation
- [ ] add function to actonc to print dependency tree of some modules
- [x] add
testcommand- [x] actonc to look for
__test_main(env)as root actor - [x] produce test executable in out/test/... ?
- [x] actonc to do test discovery and inject dicts
__unit_tests,__actor_testsand__env_tests
- [x] actonc to look for
I reckon the acton frontend should communicate with actonc over like a UNIX pipe or similar. Guess we should have a little protocol there, like something a little more structured.
I forked out the remaining items into their own issues instead, seems easier to track the more specific stuff. Closing this one where the primary goal of adding a acton frontend is indeed done.