You might want
julia> @sym answer = D(3x^4, x)
12*:x^3
julia> func = @sym Compile([x], Evaluate(answer))
#3 (generic function with 1 method)
julia> func(5)
1500
or
julia> @sym expr = 3a + b
3:a + :b
julia> func1 = @sym Compile([a, b], Evaluate(expr))
#5 (generic function with 1 method)
julia> func1(1, 2)
5