← Back to context

Comment by cratermoon

5 years ago

> A code should never fail at runtime because you made a function name typo that it couldnt tell you about any other time for free.

So you also reject all dynamic and weakly typed languages? No JavaScript, Objective-C, PHP, Python, Ruby, Lisp, or Tcl? No type coercion at runtime?

> at the cost of having non compiled production code

Groovy can be compiled to the same bytecode as Java.

If the language doesn't help you with a function name typo, that's crap dynamic. Not only is that not a feature or benefit of dynamic, but it fuels unfair strawman arguments against dynamic.

Here is something I made largely for my own use:

  This is the TXR Lisp interactive listener of TXR 257.
  Quit with :quit or Ctrl-D on an empty line. Ctrl-X ? for cheatsheet.
  TXR is enteric coated to release over 24 hours of lasting relief.
  1> (file-put-string "test.tl" "(foo (cons a))")
  t
  2> (compile-file "test.tl")
  * test.tl:1: warning: cons: too few arguments: needs 2, given 1
  * test.tl:1: warning: unbound variable a
  * test.tl:1: warning: unbound function foo
  * expr-2:1: variable a is not defined

That's still a strawman; it only scratches the surface of what can be diagnosed.

For any non-trival program (more than a couple of files/pages long), dynamic and weak typing are a no-go.

  • How strongly typed is C? Are non-trivial programs in C a no-go? Would a LISP program more than a couple of pages long be forbidden?