The Stack Overflow blog reports on a new programming language called Mariposa.
They call it a “toy” programming language, saying it was “created as a way to experiment with novel and strange features, such as variable assignment outside the normal order of execution; more colloquially, time travel.” ”
Computer science has long sought to reason about time in electronic systems, thanks to a consistent interest in concurrency and real-time messaging. Mariposa allows you to manipulate execution order by assigning an instant to a variable and then setting its context. that instance. Below is a basic example from the Mariposa Readme.
x = 1
t = now()
Print(x)
time:
x = 2
According to the normal order of operations, this code should print '1'. However, since t is assigned to his second line instance, the changes specified within the at t: block are applied immediately, and this code prints “2”…
Although Mariposa has received considerable attention recently, it is not the first implementation of time travel in programming. There is a Haskell package, appropriately called tardis, that creates her two state transformer. One moves forward in time and the other moves in the opposite direction. As explained in the documentation: “The most concise way to explain this is: getPast gets the value from the most recent sendFuture, and getFuture gets the value from the next sendPast.” The past of is the future of another function.
This article describes how to apply logic to time, including interval temporal logic systems and “modeling, analysis, and verification languages/tools that enable temporal and state modeling without requiring an understanding of temporal logic.” Considers “the history and future of other programming paradigms.”