An apparatus for intentional programming for a heterogeneous system, the apparatus comprising: a code lifter to: identify annotated code corresponding to an algorithm to be executed on the heterogeneous system based on an identifier being associated with the annotated code, the annotated code in a first representation; and convert the annotated code in the first representation to intermediate code in a second representation by identifying the intermediate code as having a first algorithmic intent that corresponds to a second algorithmic intent of the annotated code; a domain specific language, DSL, generator to translate the intermediate code in the second representation to DSL code in a third representation when the first algorithmic intent matches the second algorithmic intent, the third representation corresponding to a DSL representation; and a code replacer to invoke a compiler to generate an executable including variant binaries based on the DSL code, each of the variant binaries (502, 504, 506, 508, 510) to invoke a respective one of processing elements (102, 106, 108, 110) of the heterogeneous system to execute a workload based on the algorithm; wherein the executable includes a runtime scheduler, and the code replacer is to replace the annotated code in application code with a function call to the runtime scheduler to invoke a variant binary to be loaded onto one or more of the processing elements (102, 106, 108, 110) of the heterogeneous system to execute the workload; and wherein the runtime scheduler is configured to determine whether a workload should be offloaded from one of the processing elements to a different one of the processing elements to achieve a performance goal associated with the heterogeneous system. identify annotated code corresponding to an algorithm to be executed on the heterogeneous system based on an identifier being associated with the annotated code, the annotated code in a first representation; and convert the annotated code in the first representation to intermediate code in a second representation by identifying the intermediate code as having a first algorithmic intent that corresponds to a second algorithmic intent of the annotated code; a domain specific language, DSL, generator to translate the intermediate code in the second representation to DSL code in a third representation when the first algorithmic intent matches the second algorithmic intent, the third representation corresponding to a DSL representation; and a code replacer to invoke a compiler to generate an executable including variant binaries based on the DSL code, each of the variant binaries (502, 504, 506, 508, 510) to invoke a respective one of processing elements (102, 106, 108, 110) of the heterogeneous system to execute a workload based on the algorithm; wherein the executable includes a runtime scheduler, and the code replacer is to replace the annotated code in application code with a function call to the runtime scheduler to invoke a variant binary to be loaded onto one or more of the processing elements (102, 106, 108, 110) of the heterogeneous system to execute the workload; and wherein the runtime scheduler is configured to determine whether a workload should be offloaded from one of the processing elements to a different one of the processing elements to achieve a performance goal associated with the heterogeneous system.