Mathieu Bouchard <[EMAIL PROTECTED]> > On Sun, 30 Sep 2001, Guido van Rossum wrote: >>>> That may be Perl's philosophy. In Python, file and network ops are >>>> purely a library issue. >>> I don't mean to sound stupid, but if you don't have file ops, how do >>> you open the library which implements them? >> In Python, the bootstrap operation here is the IMPORT opcode. > > In Ruby, > * the "File" class is linked statically to the interpreter > > * the operation for loading a library is in the "Kernel" module, also > linked statically > > * "TCPSocket" and such are provided by dynamic libraries
In Tcl, file and TCP socket handling are done by built-in commands, and libraries can always define new ones. There are variants though (for assorted embedded environments IIRC) that lack one or both of them, which is OK since they're not an essential part of the core. > * no opcode is even remotely IO-related. The fanciest you can find > may be the regexp-literal. Tcl opcodes are not complex at all, and don't do anything with IO. But then they're not exposed outside the core anyway; programmers only notice they're there by the increased speed of execution. But then our security model is based at the Tcl interpreter and command levels, which seems to work well. For example, IO itself is typically not a privileged operation, but creating a channel (e.g. by opening a file or socket) usually is, and these cause a trap out into the parent interpreter which can decide whether to allow the creation or throw it out (with optional rude message.) This is, of course, completely configurable (so it's quite easy to implement file-size limiting, even though its not there by default.) IIRC, the only operations that are not restrictable in this way are reading variables and calling commands (though the set of variables and commands is controllable.) I suppose it depends in general on integrating the security model with the abstraction that the language itself uses. Donal. -- Donal K. Fellows, Department of Computer Science, University of Manchester, UK. (work) [EMAIL PROTECTED] Tel: +44-161-275-6137 (preferred email addr.) (home) [EMAIL PROTECTED] Tel: +44-1274-401017 Mobile: +44-7957-298955 http://www.cs.man.ac.uk/~fellowsd/ (Don't quote my .sig; I've seen it before!)
