User:Junkshipp/Sandbox3

From Esolang
Jump to navigation Jump to search

DISPLAYTITLE: Know-Nothing

  1. Know-Nothing, the language

Goals:

Can make basic calculations with public variables Can make hidden calculations with hidden variables Can be used to prove hidden calculations are valid and lead to the desired result

Ideas:

Datatypes based on bits transmute possible if same amount of bits (free) roll bits around (free) cut down into smaller thing (free) concatenate certain basic operations: plus, xor, and, etc.

variables can either be declared with hidden or public. the actual values for hidden variables can be imported from another file verification of stuff.

Syntax

hidden variables declared with hidden public variables declared with public public variables cannot depend on hidden variables, but hidden variables can depend on public ones

public test = 0010
public test2 = test ++ test
hidden witness = IO # defaults to keyboard if no file provided
hidden witness2 = IO(mysecret.txt) # takes the contents of a file if one is given
hidden messingaround = witness ++ test2

note: am i going to have "function coloring" like issues here?

meaningful offside rule

repeat [public variable] times
  doSomething()
doSomethingElse() 

no traditional for loops.

conditions

if x then
  doStuff()
else 
  destroyUniverse()

where x encodes only one bit. x can be public or hidden.

function definitions


printing

public text = "hello world"
printstr(text) # prints "hello world"
printhex(text) # prints "68656C6C6F20776F726C64"
printbin(text) # as you'd expect
printtype(text) # text: public 11*8

printstr uses ascii but if the character is invalid it errors printing only works if the value is public or if the command is printtype

transmute

public bits = 01010101
printtype(bits) # public 8
public nibbles = text as 2*4
printtype(nibbles) # nibbles: public 2*4

functions all functions get inlined maybe no scope no recursion however optimisations can be used or idk

fun test(aaa) =
  aaa ++ aaa 

assertions

assert x

where x encodes only one bit. x can be public or hidden. this is where the zero-knowledge proving mechanics come in.