www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - Is it possible to generate a pool of random D or D inline assembler

reply Enjoys Math <enjoysmath gmail.com> writes:
Without them crashing the app running them?  Say by wrapping with 
try / catch?

You can assume that I've limited the opcode addresses to the 
program and/or the data section which I'll try to put right next 
to the code.

Reason is so I don't have to make my own VM.

I want to mutate computable functions in a genetic-algorithm 
style, so in order to include the full space of computable 
functions I need a full programming language, or a VM that 
includes conditional jump instructions.

The purpose of it is to make a real-time, short-lived function 
predictor.
Jul 18 2017
next sibling parent Adam D. Ruppe <destructionator gmail.com> writes:
On Tuesday, 18 July 2017 at 17:35:17 UTC, Enjoys Math wrote:
 Without them crashing the app running them?  Say by wrapping 
 with try / catch?
Run them in a separate process, so it can die independently.
Jul 18 2017
prev sibling next sibling parent Sebastien Alaiwan <ace17 free.fr> writes:
On Tuesday, 18 July 2017 at 17:35:17 UTC, Enjoys Math wrote:
 Without them crashing the app running them?  Say by wrapping 
 with try / catch?
and, most probably a timeout, as you're certainly going to run into infinite loops.
 Reason is so I don't have to make my own VM.
Why not reuse an existing one? Some of them are very simple: https://github.com/munificent/wren It will be a lot easier than trying to generate random *compilable* D programs ; and will avoid requiring a compilation step in your mutation loop (I know the D compiler is fast, but still :-) ).
Jul 18 2017
prev sibling parent WhatMeForget <kheaser gmail.com> writes:
On Tuesday, 18 July 2017 at 17:35:17 UTC, Enjoys Math wrote:
 The purpose of it is to make a real-time, short-lived function 
 predictor.
I'm genuinely curious. What is a function predictor used for?
Jul 19 2017