I am just curious. Is it possible to embed Artificial Intelligence inside compiler? So as the program gets executed, the A.I looks at it and optimizes the byte code next time so that every run becomes little more efficient?
Say I code a function add(a, b), as it runs, the A.I will know that a and b are mostly Integer, so with that info it can optimize the byte code. Like strategy algorithm it can pick up the best byte code for given inputs thus making execution faster.
If we can do that, then all scripting languages will become super efficient.
yes. however...
assuming that:
* programs cannot take forever to run
* there is a maximum size that a program can have
and that there are programs `x` and `y` and optimizer `f`, such that
y = f(x)
so that `y` is teh optimized version of `x`.
you can write `f` yourself or kindly ask teh computer to write it for
you.
if you ask it, then an AI is a function `g` of some magic `z`, such that
g(z) = f
and asking teh machine to guess `f` is teh same thing as asking for it
to evaluate `g(z)`.
this is nice because you could just swap teh value of `z` to ask for
optimized versions of other values of `x`.
now you have to decide wat this magic `z` will be, it could be
programming language for example, and write `g`. but luckily, for any
magic you may think of, because programs have max size and cannot take
forever to run, you can simply brute force characters and try out all
possible programs...
this is obviously slow and then you think about _optimizing_ this AI and
then you notice that _optimiception_...
now wat if instead you just write a fast `h` such that
h(z, x) = g(z)(x) = y
you could call `u = (z, x)`, and then
h(u) = y
teh thing to notice is that teh set of `u` is bigger than teh set of
`x`, therefore teh problem may be (considerably) harder, and we dont
even want `y`! in fact, wat we really just want from teh beginning is
some `w` for a given `v` such that
w = x(v)
and that solves some kind of real problem and we want it fast. whether
there is `y`, `g` or `h`, we dont care.
so if you want fast code, write C, if you want to code fast, write ruby,
if you dont want to code, write an stupid AI to do it for you and toss
insane amounts of CPU so that it becomes faster than humans and we dont
have to think anymoar and become zombies and live forever enslaved by
machines inside teh matrix we built ourselves.
this is wat i would expect in a near future.
<3
···
--
dota? =op