Back to topic, it is amazing Scala can perform better than Java in most cases, considering both compiled to bytecode.
Anyone ever thought of inventing a new (better) language?
It's not amazing that Scala does better than Java, it seldom did. Those benchmarks you saw are tailored made Scala benchmark that does better than Java after they are written in such arcane approaches until it defeats the purpose of going with Scala in the first place.
Read more at the following articles
Benchmarking Scala Against Java | Javalobby
Performance of Scala compared to Java - Programmers Stack Exchange
You will find no lack of such articles one saying each if better. However you will also find articles that coincide with my personal stand. Each has their own merits. The fact that both languages compiled to the same set of virtual machine opcodes, we can gladly move up the premises and assume on the VM level there is no apparent advantages.
If you need to write Scala into the way how Java is written just to take advantage of the performance, then effectively you might as well write that portion of the codes in Java.
The value of Scala in my opinion is the expressiveness and effectiveness as a functional language. I am a fan of functional language and often excited at the simplicity and expressive power of a functional language, but one must be trained to think in this matter to code well in functional approaches. it's really a good mind training exercise to better a developer in solving problem.
If you are interested in creating your own language, I must let you know it's not an easy task and before you decided to, having one more language doesn't necessarily means better, it first introduce fragmentation in the development world. Look at the good number of languages we already have, yet only a few of them get used frequently. Next is interoperability is a problem.
However if you have a good reason, methodology, or idea to bring more value to development with this new language, feel free to do so. But don't take it lightly because developing a new programming language is far more involving.
I have taken 2 main courses as introductory into developing programming languages and also in my final year project, I have experience augmenting the C89 programming language with safe typing features, as such I can give you a more deeper insight into programming languages design.
First and foremost, formal language design require skill set in formalizing mathematical inductions and logic inference and several such niche academic concepts into the language. For a new langauge, it must have its own set of semantics and rules. Typing is a very mathematical topic, about inferring the type of a variable, the type of the expression and hence the statement and so forth.
Then you need to have understanding about context-free grammar, lexical analysis, different parsing approaches, forming abstract syntax trees, manipulating them and optimising certain parts of the tree to have a more compact and faster one. Having a program written according to specification doesn't make it a valid programming language, you need to examine and validate the AST to find out which part of the tree is invalid eventhough it satisfy the grammar. Grammar are context free, but programming language processing doesn't need to be.
After these, you need to look at how to convert your AST into opcodes, either working with a register architecture or stack architecture machine(or virtual machine). Working with register architecture is an art, register allocation is a graph colouring problem. You only have limited number of registers at your disposal, so you need to know how to use them appropriately. Stack allocation is much easier though.
Then you need to rack your brains on thread issues. how to provide a language that can handle threading properly, providing synchronization techniques. How to manage the memory properly, if the underlying machine(or virtual machine) doesn't do it for you. Should you have a explicit memory management model, or automatic memory management model ? You also need to devise scoping concepts. Each language have it's own set of rules for scoping. Lisp, Perl, PHP, Java all have different scoping approaches.
Perl for example, have global, dynamic, and local scoping concepts. PHP variables are local by default inside functions and will not float up to the global scope unless explicitly required. Java consist for class scoping and no global scope. If you are designing a functional language, you also need to consider local scoping to closure.
So you see, programming language design is not an easy task. One need a lot of skill set and knowledge to do it, and much more with experience, to do it good. I'm not discouraging you from doing it, I'm just giving you a heads up on what is ahead of you if you decided to give it a try
