Yes of course!
DSL stands for Domain-Specific Language and in Julia, it refers to using macros to be able to write an input file that describes a problem to solve or an instruction in a better or simpler way than coding using Julia’s syntax. This also means that the user does not need to know how to code in Julia, she only needs to know macro syntax calls.
On the other hand, if you do not want to read what I coded, the question to answer is the following:
How would you implement the following macros?
model = Model()
@var model x = 1.
@var model y = 1. + x
@var model n = 10
@var model v = zeros(n)
@var model v[1] = 1.0
@var model i = 5
@var model v[i] = 234. + x
@var model a = pi + sqrt(2.)
@var model b = 1.0 + x
@fun model f(x) = a * x + b # where a and b are the variables above and if they change, the function must change as well.
@var model s = f(1.0)
@var model s = f(a)
# etc...
or maybe, the other way arround would be:
@input begin
@var x = 1.
@var y = 1. + x
@var n = 10
@var v = zeros(n)
@var v[1] = 1.0
@var i = 5
@var v[i] = 234. + x
@var a = pi + sqrt(2.)
@var model b = 1.0 + x
@fun f(x) = a * x + b # where a and b are the variables above (but not x), and if they change, the function must change as well.
@fun h(t) = f(t) + t
@var s1 = f(1.0)
@var s2 = h(a)
# etc...
end
It is quite a challenge !