Live data from Hacker News

PicoC: a very small C interpreter for scripting

code.google.com

1–10 of 47 posts

Re: PicoC: a very small C interpreter for scripting

#6
post #5
post #4

Earlier quoted context omitted.

Running every kind of script will never corrupt the application memory :)

[deleted]

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.

Re: PicoC: a very small C interpreter for scripting

#7
post #5
post #4

Earlier quoted context omitted.

Running every kind of script will never corrupt the application memory :)

[deleted]

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.

Re: PicoC: a very small C interpreter for scripting

#9
post #7
post #5

Earlier quoted context omitted.

[deleted]

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.

Re: PicoC: a very small C interpreter for scripting

#10
post #5

Earlier quoted context omitted.

[deleted]

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?

Post reply on HN