Val is a programming language that focuses on mutable value semantics and generic programming for high-level systems programming. It aims to be fast by compiling ahead-of-time to machine code and using its type system to support in-place mutation. Val prioritizes safety by default, ensuring that ordinary code is memory safe, typesafe, and data-race-free. It borrows heavily from Swift and emphasizes value semantics while avoiding complexities associated with reference semantics. Val is currently under active development and is not ready for use. It sets itself apart from other languages by its focus on mutable value semantics for efficient, generic code. The code of the compiler is open source and hosted on GitHub.
One unique feature of Val is its use of subscripts, which grant temporary read and write access to a projected value. In the provided example program, no unnecessary allocation occurs and no pointers or references are used. The author highlights that Val’s types behave like integers, and all possible accesses to a function parameter are visible in the body of that function. The language does not use lifetime annotations, as it uses a simpler model without references.
Please note that the controversial information and surprising or clever content could not be identified in the given web content.
https://www.val-lang.dev/