3 ms·
> I much more need a syntax that does not hide what happens (procedure call, list indexing or at least "indexing"). Each of those is actually hiding what reall
by zeveb 9y ago
> I much more need a syntax that does not hide what happens (procedure call, list indexing or at least "indexing").
Each of those is actually hiding what really happens. E.g. for a procedure call the runtime compares the arity of the call and the called function, inserts each argument into a data structure of some sort, perhaps grafts together environments or does other things on a language-specific basis, performs a jump of some sort, then the called function takes over, and finally stashes its return value(s) in a data structure of some sort and performs another jump.
Even list indexing in a language like Python is relatively complex, involving a lookup of the list length, bounds-checking &c.
> Code generation is mostly bad, it typically means the problem wasn't thought through, and that there is a lack of clearly defined building blocks.
Proper syntactic abstraction is all about building the right blocks for the problem at hand. At the end of the day, all we have are bits of silicon transferring electron: everything above that is an abstraction. A sufficiently-powerful programming language enables the programmer to develop the abstractions he needs for the problem he has.
- jstimpfle 9y agoFor Python, I agree to an extent. The machinery is hidden of course. That's the price of the convenience of a dynamic scripting language. But one still can see the relevant things. For example, for a subscripting operation, what counts is often only the mathematical aspect of it: It's a right-unique relation (i.e. a mathematical function) applied to the given element. And it's reasonably fast - even in Python with dicts, we can assume O(1) for most purposes. It's nice when these important properties are indicated by a visual clue (square brackets). > A sufficiently-powerful programming language enables the programmer to develop the abstractions he needs for the problem he has. Sure. And that programming language still happens to be C for many, many purposes.