Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> 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?


There are toolings that patch C's shortcomings, and there's a reason better typed languages (e.g. Rust) are making strides in C's domain.


TIOBE gives C 14.32% (1) against Rust 0.49% (29), so "strides" might be over-egging the pudding.


Historic vs future trends.


Which tools patch C's shortcomings?


Static analysis tools and subsets like MISRA C.


Do you have a good one in mind? All the open source tools I've tried are MISRAble


Nope, I haven't been working with C recently.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: