Понравилась презентация – покажи это...

Слайд 1


Слайд 2

What Is JSON-FP Programs are expressed as a JSON object in a functional programming style.

Слайд 3

Ok. That sounds like something serious, but what does that really mean?

Слайд 4

Introducing JSON-FP JSON-FP uses a JSON object to describe a computer program. If you send a JSON object to JSON-FP to run, you could get a very different object in return.

Слайд 5

Let’s Start With Something Simple var expr = {add: 1} ; jsonfp.apply(1, expr);

Слайд 6

var expr = {add: 1} ; jsonfp.apply(1, expr); That’s the same as saying 1 + 1 1 ? {add: 1} === (1 + 1) Now you know a JSON-FP expression is as simple as: {op: option} Ex: {add: 1}

Слайд 7

JSON-FP allows you to replace ‘option’ with another JSON-FP expression. That makes things… interesting.

Слайд 8

Changing {add: 1} to {add: {‘<‘: 10}} The program changes to: ‘If the input is smaller than 10, add 1 to it.’

Слайд 9

Another Example _.map(list, function(page) { return _.pick(page, ‘title’); }); The above code uses underscore/lodash to remove all but the ‘title’ property from a list of pages.

Слайд 10

If Done By JSON-FP… _.map(list, function(page) { return _.pick(page, ‘title’); }); vs {map: {pick: ‘title’}}

Слайд 11

So you may notice the JSON-FP expression can be very concise and it can help developers to focus on the problem they want to solve.

Слайд 12

But that’s not the whole point…

Слайд 13

Properties/features of JSON-FP: Map/Reduce in the distributed environments. Functional programming Homoiconic / metaprogramming

Слайд 14

Map/reduce, functional programming and homoiconic… Those are too heavy stuff for this introduction. We’ll cover them in the coming slides. But we can talk a little about map/reduce…

Слайд 15

If your application has to query data repositories in a heterogeneous environment, hadoop/spark is NOT a good fit. Try JSON-FP, life will be much easier.

Слайд 16

Any real world applications?

Слайд 17

Well, JSON-FP is less than a month old. Interesting applications are coming… For now, you can check out newsql (https://github.com/benlue/newsql) which uses JSON-FP to query objects. Our next generation API services uses JSON-FP, too.

Слайд 18

That’s it for now. For more JSON-FP examples, check out: https://github.com/benlue/jsonfp-examples The JSON-FP is open sourced at github: https://github.com/benlue/jsonfp