markdown 介绍Fire语言

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了markdown 介绍Fire语言相关的知识,希望对你有一定的参考价值。

# Fire

`Fire` is a new programming language designed to embody the linear, easy to understand principles of reactive programming. It takes away the hard to read, nested structures of traditional programming languages like Python or Java and makes it all continous. We all know diagrams that work by drawing arrows from one place to another right? That's how Fire works:

```
2 -> + 2 -> print
result:
4
```

See, how easy was that? `2 -> + 2 -> print` was all you need to do to print the number 4. Now in a language like C++ you would need to do

```
#include <iostream>

int main() {
    int a = 2;
    a += 2;
    std::cout << a << std::endl;
}
```

Fire's focus and speciality is turning programs into linear expressions of data and numbers. This allows programs and computer science to be more integrated into other fields and easier to learn.

## Streams of Data

`Fire` is based around the concept of streams, list of data, like numbers, dates, prices, anything you want to either change, filter, search or reduce.

Here's an example of how to sum and print numbers 1 to 10.

```
1 to 10 -> print -> (+) -> print

result:
[1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
[45]
```

See? That wasn't that hard at all. That would take at least 40 lines of code in a regular programming language.

以上是关于markdown 介绍Fire语言的主要内容,如果未能解决你的问题,请参考以下文章

能提高生产率的Markdown介绍

Smart TV、Android TV 和 Fire TV 的一种语言

Markdown 语法简要介绍

HDU 1045 Fire Net(DFS)

python fire库的使用

用markdown写博客及markdown介绍