Presentation on Functional Programming in a for-profit company using OCaml, presented on December 14th 2011 at Ghent University (UGent).
Due to the Haskell background of the attendees, OCaml was introduced with this in mind.
AdRoll Tech Talk Presentation:
In this talk I present three approaches to understanding monads:
- How Monads Arise Naturally
- Monads as Implemented in Haskell
- Monads in Category Theory
What does it mean to be Reactive? The concept of Reactive Programming has gained much traction in the last few years as a paradigm well-suited for the development of asynchronous event-driven applications. Unfortunately, reactive programming has been at the center of much discussion, if not confusion, with regards to its definition, properties and identifying principles. In this talk I am going to wield the most powerful tool available to software engineers, mathematics, in order to formally derive the reactive types and bring clarity to this much opinionated topic.
AdRoll Tech Talk Presentation:
In this talk I present three approaches to understanding monads:
- How Monads Arise Naturally
- Monads as Implemented in Haskell
- Monads in Category Theory
What does it mean to be Reactive? The concept of Reactive Programming has gained much traction in the last few years as a paradigm well-suited for the development of asynchronous event-driven applications. Unfortunately, reactive programming has been at the center of much discussion, if not confusion, with regards to its definition, properties and identifying principles. In this talk I am going to wield the most powerful tool available to software engineers, mathematics, in order to formally derive the reactive types and bring clarity to this much opinionated topic.
(Demo code and video available at http://fsharpforfunandprofit.com/cap/)
We all want to produce modular and robust code that is easy to test and refactor, and we have design principles such as SOLID that help us do that.
In this talk I'll look at a very different approach to design using "capabilities" and the principle of least authority. I'll show how using these design techniques throughout your core domain (and not just at your API boundary) also leads to well-designed and modular code.
I'll demonstrate how to design and use a capability based approach, how capabilities can be quickly combined and restricted easily, and how capabilities are a natural fit with a REST API that uses HATEAOS.
(Video available at http://fsharpforfunandprofit.com/monadster/)
You've got a pile of assorted functions lying around. Each one is useful and reliable, but they just don't fit together properly. How can you assemble them into a complete system that can stand on its own two feet and terrorize the local villagers?
In this session, I'll show how functional programming can transform all sorts of existing code into shapes that are plug-compatible and which can be bolted together effortlessly.
SAFETY NOTE: The techniques demonstrated are perfectly harmless and can even be used at your workplace -- no lightning bolts required.
Author: Vladimir Khorikov www.eastbanctech.com
With the advent of LINQ, C# has gotten a significant exposure to functional programming. However, functional programming in C# is not restricted to the use of extension methods, lambdas and immutable classes. There are a lot of practices that haven't been adopted as widely because there's not much of native language support for them in C#. Still, they can be extremely beneficial should you incorporate them into your day-to-day work.
From this presentation you’ll learn:
• The fundamental principles behind functional programming,
• Why they are important,
• How to apply them in practice.
Domain Driven Design with the F# type System -- NDC London 2013Scott Wlaschin
(Video of these slides here http://fsharpforfunandprofit.com/ddd)
Statically typed functional programming languages like F# encourage a very different way of thinking about types. The type system is your friend, not an annoyance, and can be used in many ways that might not be familiar to OO programmers.
Types can be used to represent the domain in a fine-grained, self documenting way. And in many cases, types can even be used to encode business rules so that you literally cannot create incorrect code. You can then use the static type checking almost as an instant unit test — making sure that your code is correct at compile time.
In this talk, we'll look at some of the ways you can use types as part of a domain driven design process, with some simple real world examples in F#. No jargon, no maths, and no prior F# experience necessary.
Code, links to video, etc., at http://fsharpforfunandprofit.com/ddd
For more on DDD and F# see:
http://fsharpforfunandprofit.com/ddd/
http://tomasp.net/blog/type-first-development.aspx/
http://gorodinski.com/blog/2013/02/17/domain-driven-design-with-fsharp-and-eventstore/
(Video and code available at http://fsharpforfunandprofit.com/cap)
In this talk I'll look at a unusual approach to designing internal interfaces and external APIs -- a "capability-based" approach that takes the Principle Of Least Authority and applies it to software design.
When this approach is used, it produces a robust and modular design which captures the domain constraints, resulting in an API which is self-documenting and hard to misuse.
I'll demonstrate how to design and implement a capability based approach, how capabilities can be quickly combined and restricted easily, and how capabilities are a natural fit with a REST API that uses HATEOAS.
(Video and code available at http://fsharpforfunandprofit.com/turtle)
In this fast-paced talk, I'll start with the well known API for turtle graphics, and then stretch it to the breaking point by creating 13 different implementations, each demonstrating a different functional programming technique.
Along the way, we'll use partial application, functional dependency injection, validation
with Success/Failure results, the Either monad, the State monad, agents with message queues, event sourcing, stream processing, capability-based design, and the interpreter pattern (aka free monad). Phew!
How can we implement concepts of Lambda Calculus and Category Theory in C# and F#:
- Lambda Calculus: The importance of expressions to build a robust and reasonable program flow
- Category Theory: How to apply functional concepts like functors, applicatives or monads to deal wit
Video and related blog posts at fsharpforfunandprofit.com/ettt
Follow along as I ridiculously over-engineer a simple game to demonstrate how functional programming can be used to create a real-world "enterprise-ready" application.
Topics covered include: encoding business rules into types, data hiding with parametric polymorphism, using functions for capability-based security, exposing a REST API with HATEAOS, the functional approach to logging, actors, scalability and more.
(Demo code and video available at http://fsharpforfunandprofit.com/cap/)
We all want to produce modular and robust code that is easy to test and refactor, and we have design principles such as SOLID that help us do that.
In this talk I'll look at a very different approach to design using "capabilities" and the principle of least authority. I'll show how using these design techniques throughout your core domain (and not just at your API boundary) also leads to well-designed and modular code.
I'll demonstrate how to design and use a capability based approach, how capabilities can be quickly combined and restricted easily, and how capabilities are a natural fit with a REST API that uses HATEAOS.
(Video available at http://fsharpforfunandprofit.com/monadster/)
You've got a pile of assorted functions lying around. Each one is useful and reliable, but they just don't fit together properly. How can you assemble them into a complete system that can stand on its own two feet and terrorize the local villagers?
In this session, I'll show how functional programming can transform all sorts of existing code into shapes that are plug-compatible and which can be bolted together effortlessly.
SAFETY NOTE: The techniques demonstrated are perfectly harmless and can even be used at your workplace -- no lightning bolts required.
Author: Vladimir Khorikov www.eastbanctech.com
With the advent of LINQ, C# has gotten a significant exposure to functional programming. However, functional programming in C# is not restricted to the use of extension methods, lambdas and immutable classes. There are a lot of practices that haven't been adopted as widely because there's not much of native language support for them in C#. Still, they can be extremely beneficial should you incorporate them into your day-to-day work.
From this presentation you’ll learn:
• The fundamental principles behind functional programming,
• Why they are important,
• How to apply them in practice.
Domain Driven Design with the F# type System -- NDC London 2013Scott Wlaschin
(Video of these slides here http://fsharpforfunandprofit.com/ddd)
Statically typed functional programming languages like F# encourage a very different way of thinking about types. The type system is your friend, not an annoyance, and can be used in many ways that might not be familiar to OO programmers.
Types can be used to represent the domain in a fine-grained, self documenting way. And in many cases, types can even be used to encode business rules so that you literally cannot create incorrect code. You can then use the static type checking almost as an instant unit test — making sure that your code is correct at compile time.
In this talk, we'll look at some of the ways you can use types as part of a domain driven design process, with some simple real world examples in F#. No jargon, no maths, and no prior F# experience necessary.
Code, links to video, etc., at http://fsharpforfunandprofit.com/ddd
For more on DDD and F# see:
http://fsharpforfunandprofit.com/ddd/
http://tomasp.net/blog/type-first-development.aspx/
http://gorodinski.com/blog/2013/02/17/domain-driven-design-with-fsharp-and-eventstore/
(Video and code available at http://fsharpforfunandprofit.com/cap)
In this talk I'll look at a unusual approach to designing internal interfaces and external APIs -- a "capability-based" approach that takes the Principle Of Least Authority and applies it to software design.
When this approach is used, it produces a robust and modular design which captures the domain constraints, resulting in an API which is self-documenting and hard to misuse.
I'll demonstrate how to design and implement a capability based approach, how capabilities can be quickly combined and restricted easily, and how capabilities are a natural fit with a REST API that uses HATEOAS.
(Video and code available at http://fsharpforfunandprofit.com/turtle)
In this fast-paced talk, I'll start with the well known API for turtle graphics, and then stretch it to the breaking point by creating 13 different implementations, each demonstrating a different functional programming technique.
Along the way, we'll use partial application, functional dependency injection, validation
with Success/Failure results, the Either monad, the State monad, agents with message queues, event sourcing, stream processing, capability-based design, and the interpreter pattern (aka free monad). Phew!
How can we implement concepts of Lambda Calculus and Category Theory in C# and F#:
- Lambda Calculus: The importance of expressions to build a robust and reasonable program flow
- Category Theory: How to apply functional concepts like functors, applicatives or monads to deal wit
Video and related blog posts at fsharpforfunandprofit.com/ettt
Follow along as I ridiculously over-engineer a simple game to demonstrate how functional programming can be used to create a real-world "enterprise-ready" application.
Topics covered include: encoding business rules into types, data hiding with parametric polymorphism, using functions for capability-based security, exposing a REST API with HATEAOS, the functional approach to logging, actors, scalability and more.
With Anaconda (in particular Numba and Dask) you can scale up your NumPy and Pandas stack to many cpus and GPUs as well as scale-out to run on clusters of machines including Hadoop.
Python libraries presentation Contains all top 10 labraries information like numpy,tenslorflow,scikit-learn,Numpy,keras,PyToruch,LightGBM,Eli5,scipy,theano,pandas
FC-Compiler™ is a (free) Calculus-level Compiler that simplifies Tweaking parameters in ones math model. The FortranCalculus (FC) language is for math modeling, simulation, and optimization. FC is based on Automatic Differentiation that simplifies computer code to an absolute minimum; i.e., a mathematical model, constraints, and the objective (function) definition. Minimizing the amount of code allows the user to concentrate on the science or engineering problem at hand and not on the (numerical) process requirements to achieve an optimum solution. Download at http://goal-driven.net/apps/fc-compiler.html
FC-Compiler™ App has many (50+) example problems with output (see 'Demos' on main menu) for viewing and getting ideas on solving your own problems. These are improved productivity examples do to using Calculus-level Problem-Solving. Please share this Calculus Problem-Solving tool with your friends. Thanks!
An introductory talk on scientific computing in Python. Statistics, probability and linear algebra, are important aspects of computing/computer modeling and the same is covered here.
Cassandra Day SV 2014: Spark, Shark, and Apache CassandraDataStax Academy
This session covers our experience with using the Spark and Shark frameworks for running real-time queries on top of Cassandra data.We will start by surveying the current Cassandra analytics landscape, including Hadoop and HIVE, and touch on the use of custom input formats to extract data from Cassandra. We will then dive into Spark and Shark, two memory-based cluster computing frameworks, and how they enable often dramatic improvements in query speed and productivity, over the standard solutions today.
Many companies have invested time and money into building sophisticated data pipelines that can move massive amounts of data, often in real time. However, for the analyst or data scientist who builds offline models, integrating their analyses into these pipelines for operational purposes can pose a challenge.
In this slide deck, we will discuss some key technologies and workflows companies can leverage to build end-to-end solutions for automating statistical and machine learning solutions: from collection and storage to analysis and real-time predictions.
Learn how to get small teams to embrace both using and contributing to open source in a healthy way. See case studies of open source projects and how they have contributed to the growth of a small team.
Talk given at first OmniSci user conference where I discuss cooperating with open-source communities to ensure you get useful answers quickly from your data. I get a chance to introduce OpenTeams in this talk as well and discuss how it can help companies cooperate with communities.
Similar to Real-World Functional Programming @ Incubaid (20)
Full-RAG: A modern architecture for hyper-personalizationZilliz
Mike Del Balso, CEO & Co-Founder at Tecton, presents "Full RAG," a novel approach to AI recommendation systems, aiming to push beyond the limitations of traditional models through a deep integration of contextual insights and real-time data, leveraging the Retrieval-Augmented Generation architecture. This talk will outline Full RAG's potential to significantly enhance personalization, address engineering challenges such as data management and model training, and introduce data enrichment with reranking as a key solution. Attendees will gain crucial insights into the importance of hyperpersonalization in AI, the capabilities of Full RAG for advanced personalization, and strategies for managing complex data integrations for deploying cutting-edge AI solutions.
In his public lecture, Christian Timmerer provides insights into the fascinating history of video streaming, starting from its humble beginnings before YouTube to the groundbreaking technologies that now dominate platforms like Netflix and ORF ON. Timmerer also presents provocative contributions of his own that have significantly influenced the industry. He concludes by looking at future challenges and invites the audience to join in a discussion.
Epistemic Interaction - tuning interfaces to provide information for AI supportAlan Dix
Paper presented at SYNERGY workshop at AVI 2024, Genoa, Italy. 3rd June 2024
https://alandix.com/academic/papers/synergy2024-epistemic/
As machine learning integrates deeper into human-computer interactions, the concept of epistemic interaction emerges, aiming to refine these interactions to enhance system adaptability. This approach encourages minor, intentional adjustments in user behaviour to enrich the data available for system learning. This paper introduces epistemic interaction within the context of human-system communication, illustrating how deliberate interaction design can improve system understanding and adaptation. Through concrete examples, we demonstrate the potential of epistemic interaction to significantly advance human-computer interaction by leveraging intuitive human communication strategies to inform system design and functionality, offering a novel pathway for enriching user-system engagements.
Building RAG with self-deployed Milvus vector database and Snowpark Container...Zilliz
This talk will give hands-on advice on building RAG applications with an open-source Milvus database deployed as a docker container. We will also introduce the integration of Milvus with Snowpark Container Services.
How to Get CNIC Information System with Paksim Ga.pptxdanishmna97
Pakdata Cf is a groundbreaking system designed to streamline and facilitate access to CNIC information. This innovative platform leverages advanced technology to provide users with efficient and secure access to their CNIC details.
Securing your Kubernetes cluster_ a step-by-step guide to success !KatiaHIMEUR1
Today, after several years of existence, an extremely active community and an ultra-dynamic ecosystem, Kubernetes has established itself as the de facto standard in container orchestration. Thanks to a wide range of managed services, it has never been so easy to set up a ready-to-use Kubernetes cluster.
However, this ease of use means that the subject of security in Kubernetes is often left for later, or even neglected. This exposes companies to significant risks.
In this talk, I'll show you step-by-step how to secure your Kubernetes cluster for greater peace of mind and reliability.
Enchancing adoption of Open Source Libraries. A case study on Albumentations.AIVladimir Iglovikov, Ph.D.
Presented by Vladimir Iglovikov:
- https://www.linkedin.com/in/iglovikov/
- https://x.com/viglovikov
- https://www.instagram.com/ternaus/
This presentation delves into the journey of Albumentations.ai, a highly successful open-source library for data augmentation.
Created out of a necessity for superior performance in Kaggle competitions, Albumentations has grown to become a widely used tool among data scientists and machine learning practitioners.
This case study covers various aspects, including:
People: The contributors and community that have supported Albumentations.
Metrics: The success indicators such as downloads, daily active users, GitHub stars, and financial contributions.
Challenges: The hurdles in monetizing open-source projects and measuring user engagement.
Development Practices: Best practices for creating, maintaining, and scaling open-source libraries, including code hygiene, CI/CD, and fast iteration.
Community Building: Strategies for making adoption easy, iterating quickly, and fostering a vibrant, engaged community.
Marketing: Both online and offline marketing tactics, focusing on real, impactful interactions and collaborations.
Mental Health: Maintaining balance and not feeling pressured by user demands.
Key insights include the importance of automation, making the adoption process seamless, and leveraging offline interactions for marketing. The presentation also emphasizes the need for continuous small improvements and building a friendly, inclusive community that contributes to the project's growth.
Vladimir Iglovikov brings his extensive experience as a Kaggle Grandmaster, ex-Staff ML Engineer at Lyft, sharing valuable lessons and practical advice for anyone looking to enhance the adoption of their open-source projects.
Explore more about Albumentations and join the community at:
GitHub: https://github.com/albumentations-team/albumentations
Website: https://albumentations.ai/
LinkedIn: https://www.linkedin.com/company/100504475
Twitter: https://x.com/albumentations
zkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex ProofsAlex Pruden
This paper presents Reef, a system for generating publicly verifiable succinct non-interactive zero-knowledge proofs that a committed document matches or does not match a regular expression. We describe applications such as proving the strength of passwords, the provenance of email despite redactions, the validity of oblivious DNS queries, and the existence of mutations in DNA. Reef supports the Perl Compatible Regular Expression syntax, including wildcards, alternation, ranges, capture groups, Kleene star, negations, and lookarounds. Reef introduces a new type of automata, Skipping Alternating Finite Automata (SAFA), that skips irrelevant parts of a document when producing proofs without undermining soundness, and instantiates SAFA with a lookup argument. Our experimental evaluation confirms that Reef can generate proofs for documents with 32M characters; the proofs are small and cheap to verify (under a second).
Paper: https://eprint.iacr.org/2023/1886
In the rapidly evolving landscape of technologies, XML continues to play a vital role in structuring, storing, and transporting data across diverse systems. The recent advancements in artificial intelligence (AI) present new methodologies for enhancing XML development workflows, introducing efficiency, automation, and intelligent capabilities. This presentation will outline the scope and perspective of utilizing AI in XML development. The potential benefits and the possible pitfalls will be highlighted, providing a balanced view of the subject.
We will explore the capabilities of AI in understanding XML markup languages and autonomously creating structured XML content. Additionally, we will examine the capacity of AI to enrich plain text with appropriate XML markup. Practical examples and methodological guidelines will be provided to elucidate how AI can be effectively prompted to interpret and generate accurate XML markup.
Further emphasis will be placed on the role of AI in developing XSLT, or schemas such as XSD and Schematron. We will address the techniques and strategies adopted to create prompts for generating code, explaining code, or refactoring the code, and the results achieved.
The discussion will extend to how AI can be used to transform XML content. In particular, the focus will be on the use of AI XPath extension functions in XSLT, Schematron, Schematron Quick Fixes, or for XML content refactoring.
The presentation aims to deliver a comprehensive overview of AI usage in XML development, providing attendees with the necessary knowledge to make informed decisions. Whether you’re at the early stages of adopting AI or considering integrating it in advanced XML development, this presentation will cover all levels of expertise.
By highlighting the potential advantages and challenges of integrating AI with XML development tools and languages, the presentation seeks to inspire thoughtful conversation around the future of XML development. We’ll not only delve into the technical aspects of AI-powered XML development but also discuss practical implications and possible future directions.
Dr. Sean Tan, Head of Data Science, Changi Airport Group
Discover how Changi Airport Group (CAG) leverages graph technologies and generative AI to revolutionize their search capabilities. This session delves into the unique search needs of CAG’s diverse passengers and customers, showcasing how graph data structures enhance the accuracy and relevance of AI-generated search results, mitigating the risk of “hallucinations” and improving the overall customer journey.
DevOps and Testing slides at DASA ConnectKari Kakkonen
My and Rik Marselis slides at 30.5.2024 DASA Connect conference. We discuss about what is testing, then what is agile testing and finally what is Testing in DevOps. Finally we had lovely workshop with the participants trying to find out different ways to think about quality and testing in different parts of the DevOps infinity loop.
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024Neo4j
Neha Bajwa, Vice President of Product Marketing, Neo4j
Join us as we explore breakthrough innovations enabled by interconnected data and AI. Discover firsthand how organizations use relationships in data to uncover contextual insights and solve our most pressing challenges – from optimizing supply chains, detecting fraud, and improving customer experiences to accelerating drug discoveries.
Essentials of Automations: The Art of Triggers and Actions in FMESafe Software
In this second installment of our Essentials of Automations webinar series, we’ll explore the landscape of triggers and actions, guiding you through the nuances of authoring and adapting workspaces for seamless automations. Gain an understanding of the full spectrum of triggers and actions available in FME, empowering you to enhance your workspaces for efficient automation.
We’ll kick things off by showcasing the most commonly used event-based triggers, introducing you to various automation workflows like manual triggers, schedules, directory watchers, and more. Plus, see how these elements play out in real scenarios.
Whether you’re tweaking your current setup or building from the ground up, this session will arm you with the tools and insights needed to transform your FME usage into a powerhouse of productivity. Join us to discover effective strategies that simplify complex processes, enhancing your productivity and transforming your data management practices with FME. Let’s turn complexity into clarity and make your workspaces work wonders!
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...James Anderson
Effective Application Security in Software Delivery lifecycle using Deployment Firewall and DBOM
The modern software delivery process (or the CI/CD process) includes many tools, distributed teams, open-source code, and cloud platforms. Constant focus on speed to release software to market, along with the traditional slow and manual security checks has caused gaps in continuous security as an important piece in the software supply chain. Today organizations feel more susceptible to external and internal cyber threats due to the vast attack surface in their applications supply chain and the lack of end-to-end governance and risk management.
The software team must secure its software delivery process to avoid vulnerability and security breaches. This needs to be achieved with existing tool chains and without extensive rework of the delivery processes. This talk will present strategies and techniques for providing visibility into the true risk of the existing vulnerabilities, preventing the introduction of security issues in the software, resolving vulnerabilities in production environments quickly, and capturing the deployment bill of materials (DBOM).
Speakers:
Bob Boule
Robert Boule is a technology enthusiast with PASSION for technology and making things work along with a knack for helping others understand how things work. He comes with around 20 years of solution engineering experience in application security, software continuous delivery, and SaaS platforms. He is known for his dynamic presentations in CI/CD and application security integrated in software delivery lifecycle.
Gopinath Rebala
Gopinath Rebala is the CTO of OpsMx, where he has overall responsibility for the machine learning and data processing architectures for Secure Software Delivery. Gopi also has a strong connection with our customers, leading design and architecture for strategic implementations. Gopi is a frequent speaker and well-known leader in continuous delivery and integrating security into software delivery.
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
Real-World Functional Programming @ Incubaid
1. About Incubaid
Functional Programming @ Incubaid
OCaml
Conclusion
Real-World Functional Programming @
Incubaid
Romain Slootmaekers Nicolas Trangez
Incubaid BVBA
{romain,nicolas}@incubaid.com
Twitter: @incubaid
Team Blog: blog.incubaid.com
Romain Slootmaekers, Nicolas Trangez Real-World Functional Programming @ Incubaid
2. About Incubaid
Functional Programming @ Incubaid
OCaml
Conclusion
1 About Incubaid
2 Functional Programming @ Incubaid
Why FP?
Current Projects
3 OCaml
OCaml vs. Haskell
Code Teaser
4 Conclusion
Romain Slootmaekers, Nicolas Trangez Real-World Functional Programming @ Incubaid
3. About Incubaid
Functional Programming @ Incubaid
OCaml
Conclusion
Outline
1 About Incubaid
2 Functional Programming @ Incubaid
Why FP?
Current Projects
3 OCaml
OCaml vs. Haskell
Code Teaser
4 Conclusion
Romain Slootmaekers, Nicolas Trangez Real-World Functional Programming @ Incubaid
4. About Incubaid
Functional Programming @ Incubaid
OCaml
Conclusion
Company Overview
Technology incubator
Creating & providing services to startups
Not a VC, collaboration with external parties
Main activities: Datacenter & Cloud Computing
Romain Slootmaekers, Nicolas Trangez Real-World Functional Programming @ Incubaid
5. About Incubaid
Functional Programming @ Incubaid
OCaml
Conclusion
History
Dedigate (2000)
acquired by Terremark (2005)
Hostbasket (2000)
acquired by Telenet (2008)
DataCenter Technologies (2002)
acquired by Veritas/Symantec (2005)
Q-Layer (2007)
acquired by Sun Microsystems (2009)
Romain Slootmaekers, Nicolas Trangez Real-World Functional Programming @ Incubaid
6. About Incubaid
Functional Programming @ Incubaid Why FP?
OCaml Current Projects
Conclusion
Outline
1 About Incubaid
2 Functional Programming @ Incubaid
Why FP?
Current Projects
3 OCaml
OCaml vs. Haskell
Code Teaser
4 Conclusion
Romain Slootmaekers, Nicolas Trangez Real-World Functional Programming @ Incubaid
7. About Incubaid
Functional Programming @ Incubaid Why FP?
OCaml Current Projects
Conclusion
Outline
1 About Incubaid
2 Functional Programming @ Incubaid
Why FP?
Current Projects
3 OCaml
OCaml vs. Haskell
Code Teaser
4 Conclusion
Romain Slootmaekers, Nicolas Trangez Real-World Functional Programming @ Incubaid
8. About Incubaid
Functional Programming @ Incubaid Why FP?
OCaml Current Projects
Conclusion
Development Benefits
Code quality
Correctness
Easy refactoring
Performance
Developer performance (Getting Things Done)
Developer satisfaction
Developer quality (hiring!)
Not the average “Enterprise Developer” ;-)
Mathematical background or interests
Good at logical, conceptual reasoning
Smaller prototype-to-production cycle
Romain Slootmaekers, Nicolas Trangez Real-World Functional Programming @ Incubaid
9. About Incubaid
Functional Programming @ Incubaid Why FP?
OCaml Current Projects
Conclusion
Ideal fit for our Application Domains
Handling large opaque data blobs (DSS)
System & application automation (SSO)
Highly scalable distributed systems
Large scale implies constant random failure
Transactions? Where, why, how?
Concurrency
Immutability of data, purity of operations, idempotent
actions,. . . allow to reason about systems and their
behaviour
Romain Slootmaekers, Nicolas Trangez Real-World Functional Programming @ Incubaid
10. About Incubaid
Functional Programming @ Incubaid Why FP?
OCaml Current Projects
Conclusion
FP: more than languages
Note
Functional Programming is not only about languages. Insight in
FP concepts and techniques can bring radical improvements to
the architecture and design of software, especially in
large-scale, highly-unreliable environments.
Romain Slootmaekers, Nicolas Trangez Real-World Functional Programming @ Incubaid
11. About Incubaid
Functional Programming @ Incubaid Why FP?
OCaml Current Projects
Conclusion
Outline
1 About Incubaid
2 Functional Programming @ Incubaid
Why FP?
Current Projects
3 OCaml
OCaml vs. Haskell
Code Teaser
4 Conclusion
Romain Slootmaekers, Nicolas Trangez Real-World Functional Programming @ Incubaid
12. About Incubaid
Functional Programming @ Incubaid Why FP?
OCaml Current Projects
Conclusion
Amplidata DSS
Next-generation large object storage
Redundant storage of petabytes of big files
Dispersed storage using rateless codes
Initial version: C++
Current version: OCaml (90%), C (9%), Asm (1%)
More info @ amplidata.com
Romain Slootmaekers, Nicolas Trangez Real-World Functional Programming @ Incubaid
14. About Incubaid
Functional Programming @ Incubaid Why FP?
OCaml Current Projects
Conclusion
Arakoon
Distributed, consistent, persistent key-value store
Multi-Paxos implementation
TokyoCabinet backend
OCaml
Open Source, see http://www.arakoon.org/
A nursery of two 3-node clusters
Cluster A A0 client0 client2 Cluster B B0 client1
A1 B1
A2 B2
Romain Slootmaekers, Nicolas Trangez Real-World Functional Programming @ Incubaid
15. About Incubaid
Functional Programming @ Incubaid Why FP?
OCaml Current Projects
Conclusion
Baardskeerder
Local, in-process key-value database
Append-only B-tree-ish, persistent
Replace TokyoCabinet which can’t cope with large values
Benefits of and doesn’t kill SSD drives
OCaml (future Arakoon backend)
Not publicly available yet
Follow @incubaid or blog.incubaid.com for updates
Romain Slootmaekers, Nicolas Trangez Real-World Functional Programming @ Incubaid
16. About Incubaid
Functional Programming @ Incubaid Why FP?
OCaml Current Projects
Conclusion
Baardskeerder (Cont.)
Tree Construction
0: Value "A"
1: Leaf [ " a " , Outer 0 ]
2: Commit ( Outer 1 )
a b c 3: Value "B"
4: Leaf [ " a " , Outer 0 ; " b " , Outer 3 ]
5: Commit ( Outer 4 )
6: Value "C"
A B C 7: Leaf [ " a " , Outer 0 ; " b " , Outer 3 ; " c " , Outer 6 ]
8: Commit ( Outer 7 )
Romain Slootmaekers, Nicolas Trangez Real-World Functional Programming @ Incubaid
17. About Incubaid
Functional Programming @ Incubaid OCaml vs. Haskell
OCaml Code Teaser
Conclusion
Outline
1 About Incubaid
2 Functional Programming @ Incubaid
Why FP?
Current Projects
3 OCaml
OCaml vs. Haskell
Code Teaser
4 Conclusion
Romain Slootmaekers, Nicolas Trangez Real-World Functional Programming @ Incubaid
18. About Incubaid
Functional Programming @ Incubaid OCaml vs. Haskell
OCaml Code Teaser
Conclusion
Introduction
Objective Caml
Objective Categorical Abstract Machine/Meta Language
Dialect of ML
Descendents include Microsoft F#, JoCaml (, Scala)
Static typing using type inference
Eager evaluation (by default)
Emphasis on performance, both in language features as
well as standard library implementation
Romain Slootmaekers, Nicolas Trangez Real-World Functional Programming @ Incubaid
19. About Incubaid
Functional Programming @ Incubaid OCaml vs. Haskell
OCaml Code Teaser
Conclusion
Timeline
1970 1980 1990 2000 2010
Caml
Ocaml
F#
ML
Miranda
Haskell
Standard ML
Prolog
Erlang
C
C++
Scala
Java
C#
1970 1980 1990 2000 2010
Romain Slootmaekers, Nicolas Trangez Real-World Functional Programming @ Incubaid
20. About Incubaid
Functional Programming @ Incubaid OCaml vs. Haskell
OCaml Code Teaser
Conclusion
Compiler and Runtime
Main implementation from INRIA (.fr)
Bytecode and native targets
Very fast compilation
Straight-forward compiler backend & code generation
Easy to reason about efficiency, predict compiler output
If necessary (unlike GHC) native assembly can be
read/interpreted by humans
Thanks to this, we were able to debug an obscure
non-reproducible bug in Arakoon once, which turned out to
be a flaw in one of the libraries we use. Details on request!
Romain Slootmaekers, Nicolas Trangez Real-World Functional Programming @ Incubaid
21. About Incubaid
Functional Programming @ Incubaid OCaml vs. Haskell
OCaml Code Teaser
Conclusion
Concurrency & Parallellism
Using native/system threads (1-to-1 mapping)
No parallel runtime (only one OCaml execution thread at
all times), a reentrant runtime is WIP
Lightweight “Monadic Threads” for concurrency using Lwt,
Async,. . . See W.L.Harrison, “Cheap (But Functional)
Threads”
Romain Slootmaekers, Nicolas Trangez Real-World Functional Programming @ Incubaid
22. About Incubaid
Functional Programming @ Incubaid OCaml vs. Haskell
OCaml Code Teaser
Conclusion
Applications
Ocsigen: Web application framework, parent project of
Lwt: lightweight threading
Js_of_ocaml: OCaml to JavaScript compiler
Mirage: Xen-based exokernel
Coq: Proof assistant
MLDonkey: EDonkey P2P client
Unison: File synchronization
haXe compiler: High-level multiplatform language,
compiled to JS/SWF/AS3/PHP5/C++/. . .
Coccinelle: Semantic patches
Romain Slootmaekers, Nicolas Trangez Real-World Functional Programming @ Incubaid
23. About Incubaid
Functional Programming @ Incubaid OCaml vs. Haskell
OCaml Code Teaser
Conclusion
Outline
1 About Incubaid
2 Functional Programming @ Incubaid
Why FP?
Current Projects
3 OCaml
OCaml vs. Haskell
Code Teaser
4 Conclusion
Romain Slootmaekers, Nicolas Trangez Real-World Functional Programming @ Incubaid
24. About Incubaid
Functional Programming @ Incubaid OCaml vs. Haskell
OCaml Code Teaser
Conclusion
Key Differences (1/3)
OCaml evaluation is eager by default
I once defined (>>) as (>>) a b = a >>= fun _ −> b. Lost quite
some time debugging the unexpected runtime behaviour.
No overloading (cfr. Haskell type-classes)
+ : int −> int −> int
+. : float −> float −> float (notice the dot)
+ : num −> num −> num
Both structural and referential equality operators: = and ==
Optional & named arguments
Higher-order modules & functors (not the Haskell ones)
Romain Slootmaekers, Nicolas Trangez Real-World Functional Programming @ Incubaid
25. About Incubaid
Functional Programming @ Incubaid OCaml vs. Haskell
OCaml Code Teaser
Conclusion
Key Differences (2/3)
OO support
Clean semantics
Quirky syntax
Type operators / coercions: :#, :>
Polymorphic variants (union types)
# [ ‘ Number 1 ; ‘ F l o a t 3 . 1 4 ; ‘ U n i t ; ] ; ;
− : [ > ‘ F l o a t o f f l o a t | ‘ Number o f i n t | ‘ Unit ] l i s t =
[ ‘ Number 1 ; ‘ F l o a t 3 . 1 4 ; ‘ U n i t ]
No purity restrictions (cfr. IO monad)
Side-effects (incl. IO) possible everywhere
Record fields can be mutable
In-place mutable variables (refs) implemented on top of this
Strings are in-place mutable
Romain Slootmaekers, Nicolas Trangez Real-World Functional Programming @ Incubaid
26. About Incubaid
Functional Programming @ Incubaid OCaml vs. Haskell
OCaml Code Teaser
Conclusion
Key Differences (3/3)
Sugared syntax: "abc ".[1] , [| 1; 2; 3; |].(1) vs. String .get,
Array.get
Exceptions are common, also in pure code (e.g. Not_found)
Smaller “standard library” compared to Haskell Platform
Syntax extensions
Macros: (IFDEF ... THEN ... ELSE ... END)
Comprehensions: [x | x <− [1;2;3]; x<2]
Succinctness for libraries
Normal lwt.syntax
lwt x = calc_x() in
c a l c _ x ( ) >>= fun x −> lwt y = calc_y() in
c a l c _ y ( ) >>= fun y −> ...
... (* concurrent evaluation! *)
lwt a = f () and b = g () in ...
Romain Slootmaekers, Nicolas Trangez Real-World Functional Programming @ Incubaid
27. About Incubaid
Functional Programming @ Incubaid OCaml vs. Haskell
OCaml Code Teaser
Conclusion
Gotcha: Value Restriction (1/4)
Definition
The “value restriction” is a way to maintain correct typing in the
presence of side-effects: the type of an expression can only be
generalized if the expression is a “syntactic value” (or
“non-expansive expression”):
a literal or identifier: 3, ’ a’ , . . .
an abstraction: fun x −> 2 ∗ x, . . .
a constructor applied to a syntactic value: Some 1, . . .
Romain Slootmaekers, Nicolas Trangez Real-World Functional Programming @ Incubaid
28. About Incubaid
Functional Programming @ Incubaid OCaml vs. Haskell
OCaml Code Teaser
Conclusion
Gotcha: Value Restriction (2/4)
Example
# l e t i = fun x −> x ; ;
v a l i : ’ a −> ’ a = <fun >
# let r = ref i ; ;
The type of i is ∀α.(α → α). Without value restriction, the type of
r would be ∀α.(α → α) ref.
Since it’d be polymorphic, it could be used as type
(bool −> bool) ref or ( int −> int) ref , so
r : = fun ( t r u e | f a l s e ) −> f a l s e ;
(! r ) 0
would both type-check but the last expression would result in a
runtime error.
Romain Slootmaekers, Nicolas Trangez Real-World Functional Programming @ Incubaid
29. About Incubaid
Functional Programming @ Incubaid OCaml vs. Haskell
OCaml Code Teaser
Conclusion
Gotcha: Value Restriction (3/4)
Demo
Here’s what happens for real:
# let r = ref i ; ;
v a l r : ( ’ _a −> ’ _a ) r e f = { c o n t e n t s = <fun >}
# r : = fun ( t r u e | f a l s e ) −> t r u e ; ;
− : unit = ()
# r ;;
− : ( b o o l −> b o o l ) r e f = { c o n t e n t s = <fun >}
# let s = ref i ; ;
v a l s : ( ’ _a −> ’ _a ) r e f = { c o n t e n t s = <fun >}
# (! s) 0;;
− : int = 0
# s;;
− : ( i n t −> i n t ) r e f = { c o n t e n t s = <fun >}
# l e t t = l e t l = r e f [ ] i n fun e −> l : = ( e : : (! l )); (! l );;
v a l t : ’ _a −> ’ _a l i s t = <fun >
# t 1;;
− : int l i s t = [1]
# t ;;
− : i n t −> i n t l i s t = <fun >
# t 2;;
− : i n t l i s t = [ 2 ; 1]
Romain Slootmaekers, Nicolas Trangez Real-World Functional Programming @ Incubaid
30. About Incubaid
Functional Programming @ Incubaid OCaml vs. Haskell
OCaml Code Teaser
Conclusion
Gotcha: Value Restriction (4/4)
Work-around using eta-expansion
# let id x = x ; ;
v a l i d : ’ a −> ’ a = <fun >
# ( i d 1 , i d "abc" ) ; ;
− : i n t ∗ s t r i n g = ( 1 , "abc" )
# l e t id ’ = i d i d ; ;
v a l i d ’ : ’ _a −> ’ _a = <fun >
# id ’ 1 ; ;
− : int = 1
# id ’ ; ;
− : i n t −> i n t = <fun >
# i d ’ "abc" ; ;
E r r o r : T h i s e x p r e s s i o n has type s t r i n g b u t an e x p r e s s i o n was expected of type i n t
# l e t i d ’ ’ = fun x −> ( i d i d ) x ; ;
v a l i d ’ ’ : ’ a −> ’ a = <fun >
# ( i d ’ ’ 1 , i d ’ ’ "abc" ) ; ;
− : i n t ∗ s t r i n g = ( 1 , "abc" )
# l e t f 1 = L i s t . map i d ; ;
v a l f 1 : ’ _a l i s t −> ’ _a l i s t = <fun >
# l e t f 2 = fun l −> L i s t . map i d l ; ;
v a l f 2 : ’ a l i s t −> ’ a l i s t = <fun >
Romain Slootmaekers, Nicolas Trangez Real-World Functional Programming @ Incubaid
31. About Incubaid
Functional Programming @ Incubaid OCaml vs. Haskell
OCaml Code Teaser
Conclusion
Outline
1 About Incubaid
2 Functional Programming @ Incubaid
Why FP?
Current Projects
3 OCaml
OCaml vs. Haskell
Code Teaser
4 Conclusion
Romain Slootmaekers, Nicolas Trangez Real-World Functional Programming @ Incubaid
32. About Incubaid
Functional Programming @ Incubaid OCaml vs. Haskell
OCaml Code Teaser
Conclusion
Rsync algo
Implementation of the classic “rsync” algorithm
Full source @
https://github.com/Incubaid/rsync-demo
Programming “in the large”
Expose use of
OO
Modules, functors
Imperative programming, mutability
...
but not necessarily the best, most advisable approach
Romain Slootmaekers, Nicolas Trangez Real-World Functional Programming @ Incubaid
33. About Incubaid
Functional Programming @ Incubaid OCaml vs. Haskell
OCaml Code Teaser
Conclusion
module type WEAK = sig
type t
v a l make : u n i t −> t
v a l from : s t r i n g −> i n t −> i n t −> t
v a l r e s e t : t −> u n i t
v a l d i g e s t : t −> i n t
v a l r o t a t e : t −> char −> char −> u n i t
v a l update : t −> s t r i n g −> i n t −> i n t −> u n i t
end
module type STRONG = sig
type t
v a l to_hex : t −> s t r i n g
v a l f i l e : s t r i n g −> t
v a l s u b s t r i n g : s t r i n g −> i n t −> i n t −> t
v a l w r i t e : out_channel −> t −> u n i t
v a l read : i n _ c h a n n e l −> t
end
module SDigest = ( s t r u c t
include D i g e s t
l e t read i c = I o . r e a d _ s t r i n g i c
l e t w r i t e oc t = I o . w r i t e _ s t r i n g oc t
end : STRONG)
Romain Slootmaekers, Nicolas Trangez Real-World Functional Programming @ Incubaid
34. About Incubaid
Functional Programming @ Incubaid OCaml vs. Haskell
OCaml Code Teaser
Conclusion
open Hash
open S i g n a t u r e
module Rsync = functor (W:WEAK) −> functor (S :STRONG) −> s t r u c t
module MySig = S i g n a t u r e (W) ( S)
class d e l t a _ e m i t t e r s i g n a t u r e new_fn h a n d l e r =
l e t bs = MySig . b l o c k _ s i z e s i g n a t u r e i n
l e t b u f f e r _ s i z e = 8 ∗ bs i n
l e t b u f f e r = S t r i n g . create b u f f e r _ s i z e in
object ( s e l f )
v a l mutable _read = 0
v a l mutable _ f i r s t _ f r e e = 0
v a l mutable _ n _ f r e e = b u f f e r _ s i z e
v a l mutable _ f i r s t _ t o d o = 0
v a l mutable _ p r e v i o u s _ a c t i o n = S t a r t bs
v a l mutable _ f i n i s h e d = f a l s e
v a l mutable _weak_ok = f a l s e
v a l _weak = W. make ( )
method _examine_block b u f f e r o f f s e t l e n g t h =
l e t wd = W. d i g e s t _weak i n
match MySig . lookup_weak s i g n a t u r e wd with
| None −> None
| Some bs −>
l e t strong = S. substring b u f f e r o f f s e t length in
i f s t r o n g = MySig . b s _s t r o n g bs
then Some ( MySig . bs_index bs )
else None
Romain Slootmaekers, Nicolas Trangez Real-World Functional Programming @ Incubaid
35. About Incubaid
Functional Programming @ Incubaid
OCaml
Conclusion
Outline
1 About Incubaid
2 Functional Programming @ Incubaid
Why FP?
Current Projects
3 OCaml
OCaml vs. Haskell
Code Teaser
4 Conclusion
Romain Slootmaekers, Nicolas Trangez Real-World Functional Programming @ Incubaid
36. About Incubaid
Functional Programming @ Incubaid
OCaml
Conclusion
In Retrospect
No regrets
Productivity increased, less bugs
Bugs fixed quickly, features added easily
Runtime issues mainly due to improper usage or
configuration (the universe is still winning!), except Lwt
bugs
Limited tooling support compared to e.g. JVM
(JMX/JConsole, remote debugging, GC tuning,. . . )
No deal-breaker, because less needed
Would be some nice projects!
Romain Slootmaekers, Nicolas Trangez Real-World Functional Programming @ Incubaid
37. About Incubaid
Functional Programming @ Incubaid
OCaml
Conclusion
Future
Current focus on OCaml: in general, best known by the
team
Haskell for “compilable pseudocode”, once in a while
Haskell for future projects, why not?
Introduce devs, architects,. . . of non-FP projects to the FP
concepts and strengths to increase the quality of their
work: knowledge of FP concepts changes the way you
think about programming, even in non-FP settings
Romain Slootmaekers, Nicolas Trangez Real-World Functional Programming @ Incubaid
38. About Incubaid
Functional Programming @ Incubaid
OCaml
Conclusion
Internships & Jobs
Interested in working on our software and building future-proof
scalable computing platforms & looking for an internship or job?
Come join us!
recruiting@incubaid.com
wehire.be
Romain Slootmaekers, Nicolas Trangez Real-World Functional Programming @ Incubaid
39. About Incubaid
Functional Programming @ Incubaid
OCaml
Conclusion
Questions?
Romain Slootmaekers, Nicolas Trangez Real-World Functional Programming @ Incubaid