

IPLANG – an optimization-based language - idunning
http://iaindunning.com/2014/iplang.html

======
dj-wonk
This is crazy; perhaps that's what makes it intriguing.

In any case, I'm scratching my head. For example:

> We can thus, for any Brainfuck program, create an integer optimization
> problem with 3n decision variables where the optimal solution is that
> program.

Got it.

Integer optimization is designed to solve numerical problems. Is there any
reason or inspiration to suggest that use this technique is a productive way
to write programs that satisfy certain constraints?

~~~
idunning
Mostly an exercise in using a tool for something not intended - art?

You can definitely express any Brainfuck program as a integer program, and you
can add constraints that will constrain what the program does/must do, but it
isn't clear to me how to add useful constraints/objective that are still
linear. It'd be an interesting exercise though, and something I'll be thinking
about.

Integer optimization does have some practical uses related to programming
though - its use has been explored in compilers. E.g.
[http://www.sciencedirect.com/science/article/pii/S0898122197...](http://www.sciencedirect.com/science/article/pii/S0898122197001843)

------
scottfr
For those looking for examples of actually used languages designed
specifically for optimization problems, there are several out there.

AMPL is one such language [1]

[1] [http://www.ampl.com/EXAMPLES/](http://www.ampl.com/EXAMPLES/)

~~~
idunning
The language I used, JuMP [1], is quite similar to AMPL. In fact in [2] we do
performance comparisons with it. Check it out if you have a chance.

[1] [https://github.com/JuliaOpt/JuMP.jl](https://github.com/JuliaOpt/JuMP.jl)

[2] [http://arxiv.org/abs/1312.1431](http://arxiv.org/abs/1312.1431)

------
nn3
What happens when there are multiple best solutions?

~~~
idunning
Could be a challenge: write an IPLANG program with multiple "interesting"
solutions

~~~
mlubin
Should the IPLANG "compiler" try to detect multiple solutions?

~~~
idunning
I suppose it could, and would be fairly easy to do!

------
termain
Can this be used as a BF supercompiler?

~~~
idunning
It might be possible. Consider adding new auxiliary variables that represent
the state of memory after each operation. You may be then able to add (linear)
constraints to those auxiliary variables that are meaningful. Including user
input could be tricky though.

