"Is it possible to do this all from an editor like emacs?"
Sure. Heck, I think this is where emacs came from! Don't do it though. cli programming is fine if you're really into it but I implore you to think about that one for a little bit. I mean, if you want to do it in emacs, why not just program in assembly? I'm kidding ;-)