3 ms·
I'm pretty sure Algol (1958) had full structured programming.
by jonsen 4y ago
I'm pretty sure Algol (1958) had full structured programming.
- db48x 4y agoAlmost. Algol-58 had structured loops, but not conditionals (the IF statement only allowed you to skip the next statement, and there was no ELSE). Algol-60 had conditionals identical to what you find in languages today. But Algol-60 was published in 1962! It was certainly an idea that was in the air at the time; computer science was developing rapidly and of course everyone read everyone else’s papers and collaborated with each other. McCarthy, the inventor of Lisp, was also the one to propose structured conditionals for Algol-58, though it wasn’t accepted until later. Lisp was unusual in that it had 10 things that no other languages of the day had: 1. Structured conditionals 2. First–class functions 3. Recursion 4. variables are pointers, only values are typed 5. automatic Garbage Collection 6. no statements, only expressions 7. symbols as a data type distinct from strings 8. all code is entered as a syntax tree (homoiconicity) 9. full language available at load, compile, and run time 10. Macros Most modern languages have adopted most of these, with few exceptions. Systems languages (like Rust) often forgo automatic garbage collection (for good reasons), and nobody does macros as well as Common Lisp. Homoiconicity is quite rare outside the Lisp family of languages, as is having the compiler be part of the run time. On that latter point, Javascript comes the closest; you can go into the dev tools and define a new function that will be JIT–compiled along with all the rest, even if there is no specific function you can call to compile some code, or to disassemble some compiled code. It has an `eval` function you can use to read and evaluate new code from strings. In Lisp this is broken into two functions, `read` to parse code (or data) out of a string and produce list structure, and `eval` which executes code which has previously been parsed by `read`, or constructed by a macro, etc.
- jonsen 4y agoThanks!