PicoC: a very small C interpreter for scripting
11–20 of 47 posts
Re: PicoC: a very small C interpreter for scripting
#12Earlier quoted context omitted.
Well, if it's interpreted, the interpreter could sandbox the C code it's running, rather than passing it through directly to its own memory space.
That would kind of defy the whole premise of this thing wouldn't it? The biggest and most sought after "feature" of C is it's speed and direct memory access (and simplicity, I guess). If you take that away, what's left?
Re: PicoC: a very small C interpreter for scripting
#13Would this be allowed in an iPhone application, since it's all C?
Re: PicoC: a very small C interpreter for scripting
#14Re: PicoC: a very small C interpreter for scripting
#15I wonder how it compares to other small systems like Lua, or, say Antirez' Jim interpreter, in terms of speed and features.
Otherwise it is probably better to use Lua for instance, since I bet it is much faster (I just read part of the PicoC implementation and it is a pretty straightforward interpreter, very cool to read but hardly the faster) and safer.
Re: PicoC: a very small C interpreter for scripting
#16Re: PicoC: a very small C interpreter for scripting
#17Also see: http://root.cern.ch/drupal/content/cint — an interpretor, but large.
Re: PicoC: a very small C interpreter for scripting
#18Re: PicoC: a very small C interpreter for scripting
#19How refreshing to see something that only has 'readline' as a dependency and otherwise just requires a working C compiler and 'make'.
Re: PicoC: a very small C interpreter for scripting
#20Earlier quoted context omitted.
Of course it is possible in an interpreter. You simply need to verify each access before allowing it, much like Valgrind does. Of course it's quite costly do to so, and since C gives the programmer a lot of freedom I guess it's hard to optimize the tests, i.e. to know which accesses are safe without explicitly keeping track.
Are you sure? Even Valgrind does not detect everything. E.g. when you mess up variables within your stack.