in reply to Re^3: Perl 5 Optimizing Compiler, Part 4: LLVM Backend?
in thread Perl 5 Optimizing Compiler, Part 4: LLVM Backend?
It is the fundamental nature of a programming language like Perl that the opcodes can be presented with many different situations, as you described. And it knows how to deal with them, so that the programmer does not have to.
In order to avoid having the interpreter have to do all of these things, you must introduce strong-typing into the language. Which Perl emphatically does not have. You must restrict the type of parameters that can be passed into a given subroutine, so that the compiler can make the correct determination(s), statically. You must also be able to prove that the operation of the compiler and therefore of the generated code is correct: that your statically-determined checks are both complete and correct; that no other program behavior is possible.
I argue that the Perl language does not possess the necessary semantics, and it was purposely designed not to require them. As a language, it is a product of its intended implementation-method; of DWIM and all of that. And I argue that these characteristics impose that implementation method at the exclusion of all others.
If you want strong typing, use any one of many languages that provide it. Those languages provide the semantic detail that your compiler will require. Without them, you will find that you can’t do it. The Perl language does not possess them and it never did. And I think that this is what the professor was saying, when he said it would be a good project for an intern where you could always stop at any time and say you won.
As I have politely said before, each of us have different core competencies, and language/compiler/interpreters happen to be one of mine.