2018-02-11 14:38 GMT+01:00 Marko Grdinic <mra...@gmail.com>: > I first asked this on SO > <https://stackoverflow.com/questions/48729784/does-racket-offer-anything-for-implementing-a-language-with-its-own-gc-that-coul> > and > got the advice to ask here on the mailing list. Compared to when I asked I > do know how malloc is implemented now, but since it is a pile of hacks I am > going to have to make the thing I had in mind previously. It is > disappointing. I'd hoped it would be something I could not have come up on > my own because nothing I've come up feels like a solution. > > Setting that aside, would it be possible to do what I asked in the title > for a language like Spiral <https://github.com/mrakgr/The-Spiral-Language> > ? > > Even if it were possible I am not saying I'd defect to right away - the > kind of nets I want to make for my ML library are not so complex that they > would require full GC, but I might consider it in the future when the > demands they start placing on me grow bigger and there will be new chip > architectures that would require me to break up with Cuda. >
What is the backend for Spiral -- a combination of the CPU and a GPU? > Probably I could implement GC for GPU memory on top of the language even > now, but it would be complicated and slow, so I'd rather avoid it unless it > were absolutely necessary. > > Also while GC is most important to me personally, maybe Racket could offer > me other things like IDE integration for the language and the ability to > compile the prepasses into a module without me having to make my own > bytecode? I am guessing in Racket that would be something like a partial > macro expansion? > The standard way of implementing a Racket language X is to parse and compile/expand a source file into an existing Racket language (which eventually will be compiled to bytecode and then jitted). If one takes care to keep source locations around, IDE integration will be automatic. This approach (the compiled source uses Racket primitives) will allocate values on the standard heap and use the built-in garbage collector in Racket. It is possible to use low-level primitives to allocate memory that the Garbage collector won't touch though. See "Inside: Racket C API". http://docs.racket-lang.org/inside/index.html -- Jens Axel Søgaard -- You received this message because you are subscribed to the Google Groups "Racket Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to racket-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.