6 ms·
> ...who in their right mind would bother interpreting it? Um... me? https://code.google.com/p/picoc/ https://code.google.com/p/picoc/
by zik 12y ago
> ...who in their right mind would bother interpreting it?
Um... me?
https://code.google.com/p/picoc/ https://code.google.com/p/picoc/
- e12e 12y agoThat's really an interpreter (as opposed to using a bytecode vm or some such)? How does it deal with memory allocation, alignment etc? And (I don't have a proper dev setup on hand) -- the obvious question -- can it run itself, in itself in itself? (And itself in tcc in itself?) ;-)
- zik 12y agoIt's a real interpreter. It runs directly from the source code - it doesn't even store a parse tree or bytecode. Memory allocation and alignment is done in the standard C ways. It's designed as a scripting variant of C so it doesn't implement 100% of the C standard (eg. bitfields), so no it's not self-hosting.
- e12e 12y agoFascinating, I'll have to look at it more closely when I've got a usable command line available. I would not have thought it was feasible for a useful subset of C -- but then I tend to forget that it is a rather simple language at heart (eg: after running the pre-prosessor).
- angersock 12y agoDo you support GOTOs? #ifdefs? aligment #pragmas? #includes? extern? If you don't--which is integral to how C works--you've created a cool C-like language, but not C. C is quite nearly just a high-level assembler with syntax sugar.