Hacker News new | ask | show | jobs
by dragonwriter 4255 days ago
> A view is a concept in k that is unusual in other languages: When "a" gets updated, then "c" will automatically contain the new values.

Its actually not at all an unusual concept; its well known from SQL, for instance, but also Scala has them (Scala views aren't views in the sense that you use the term, but the lazily-implemented transformers they implement produce views of the type under discussion) as does Ruby (via Enumerable::Lazy). In fact, while the name "views" isn't exactly commonly used for them outside of SQL (though, as noted, Scala uses the term for the construct through which one obtains them), they are pretty ubiquitous in modern languages.

1 comments

A view can be thought of as a dependency expression. In version 3 of K there was a data driven GUI. The dependencies allowed one to to Functional Reactive Programming (FRP) quite easily.

Unlike SQL, views in k are not limited to queries as dependency expressions. The expressions can be arbitrary.