Live data from Hacker News

Mariposa – A programming language with time-travel

github.com

21–30 of 63 posts

Re: Mariposa – A programming language with time-travel

#22

Okay but why? Sincerely: what is the pragmatic value? [edit: NM, end of the page... > Semantics and correctness of implementation It is not obvious how the Mariposa language could be given a formal semantics. Since there is no specification of its semantics, it doesn't even make sense to ask if the implementation is right or wrong. However, we are sure that the implementation is incorrect for almost any conceivable s…

For fun. Fun is a valid reason to do this.

Re: Mariposa – A programming language with time-travel

#24
Really cool project! It might be interesting to note that the mentioned time travel paradoxes can be solved by using probablistic states (as multi-valued interpretations of quantum mechanics would imply would be the case in any real system with time travel). And that this results in a computational system that can solve 'uncomputable' problems like the halting problem. See https://arxiv.org/abs/1609.05507. Time travel is really fun to think about in a computational setting!

Re: Mariposa – A programming language with time-travel

#26
In Haskell and other pure functional programming languages, monads are used to model arbitrary contexts. For example, in Haskell, there is a package which provides the Tardis monad which provides a time traveling context[1]. It can be used to solve some classes of algorithmic problems quite elegantly[2].

1. https://hackage.haskell.org/package/tardis-0.4.4.0/docs/Cont...

2. https://rosettacode.org/wiki/Water_collected_between_towers?... (see the "see also" section for a Tardis implementation)

Re: Mariposa – A programming language with time-travel

#27

Okay but why? Sincerely: what is the pragmatic value? [edit: NM, end of the page... > Semantics and correctness of implementation It is not obvious how the Mariposa language could be given a formal semantics. Since there is no specification of its semantics, it doesn't even make sense to ask if the implementation is right or wrong. However, we are sure that the implementation is incorrect for almost any conceivable s…

Exactly, there's no rationale given, nor any practical example of where this would be useful. Mutability is already a source of complexity, adding time-traveling to it seems like it would just make it worse...

I read the proposal as immutable within a given tick.

Re: Mariposa – A programming language with time-travel

#28

Earlier quoted context omitted.

Exactly, there's no rationale given, nor any practical example of where this would be useful. Mutability is already a source of complexity, adding time-traveling to it seems like it would just make it worse...

Initially I followed the link wondering if perhaps the author had done something interesting regarding append only ledgers and derivative generation processing semantics (e.g. event 5 modifies event 2, impacting the proper processing of events 3 and 4). After all, the linearity of the character stream is not unlike log offset/ledger row. Frequently these esoteric languages have very interesting purposes.

I don't know if this is still the case, but I recall needing to run LaTeX twice before it would produce the correct output. Something like this might make it easier to generate documents in one pass.

Re: Mariposa – A programming language with time-travel

#29
Your approach is intriguing. I appreciate the inclusion of descriptions that elucidate what's happening in the code; this is often lacking in professional and scientific programming. This is particularly relevant in quantitative finance, where many bugs stem from misunderstandings related to the timing associated with variables.

To address this, we implemented a similar concept in ThetaML for defining stochastic processes, financial instrument payoffs, and trading strategies. We introduced the

  theta t
operator, which represents the passage of time t. Here's how a stochastic process might be represented:

  S = 1
  loop inf
    theta @dt
    S = S * exp( (r - 0.5 * sigma^2) * @dt
  end
We also introduced stochastic expressions like expected value E(V!) given the current state of all simulated values where V! is a reference to the future value of V.

Example:

   1: model EuropeanPut
   2: % This model returns a simulated European put option price
   3: import S “Stock prices”
   4: import CUR “Discount factor”
   5: import K “Strike price for the European put option”
   6: import T “Time to maturity in years”
   7: export P “European put option price”
   8:
   9: P = E(V_CUR!)
  10: % T years pass
  11: theta T
  12: % at maturity T, the option payoff is discounted to time 0
  13: V_CUR = max(K - S, 0) * CUR
  14:
  15: end
This system enables the evaluation of the models using Monte Carlo Simulations and the computation of expected values E(x!) using regression techniques.

For those interested, you can find more information in the ThetaML Handbook: Here is the ThetaML Handbook: https://www.thetaris.com/doc/book-2012-thetaml-Handbook.pdf

Post reply on HN