
Ask HN: Magic Wand in hand: which futuristic idea would you bring in instantly - goldenv
Remember: With great power, comes great responsibility. Choose wisely.
======
zelah
I would bring in _efficient_ declarative programming. One could then tell the
computer "I want the number which squared equals 2". The computer asks "To how
many decimal places?". You specify any number you like. It would be truly
amazing to be able to say to the computer _what_ you want calculated without
having to say _how_ you want it calculated!

~~~
BjoernKW
SQL in some cases comes close enough, for example:

SELECT sqrt(2) INTO square_root

SELECT round(sqrt::NUMERIC, 2) FROM square_root

An SQL console is a REPL environment that allows for interaction with previous
results. So, apart from the natural language interface I think that's pretty
much what you're describing (and if required that natural language interface
could be added using something like Siri or wit.ai)

~~~
zelah
Now suppose that the problem is not so straight forward as in finding the
square root. Declarative programming in the general case would allow one to
specify to a robot that it should walk to a certain location and arrive at a
certain time. It knows (or can figure out) how to avoid crashing into things
and also about not breaking laws and such. It can decide what time to leave
the starting point but you don't have to tell it all the steps that will be
involved. It is really about constraint satisfaction. Your program might look
like this: "meetAt(workPlace , 5:00AM)". It is a well defined problem that
clearly has right and wrong outcomes but the constraints are given, not a
specific algorithm for the solution. Prolog is one example of a language that
automatically solves declarative constraints but the syntax is bad.

~~~
BjoernKW
> Prolog is one example of a language that automatically solves declarative
> constraints but the syntax is bad.

That's why I mentioned SQL. Both SQL and Prolog are declarative languages but
SQL has a much more approachable syntax. In SQL constraints can be expressed
using WHERE and ON clauses. For your more complex robot example this would
require some work but it's certainly possible.

~~~
zelah
I will look closer at the SQL language then but what about efficiency?

~~~
BjoernKW
In general SQL is fast enough. In many cases it's faster than scripting
languages or even faster than compiled languages (particularly when it comes
to dealing with list or set data structures). RDBMS like PostgreSQL for
example tend to be highly optimised and efficient pieces of software.

------
bbcbasic
Nuclear fusion reactor small enough to fit in your phone, but would power it
forever by taking hydrogen from the air.

------
sand500
Gonna think big, Robot utopia like that sepcified in the short story Manna

------
nnn1234
Self sovereign ID Protocols built on top of that

