2 ms·
I was thinking of rust specifically because of GC, I don't know how to write a GC and I don't even want to try. But if I use rust, I won't have to because of ru
by madushan1000 6y ago
I was thinking of rust specifically because of GC, I don't know how to write a GC and I don't even want to try. But if I use rust, I won't have to because of rust's zero cost abstractions.
- icen 6y agoThere seems to be a bit of confusion here. Idris doesn't provide the same tools and guarantees as Rust does to manage memory, and instead requires that implementations provide a garbage collector. If you're producing code for a collected language, you can forward on all of the allocations to that language, and if not, you will need to implement one. Zero-cost abstractions or not, Idris needs a GC from somewhere.
- kryptiskt 6y agoReference counting would go a long way though as there is very little mutation in a typical Idris program, so you could probably sew something together in Rust with Rc cells and a simple cycle detector. But basically, having true closures requires some kind of GC. That was already recognized in Steele's Lambda papers in the 70s. Rust has to make compromises with its closures to avoid that.
- madushan1000 6y agoI was hoping I could get by without resolving to to GC, utilizing the rust allocation model(RAII with syntactic sugar and compiler helping out basically). If I "have to" write a GC because idris programming model requires is, I don't think there is a lot of value in writing a rust code generator.