7 comments

[ 5.7 ms ] story [ 26.0 ms ] thread
The real question is why hasn't a language emerged that is as efficient as C but much safer? Undoubtedly such language is feasible.
lua seems to be the closest option
Do you have any examples of how Lua is as efficient as C?
nothing is going to be efficient as C if you want it to manage the problems of C.

Lua just happens to be the thinnest wrapper i've seen on top of C that offers enough extras to make it worth learning/using over C.

I think the Go language people are trying for this:

> Go is an attempt to combine the ease of programming of an interpreted, dynamically typed language with the efficiency and safety of a statically typed, compiled language. It also aims to be modern, with support for networked and multicore computing. Finally, it is intended to be fast: it should take at most a few seconds to build a large executable on a single computer. To meet these goals required addressing a number of linguistic issues: an expressive but lightweight type system; concurrency and garbage collection; rigid dependency specification; and so on. These cannot be addressed well by libraries or tools; a new language was called for. (from http://golang.org/doc/go_faq.html#What_is_the_purpose_of_the... )

Another approach is to have the safer language compile down to C. This is the approach taken by various Schemes, like Chicken Scheme.

The Stalin Scheme compiler, "often generates code that outperforms handwritten C and Fortran code".[1]

[1] - ftp://ftp.ecn.purdue.edu/qobi/research-statement.pdf