Mariposa – A programming language with time-travel
1–10 of 63 posts
Re: Mariposa – A programming language with time-travel
#2Re: Mariposa – A programming language with time-travel
#3Not to be dismissive, but this feels like pointers and lambdas with extra steps.
Re: Mariposa – A programming language with time-travel
#4Not to be dismissive, but this feels like pointers and lambdas with extra steps.
Re: Mariposa – A programming language with time-travel
#5 (define x 1)
(define t (now))
(display x)
(at t
(set! x 2))
and trying to implement now and at in a way that would behave correctly. I ran into a wall trying to implement it, because I don't think there is a way to define at that could reference the environment that t was defined in. Maybe a more powerful language like Kernel[0] could implement the same features, but I don't think Scheme can. Very cool!Also FWIW here is the definition of now and at that I had before I decided to stop:
(define-syntax now
(syntax-rules ()
((_)
(call/cc
(lambda (k)
(lambda (at-body) (at-body) (k #f)))))))
(define-syntax at
(syntax-rules ()
((_ instant body1 body ...)
(instant (lambda () body1 body ...)))))
[0] https://web.cs.wpi.edu/~jshutt/kernel.htmlRe: Mariposa – A programming language with time-travel
#6Re: Mariposa – A programming language with time-travel
#7Sincerely: 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 semantics. It should be understood only as an exploratory game.
]
Re: Mariposa – A programming language with time-travel
#8It seems to me like this should be something that can be done using continuations in Scheme. I tried writing the first example: (define x 1) (define t (now)) (display x) (at t (set! x 2)) and trying to implement now and at in a way that would behave correctly. I ran into a wall trying to implement it, because I don't think there is a way to define at that could reference the environment that t was defined in. Maybe a…
It's an interesting problem, but one that I think is ok not to be able to solve in Scheme.
Re: Mariposa – A programming language with time-travel
#9It seems to me like this should be something that can be done using continuations in Scheme. I tried writing the first example: (define x 1) (define t (now)) (display x) (at t (set! x 2)) and trying to implement now and at in a way that would behave correctly. I ran into a wall trying to implement it, because I don't think there is a way to define at that could reference the environment that t was defined in. Maybe a…
You might have to require that any code that uses the now/at constructs be wrapped in a macro invocation, e.g. (with-time-travel ...). The with-time-travel macro would then be a syntax transformer that rewrites the program. I'm not sure how, though... you'd have to enumerate all of the code blocks that are inside "at" forms, and then conditionally dispatch to them in the expansion of the "now" form; but that doesn't…