5 ms·
My guess is that less imperative languages is the future. Today all programming languages are basically about exact instructions what to do: languages differ in
by akomtu 5y ago
My guess is that less imperative languages is the future. Today all programming languages are basically about exact instructions what to do: languages differ in exactness and creativity of expressing said exactness, but they all share this idea. The next gen languages will let us tell what we want to get at each step, and such languages will differ in granurality of these steps. A basic example: "a=2; b=5; a>b" means "make sure a is greater than b", which is same as swap(a,b) in imperative languages. I know, some would say "ah, that's prolog!" but I don't believe an esoteric language like prolog can win. It must be something javascrptish, understandable by average programmers, and easily mixable with traditional imperative code.
- deleted 5y ago[deleted]
- valenterry 5y agoI don't think that's gonna happen at any time. And if it does, we have an AI that is as smart as a human, so we will all be out of our jobs. Because, a>b could also mean a should become 6. So you need to understand the intent to decide what you should do. In that sense, it's not even prolog, it's "worse" (read: harder to achieve).
- akomtu 5y agoA better example would be sorting. Most of the time we don't care about how numbers are sorted, we only care about the result. In this hypothetical new language, sorting would look like "input: A1..An. output: for all k, Ak < Ak+1." It's implied somewhere in the constraints of the upper function that it'a a permutation, but if you want to be pedantic, you can add "for all k exists m such that Bk=Am."
- valenterry 5y agoYou are making things more complicated than they currently are. Currently I call "list.sorted" and I get a sorted list. What you propose is essentially what some languages like Idris already offer: general purpose programming with constraints that allow the compiler to generate an implementation, given that the constraints are precise enough.