2014

From Esolang
Jump to navigation Jump to search

2014 is an esoteric programming language created by User:AndoDaan on 31 December 2014. During the year 2014, any 2014 program will print "Hello, world!". In subsequent years (and, presumably, years before 2014, although it will never be possible to tell), 2014 programs do nothing. (This means that, like with several other esoteric programming languages, all 2014 programs are equivalent.)

The language's announcement, at 20:09 UTC on 31 December 2014, kicked off a race to make some use of the language before the end of the year (and this wiki article was written in a similar hurry, even though there is no particular reason for the article to be written in 2014). The first known implementation (on the IRC bot HackEgo) was announced at 20:30 UTC on 31 December 2014, meaning that this language will only have been usable for around 3 and a half hours, and by the time you read this, has probably forever faded into uselessness.

Implementation

JavaScript Interpreter

"use strict";
const server="129.6.15.30"; // Currently a NIST server; change this to the address of the "2014 server" if it exists.
const net=require("net");
let d=Buffer.allocUnsafe(0);
net.connect(37,server).on("data",x=>{
  d=Buffer.concat([d,x]);
  if(d.length>=4) {
    if(new Date((d.readUInt32BE(0)-2208988800)*1000).getFullYear()==2014) {
      console.log("Hello, world!");
      process.exit(0);
    } else {
      console.error("");
      process.exit(1);
    }
  }
}).on("error",()=>{
  console.error("Error communicating with 2014 server.");
  process.exit(2);
}).on("end",()=>{
  console.error("Failed to receive four bytes of data from server.");
  process.exit(2);
});

See Also