TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Natural Async Programming - samholmes

1 点作者 samholmes大约 12 年前

2 条评论

samholmes大约 12 年前
Looks like this concept is out there. FRP (Functional reactive programming), or as I like to call it FAP (functional adaptive programming ;P), is the idea that values (return values even) can change over time and therefore all statements depending on those values will re-evaluate. I like this concept. It's almost like all values can be streams of values. I like how Elm (programming language/DSL) calls them signals because they're almost like streams, but hold a value at any given time (I suppose). I really wish JS had this implementation.
samholmes大约 12 年前
Updated the entry with some further examples. You can see how this makes libraries like async (by caolan) unnecessary. Asynchronous functions could just be functions that don't return a value immediately. Other statements that depend on these values being returned by the asynchronous functions would be queued for execution automatically by the interpreter. This makes all async parallel, and async in a series wouldn't even be in the thinking of the programmer.