Re:I want to fix programming
by pfraze on Tuesday January 24, 2012 @06:51PM
(#3507593)
What if you created a declarative language which allows you to override the algorithms in a functional/imperative? You could create a public algorithm repo that auto-pulls into your local machine on setup. Could search for algorithms by declarations. That would be a lot of reuse.
[ Parent
| on HN ]
Re:I want to fix programming
by munificent on Tuesday January 24, 2012 @08:15PM
(#3507872)
> What if you created a declarative language which allows you to override the algorithms in a functional/imperative?
We have that. They're called libraries. If I need to sort a collection, I don't write an imperative chunk of code, I just do:
sort(myCollection)
Looks pretty declarative to me.
Re:I want to fix programming
by dmitriy_ko on Tuesday January 24, 2012 @10:25PM
(#3508247)
The issue here is that function definition doesn't tell what the function does. So you may have hundred implementations of sorting algorithms in different libraries, and neither compiler nor the IDE know that they all do the same thing. So when you write
sort(myCollection)
you are still referring to one particular set of instructions. The system parent poster envisions (the way I understand it) would be along those lines:
* User gives SPECIFICATION of sort, along the lines OP writes about in his blog.
* Other contributors provide various implementations which satisfy the specification. Such system would either have to auto-prove that implementation meets specification or just trust contributors that it does.
* Then in your code you can write sort(myCollection) and the system would pick the best implementation.