
Ask HN: Is there a declarative animation language? - elviejo
I&#x27;m looking for a programming language for graphics. Something like processing.org but more declarative.<p>for example if I had a circle with center in 0,0 and then I exited to have center in 100,100 then the animation to transform from one to the other should happen automatically.<p>something that looks like:<p>(circle 0,0) `animate` (circle 100,100).<p>or even better animate automatically between scenes, where a scene is a set of other drawings.
so animate from scene to the next would be like:<p>scene1 `animate` scene2<p>does something like that exist?
======
brudgers
Racket has universe, [https://docs.racket-
lang.org/teachpack/2htdpuniverse.html](https://docs.racket-
lang.org/teachpack/2htdpuniverse.html)

also "how to design worlds"
[https://world.cs.brown.edu/](https://world.cs.brown.edu/)

sample of HTDW,
[https://world.cs.brown.edu/1/projects/chicken/v1.gif](https://world.cs.brown.edu/1/projects/chicken/v1.gif)

------
bartvk
SwiftUI has features like that

    
    
        struct AnimatedCircle: View {
            @State private var radius: CGFloat = 0
            var body: some View {
                Circle()
                    .frame(width: radius, height: radius)
                    .onAppear {
                        withAnimation {
                            self.radius = 100
                        }
                    }
            }
        }

------
Someone
XML-based, so a bit wordy, but css animations are declarative and can be
combined with svg. See for example [https://css-tricks.com/guide-svg-
animations-smil](https://css-tricks.com/guide-svg-animations-smil).

[https://en.wikipedia.org/wiki/Synchronized_Multimedia_Integr...](https://en.wikipedia.org/wiki/Synchronized_Multimedia_Integration_Language)
takes that a bit further by allowing animation of other things than
attributes.

------
hotdox
[https://github.com/3b1b/manim](https://github.com/3b1b/manim)

------
shirogane86x
Haskell has reanimate
([https://reanimate.github.io/](https://reanimate.github.io/)), although I
don't personally have much experience with it. But it does have an online
playground to try out stuff in the browser

------
byoung2
[http://paperjs.org/about/](http://paperjs.org/about/) might be a good
starting point

