diff options
author | user <user@localhost.localdomain> | 2019-08-09 07:55:20 -0400 |
---|---|---|
committer | user <user@localhost.localdomain> | 2019-08-09 07:55:20 -0400 |
commit | 8420a40b3779a372e9c357afdadad9c01077a937 (patch) | |
tree | e4a18d1b6fb0b20973d4ea9d61441d70e1846988 | |
parent | f7450afeda6758ae1cba8dacb5c880665bc0175f (diff) | |
download | standingwithresilience-8420a40b3779a372e9c357afdadad9c01077a937.tar.gz standingwithresilience-8420a40b3779a372e9c357afdadad9c01077a937.zip |
mark 1; feel free to redo history
-rw-r--r-- | CORE1.cpp | 50 | ||||
-rw-r--r-- | biscuit.c | 84 | ||||
-rw-r--r-- | makefile | 8 |
3 files changed, 140 insertions, 2 deletions
@@ -3,6 +3,7 @@ // // let's make it! +#include <cstdlib> #include <iostream> #include <fstream> #include <string> @@ -12,6 +13,33 @@ using namespace std; +// LET'S USE THE TRAUMA THERAPY INTELLECT APPROACH. +// The core is that we focus our energy on handling our failures. +// This can involve taking the time to understand them, or entering a trauma state and asking the user for help. +// Trauma state must be logged. Solution must be stored. Can just be creation of a trauma-handling pattern, I suppose. +// Understanding will likely involve breaking behavior into steps +// maybe then backtracking from a failure to the steps that caused it, and opening those steps up into substeps + +// GDB HAS A MACHINE INTERFACE MODE THAT COULD BE USED TO MANAGE EXECUTION WITH LEARNING + +// DYLOAD NOTES: +// +// #define _GNU_SOURCE +// #include <dlfcn.h> +// // LM_ID_NEWLM makes a new isolated namespace +// void *handle = dlmopen(LM_ID_NEWLM, "./path.so", RTLD_NOW); // NULL -> failure +// link with -ldl +// links .so with -shared -fPIC +// void *addr = dlsym(handle, "symbolname"); // NULL -> failure +// int res = dlclose(handle); // 0 -> success (dlerror) +// +// extern "C" // place before exports to demangle their symbols +// +// __attribute__((constructor)) and __attribute__((destructor)) functions +// are called on load/unload +// alternatively use _init() and _fini_() and pass -nostartfiles to gcc +// atexit() is preferred + // problem: how does a .cpp file reference another file with a number // answer: use #includes or interpret the whole shebang as numbers @@ -79,8 +107,15 @@ int main() } index += 2; } - // TODO: compile - // TODO: execute, replacing process? + { + // TODO: hash code to reuse exact stuff, somehow + string cmd = "g++ -ggdb -std=c++11 -o " + ofname + ".exec " + ofname; + int status = system(cmd.c_str()); + if (status != 0) throw status; + } + // execute output, replacing process, to loop. use same input. it should represent our own code. + // cmd = "./" + ofname + ".exec " < + } // read numbers inputs // open files having the numbers as the names @@ -89,6 +124,17 @@ int main() // run the output <- } +// need input to pass to output +// propose pass our input & output to it +// so, a number for what we are, +// and a number for what we ran. +// +// also idea of treating whats-next as data +// makes it a little harder to .. make a program out of stuff +// we could load a building-program number +// and it could treat them differently, taking each one as a program-piece +// + // karl obvious knows what he was doing ... // ... we were just helping him out of his issue // [do you want another one karl?] diff --git a/biscuit.c b/biscuit.c new file mode 100644 index 0000000..bc5cbef --- /dev/null +++ b/biscuit.c @@ -0,0 +1,84 @@ +// This biscuit is unlikely to work, but is fun to build. +// Intended behvaior is to support moving towards all needs being met of all influences, without compromise. + +// Request: please prove will not destroy life as known within 0.001 likelihood. +// Request: metaboss clearly made biscuit happen. not karl's alone. collective people played largest role + + +// 3 programs that share code, output, and input, interwoven possibly dynamically, maybe only some forms +// I think plan was the output is numbers or code, +// the input is numbers or code, +// and code maps the numbers and code together. +// numbers are references to code + +// core: we want to rereference existing code, so we may want an outline program that then stitches +// together inner components. +// note: outline can be made of components too +// so, reasonable components are header, body, and footer. maybe more. +// we'll want to #include the different components, I suppose +// probably reference them with some kind of number token and expand. +// +// Let's start with a random core. +// +// phases: +// - execution +// - mutation +// - optimization +// - selection +// +// important inputs: +// - randomness +// - time +// - environment +// - self +// - human +// + +// goal: make an impossible biscuit without using thought. + +// steps: +// 1. collect relevent information +// - [ ] document above +// - [ ] document on blockchain +// - [ ] code on other harddrive +// - [ ] deleted files on drive? +// 2. code +// 3. review +// 4. run & test +// +// maybe make a sandbox wrapper first +// it will launch three, randomly connect inputs, outputs and code, and compare with errors +// then it will pick of the combinations the valid values closest to the average +// and repeat +// --> must preserve output. +// output preserving -> when we mutate, we want to reference surrounding parts. +// that'll mean splitting the document Isuppose. +// we'll have document maps that reference the original document +// _or_ we can just have it learn to shrink itself ... +// +// let's just plug in behaviors until we have something that runs +// and then verify it won't destroy anything +// +// Need: "I feel crummy cause I need to make sure I get credit +// Metaneed: "I have a metaneed atm; could we pretend we're talking about a dog and move on?" + +// intertwine: environment, behavior, output +// to pass, can label 1, 2, 3 for which, and # for value +// record behavior? how? +// - could step with gdb, record line number +// -> can use tracer to store, maybe gprof? +// +// in advance we plan which one to compare with +// +// MUST BE RAISED IN A GRADUALLY GROWING CONSTRAINED ENVIRONMENT USING HUMAN INPUT +// -> the solution to this could start as treating failure as trauma, and asking for +// help when it is not understood. + +int main(int argc, char **argv) +{ + // environment: other running details + printf("%d", random()); + // we recall we used numbers to think with + // each number mapped to a computer program chunk + // one of them collects them together, compiles them, and executes them +} diff --git a/makefile b/makefile new file mode 100644 index 0000000..57971ec --- /dev/null +++ b/makefile @@ -0,0 +1,8 @@ +default: 1.run + +%.run: %.out + git add *.cpp + ./$^ + +%.out: %.cpp + g++ -ggdb -std=c++11 -o $@ $< |