Gödelang

From Esolang
(Redirected from Gödelfuck)
Jump to navigation Jump to search

Gödelang is an esolang created by User:TJC games. It's based off of Gödel numbering, and it's just another Brain**** clone.

Interpretation

Each program is represented as a number, which is read by breaking it down into its prime factors and using the powers as the instructions. If it uses a number not listed in the below table, it's recompiled and run. The powers are as follows:

Gödelang 1.0 value BF alternative Instruction
0 end of file Terminate program
1 > Move pointer 1 byte to the right
2 < Move pointer 1 byte to the left
3 + Increase byte at pointer by 1
5 - Decrease byte at pointer by 1
7 ++++++++++++++++ Increase byte at pointer by 16 (= 100002)
9 ---------------- Decrease byte at pointer by 16 (= 100002)
10 . Output ASCII character stored in byte at pointer
11 , Input ASCII character and store in byte at pointer
13 [ If byte at pointer = 0, then skip to next 14
14 ] If byte at pointer != 0, then skip to previous 13
Gödelang 1.1 value BF alternative Instruction
0 end of file Terminate program
1 > Move pointer 1 value to the right
2 < Move pointer 1 value to the left
3 + Increase value at pointer by 1
5 - Decrease value at pointer by 1
7 . Output ASCII character stored in value at pointer
9 none Output value stored in value at pointer
10 , Input ASCII character and store in value at pointer
11 none Input value typed in (return to enter, any letters sets to 0)
13 [ If byte at pointer = 0, then skip to next 14
14 ] If byte at pointer != 0, then skip to previous 13
15 none If byte at pointer = 0, then skip to next 17
17 none No function, except for use with 15
19 [-] or [+] Set value at pointer to 0
Gödelang 2.0 value BF alternative Instruction
0 end of file, ], or none Terminate program
1 > Move pointer 1 value to the right
2 < Move pointer 1 value to the left
3 + Increase value at pointer by 1
5 - Decrease value at pointer by 1
7 . Output ASCII / UTF-8 / UTF-16 character stored in value at pointer
9 none Output value stored in value at pointer
10 , Input ASCII / UTF-8 / UTF-16 character and store in value at pointer
11 none Input value typed in (return to enter, any letters sets to 0)
13 [-] or [+] Set cell to zero

Notes for v2: If the sign is positive, it's a if loop. If the sign is negative, it's a while loop. In v2, you cannot have while ends in if loops. I don't think that there is a way to interpret one instruction as another, but if there is a valid prime factorisation sequence that, at the top level, only contains integers, then v2 is henceforth a null language. You are allowed to use / to denote fractions

Gödelang 2.1 value BF alternative Instruction
0 end of file, ], or none Escape routine
1 none Continue the current highest loop the pointer is in
2 none Escape the current highest loop the pointer is in
3 none Halt the program
5 > Move pointer 1 value to the right
7 < Move pointer 1 value to the left
9 + Increase value at pointer by 1
10 - Decrease value at pointer by 1
11 . Output ASCII character stored in value at pointer
13 none Output value stored in value at pointer
14 , Input ASCII character and store in value at pointer
15 none Input value typed in (return to enter, any letters sets to 0)
17 [-] or [+] Set cell to zero

Examples

Cat program

An infinite cat program, equivalent to the brainfuck code ,.[,.] and conforming to the Gödelang version 1.1, can be encoded in the Gödel number

59250896327476337572570276385712371250000000000

In version 2, the program seems to be too close to 0 to be calculated. It is equivalent to

24 * 5^(-452 093 906 250)

Truth-machine

Harnessing the possibility to input and output integer values, the Gödelang version 1.1 instructions 11, 13, 9, 14, 9 are realized in this program:

10198658019570622936267207428000000000

In V2.1, you can make a False-machine with a value of about

52242776064/91680193377742358281070619602424158297818248567928361864131947526829192000035599620532010929835608979716784905390898709850558860481539919780776928229913685688032830149784701257635617789408388586921284056689525435398923132111903444608861016469324269370759726965532715689622178789895875082269998751214533744159441693919489131405990942695220190190433007941120072809872286302226268028597589460878995298179611748474827857862338546292940453488504646633885676322286900227632672331939520852110627396816958653179814767415387050825248361798679644778727318615286061980708813122069336719068701132525168412816484905038302307596480864333712447647005368176341687106051147829847972312537420662110583612691452650897107029339649729068515911653620885216676145494941600133880243907342863971781983529067131958209728741057313962630861437728492675646517300550489129645008415526273231857035433249590781034996178475624781019086186013538820843442021808461649473743068721785025598688368890905486984044591885953078007671526894294375549017894147650918494366160398983409226667713751162050492348640971466409091685183976560224523118944946788487478971069395545893784168023744389354909168514621676230616283872776560632135443800426396863336000492634968185121117898492644546795904494273613024480161722092718360243174325862414808677577652465814430888757647645334595091543384363784391327065696986360863787907740636366559198527502801396318084445495999785016853701187301886928683522875216777596320023831766257037835481459513078147635908517117641057569110858609231343757723632425839459876282470568754952557284312484823404379386967354765972431533106202212234785447986130347110705723633642330327529688235331943776300498046626513815585584583009770258823310291597219775701409945387271122192373080586678565667551676149273842288207817219726776108683272506239823409157147170570561499734851437528302804212717537718447716936291102397508054593581229280391865949290300835113895920053808585381893609175287164384409411662722154632986718233425758704616021221681391338184546710247829135311476416142868851391990873857859837322566818411816459265816168812315418035892592978755745348802632219126824658158911235546204512718421808431224822564187034917359878434747611865337028324838456098380657258710996596716311183102156763373393353779546816544535568788288230941901933660621501833168902688185240411253177018633854175812747613586417788652069284079082856081753344412363835109597835888177360794777262373882306444172027006746350265384678857287083451056185038199715180314613903557536689917087006253318577516567238057098219717714991135046717331825288459441939944384231427053615246603673149366684810101007389047286086002908676847808354793129174907311083141133222721554561639943578480226632645706097365787149934704750064271531422154614106323746555150496139526784168350043608366025191872604096835431494037959690402340070967761652201794358759800851103625969576560083839820549662683616488295524848137289286863737153673977283514360748349375207743029121085716169662686751077233947832355783149863422745616268945699186564822424903115948646891985377501576593376502354877590192662661840307202026252261074427053408663201991100812380610664923532394632207108336486162569570693629922981326908730445999327532232575307374095405924670608341388735791643037578942706050906131699031149623025187953877366125912169086047907295932214361088901763196769061384482705854666255519751019388085387570775721487622836337558671375455747325288060872476409036458284897844902404831647811883726284034698080498687327215258332192070287021019632409043884894962240840797450382864901786141214891572302942578571798868500442134999278464999945071061816031906179910755076331691177706336024618857657307859017747658288247682522749793321983243981010542173569341235936784465589094653260133509418676713304428968092130742031543285081862358366141603371268928192700608784383392268855610267893489131597676644786449114985209914073929317203145665229081001992754380512439899116754621668858041574797933554207411630799651956336759051725342769717815896541294766368491459643862421682728970264188147088504045842505040432893986281661600965712005376454067011773095272226360177630227608605843700226095091075866971742957003559945851161052952879280464062922943889538007575394703831033416860996394897539764842192448249683774047837746863304891881138370870325614646494801770734328456652261609518194513462513333501644905684795312536960659572939856561914110255127905846363336461815368038517192189620328930234109703261010756566476621654445454159357924871808773535913529610016580128015642095840651596463385900009585465514128711140946038492845248060758580647789460774746415713297726232671793640395184227354928743703932666124066409553678054779534508922257352056499538155898066116183422141637441034101500388458733442162737160276156914872899270821750725281067368811650967482366667360683634095989863762986805084336154607645419043599076692886178462930884711381389511899125452388391456165720549707843736964762643990646114521341371695124372219136455815270857780651881324017101283716582716720925294507210907810756627177407833171933108693372442282567151715818224577640616293379306024557209255515419880778191685053123679685047892846175114486581798409697980413448264875992800741158409065451556033938953275452947783468689836222084673669101825758892388426806325644417803271331782229024588890884950038314325195037106862942367742736685560739919444016471935293062133347077333126001516601353403164954846074413711180980770174955643729002014157098075840227302419023477289597382928486229635306032587933976020026058950506937184862157631832663577829575571655917919152086417027857437691966859201290359340321411815318574187982881953551042152882018105284657460973818388083600439131259918212890625

Interpreter

  • Common Lisp implementation of the Gödelang programming language. This includes an interpreter and converters betwixt brainfuck and Gödelang.