Haskell? Not buggy code? I'd say Haskell is the best language to write buggy code. And when I say buggy is not about writing purposely to be buggy, I say it's a maintenance horror show that WILL produce buggy code 100% down the road. Remember, maintenance is 90% of a project life, the initial development is only 10%.
Ok. The main point was to discuss making languages that are better at preventing bugs. I simply threw out one to get the conversation started, not to be the final answer. Other thoughts?
You can't prevent injection bugs on a language level, since injection happens when you use string manipulation to dynamically create code that you send to another program. This means that it is just as easy to create SQL injection bugs in Haskell or Rust or any other language, because they all support concatenating strings to create SQL.
Type inference, pure functions, functional, assertions, …
Maybe start with Haskell?