Re:AMA: Explaining my 750 line compiler+runtime designed to ...
by kovek on Sunday March 05, 2017 @06:26PM
(#13799525)
How do you manage to still work with ed? Where can we read about that? I'm curious to see how useful it can be
Re:AMA: Explaining my 750 line compiler+runtime designed to ...
by arcfide on Sunday March 05, 2017 @07:45PM
(#13799907)
I don't have it anymore, but I did a live coding session in ed(1) where I edited thousands of lines of XML code as a demonstration of using ed. It's a very powerful editor, almost too powerful for my "simple tools" aesthetic.
Just a few things you can do with Ed:
Structured/Outlining Refactoring Rapid code catenation and splitting
It's one of my favorite editors. I don't think I have a video of it, but prior versions of the code were optimized for ed(1) hacking, allowing me to do structured/outline editing easily with ed(1).
The compiler is already portable to BSD. However, the underlying library I use to do GPU programming (ArrayFire) is not ported to BSD, though it Is for Linux. The Dyalog interpreter is available for AIX as well as Linux, and that's what you need to host the compiler right now. If Dyalog received the interest, it would be pretty straightforward to port Dyalog APL to BSD.
If one wanted to provide a self-hosting Co-dfns compiler, you could implement a minimal dfns interpreter and then run the Co-dfns compiler over that. To my knowledge no such interpreter exists yet. However, porting either ArrayFire or the Co-dfns runtime would go a long way to doing this, because you could then share the runtime library between the interpreter and the compiler.
So, yes, this is quite possible, and probably not even that much work. I'd welcome such a contribution. :-)