4 ms·
If I understand your first sentence, I think it says there are "old languages" that are relatively devoid of footguns. If so, which languages?
by pshc 9y ago
If I understand your first sentence, I think it says there are "old languages" that are relatively devoid of footguns. If so, which languages?
- yjftsjthsd-h 9y agoI believe the standard example is Modula 2. Somewhat newer, but Ada is pretty great.
- jblow 9y agoJust about any old language, including C post-ANSI. The main relatively-heavily-used offenders are Lisp and shell scripts of various kinds. (And I think "oops, you made a typo, you don't find out until you try to run it and happen to ht that branch of code, oops that did not happen for three months, who knows what other bombs are sitting there waiting" is one of the primary factors in Lisp not gaining wider adoption.) I mean, C is less compile-time-checky than Pascal, but it is tremendously better than JavaScript in that regard. So is FORTRAN, etc, etc.
- lispm 9y agoUsing a Lisp compiler helps a bit. * (defun foo (alpha) (flet ((beta (bar) (+ alph bar))) (bet (beta 1 2)))) The Lisp compiler, here SBCL with its REPL, detects in this function above: * wrong number of arguments * undefined function * undefined variable * unused variable Lisp compilers have only been made available as late as 1962, so that might explain why Lisp has no wider adoption... ; in: DEFUN FOO ; (BETA 1 2) ; ; caught WARNING: ; function called with two arguments, but wants exactly one ; See also: ; The ANSI Standard, Section 3.2.2.3 ; (SB-INT:NAMED-LAMBDA FOO ; (ALPHA) ; (BLOCK FOO ; (FLET ((BETA # ; #)) ; (BET (BETA 1 2))))) ; ; caught STYLE-WARNING: ; The variable ALPHA is defined but never used. ; in: DEFUN FOO ; (+ ALPH BAR) ; ; caught WARNING: ; undefined variable: ALPH ; (BET (BETA 1 2)) ; ; caught STYLE-WARNING: ; undefined function: BET ; ; compilation unit finished ; Undefined function: ; BET ; Undefined variable: ; ALPH ; caught 2 WARNING conditions ; caught 2 STYLE-WARNING conditions FOO
- cronjobber 9y agoMost of your comments would be vastly improved by omitting the reams of repl output.
- flavio81 9y agoTrue, so true. The SBCL compiler is almost human; Once, it insulted me with something like: "You have assigned a value to an index out of bounds. Congratulations!!" Keep on preaching, Rainer, and may the other programmers see the light.