YES, such a language would reduce the need for mode-switching. But the really useful thing is to express the entire interface exposed by the kernel to the process in this language. Why write a syscall to get the current process ID when the kernel will interpret the identifier "Application" in a script as referring to a Process object representing the current/running/calling process? Likewise for security and IPC: security is just a matter of what other processes or processes' objects have names in the current process's script namespace, and IPC is just a matter of naming another process in a script and invoking an operator on that process to send data to it.
The idea is to build a domain-specific language especially suited to getting done, elegantly and efficiently, those tasks reserved for kernel-space. Doing so would allow not only a reduction in the number of user/kernel switches, but would allow a reduction of complexity of the kernel operations themselves. For example, there would be no need to supply separate blocking and unblocking I/O operations. If the application will either send a script that just says:
Code: Select all
Application.perform_io(file,data,options)
Code: Select all
let result = Application.perform_io(file,data,options)
block
return result