Generative Programming In The Large - Applied C++ meta-programmingSchalk Cronjé
Digs into the details of effective generative programming in C++. Major focus on using meta-programming techniques to create efficient, low cyclomatic complexity in artefacts.
Presentation done at the historic 20 yeras of C++ conference in Las Vegas 2005. This is also the first time I ever spoke on the topic of combing generative programming and C++ template metaprogramming
The document discusses practical generative programming. It defines generative programming as automatically manufacturing customized products from reusable components using configuration knowledge. It describes the key elements and steps of generative programming. It discusses strategies for implementing generative programming in C++, including using templates and traits classes to configure generic components. It provides an example of how to capture configuration metadata in XML to define attributes like port ranges and generate C++ code.
Finagle is an asynchronous RPC framework from Twitter that provides client/server abstractions over various protocols like HTTP and Thrift. It uses Futures to handle asynchronous operations and provides methods like map, flatmap, and handle to transform Futures. The Java Service Framework builds on Finagle to add features like metrics, logging, and rate limiting for Java services. It allows configuring options like enabling specific logs and metrics through a Proxy builder.
The model/view design pattern is the standard way of separating UI from business logic, especially when the data exchanged is dynamic. In a series of blog posts released in May, we presented an introduction to model/view design and provided an example of how this pattern is leveraged in Qt applications. In this webinar, we will go more in depth, illustrating model/view with a set of two QML programming examples. The first will consider the simple case where data size remains constant. The second will cover the more common situation where data size is dynamic.
Writing concurrent code is becoming more and more important to leverage the parallelism of multicore architectures. The C++11 library introduced futures and promises as a first step towards task-based programming. However, the C++ support of concurrency is still very limited. Other languages, like C# and Python, provide some forms of resumable functions or coroutines and in C#, the async/await pattern enables to write functions that suspend their execution while waiting for a computation or I/O to complete.This talk will describe a proposal for the addition of resumable function and async/await in C++17. We will focus on the implementation of resumable function on Windows, and we'll play with a first prototype of their implementation in the Visual Studio 2015 Preview. Finally, we will see how resumable functions can also be used to implement (lazy) generators, similar to the one provided by "yield" statements in C#.
Skiron - Experiments in CPU Design in DMithun Hunsur
This document discusses Skiron, an experimental CPU design project implemented in the D programming language. It provides an overview of Skiron, which simulates a RISC-inspired instruction set architecture. It describes the idioms and patterns used in D to define the instruction set and encoding in a way that is self-documenting and allows different parts of the software to stay in sync. It also discusses lessons learned, such as issues with delegates, as well as potential improvements to D's metaprogramming capabilities and standard library support for @nogc code. Realizing Skiron in hardware with an FPGA and making it self-hosting are presented as future goals.
clWrap: Nonsense free control of your GPUJohn Colvin
The document discusses OpenCL and GPU programming. It provides an overview of OpenCL concepts like platforms, devices, contexts, kernels, command queues, buffers and images. It describes the OpenCL C API and some limitations. It then introduces clWrap, a D library that aims to provide a more type-safe and high-level wrapper for OpenCL. clWrap sits on top of the OpenCL C API and allows dropping down to it when needed. It also provides examples of mapping kernels and data to GPUs using clWrap.
This document provides an overview and agenda for a presentation on polyglot programming and asynchronous programming using C++ features like futures, coroutines, and generators. The presentation introduces DDS-RPC, which allows for remote procedure calls over a data distribution service middleware. It discusses how C++ futures and coroutines can be used to write asynchronous and non-blocking I/O code in a synchronous-looking way. Examples are provided to demonstrate features like serial and parallel composition of futures, using await with coroutines, and using generators to lazily iterate over data.
Qt Quick/QML brings designers and developers together to create and collaborate. QML is a collection of technologies that can build modern and fluid interfaces for applications – quickly. Join us for part 3 of our 4 part webinar series where we explore the best of QML for mobile, embedded and desktop.
Part 3 will cover:
C++ / QML Integration
Reusing Existing C++ Code
Optimizing Communicating Event-Loop Languages with TruffleStefan Marr
Communicating Event-Loop Languages similar to E and AmbientTalk are recently gaining more traction as a subset of actor languages. With the rise of JavaScript, E’s notion of vats and non-blocking communication based on promises entered the mainstream. For implementations, the combination of dynamic typing, asynchronous message sending, and promise resolution pose new optimization challenges.
This paper discusses these challenges and presents initial experiments for a Newspeak implementation based on the Truffle framework. Our implementation is on average 1.65x slower than Java on a set of 14 benchmarks. Initial optimizations improve the performance of asynchronous messages and reduce the cost of encapsulation on microbenchmarks by about 2x. Parallel actor benchmarks further show that the system scales based on the workload characteristics. Thus, we conclude that Truffle is a promising platform also for communicating event-loop languages.
Qt Quick/QML brings designers and developers together to create and collaborate. QML is a collection of technologies that can build modern and fluid interfaces for applications – quickly. Join us for part 2 of our 4 part webinar series where we explore the best of QML for mobile, embedded and desktop.
Part 2 will cover:
Creating New Items
States and Transitions
Dynamic Creation of Items
Vibrant Technologies is headquarted in Mumbai,India.We are the best Hadoop training provider in Navi Mumbai who provides Live Projects to students.We provide Corporate Training also.We are Best Hadoop classes in Mumbai according to our students and corporates
The document provides examples of how to perform various actions in QuickTest Professional (QTP) such as selecting items from a web list, setting values in a web edit, reading and writing data to text files, and using descriptive programming. Key examples include selecting the third item from a web list, setting the pincode value to "23" in a web edit, reading lines from one text file and writing them to another file, and setting the value "oshoworld" in the first web edit on a page using a descriptive program.
A Domain-Specific Embedded Language for Programming Parallel Architectures.Jason Hearne-McGuiness
This document proposes a domain-specific embedded language (DSEL) for programming parallel architectures. The DSEL aims to enable parallelism while avoiding issues like deadlocks, race conditions, and complex APIs. It presents the grammar and properties of the proposed DSEL, including that it generates schedules that are deadlock-free and race-condition free. Examples demonstrating data flow and data parallelism using the DSEL are also provided.
Building High-Performance Language Implementations With Low EffortStefan Marr
This talk shows how languages can be implemented as self-optimizing interpreters, and how Truffle or RPython go about to just-in-time compile these interpreters to efficient native code.
Programming languages are never perfect, so people start building domain-specific languages to be able to solve their problems more easily. However, custom languages are often slow, or take enormous amounts of effort to be made fast by building custom compilers or virtual machines.
With the notion of self-optimizing interpreters, researchers proposed a way to implement languages easily and generate a JIT compiler from a simple interpreter. We explore the idea and experiment with it on top of RPython (of PyPy fame) with its meta-tracing JIT compiler, as well as Truffle, the JVM framework of Oracle Labs for self-optimizing interpreters.
In this talk, we show how a simple interpreter can reach the same order of magnitude of performance as the highly optimizing JVM for Java. We discuss the implementation on top of RPython as well as on top of Java with Truffle so that you can start right away, independent of whether you prefer the Python or JVM ecosystem.
While our own experiments focus on SOM, a little Smalltalk variant to keep things simple, other people have used this approach to improve peek performance of JRuby, or build languages such as JavaScript, R, and Python 3.
Zero-Overhead Metaprogramming: Reflection and Metaobject Protocols Fast and w...Stefan Marr
Runtime metaprogramming enables many useful applications and is often a convenient solution to solve problems in a generic way, which makes it widely used in frameworks, middleware, and domain-specific languages. However, powerful metaobject protocols are rarely supported and even common concepts such as reflective method invocation or dynamic proxies are not optimized. Solutions proposed in literature either restrict the metaprogramming capabilities or require application or library developers to apply performance improving techniques.
For overhead-free runtime metaprogramming, we demonstrate that dispatch chains, a generalized form of polymorphic inline caches common to self-optimizing interpreters, are a simple optimization at the language-implementation level. Our evaluation with self-optimizing interpreters shows that unrestricted metaobject protocols can be realized for the first time without runtime overhead, and that this optimization is applicable for just-in-time compilation of interpreters based on meta-tracing as well as partial evaluation. In this context, we also demonstrate that optimizing common reflective operations can lead to significant performance improvements for existing applications.
Qt Quick/QML brings designers and developers together to create and collaborate. QML is a collection of technologies that can build modern and fluid interfaces for applications – quickly. Join us for this webinar to explore the best of QML for mobile, embedded and desktop.
Part III will cover:
- C++ Backends
- Reusing existing code
- Creating QML Modules
This document outlines Kumar Rajeev Rastogi's presentation on using native compilation, also known as schema binding, to improve PostgreSQL performance. It discusses trends toward in-memory databases and the need to reduce CPU instructions. Three methods for generating specialized access functions for tuples based on table schemas are described: 1) changing the tuple format, 2) using existing macros, and 3) reordering columns. Performance tests on TPC-H and hash joins show improvements of up to 36% and 23% respectively through dramatic reductions in CPU instructions via schema binding.
Дмитрий Копляров , Потокобезопасные сигналы в C++Sergey Platonov
Распространённые подходы к реализации сигналов (boost, Qt) удобны в однопоточном окружении, но, к сожалению, имеют два недостатка при использовании из нескольких потоков: 1. Нет возможности атомарно подключиться к сигналу и получить текущее состояние объекта. 2. Отключение от сигнала плохо совместимо с идиомой RAII. В результате, “очевидный” код приводит к race condition’ам и обращениям к разрушенным объектам, а “правильный” подразумевает сложные схемы владения (shared_from_this, либо введение функционально избыточных объектов).
В докладе я расскажу об альтернативной реализации сигналов, лишённой этих недостатков, и объясню на примерах её преимущества перед boost::signals2.
Blocks is a cool concept and is very much needed for performance improvements and responsiveness. GCD helps run blocks effortlessly by scheduling on a desired queue, priority and lots more.
Comparing different concurrency models on the JVMMario Fusco
This document compares different concurrency models on the JVM, including the native Java concurrency model based on threads, semaphores, and locks. It discusses the pros and cons of threads and locks, including issues around non-determinism from shared mutable state. Functional programming with immutable data and internal iteration is presented as an alternative that allows for free parallelism. The document also covers actors and their message passing approach, as well as software transactional memory.
This document discusses SystemVerilog assertions (SVA). It introduces SVA and explains that assertions are used to document design functionality, check design intent is met, and determine if verification tested the design. Assertions can be specified by the design or verification engineer. The document outlines the key building blocks of SVA like sequences, properties, and assertions. It provides examples of different types of assertions and how they are used. Key concepts discussed include implication, timing windows, edge detection, and repetition operators.
How and why I turned my old Java projects into a first-class serverless compo...Mario Fusco
Mario Fusco discusses turning old Java rule engine projects into serverless components by refactoring them to run natively on GraalVM and integrate with Quarkus. He describes the limitations of ahead-of-time compilation with GraalVM, such as lack of dynamic classloading. He details refactoring Drools to use an executable model and removing dependencies on dynamic class definition. This allows Drools to natively compile on GraalVM. He also discusses integrating the refactored Drools with Quarkus.
This document discusses Dojo GFX, a cross-browser graphics package for creating interactive graphics. It supports backends like SVG, VML, Canvas and Silverlight. The document outlines that SVG is used as a benchmark and recommended choice, and that Dojo GFX code is smallest for the SVG renderer. Real-world examples of Dojo GFX include engineering drawings, mapping, user interfaces and charts.
This document discusses exciting features of JavaScript including how it can be used in browsers and non-browser environments. It covers how JavaScript supports object-oriented, functional, and aspect-oriented programming paradigms through its first-class functions, closures, and other language features. The document also discusses how code generation and introspection are possible in JavaScript and how this enables implementing domain-specific languages through techniques like lambda functions. In conclusion, the author expresses optimism about JavaScript's potential for large-scale development.
Skiron - Experiments in CPU Design in DMithun Hunsur
This document discusses Skiron, an experimental CPU design project implemented in the D programming language. It provides an overview of Skiron, which simulates a RISC-inspired instruction set architecture. It describes the idioms and patterns used in D to define the instruction set and encoding in a way that is self-documenting and allows different parts of the software to stay in sync. It also discusses lessons learned, such as issues with delegates, as well as potential improvements to D's metaprogramming capabilities and standard library support for @nogc code. Realizing Skiron in hardware with an FPGA and making it self-hosting are presented as future goals.
clWrap: Nonsense free control of your GPUJohn Colvin
The document discusses OpenCL and GPU programming. It provides an overview of OpenCL concepts like platforms, devices, contexts, kernels, command queues, buffers and images. It describes the OpenCL C API and some limitations. It then introduces clWrap, a D library that aims to provide a more type-safe and high-level wrapper for OpenCL. clWrap sits on top of the OpenCL C API and allows dropping down to it when needed. It also provides examples of mapping kernels and data to GPUs using clWrap.
This document provides an overview and agenda for a presentation on polyglot programming and asynchronous programming using C++ features like futures, coroutines, and generators. The presentation introduces DDS-RPC, which allows for remote procedure calls over a data distribution service middleware. It discusses how C++ futures and coroutines can be used to write asynchronous and non-blocking I/O code in a synchronous-looking way. Examples are provided to demonstrate features like serial and parallel composition of futures, using await with coroutines, and using generators to lazily iterate over data.
Qt Quick/QML brings designers and developers together to create and collaborate. QML is a collection of technologies that can build modern and fluid interfaces for applications – quickly. Join us for part 3 of our 4 part webinar series where we explore the best of QML for mobile, embedded and desktop.
Part 3 will cover:
C++ / QML Integration
Reusing Existing C++ Code
Optimizing Communicating Event-Loop Languages with TruffleStefan Marr
Communicating Event-Loop Languages similar to E and AmbientTalk are recently gaining more traction as a subset of actor languages. With the rise of JavaScript, E’s notion of vats and non-blocking communication based on promises entered the mainstream. For implementations, the combination of dynamic typing, asynchronous message sending, and promise resolution pose new optimization challenges.
This paper discusses these challenges and presents initial experiments for a Newspeak implementation based on the Truffle framework. Our implementation is on average 1.65x slower than Java on a set of 14 benchmarks. Initial optimizations improve the performance of asynchronous messages and reduce the cost of encapsulation on microbenchmarks by about 2x. Parallel actor benchmarks further show that the system scales based on the workload characteristics. Thus, we conclude that Truffle is a promising platform also for communicating event-loop languages.
Qt Quick/QML brings designers and developers together to create and collaborate. QML is a collection of technologies that can build modern and fluid interfaces for applications – quickly. Join us for part 2 of our 4 part webinar series where we explore the best of QML for mobile, embedded and desktop.
Part 2 will cover:
Creating New Items
States and Transitions
Dynamic Creation of Items
Vibrant Technologies is headquarted in Mumbai,India.We are the best Hadoop training provider in Navi Mumbai who provides Live Projects to students.We provide Corporate Training also.We are Best Hadoop classes in Mumbai according to our students and corporates
The document provides examples of how to perform various actions in QuickTest Professional (QTP) such as selecting items from a web list, setting values in a web edit, reading and writing data to text files, and using descriptive programming. Key examples include selecting the third item from a web list, setting the pincode value to "23" in a web edit, reading lines from one text file and writing them to another file, and setting the value "oshoworld" in the first web edit on a page using a descriptive program.
A Domain-Specific Embedded Language for Programming Parallel Architectures.Jason Hearne-McGuiness
This document proposes a domain-specific embedded language (DSEL) for programming parallel architectures. The DSEL aims to enable parallelism while avoiding issues like deadlocks, race conditions, and complex APIs. It presents the grammar and properties of the proposed DSEL, including that it generates schedules that are deadlock-free and race-condition free. Examples demonstrating data flow and data parallelism using the DSEL are also provided.
Building High-Performance Language Implementations With Low EffortStefan Marr
This talk shows how languages can be implemented as self-optimizing interpreters, and how Truffle or RPython go about to just-in-time compile these interpreters to efficient native code.
Programming languages are never perfect, so people start building domain-specific languages to be able to solve their problems more easily. However, custom languages are often slow, or take enormous amounts of effort to be made fast by building custom compilers or virtual machines.
With the notion of self-optimizing interpreters, researchers proposed a way to implement languages easily and generate a JIT compiler from a simple interpreter. We explore the idea and experiment with it on top of RPython (of PyPy fame) with its meta-tracing JIT compiler, as well as Truffle, the JVM framework of Oracle Labs for self-optimizing interpreters.
In this talk, we show how a simple interpreter can reach the same order of magnitude of performance as the highly optimizing JVM for Java. We discuss the implementation on top of RPython as well as on top of Java with Truffle so that you can start right away, independent of whether you prefer the Python or JVM ecosystem.
While our own experiments focus on SOM, a little Smalltalk variant to keep things simple, other people have used this approach to improve peek performance of JRuby, or build languages such as JavaScript, R, and Python 3.
Zero-Overhead Metaprogramming: Reflection and Metaobject Protocols Fast and w...Stefan Marr
Runtime metaprogramming enables many useful applications and is often a convenient solution to solve problems in a generic way, which makes it widely used in frameworks, middleware, and domain-specific languages. However, powerful metaobject protocols are rarely supported and even common concepts such as reflective method invocation or dynamic proxies are not optimized. Solutions proposed in literature either restrict the metaprogramming capabilities or require application or library developers to apply performance improving techniques.
For overhead-free runtime metaprogramming, we demonstrate that dispatch chains, a generalized form of polymorphic inline caches common to self-optimizing interpreters, are a simple optimization at the language-implementation level. Our evaluation with self-optimizing interpreters shows that unrestricted metaobject protocols can be realized for the first time without runtime overhead, and that this optimization is applicable for just-in-time compilation of interpreters based on meta-tracing as well as partial evaluation. In this context, we also demonstrate that optimizing common reflective operations can lead to significant performance improvements for existing applications.
Qt Quick/QML brings designers and developers together to create and collaborate. QML is a collection of technologies that can build modern and fluid interfaces for applications – quickly. Join us for this webinar to explore the best of QML for mobile, embedded and desktop.
Part III will cover:
- C++ Backends
- Reusing existing code
- Creating QML Modules
This document outlines Kumar Rajeev Rastogi's presentation on using native compilation, also known as schema binding, to improve PostgreSQL performance. It discusses trends toward in-memory databases and the need to reduce CPU instructions. Three methods for generating specialized access functions for tuples based on table schemas are described: 1) changing the tuple format, 2) using existing macros, and 3) reordering columns. Performance tests on TPC-H and hash joins show improvements of up to 36% and 23% respectively through dramatic reductions in CPU instructions via schema binding.
Дмитрий Копляров , Потокобезопасные сигналы в C++Sergey Platonov
Распространённые подходы к реализации сигналов (boost, Qt) удобны в однопоточном окружении, но, к сожалению, имеют два недостатка при использовании из нескольких потоков: 1. Нет возможности атомарно подключиться к сигналу и получить текущее состояние объекта. 2. Отключение от сигнала плохо совместимо с идиомой RAII. В результате, “очевидный” код приводит к race condition’ам и обращениям к разрушенным объектам, а “правильный” подразумевает сложные схемы владения (shared_from_this, либо введение функционально избыточных объектов).
В докладе я расскажу об альтернативной реализации сигналов, лишённой этих недостатков, и объясню на примерах её преимущества перед boost::signals2.
Blocks is a cool concept and is very much needed for performance improvements and responsiveness. GCD helps run blocks effortlessly by scheduling on a desired queue, priority and lots more.
Comparing different concurrency models on the JVMMario Fusco
This document compares different concurrency models on the JVM, including the native Java concurrency model based on threads, semaphores, and locks. It discusses the pros and cons of threads and locks, including issues around non-determinism from shared mutable state. Functional programming with immutable data and internal iteration is presented as an alternative that allows for free parallelism. The document also covers actors and their message passing approach, as well as software transactional memory.
This document discusses SystemVerilog assertions (SVA). It introduces SVA and explains that assertions are used to document design functionality, check design intent is met, and determine if verification tested the design. Assertions can be specified by the design or verification engineer. The document outlines the key building blocks of SVA like sequences, properties, and assertions. It provides examples of different types of assertions and how they are used. Key concepts discussed include implication, timing windows, edge detection, and repetition operators.
How and why I turned my old Java projects into a first-class serverless compo...Mario Fusco
Mario Fusco discusses turning old Java rule engine projects into serverless components by refactoring them to run natively on GraalVM and integrate with Quarkus. He describes the limitations of ahead-of-time compilation with GraalVM, such as lack of dynamic classloading. He details refactoring Drools to use an executable model and removing dependencies on dynamic class definition. This allows Drools to natively compile on GraalVM. He also discusses integrating the refactored Drools with Quarkus.
This document discusses Dojo GFX, a cross-browser graphics package for creating interactive graphics. It supports backends like SVG, VML, Canvas and Silverlight. The document outlines that SVG is used as a benchmark and recommended choice, and that Dojo GFX code is smallest for the SVG renderer. Real-world examples of Dojo GFX include engineering drawings, mapping, user interfaces and charts.
This document discusses exciting features of JavaScript including how it can be used in browsers and non-browser environments. It covers how JavaScript supports object-oriented, functional, and aspect-oriented programming paradigms through its first-class functions, closures, and other language features. The document also discusses how code generation and introspection are possible in JavaScript and how this enables implementing domain-specific languages through techniques like lambda functions. In conclusion, the author expresses optimism about JavaScript's potential for large-scale development.
JavaScript and popular programming paradigms (OOP, AOP, FP, DSL). Overview of the language to see what tools we can leverage to reduce complexity of our projects.
This part goes over language features and looks at OOP and AOP with JavaScript.
The presentation was delivered at ClubAJAX on 2/2/2010.
Blog post: http://lazutkin.com/blog/2010/feb/5/exciting-js-1/
Continued in Part II: http://www.slideshare.net/elazutkin/exciting-javascript-part-ii
The document discusses various patterns for generative programming including parser generation. It describes using a context-free grammar as input to automatically generate a parser. The key steps are:
1. Define regular expressions for tokens and context-free productions for nonterminals
2. Generate code for the parser from the grammar
3. Write boilerplate code to execute the generated parser and feed it a token stream.
The overall approach is to specify language structure through a grammar and then generate artifacts like lexers and parsers that can recognize or operate on that language.
The document discusses practical meta-programming using C++ templates. It explains how template specialization and partial specialization allow recursive instantiation of templates to transform types and data at compile-time in a functional programming-like manner. Examples are provided to demonstrate summing values, checking type traits, approximating mathematical functions, and creating heterogeneous tuples through recursive templates. SFINAE (substitution failure is not an error) is also introduced as a way to selectively overload functions based on type traits.
Generative Software Development. Overview and ExamplesEelco Visser
Generative software development is a system-family approach that focuses on automating the creation of system-family members. A given system can be automatically generated from a specification written in one or more domain-specific languages. Domain-specific languages are used to specify systems at a high level of abstraction in a particular problem domain, while mappings and solution components implement the specification in a lower-level solution space. This allows automatic generation of systems from concise, domain-focused specifications.
A Generative Programming Approach to Developing Pervasive Computing SystemsDamien Cassou
This document presents a generative programming approach to developing pervasive computing systems. It describes challenges in pervasive computing like heterogeneity, lack of structure, and dynamicity. It proposes addressing these through domain-specific languages to describe devices, architectures, and generate a programming framework and simulation support. This approach aims to guide development and ensure conformance while abstracting distributed aspects and supporting multiple expertise.
What is probabilistic programming? By analogy: if functional programming is programming with first-class functions and equational reasoning, probabilistic programming is programming with first-class distributions and Bayesian inference. All computable probability distributions can be encoded as probabilistic programs, and every probabilistic program represents a probability distribution.
What does it do? It gives a concise language for specifying complex, structured statistical models, and abstracts over the implementation details of exact and approximate inference algorithms. These models can be networked, causal, hierarchical, recursive, anything: the graph structure of the program is the generative structure of the distribution.
Who's interested? Cognitive scientists, statisticians, machine-learning specialists, and artificial-intelligence researchers.
1. The document discusses Transformational Generative Grammar, which is a theory of grammar developed by Noam Chomsky that uses transformations to relate deep and surface structures of sentences.
2. It defines key concepts of transformational grammar like deep structure, surface structure, and transformations. Deep structure is the underlying form of a sentence before rules are applied, and surface structure is the final spoken/heard form.
3. Examples of transformations provided include passive, extraposition, and various focusing transformations like end-focus that place important information at the end of sentences.
This document provides an overview of syntax and generative grammar. It defines syntax as the way words are arranged to show relationships of meaning within and between sentences. Grammar is defined as the art of writing, but is now used to study language. Generative grammar uses formal rules to generate an infinite set of grammatical sentences. It distinguishes between deep structure and surface structure. Tree diagrams are used to represent syntactic structures with symbols like S, NP, VP. Phrase structure rules, lexical rules, and movement rules are components of generative grammar. Complement phrases and recursion allow sentences to be embedded within other sentences.
Ubiquitous computing (ubicomp) refers to computers integrated into everyday objects and activities. The goal is to create an environment where connectivity between devices is always available but unobtrusive. Examples of ubicomp devices include digital audio players, RFID tags, smartphones, and interactive whiteboards. Mark Weiser is considered the father of ubiquitous computing and coined the term in the 1980s.
The document proposes an IT infrastructure for Shiv LLC, a company with locations in Los Angeles, Dallas, and Houston. It recommends implementing an Active Directory domain to enable communication and file sharing across the three locations. A centralized file server would store common files and applications. Each location would have its own local area network, connected to the other sites and to the internet via VPN. Firewalls, antivirus software, and regular backups would help secure the network and protect company data. The design allows for future growth and expansion as the company scales up.
Paper by Paco Nathan (Mesosphere) and Girish Kathalagiri (AgilOne) presented at the PMML Workshop (2013-08-11) at KDD 2013 in Chicago http://kdd13pmml.wordpress.com/
The paper uses Open Data from the City of Chicago to build predictive models for crime based on seasonality, geolocation, and other factors. The modeling illustrates use of the Pattern library https://github.com/Cascading/pattern in Cascading to import PMML -- in this case, the use of model chaining to create ensembles.
How Google AppEngine deals with digital art? how about music? a few case studies developed by Stinkdigital with Google Creative Lab and how App Engine dealt with a considerable amount of visits
Peter Lawrey is the CEO of Chronicle Software. He has 7 years experience working as a Java developer for investment banks and trading firms. Chronicle Software helps companies migrate to high performance Java code and was involved in one of the first large Java 8 projects in production in December 2014. The company offers workshops, training, consulting and custom development services. The talk will cover reading and writing lambdas, capturing vs non-capturing lambdas, transforming imperative code to streams, mixing imperative and functional code, and taking Q&A.
The document discusses creating an optimized algorithm in R. It covers writing functions and algorithms in R, creating R packages, and optimizing code performance using parallel computing and high performance computing. Key steps include reviewing existing algorithms, identifying gaps, testing and iterating a new algorithm, publishing the work, and making the algorithm available to others through an R package.
Pivotal Data Labs - Technology and Tools in our Data Scientist's Arsenal Srivatsan Ramanujam
These slides give an overview of the technology and the tools used by Data Scientists at Pivotal Data Labs. This includes Procedural Languages like PL/Python, PL/R, PL/Java, PL/Perl and the parallel, in-database machine learning library MADlib. The slides also highlight the power and flexibility of the Pivotal platform from embracing open source libraries in Python, R or Java to using new computing paradigms such as Spark on Pivotal HD.
Groovy is a dynamic language for the Java Virtual Machine that simplifies programming through features like closures, properties, and built-in support for lists, maps, ranges, and regular expressions. The latest version 1.5 adds support for Java 5 features like annotations and generics to leverage frameworks that use them. Groovy can be integrated into applications through mechanisms like JSR-223, Spring, and Groovy's own GroovyClassLoader to externalize business rules, provide extension points, and customize applications.
Performance modeling and simulation for accumulo applicationsAccumulo Summit
Apache Accumulo is known for being a high performance sorted key/value database, but achieving high performance in your application still requires good development practices. Often, developers will extrapolate from small-scale tests to argue that the application will perform well at higher scales. Unfortunately, design and implementation flaws that aren't visible at small scale inevitably show up in production at a much higher cost to fix.
Sqrrl is an application built on Accumulo that leverages log storage, indexing, graphs, and statistics modeling while supporting high throughput ingest and distributed analytic processing. At Sqrrl, we ensure reliable performance using a variety of modeling and simulation techniques. This talk will show examples of insights and performance improvements gained from micro-benchmarking, analog simulation, and predictive model validation.
– Speaker –
Adam Fuchs
CTO, Sqrrl
Adam Fuchs is one of the original developers and architects of Apache Accumulo. He is now the chief technology officer for Sqrrl, leveraging the techniques and design patterns learned from a long career in data processing at the National Security Agency to build a cybersecurity threat hunting platform. Adam got his undergraduate degree in computer science at the University of Washington and attended graduate school at the University of Maryland, College Park. He now lives in Seattle with his wife and two kids, where he enjoys running up mountains in his spare time.
— More Information —
For more information see http://www.accumulosummit.com/
The document describes the Cloudera Data Science Challenge, which involves solving three data science problems using large datasets. For the first problem, Smartfly, the goal is to predict flight delays using historical flight data and machine learning algorithms like logistic regression and SVM. The second problem, Almost Famous, involves statistical analysis of web log data and filtering for spam. The third problem, Winklr, requires analyzing a social network graph to recommend users to follow. The document discusses the approaches, tools, and results for each problem.
Data Science Challenge presentation given to the CinBITools Meetup GroupDoug Needham
The document describes the Cloudera Data Science Challenge, which involves solving three data science problems using large datasets. For the first problem, Smartfly, the goal is to predict flight delays using historical flight data and machine learning algorithms like logistic regression and SVM. The second problem, Almost Famous, involves statistical analysis of web log data and filtering for spam. The third problem, Winklr, requires social network analysis to recommend users to follow on a social media platform based on click data. The document discusses the approaches, tools, and algorithms used to solve each problem at scale using Apache Spark and Hadoop technologies.
Lone StarPHP 2013 - Building Web Apps from a New AnglePablo Godel
AngularJS is a new JavaScript framework, backed by Google, for building powerful, complex and rich client-side web applications. We will go over the features and basics of building a web application with AngularJS and we will demonstrate how to communitate with a REST server built with PHP.
This document summarizes a presentation about exploring SharePoint with the F# programming language. It discusses the history and characteristics of functional programming and F#, including that F# is a functional-first language developed by Microsoft Research. It also covers how to use the F# Client Object Model to connect to and query SharePoint, including loading references, creating a client context, and querying sites, lists, and list items. The presentation demonstrates iterating through lists and items and retrieving properties.
The document discusses creating an optimized algorithm in R. It covers:
1) Background on R and some popular R packages and interfaces.
2) Optimizing code performance by using parallel computing techniques like multiple cores and high performance computing clusters.
3) Steps for writing functions in R, creating R packages, and optimizing code performance.
This document provides an overview of Google App Engine, including what cloud computing is, the different types of cloud computing models, how App Engine provides a scalable infrastructure, the programming languages and frameworks supported, how data is stored and accessed via the datastore, services available on App Engine like caching, task queues, and mail, and tips for testing and deploying App Engine applications.
This document provides an overview and introduction to programming graphics in C++ using the G3D library for a course at Williams College. It discusses key differences between C++ and Java, how to compile and debug C++ programs, C++ concepts like inheritance, and how G3D handles memory management to avoid manually allocating and freeing memory. The document is intended as a starting guide for programmers familiar with Java but new to C++ and 3D graphics.
Dean Wampler presents on using Scalding, which leverages Cascading, to write MapReduce jobs in a more productive way. Cascading provides higher-level abstractions for building data pipelines and hides much of the boilerplate of the Hadoop MapReduce framework. It allows expressing jobs using concepts like joins and group-bys in a cleaner way focused on the algorithm rather than infrastructure details. Word count is shown implemented in the lower-level MapReduce API versus in Cascading Java code to demonstrate how Cascading minimizes boilerplate and exposes the right abstractions.
Presentation on some of my recent experiences with Microsoft Azure, Amazon S3, GoGrid and other cloud technologies, especially while developing:
- http://www.runsaturday.com
- http://www.stacka.com
- http://www.clouddotnet.com
I'm presenting this tonight at the London .Net User's group - but thought it would be useful to share more widely!
If you need more info, contact [email protected] - please mark your email with No Spam somehow... hopefully it will get through to me.
Efficient client-server interactions make or break a web application. This talk as about advanced techniques, which can be used with popular frameworks, to improve performance, and simplify data manipulations.
Harper Reed, the keynote speaker, discussed his experience as CTO of Obama for America's 2012 campaign, noting the massive scale of building technology for a presidential campaign. Other speakers discussed emerging technologies like touch screens, CSS preprocessors, single-page applications, server-side tools for testing, Node.js streams and events, open source challenges, and crafting URLs independent of content management systems. Overall the conference covered front-end development, web applications, Node.js, and rethinking technologies.
My talking points for the presentation on optimization of modern web applications. It is a huge topic, and I concentrated mostly on technical aspects of it.
Server-side JavaScript (SSJS) is gaining popularity due to factors like the rise of NoSQL databases, asynchronous programming, and JavaScript's ubiquity. SSJS environments like Node.js, CommonJS, and AppEngineJS allow developers to use JavaScript beyond the browser by running it on the server. Google App Engine also provides a platform for hosting SSJS applications and automatically scaling them.
This document summarizes Eugene Lazutkin's talk on programmer's tools and how Dojo supports different programming paradigms in JavaScript. The talk discusses code structuring techniques like modules, object-oriented programming, mixins, and how Dojo implements these patterns through features like dojo.declare and dojo.require. It also mentions asynchronous programming tools in Dojo and other topics not covered in the talk like widgets and graphics.
More details on the form manager, and advanced techniques. It was delivered at dojo.connect on 2/10/2010. Blog post: http://lazutkin.com/blog/2010/feb/10/rad-crud/
CRUD, form management, and how Dojo solves it. It was delivered at ClubAJAX on 12/2/2009. Blog post: http://lazutkin.com/blog/2009/dec/2/crud-with-dojo/
The document provides an overview of the Dojo Toolkit and its components for graphics and charting. It discusses the major objects in Dojo GFX for creating and manipulating shapes, as well as transformations and rendering. It also covers the major players in Dojo Charting, including plots, axes, data series, and actions for processing events. The document concludes with suggestions for building a simple image viewer and interactive chart as examples.
DojoX GFX Session Eugene Lazutkin SVG Open 2007Eugene Lazutkin
Eugene Lazutkin's course session on DojoX GFX at SVG Open 2007.
(The keynote is here: http://www.slideshare.net/elazutkin/dojox-gfx-keynote-eugene-lazutkin-svg-open-2007/)
DojoX GFX Keynote Eugene Lazutkin SVG Open 2007Eugene Lazutkin
Eugene Lazutkin's keynote on DojoX GFX at SVG Open 2007.
(The seminar notes are here: http://www.slideshare.net/elazutkin/dojox-gfx-session-eugene-lazutkin-svg-open-2007/)
#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025BookNet Canada
Book industry standards are evolving rapidly. In the first part of this session, we’ll share an overview of key developments from 2024 and the early months of 2025. Then, BookNet’s resident standards expert, Tom Richardson, and CEO, Lauren Stewart, have a forward-looking conversation about what’s next.
Link to recording, transcript, and accompanying resource: https://bnctechforum.ca/sessions/standardsgoals-for-2025-standards-certification-roundup/
Presented by BookNet Canada on May 6, 2025 with support from the Department of Canadian Heritage.
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptxAnoop Ashok
In today's fast-paced retail environment, efficiency is key. Every minute counts, and every penny matters. One tool that can significantly boost your store's efficiency is a well-executed planogram. These visual merchandising blueprints not only enhance store layouts but also save time and money in the process.
What is Model Context Protocol(MCP) - The new technology for communication bw...Vishnu Singh Chundawat
The MCP (Model Context Protocol) is a framework designed to manage context and interaction within complex systems. This SlideShare presentation will provide a detailed overview of the MCP Model, its applications, and how it plays a crucial role in improving communication and decision-making in distributed systems. We will explore the key concepts behind the protocol, including the importance of context, data management, and how this model enhances system adaptability and responsiveness. Ideal for software developers, system architects, and IT professionals, this presentation will offer valuable insights into how the MCP Model can streamline workflows, improve efficiency, and create more intuitive systems for a wide range of use cases.
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...SOFTTECHHUB
I started my online journey with several hosting services before stumbling upon Ai EngineHost. At first, the idea of paying one fee and getting lifetime access seemed too good to pass up. The platform is built on reliable US-based servers, ensuring your projects run at high speeds and remain safe. Let me take you step by step through its benefits and features as I explain why this hosting solution is a perfect fit for digital entrepreneurs.
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptxJustin Reock
Building 10x Organizations with Modern Productivity Metrics
10x developers may be a myth, but 10x organizations are very real, as proven by the influential study performed in the 1980s, ‘The Coding War Games.’
Right now, here in early 2025, we seem to be experiencing YAPP (Yet Another Productivity Philosophy), and that philosophy is converging on developer experience. It seems that with every new method we invent for the delivery of products, whether physical or virtual, we reinvent productivity philosophies to go alongside them.
But which of these approaches actually work? DORA? SPACE? DevEx? What should we invest in and create urgency behind today, so that we don’t find ourselves having the same discussion again in a decade?
How Can I use the AI Hype in my Business Context?Daniel Lehner
𝙄𝙨 𝘼𝙄 𝙟𝙪𝙨𝙩 𝙝𝙮𝙥𝙚? 𝙊𝙧 𝙞𝙨 𝙞𝙩 𝙩𝙝𝙚 𝙜𝙖𝙢𝙚 𝙘𝙝𝙖𝙣𝙜𝙚𝙧 𝙮𝙤𝙪𝙧 𝙗𝙪𝙨𝙞𝙣𝙚𝙨𝙨 𝙣𝙚𝙚𝙙𝙨?
Everyone’s talking about AI but is anyone really using it to create real value?
Most companies want to leverage AI. Few know 𝗵𝗼𝘄.
✅ What exactly should you ask to find real AI opportunities?
✅ Which AI techniques actually fit your business?
✅ Is your data even ready for AI?
If you’re not sure, you’re not alone. This is a condensed version of the slides I presented at a Linkedin webinar for Tecnovy on 28.04.2025.
HCL Nomad Web – Best Practices and Managing Multiuser Environmentspanagenda
Webinar Recording: https://www.panagenda.com/webinars/hcl-nomad-web-best-practices-and-managing-multiuser-environments/
HCL Nomad Web is heralded as the next generation of the HCL Notes client, offering numerous advantages such as eliminating the need for packaging, distribution, and installation. Nomad Web client upgrades will be installed “automatically” in the background. This significantly reduces the administrative footprint compared to traditional HCL Notes clients. However, troubleshooting issues in Nomad Web present unique challenges compared to the Notes client.
Join Christoph and Marc as they demonstrate how to simplify the troubleshooting process in HCL Nomad Web, ensuring a smoother and more efficient user experience.
In this webinar, we will explore effective strategies for diagnosing and resolving common problems in HCL Nomad Web, including
- Accessing the console
- Locating and interpreting log files
- Accessing the data folder within the browser’s cache (using OPFS)
- Understand the difference between single- and multi-user scenarios
- Utilizing Client Clocking
This is the keynote of the Into the Box conference, highlighting the release of the BoxLang JVM language, its key enhancements, and its vision for the future.
Spark is a powerhouse for large datasets, but when it comes to smaller data workloads, its overhead can sometimes slow things down. What if you could achieve high performance and efficiency without the need for Spark?
At S&P Global Commodity Insights, having a complete view of global energy and commodities markets enables customers to make data-driven decisions with confidence and create long-term, sustainable value. 🌍
Explore delta-rs + CDC and how these open-source innovations power lightweight, high-performance data applications beyond Spark! 🚀
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdfAbi john
Analyze the growth of meme coins from mere online jokes to potential assets in the digital economy. Explore the community, culture, and utility as they elevate themselves to a new era in cryptocurrency.
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager APIUiPathCommunity
Join this UiPath Community Berlin meetup to explore the Orchestrator API, Swagger interface, and the Test Manager API. Learn how to leverage these tools to streamline automation, enhance testing, and integrate more efficiently with UiPath. Perfect for developers, testers, and automation enthusiasts!
📕 Agenda
Welcome & Introductions
Orchestrator API Overview
Exploring the Swagger Interface
Test Manager API Highlights
Streamlining Automation & Testing with APIs (Demo)
Q&A and Open Discussion
Perfect for developers, testers, and automation enthusiasts!
👉 Join our UiPath Community Berlin chapter: https://community.uipath.com/berlin/
This session streamed live on April 29, 2025, 18:00 CET.
Check out all our upcoming UiPath Community sessions at https://community.uipath.com/events/.
Role of Data Annotation Services in AI-Powered ManufacturingAndrew Leo
From predictive maintenance to robotic automation, AI is driving the future of manufacturing. But without high-quality annotated data, even the smartest models fall short.
Discover how data annotation services are powering accuracy, safety, and efficiency in AI-driven manufacturing systems.
Precision in data labeling = Precision on the production floor.
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...Alan Dix
Talk at the final event of Data Fusion Dynamics: A Collaborative UK-Saudi Initiative in Cybersecurity and Artificial Intelligence funded by the British Council UK-Saudi Challenge Fund 2024, Cardiff Metropolitan University, 29th April 2025
https://alandix.com/academic/talks/CMet2025-AI-Changes-Everything/
Is AI just another technology, or does it fundamentally change the way we live and think?
Every technology has a direct impact with micro-ethical consequences, some good, some bad. However more profound are the ways in which some technologies reshape the very fabric of society with macro-ethical impacts. The invention of the stirrup revolutionised mounted combat, but as a side effect gave rise to the feudal system, which still shapes politics today. The internal combustion engine offers personal freedom and creates pollution, but has also transformed the nature of urban planning and international trade. When we look at AI the micro-ethical issues, such as bias, are most obvious, but the macro-ethical challenges may be greater.
At a micro-ethical level AI has the potential to deepen social, ethnic and gender bias, issues I have warned about since the early 1990s! It is also being used increasingly on the battlefield. However, it also offers amazing opportunities in health and educations, as the recent Nobel prizes for the developers of AlphaFold illustrate. More radically, the need to encode ethics acts as a mirror to surface essential ethical problems and conflicts.
At the macro-ethical level, by the early 2000s digital technology had already begun to undermine sovereignty (e.g. gambling), market economics (through network effects and emergent monopolies), and the very meaning of money. Modern AI is the child of big data, big computation and ultimately big business, intensifying the inherent tendency of digital technology to concentrate power. AI is already unravelling the fundamentals of the social, political and economic world around us, but this is a world that needs radical reimagining to overcome the global environmental and human challenges that confront us. Our challenge is whether to let the threads fall as they may, or to use them to weave a better future.
Mobile App Development Company in Saudi ArabiaSteve Jonas
EmizenTech is a globally recognized software development company, proudly serving businesses since 2013. With over 11+ years of industry experience and a team of 200+ skilled professionals, we have successfully delivered 1200+ projects across various sectors. As a leading Mobile App Development Company In Saudi Arabia we offer end-to-end solutions for iOS, Android, and cross-platform applications. Our apps are known for their user-friendly interfaces, scalability, high performance, and strong security features. We tailor each mobile application to meet the unique needs of different industries, ensuring a seamless user experience. EmizenTech is committed to turning your vision into a powerful digital product that drives growth, innovation, and long-term success in the competitive mobile landscape of Saudi Arabia.
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...Noah Loul
Artificial intelligence is changing how businesses operate. Companies are using AI agents to automate tasks, reduce time spent on repetitive work, and focus more on high-value activities. Noah Loul, an AI strategist and entrepreneur, has helped dozens of companies streamline their operations using smart automation. He believes AI agents aren't just tools—they're workers that take on repeatable tasks so your human team can focus on what matters. If you want to reduce time waste and increase output, AI agents are the next move.
Procurement Insights Cost To Value Guide.pptxJon Hansen
Procurement Insights integrated Historic Procurement Industry Archives, serves as a powerful complement — not a competitor — to other procurement industry firms. It fills critical gaps in depth, agility, and contextual insight that most traditional analyst and association models overlook.
Learn more about this value- driven proprietary service offering here.
Linux Professional Institute LPIC-1 Exam.pdfRHCSA Guru
Practical pairing of generative programming with functional programming.
1. The new wave of
JavaScript techniques
Practical pairing of generative programming
with functional programming
Eugene Lazutkin, ClubAjax, 6/4/2013
Wednesday, June 5, 13
3. What is GP?
Generative programming (GP):
Creates source code automatically to improve
programmer productivity.
Can be considered as a form of code reuse.
Sometimes called “automatic programming”.
Wednesday, June 5, 13
4. Examples of GP
Macro processors:
C preprocessor.
C++ templates and inline functions.
IDE “wizards” in Eclipse, MS Visual Studio.
Meta-languages and their compilers.
Domain-specific languages (DSL).
Wednesday, June 5, 13
5. Why do we need GP?
Higher-level programming.
Meta-programming.
Modeling.
DSL.
Wednesday, June 5, 13
6. Why do we need GP?
Performance improvements.
Program transformations.
Data transformations.
Code optimization and generation.
Applies to both compilers and interpreters.
Wednesday, June 5, 13
7. Why do I need GP?
Common narrative goes like that:
“Compilers and interpreters are now very
sophisticated – no need to optimize my code.”
“Modern CPUs with their fancy pipelining,
parallel execution, and branch prediction
eliminate code inefficiencies.”
Wednesday, June 5, 13
8. Don’t write inefficient code
Always estimate the algorithmic complexity of
your code (Big O notation).
Remember simple things:
Linear code usually works faster than code
with branches or loops.
Calling a function is not free. If its body is
small, it may make sense to inline it.
Wednesday, June 5, 13
9. Don’t write inefficient code
Remember simple things:
Simplify!
Simple shorter code is usually faster.
Eliminate unnecessary variables.
Profile!!!
BTW, this was an advice by Jared Jurkiewicz.
Wednesday, June 5, 13
10. Performance summary
Do not expect that an inefficient code will be
magically efficient. Always profile!
In a battle of a code clarity with a code
efficiency support the clarity, if possible.
Avoid premature optimization by taking complex
steps, yet do not write obviously slow code.
Wednesday, June 5, 13
11. JavaScript and GP
People coming from static languages frequently
overlook or discount GP facilities in JS.
JS has four ways to generate code dynamically:
eval(), new Function(), setTimeout(),
setInterval().
Browser allows to inline code.
Wednesday, June 5, 13
12. JavaScript and GP
Amazing code-generation facilities are a big
differentiator for Javascript.
Yet they are frequently shunned for numerous
reasons, including security, which is not applied
in all scenarios.
Wednesday, June 5, 13
13. JavaScript and GP
Recently GP crept in JavaScript libraries.
Examples:
Many templating languages are actually
compiled in JavaScript or can be compiled:
Mustache, Handlebars, jQuery templates...
Wednesday, June 5, 13
14. JavaScript and GP
Examples:
All JavaScript-based templates:
EJS, JST (e.g., Underscore, Lo-Dash)...
All transpilers:
CoffeeScript, GWT, Emscripten...
Numerous code-level tools (minifiers...).
Wednesday, June 5, 13
15. JavaScript and GP
Examples:
Some libraries generate code for similar
functions from the same template in order to
reduce their downloadable size, and optimize
performance.
Lo-Dash...
Wednesday, June 5, 13
17. What is FP?
Functional programming (FP):
Treats computations as the evaluation of
mathematical functions.
Avoids state, mutations, side-effects.
Emphasizes “scenario” over “a list of actors”.
Concerns more with “how” rather than
“who” and “what”.
Wednesday, June 5, 13
18. JavaScript and FP
“JavaScript is Lisp in C’s clothing.” – said
Douglas Crockford back in 2001.
Functions are first-class objects.
Lambdas are supported (functions can be
inlined, and passed around).
Closures are supported (functions can access
their environment).
Wednesday, June 5, 13
19. Practical applications of FP
Abstracting control flow details with array extras:
var total = data
.filter(function(value){ return value % 2; })
.map(function(value){ return value * value; })
.reduce(function(acc, value){
return acc + value;
}, 0);
Wednesday, June 5, 13
20. Practical applications of FP
We can even use “building blocks” now:
var total = data
.filter(isOdd)
.map(square)
.reduce(sum, 0);
Wednesday, June 5, 13
21. Why I like this code
It is easy to understand.
It is easy to decompose or refactor.
There is no trivial technical noise like names of
index and value variables, and exit conditions.
Wednesday, June 5, 13
22. Building blocks
In general we are assumed to create our
programs from right-sized building blocks.
Bigger blocks are built from smaller blocks with a
mortar/language.
It applies to any programming paradigms.
Wednesday, June 5, 13
23. ...and reality
How come in real projects we see methods and
functions in 100s and even 1000s lines of code?
Sometimes there are “good” reasons for that.
It can take more time to figure out our
building blocks than to code everything from
scratch.
Wednesday, June 5, 13
24. ...and more reality
Sometimes there are “good” reasons for that.
Calling myriad of small functions can be
detrimental to performance.
Is it really the case? It can be verified with a
profiler, which takes time too.
It is possible to create a different system of
“building blocks”.
Wednesday, June 5, 13
25. Case for pipes
Pipes are individual components of a pipeline.
Each pipe has an input and an output
(sometimes more than one of those).
Pipeline combines individual pipes by
connecting their inputs and outputs producing a
program.
A pipeline can be used as a pipe.
Wednesday, June 5, 13
26. Case for pipes
Unix shells are a classic examples of pipes.
Closely related concept: dataflow.
Complex applications frequently can be
expressed in terms of event flow.
Hot topics in JS: event streams, data streams.
Wednesday, June 5, 13
27. Pipes and chaining
While chaining is a frequent implementation
technique for pipes, it doesn’t mean that all
chaining equates to pipes.
Pipes encapsulate streams of data and
orchestrate processing of individual bits.
Frequently chaining operates in terms of
transferred objects (streams), not data bits.
Wednesday, June 5, 13
28. Chaining
Examples in JS of chaining without piping:
jQuery
Underscore
JavaScript array extras
All examples above create a container object
before passing it down.
Wednesday, June 5, 13
30. Can we do better?
Let’s use our simple example as a start point and
optimize it by inlining functions:
var total = data
.filter(function(value){ return value % 2; })
.map(function(value){ return value * value; })
.reduce(function(acc, value){
return acc + value;
}, 0);
Wednesday, June 5, 13
31. Can we do better?
var a1 = [];
for(var i = 0; i < data.length; ++i){
if(data[i] % 2) a1.push(data[i]);
}
var a2 = new Array(a1.length);
for(var i = 0; i < a1.length; ++i){
a2[i] = a1[i] * a1[i];
}
var acc = 0;
for(var i = 0; i < a2.length; ++i){
acc += a2[i];
}
var total = acc;
Wednesday, June 5, 13
32. Can we do better?
Let’s merge loops and eliminate intermediate
arrays:
var acc = 0;
for(var i = 0; i < data.length; ++i){
var value = data[i];
if(value % 2) acc += value * value;
}
var total = acc;
Wednesday, June 5, 13
34. We did better!
And the results are in:
It is faster.
We loop over values manually.
We cannot easily move this snippet around
because our technical variable names may
clash.
Ultimately it was a trade-off.
Wednesday, June 5, 13
35. Can we have our cake and eat it too?
Yes!
Wednesday, June 5, 13
36. Can we have our cake and eat it too?
We need a way to describe a result.
Not how exactly get it, but its logical inference.
Then we can apply GP to generate an optimal
code.
Wednesday, June 5, 13
37. FP and pipes
FP gives us some answers:
Iterations can be described by higher-order
operations:
map, filter, fold/reduce, zipping, unzipping,
partitioning.
Secondary: forEach, every, some, indexOf.
Wednesday, June 5, 13
39. Heya: ctr and pipe
Heya is a library that provides a modern
foundation for building web applications (both
server and client).
Heya Pipe is a functional toolkit to build efficient
data and event processing pipes using GP.
Heya Ctr provides a constructor to build
generated components.
Wednesday, June 5, 13
40. The Heya way
Let’s use our simple example and optimize it with
Heya Pipe:
var total = data
.filter(function(value){ return value % 2; })
.map(function(value){ return value * value; })
.reduce(function(acc, value){
return acc + value;
}, 0);
Wednesday, June 5, 13
41. The Heya way
Here it is:
var f = array(new Pipe()
.filter(“value % 2”)
.map(“value *= value;”)
.fold(“accumulator += value;”, 0)
).compile();
var total = f(data);
Wednesday, June 5, 13
42. Performance results
0 750 1500 2250 3000
ms
Manual (38ms) Pipe (53ms) Extra (2885ms)
Wednesday, June 5, 13
43. What do we see?
We are as expressive as array extras.
We are as performant as manual code.
The performance gap can be reduced.
In any case pipes are >40x faster than array
extras.
Wednesday, June 5, 13
44. Heya Pipe conventions
Heya Pipe is modeled after array extras.
It can accept the same parameters.
If a string is specified instead of a function it is
assumed to be a code snippet.
Code snippets work by conventions.
Wednesday, June 5, 13
45. Heya Pipe conventions
Snippets can have several lines of code.
“Boolean” snippets assume that the last line
returns a boolean value.
Snippet’s input is a “value” variable. A snippet
can modify it to return a different value.
Snippets for fold-able operations can access and
update an “accumulator” variable.
Wednesday, June 5, 13
46. Debugging
People make mistakes ⇒ code should be
debugged.
How to debug a generated code?
What is Heya Pipe story here?
Wednesday, June 5, 13
47. Debugging
The screenshot shows node.js debugging with
node-inspector.
The generated code appears in the file panel.
The code is fully readable.
Wednesday, June 5, 13
48. Heya Pipe
Provides a rich foundation for pipes:
forEach, transform, map, filter, indexOf, every,
some, fold, scan, skip, take, skipWhile,
takeWhile, voidResult.
Can work with potentially infinite streams.
Wednesday, June 5, 13
49. Heya Pipe
Can iterate over numerous containers:
Array (sparse and dense, including in reverse),
array slices (including in reverse), Object (keys,
values, own and inherited), iterators,
enumerators, generators, and perform unfold.
Includes a compiler, and an interpreter.
Can use pipes as sub-pipes.
Wednesday, June 5, 13
50. Heya Ctr
Implements GP helpers.
Includes a simple formatting-aware
templating.
Allows managing closures.
Serves as a foundation for Heya Pipes.
Wednesday, June 5, 13
51. Closures with Heya Ctr
Allows to inject variables in a closure, which will
be directly accessible from snippets by name.
Does not use “with” statement because it is
incompatible with strict mode.
Fully strict mode compatible.
Allows to access and modify closure-bound
variables.
Wednesday, June 5, 13