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 division or scientific notation 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/91680193377742358281070619602424158297818248567928361864131947526829192000035599620532010929835608979716784905390898709850558860481539919780776928229913685688
03283014978470125763561778940838858692128405668952543539892313211190344460886101646932426937075972696553271568962217878989587508226999875121453374415944169391948913140599
09426952201901904330079411200728098722863022262680285975894608789952981796117484748278578623385462929404534885046466338856763222869002276326723319395208521106273968169586
53179814767415387050825248361798679644778727318615286061980708813122069336719068701132525168412816484905038302307596480864333712447647005368176341687106051147829847972312
53742066211058361269145265089710702933964972906851591165362088521667614549494160013388024390734286397178198352906713195820972874105731396263086143772849267564651730055048
91296450084155262732318570354332495907810349961784756247810190861860135388208434420218084616494737430687217850255986883688909054869840445918859530780076715268942943755490
17894147650918494366160398983409226667713751162050492348640971466409091685183976560224523118944946788487478971069395545893784168023744389354909168514621676230616283872776
56063213544380042639686333600049263496818512111789849264454679590449427361302448016172209271836024317432586241480867757765246581443088875764764533459509154338436378439132
70656969863608637879077406363665591985275028013963180844454959997850168537011873018869286835228752167775963200238317662570378354814595130781476359085171176410575691108586
09231343757723632425839459876282470568754952557284312484823404379386967354765972431533106202212234785447986130347110705723633642330327529688235331943776300498046626513815
58558458300977025882331029159721977570140994538727112219237308058667856566755167614927384228820781721972677610868327250623982340915714717057056149973485143752830280421271
75377184477169362911023975080545935812292803918659492903008351138959200538085853818936091752871643844094116627221546329867182334257587046160212216813913381845467102478291
35311476416142868851391990873857859837322566818411816459265816168812315418035892592978755745348802632219126824658158911235546204512718421808431224822564187034917359878434
74761186533702832483845609838065725871099659671631118310215676337339335377954681654453556878828823094190193366062150183316890268818524041125317701863385417581274761358641
77886520692840790828560817533444123638351095978358881773607947772623738823064441720270067463502653846788572870834510561850381997151803146139035575366899170870062533185775
16567238057098219717714991135046717331825288459441939944384231427053615246603673149366684810101007389047286086002908676847808354793129174907311083141133222721554561639943
57848022663264570609736578714993470475006427153142215461410632374655515049613952678416835004360836602519187260409683543149403795969040234007096776165220179435875980085110
36259695765600838398205496626836164882955248481372892868637371536739772835143607483493752077430291210857161696626867510772339478323557831498634227456162689456991865648224
24903115948646891985377501576593376502354877590192662661840307202026252261074427053408663201991100812380610664923532394632207108336486162569570693629922981326908730445999
32753223257530737409540592467060834138873579164303757894270605090613169903114962302518795387736612591216908604790729593221436108890176319676906138448270585466625551975101
93880853875707757214876228363375586713754557473252880608724764090364582848978449024048316478118837262840346980804986873272152583321920702870210196324090438848949622408407
97450382864901786141214891572302942578571798868500442134999278464999945071061816031906179910755076331691177706336024618857657307859017747658288247682522749793321983243981
01054217356934123593678446558909465326013350941867671330442896809213074203154328508186235836614160337126892819270060878438339226885561026789348913159767664478644911498520
99140739293172031456652290810019927543805124398991167546216688580415747979335542074116307996519563367590517253427697178158965412947663684914596438624216827289702641881470
88504045842505040432893986281661600965712005376454067011773095272226360177630227608605843700226095091075866971742957003559945851161052952879280464062922943889538007575394
70383103341686099639489753976484219244824968377404783774686330489188113837087032561464649480177073432845665226160951819451346251333350164490568479531253696065957293985656
19141102551279058463633364618153680385171921896203289302341097032610107565664766216544454541593579248718087735359135296100165801280156420958406515964633859000095854655141
28711140946038492845248060758580647789460774746415713297726232671793640395184227354928743703932666124066409553678054779534508922257352056499538155898066116183422141637441
03410150038845873344216273716027615691487289927082175072528106736881165096748236666736068363409598986376298680508433615460764541904359907669288617846293088471138138951189
91254523883914561657205497078437369647626439906461145213413716951243722191364558152708577806518813240171012837165827167209252945072109078107566271774078331719331086933724
42282567151715818224577640616293379306024557209255515419880778191685053123679685047892846175114486581798409697980413448264875992800741158409065451556033938953275452947783
46868983622208467366910182575889238842680632564441780327133178222902458889088495003831432519503710686294236774273668556073991944401647193529306213334707733312600151660135
34031649548460744137111809807701749556437290020141570980758402273024190234772895973829284862296353060325879339760200260589505069371848621576318326635778295755716559179191
52086417027857437691966859201290359340321411815318574187982881953551042152882018105284657460973818388083600439131259918212890625

Interpreter

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