That said I tried diving a value by 0 and that threw a runtime error.
No runtime error doesn't make sense. Say your database crashes. Something should happen...
Though, that effectively means no runtime errors depending on your definition of runtime error.
try { } catch Exception ex { //won't happen }
I am sure elm does better, but at first glance it scares me ;)
Also, builtwithelm.co is broken.
A big reason for this is that the errors are more often than not at compile time.
I'm the real world this means you deal with a bug after trying to compile, rather than an intern 8 months later trying to fix a runtime error, who is struggling to understand the codebase, much less make a good bugfix that also takes backwards compatibility into account.
So those languages that try and protect the programmer the most will generally produce better code.
MY answer though is Factor (http://factorcode.org/). Why? Because the length of the source code is about half the length of the equivalent program in Python or Scheme. And I'm absolutely sure (although it is an unproven belief) that the shorter the code, the less bugs there will be hiding in it.
WizardlySquid 1 hour ago [dead]
Languages don't create bug, people create bugs and there will always be bugs. Instead of looking for the new hotness just study your chosen language more, carefully research your problem, spend more time designing your system to be fault more tolerant and test the system to find the bugs you do have. If we're talking only about languages introducing bugs it's best to have a mature language that works best for your problem and that you are proficient at.
I agree. Programming languages are tools. They help structure problem solving. They provide convenient notations. They have hidden gotchas (sometimes). Some languages may be a better match to a particular problem than another. Programming languages are not a substitute for thought, careful design, and analysis. Language flame wars, endless comparisons, strong assertions of language goodness, and anecdotal tales of greatness are fun to read, sometimes provocative, but in the end remain (for me) unconvincing.
No but they allow certain classes of bugs to be written.
>people create bugs and there will always be bugs.
To true, but I take that to a completely different place. Some languages require super human amounts effort to avoid bugs that are easily machine checkable, or the language could offer tools that don't even make such situations possible. Picking a safer language allows you to spend some of your bug avoidance effort in a more profitable way.
> No but they allow certain classes of bugs to be written.
True. And, for some categories of bugs, there are other languages that do not allow those categories of bugs to be written. But be careful not to read too much into that. Those languages may also allow other categories of bugs to be written, or to be written more easily.
Do not assume that avoiding the previous generation of bugs means that your code is safe.