# My understand of scriptless scripts

prealpha, this thing published as I was writting may as well get feedback

I need to build up some concepts first so bear with me, err I mean lets look at some fun other examples first:

Jank is an underappreciated part of computer science; from carmack’s magic function(this is the proper name, fite me) to the entire point of zachtonics games. Furthermore advance jank is so under appreciated I have to coin the phase, right here and now.

So what is formal definition of jank? I’m glad you asked, person rolling your eyes and irritated with me. Jank is is taking an (unintentionally) overloaded function and pre-compile time pushing pre-solved math into it, for example; carmack magic function:

``````	x2 = number * 0.5F;
y  = number;
i  = * ( long * ) &y;  // evil floating point bit level hacking

i  = 0x5f3759df - ( i >> 1 );       // what the fuck?

y  = * ( float * ) &i;
y  = y * ( threehalfs - ( x2 * y * y ) );
``````

“What the fuck?”.author() is right; this is awfully confusing; this of all things needs a very long comment. But because this example was so great people did reverse engineer it.

i is a float that gets int’s add applied to it; this is the unintentional overloaded function, as in hardware floats are roughly written in scientific notation and when you treat the hardware to this abuse(don’t worry it has many safe words, like nullpointer); it will add to the exponent directly… incorrectly, but in a single cpu call, which is nice and fast clapclapclap.gif. As for the rest of pre-solving math and how this works, I’m not the right person to ask for that… clearly; but its very clever let me assure you.

Thats only simple jank tho, whats advance jank? Advance jank is when you apply higher order thoughts to jank. Lets go thru a terrible example that makes you a worse person for knowing. Compiling for a single instruction computer, for this I’ll use sub_negitiveflag_jump; try to get used to my sudo-code xkcd.png

``````   int computerstate= new array(awful_awful_machinecode)
int instruction= 0
sub_negitiveflag_jump(){
result = computerstate[instruction] - computerstate[instruction+1]
computerstate[instruction+2]= result
if (result < 0) instruction = computerstate[instruction+3]
}
while(true){sub_negitiveflag_jump())
``````

I feel dirty; I’m deeply sorry your all forever damaged if you understood this, “potential programmers they are mentally mutilated beyond hope of regeneration.” -dijstra ; for those who didn’t let me feel sorry after this:

1. this subtracts two numbers, and puts the result in a third register
3. loop this dog shit and get a turing complete computer( assuming I got all the piece I needed, but I did this from memory)

Making anything out of this is pure jank so lets go thru the first bits of a compiler

I would like a few things:

1. sub no jump
3. conditional goto
``````   add(var1,var2,out){
sub_no_jump(zero,var2,temp)
sub_no_jump(var1,temp,out)
}
``````

your homework for this week is to complete this compiler, most people drop out of this advance jank course this week and this is after the refund period, so start early and don’t be afraid to ask for help.

Those who finish go on to master in an emerging field.

2. Functional Style Database Meta Functions

[/metamordenism]

I’m kinda tired getting that last interweaved joke out. I feel a migraine coming, I wonder if 1/2 of people managed to get in my head

I’m not sure how how common this style of thing is, but I took a scala database course; I now hate scala(text highlighting (or whatever was so hard about running it) shouldn’t make most ide’s crash prone and the “toolchain” setup is worse then c++ but doesn’t have the excuse of age) but I did get several functional programming patterns that were data and parallel oriented. pesdo code, building up these patterns so I can use these concepts in the next bit

``````    par(statement1,statement2){
return (processor1.statement1, processor2.statement2) // runs the statement in parallel
}

reduce(list,f){
}

mulishit(list)= reduce(list, *)

reduce_mulicomputers(listcomputers,biglist){ //run reduce on n computers
small_lists=spiltup(biglist,listcomputers.length)
pairs = zip(listcomputers, small_lists)
pairs.map( (a,b) => a.b)
}

``````

assuming this is confusing, I’m trying to communicate tail recurive style and being able to communicate “computerobject.function” to mean this code runs else where

3. The Actual Explanation

I know the following is incorrect but I function on fuzzy logic and in theory the audience has been in my head for a while by this bit

the pattern of bitcoins smart contracts is roughly

``````  yourcomputer.maketrasaction(){
return sig,public
}
blockchain.verify(sig,public){
fancymath(sig) == public
}
``````

this simple way of thinking is not remotely explained to the general public, and eth doesn’t help or naturally the explanation of

``````  yourcomputer.makescriptlessscripttrasaction(){
return magicdata,public
}
blockchain.verify(sig,public){
fancymath(magicdata) == public
}
``````

is very much lost on them

Futhermore I believe that mw blockchain as a simple computer like an snj computer could be pushed and potentially be very helpful as an explaination but making that sudocode with a migraine isn’t happening

4. Future Work

//Look at me, being an acki-demic type

I would like to speculate that maybe fancy verifying transactions could make extremely interesting blockchains

eh, latter