SERVING THE QUANTITATIVE FINANCE COMMUNITY

Polter
Posts: 2526
Joined: April 29th, 2008, 4:55 pm

### Behold the Lambda Calculus

For inspiration:http://cpptruths.blogspot.com/2014/08/f ... lus14/EDIT: Cuch, perhaps fmap is a good way to generalize the compute2(diffusion, 10.0, 0.0) example?
Last edited by Polter on August 28th, 2014, 10:00 pm, edited 1 time in total.

Cuchulainn
Topic Author
Posts: 61589
Joined: July 16th, 2004, 7:38 am
Location: Amsterdam
Contact:

### Behold the Lambda Calculus

auto auto everywhere. Will it replace 'template'?
http://www.datasimfinancial.com
http://www.datasim.nl

Every Time We Teach a Child Something, We Keep Him from Inventing It Himself
Jean Piaget

Cuchulainn
Topic Author
Posts: 61589
Joined: July 16th, 2004, 7:38 am
Location: Amsterdam
Contact:

### Behold the Lambda Calculus

QuoteOriginally posted by: PolterFor inspiration:http://cpptruths.blogspot.com/2014/08/f ... lus14/EDIT: Cuch, perhaps fmap is a good way to generalize the compute2(diffusion, 10.0, 0.0) example?I can't say as I don't know the full impact of FP. I am trying it on ghci> The blog is Ok, but has holes.Ideally, to appreciate C++ 11 I suppose you needCategory theory -> FP -> Haskell | F# -> C++ -> (good) examples.
Last edited by Cuchulainn on September 6th, 2014, 10:00 pm, edited 1 time in total.
http://www.datasimfinancial.com
http://www.datasim.nl

Every Time We Teach a Child Something, We Keep Him from Inventing It Himself
Jean Piaget

exneratunrisk
Posts: 3559
Joined: April 20th, 2004, 12:25 pm

### Behold the Lambda Calculus

Unlambda (make programming painful and difficult)

tagoma
Posts: 18351
Joined: February 21st, 2010, 12:58 pm

### Behold the Lambda Calculus

QuoteOriginally posted by: exneratunriskUnlambda (make programming painful and difficult) LOL "All whitespace is optional and arbitrary."

Polter
Posts: 2526
Joined: April 29th, 2008, 4:55 pm

### Behold the Lambda Calculus

Interestingly, some of what we've discussed is now reaching Java world, too:QuoteDesign Patterns in the Light of Lambda Expressions by SubramaniamWe all have used design pattern in Java for decades. Most of those patterns were influenced by the capability of the language. The capability of the language, however, got better with Java 8. With lambdas, we will use some design patterns differently than before. There are other design patterns that we can use now that were beyond reasonable reach before. If you're into design patterns, what to up your skills on applying patterns with lambdas and related capabilities in Java 8, see you at the session. Pattern Reloaded by Remi ForaxThe introduction of functional interfaces in Java 8 allows to easily use the concepts of functional programming in Java. But Java is still an OOP language, and i think it's interesting to take a look at a little farther and anwser to the question how FP and OOP can be mixed together in Java 8. This talk will use the design patterns of the GoF as a common story, and show a lot of codes explaining how most of the behavioral and creational patterns can be re-written using a mix between FP and OOP in Java. object oriented to functional domain modeling by Mario FuscoThe main consequence of the introduction of lambda expressions in Java 8 is the possibility of conveniently mixing the object oriented and the functional paradigms. Nevertheless the biggest part of Java developers is not used yet to employ functional idioms and then they are not ready to fully leverage the new functional capabilities of Java. In particular it is still uncommon to see functions used together with data in business domain model. The purpose of this talk is not doing a comparison between object oriented and functional programming, but showing how these two styles can be combined in order to take advantage of the good parts of both. For example it's usual to pass a list of data to a function that processes them, but there are cases when you may want to create a list of functions and pass a single data through all of them. Immutable objects leads to a inherently thread-safe domain model. Functions often compose better than objects. Side-effect free code allows better reusability. This talk will demonstrate the validity of these statements with practical examples till to distil the essence of functional programming: data and behaviours are two aspects of the same thing.
Last edited by Polter on November 26th, 2015, 11:00 pm, edited 1 time in total.

Cuchulainn
Topic Author
Posts: 61589
Joined: July 16th, 2004, 7:38 am
Location: Amsterdam
Contact:

### Behold the Lambda Calculus

QuoteInterestingly, some of what we've discussed is now reaching Java world, too:LOL. Took them long enough.
Last edited by Cuchulainn on November 28th, 2015, 11:00 pm, edited 1 time in total.
http://www.datasimfinancial.com
http://www.datasim.nl

Every Time We Teach a Child Something, We Keep Him from Inventing It Himself
Jean Piaget

Cuchulainn
Topic Author
Posts: 61589
Joined: July 16th, 2004, 7:38 am
Location: Amsterdam
Contact:

### Behold the Lambda Calculus

I find lambda functions in combination with Layers pattern in the app/config layer.
Last edited by Cuchulainn on November 27th, 2015, 11:00 pm, edited 1 time in total.
http://www.datasimfinancial.com
http://www.datasim.nl

Every Time We Teach a Child Something, We Keep Him from Inventing It Himself
Jean Piaget

Cuchulainn
Topic Author
Posts: 61589
Joined: July 16th, 2004, 7:38 am
Location: Amsterdam
Contact:

### Behold the Lambda Calculus

Talking about GOF is like first ringing the bricklayer to bulld a house for you. He orders the bricks but will he build a bungalow or two-story for you? Just wait and see. He may need to order more bricks and he might have some left over.I recommend this book (FOR EXAMPLE) as a front-end to GOF. QuoteThis is a definitive book for complex system specification methods. The true test of these methods is evidenced in their staying power. I had the opportunity back in the early '90s to learn these methods from the late Imtiaz Pirbhai himself--their beauty is in their relative simplicity. The strength of the methods can be attributed to clear and concise "language" and nomenclature. The key to specifing and designing a "good system" is the ability to unambiguously express and communicate a model of the system. These tools provide just that. Two views of the system, the "Requirements Model" and the "Architecture Model" are the perfect complement to the iterative nature of complex system development. The book stops short of making the transition from software requirements to a software architecture. However, the methods, if applied correctly, can set the stage for either a "structured" or "object-oriented" software architecture approach. One weakness, based on experience, is applying the "User Interface" component of the "Architecture Template" to Graphical User Interface (GUI)-intensive systems, which tend to put the user in the center of the system's universe, rather than on the periphery.
Last edited by Cuchulainn on November 26th, 2015, 11:00 pm, edited 1 time in total.
http://www.datasimfinancial.com
http://www.datasim.nl

Every Time We Teach a Child Something, We Keep Him from Inventing It Himself
Jean Piaget

Cuchulainn
Topic Author
Posts: 61589
Joined: July 16th, 2004, 7:38 am
Location: Amsterdam
Contact:

### Behold the Lambda Calculus

On a related topic Delegates in .NET C++ does not have them (if you discount Boost signals2). Java Delegates??How do you do event-driven programming in C++11
Last edited by Cuchulainn on November 28th, 2015, 11:00 pm, edited 1 time in total.
http://www.datasimfinancial.com
http://www.datasim.nl

Every Time We Teach a Child Something, We Keep Him from Inventing It Himself
Jean Piaget

Cuchulainn
Topic Author
Posts: 61589
Joined: July 16th, 2004, 7:38 am
Location: Amsterdam
Contact:

### Behold the Lambda Calculus

QuoteOriginally posted by: outrunI've used a priority queue that contain pointers to callables. New events get pushed on the queue. One (or more) event processors pop events from the queue and call them. We also uses asio, mainly for communication between different machines.Are they 'scoped callbacks' i.e. automagically cleaned up when then go out of scope?
http://www.datasimfinancial.com
http://www.datasim.nl

Every Time We Teach a Child Something, We Keep Him from Inventing It Himself
Jean Piaget

Cuchulainn
Topic Author
Posts: 61589
Joined: July 16th, 2004, 7:38 am
Location: Amsterdam
Contact:

### Behold the Lambda Calculus

QuoteOriginally posted by: outrunQuoteOriginally posted by: CuchulainnQuoteOriginally posted by: outrunI've used a priority queue that contain pointers to callables. New events get pushed on the queue. One (or more) event processors pop events from the queue and call them. We also uses asio, mainly for communication between different machines.Are they 'scoped callbacks' i.e. automagically cleaned up when then go out of scope?Phew, that a difficult question. It was a long time ago, we used boost::bind and it just worked. I bet there are better options now for that part, but a priority queue where all events flow through and maintain order was for us important. I'm now programming mostly in JavaScript and on top of node.js, and there I also see these priority queues and bound callables/callbacks. I also see libs (in JavaScript) use futures and promises. Maybe that's also an interesting approach for C++?I've seen the Observer pattern (are you familiar with it..) a lot (e.g. RiskWatch, Quantlib and many non-finance). It's severely flawed in so many ways. But programmers stubbornly hang on to it. All that boiler plate code.The structural solution (partly) scoped connection
http://www.datasimfinancial.com
http://www.datasim.nl

Every Time We Teach a Child Something, We Keep Him from Inventing It Himself
Jean Piaget