'

What Is JSON-FP

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





Слайд 0

What Is JSON-FP Ben Lue @ COIMOTION


Слайд 1

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


Слайд 2

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


Слайд 3

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.


Слайд 4

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


Слайд 5

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}


Слайд 6

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


Слайд 7

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


Слайд 8

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.


Слайд 9

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


Слайд 10

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.


Слайд 11

But that’s not the whole point…


Слайд 12

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


Слайд 13

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…


Слайд 14

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.


Слайд 15

Any real world applications?


Слайд 16

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.


Слайд 17

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


×

HTML:





Ссылка: