How can I convert a string to code in Java 8?

For genetic programming (how to use evolution for software development) I need a way to convert a string (generated by evolution) to Java 8 code. Please help me. Another example: for the GUI I have a field: enter your function, say y = x*x

. It will be read as a string, how can I convert it to code to draw the next function graph?

+3


source to share


1 answer


I would use JAVA COMPATIBLE scripting language. For example CLOJURE , JYTHON , JRUBY , GROOVY or JavaScript (via RHINO ).



If you are particularly interested in using Java syntax, then GROOVY should be the way to go.

+2


source







All Articles