News for hackers. Stuff that matters.
Re:Ask HN: If you could invent a new programming paradigm wh... by austincheney on Friday October 30, 2020 @08:07PM (#24947992)
Scope tree. So much of what we access is a tree model: DOM, JSON, XML, file system. That data could be interfaced more directly if represented in a programming language as a tree of lexically scoped spaces opposed to the clunkiness of objects in OOP.
Re:Ask HN: If you could invent a new programming paradigm wh... by Jtsummers on Friday October 30, 2020 @09:04PM (#24948249)
Could you give an example (in pseudocode perhaps) of what you mean? I've been trying to parse your last sentence and not succeeding. OOP is not the only way to manage trees, in some languages (like Lisps) trees are a fundamental data structure and a lot of code is written just based on basic patterns for navigating them with nothing resembling OOP needed.
Re:Ask HN: If you could invent a new programming paradigm wh... by austincheney on Friday October 30, 2020 @10:49PM (#24948781)
Lexical scope allows nested spaces. Things declared in higher scopes are shared points of access to things declared in lower scopes but not the opposite, thus you have an active tree of of programming language references/variables in memory.

Lexical scope is optionally available is most modern languages now and is the default scope mechanism in lisp and JavaScript.

If the data is a tree and your scope mechanism is a tree there is an opportunity for one to directly represent the other. Doing so will eliminate much decoration in the code and thus increase execution performance and increase the legibility of the code.

This would not be for the faint of heart though. My professional experience tells me many people can not grasp trees at all whether in data, file system, or programming. You can try to dumb it down or abstract it away for the lost souls, as is common, but that is tech debt and an erosion of performance.