21
THE IMPROBABLE STORY OF: FP AND ENTREPRENEURSHIP

Fp and entrepreneurship

Embed Size (px)

DESCRIPTION

Given by Xavier Tordoir and my self for the students of University of Liège. This slide is a poor export of this one: http://slides.com/xa_ndy/fp-and-entrepreneurship

Citation preview

Page 1: Fp and entrepreneurship

THEIMPROBABLESTORYOF:

FPANDENTREPRENEURSHIP

Page 2: Fp and entrepreneurship

WHOAREWE?

Page 3: Fp and entrepreneurship

XAVIERTORDOIR

Page 4: Fp and entrepreneurship

ANDYPETRELLA

Page 5: Fp and entrepreneurship

Findyourways

Picksomeanddig

Mémoire:polishingphase

STUDYING=:=FUTURE[OPTION[JOB]]

Grabthebasis

Page 6: Fp and entrepreneurship

JOB=:=(WORK=>OPTION[EXPERIENCE])=>OPTION[MONEY]

Workingwillprobablyraiseyourexperience

Basedonthisexperience,youmightgetsomemoney

Experiencemightnotbeenough

Itwilldependonthekindofexperience

Page 7: Fp and entrepreneurship

IT'SNOTTHATEASYProposal:

Job=:=((Work,Explore,Learn)=>Option[Expertize])=>Option[(Money,()=>Future[Option[Job]])]

Stillsomework*sight* Butneverstoplearning,norexploring

Expertizeislikeexperience,yetrarer

Money,theunfortunateobligation

Createyoursecretsauce,alazycalltoJob

Page 8: Fp and entrepreneurship

WORKINGINIT

Everythingisdistributed

Cluesforanswersareindata

Answerquestions

Page 9: Fp and entrepreneurship

MOREANDMOREDATA

Industrialdata

energygridproductionlinesfinancetransport...

Page 10: Fp and entrepreneurship

MOREANDMOREDATA

Peopledata

web1.0:fewcontrolcontentweb2.0:lotsofend-usersmanualfeedwebx.y:lotsofcaptorsperuser

Page 11: Fp and entrepreneurship

MOREANDMOREDATA

Whydowecollectdata?

Wealwaysmisssomeatsomepointsomethingofvalueisencodedcollaborativeconsiousness

Page 12: Fp and entrepreneurship

MOBILE?REALLY?

Providingcontent=aggregatedistributedsources

BUTinsmallquantity(networkisthebottleneck)

Yesdataisavailablefromanywhere

Page 13: Fp and entrepreneurship

ITISACOMMODITY

...evendevelopment

Everythingdoneisdistributed

Software(SaaS):usermanagement,social

loginproductsupportonlinebilling/paymentaccesstodatasources

Infrastructure(IaaS):storage,servers...

Page 14: Fp and entrepreneurship

ATECHSTARTUP

Managingdistributedresourcesiskey!

GathersdistributeddatasourcesCallsdistributedservicescollectsrawdatadoessomeaggregationMustbeabletoscaleresourcesandcosts

Page 15: Fp and entrepreneurship

FP?

Failuremanagement

Asynchronouscalls

FPdescribetheresultyouwant,nothowyougetit

Threads,cores,servers,datacenters

IfFPgetsaglobaladoptionitwillbebecauseitsolvesissuesrelatedtothedistributedenvironment.

Complexityofdistribution

Page 16: Fp and entrepreneurship

FPINTHEINDUSTRY?ExamplesofpopularlanguageswithOOand

FPjavascriptrubyJava8scala

Page 17: Fp and entrepreneurship

AWAIT[_]

Page 18: Fp and entrepreneurship

EVAL[EXPRESSION]SCALA

valgetQueryParameter[T]=(request:Request)=>(name:String)=>request.query.parameters.get(name).as[T]

abstractclassRequest[T](valbody:Body[T])extendsQuerywithHeader{defparser:BodyParser[T]

valcontent:Option[T]=parser(body)

defsend(to:Service)=???}

caseclassHttpRequest[T](method:Method,body:Body)(implicitparser:BodyParser[T])extendsRequest(body){//...}

Page 19: Fp and entrepreneurship

PLAY!FRAMEWORK2

AsyncHTTP

Eventdriven/ConcurrencyusingActor

Non-blockingIO(reactive:Iteratee/CPS)

Stateless

objectDummyextendsController{//returnasync'lythe#ofusersw/namestart'gw/q"char"defcountAs=Action.async{request=>valchar=request.queryString("char")valall:Future[Seq[User]]=users.all//orWS.urlOk(all.map(_.count(_.namestartsWith"a")))}

}

Page 20: Fp and entrepreneurship

AKKA

Messagepassingstyle

Messagesareimmutable

Actorsaremutable(stateful) Threadsafetyby

confinement

Locationtransparency

classUserRepoextendsActor{varusers=Set.empty

defreceive={caseAdd(user:User)=>users=users+usercaseAll=>sender!userscaseGet(id:String)=>user=users.find(_.id==id)sender!user}}

objectAkkaAppextendsApp{//...

valrepo=system.actorOf(Props[UserRepo])

//addrepo!Add(User(1L,"")

//getvaluser=repo?Get(1L)}

Page 21: Fp and entrepreneurship

SPARK

TendstoresolveBigDatasolutionflawsProvidesanabstractionondistributeddata

Usinganextendedfunctionalstyle(notonlyMR)Representsadistributedcomputationasa

GraphIn-Memory!

valsc=newSparkContext(/*...*/)lines=sc.textFile("hdfs://...")errors=lines.filter(_.startsWith("ERROR"))errors.filter(_.contains("HDFS")).map(_.split('\t')(3)).collect()