background preloader

Advanced Theory/Papers

Facebook Twitter

JavaScript Inheritance via Prototypes and Closures. JavaScript as a prototypical language offers loads of solutions to implement classes and class inheritance.

JavaScript Inheritance via Prototypes and Closures

When coming from an Object Oriented language such as Java or Ruby, these solutions aren't obvious at the first glance. I started coding JavaScript years ago and always found a solution for my specific case. But things felt messy and I always thought "Is this really the right way of doing it? ". Well, after all those years, experience took away this feeling and now I want to share some stuff that finally meant a break-through of understanding for me.

Conal Elliott's home page. Cilk Cilk (pronounced "silk") is a linguistic and runtime technology for algorithmic multithreaded programming developed at MIT.

The philosophy behind Cilk is that a programmer should concentrate on structuring her or his program to expose parallelism and exploit locality, leaving Cilk's runtime system with the responsibility of scheduling the computation to run efficiently on a given platform. The Cilk runtime system takes care of details like load balancing, synchronization, and communication protocols.

Cilk is algorithmic in that the runtime system guarantees efficient and predictable performance. Click here for a brief introduction to Cilk. Cilk at Intel! MIT licensed Cilk technology to Cilk Arts, Inc.of Lexington, MA, a venture-funded start-up founded by Charles E. Awards SPAA Best Paper The ACM Symposium on Parallelism in Algorithms and Architectures (SPAA) awarded our 2009 paper on reducer hyperobjects its Best Paper Award. PLDI 10-Year Retrospective Award HPC Challenge Award. Circle-ellipse problem. The circle-ellipse problem in software development (sometimes known as the square-rectangle problem) illustrates a number of pitfalls which can arise when using subtype polymorphism in object modelling.

Circle-ellipse problem

The issues are most commonly encountered when using object-oriented programming. The existence of the circle-ellipse problem is sometimes used to criticize object-oriented programming. It may also imply that hierarchical taxonomies are difficult to make universal, implying that situational classification systems may be more practical. The problem[edit] SOLID Development Principles – In Motivational Pictures. I found the Motivator this morning. It lets you create your own motivational pictures. So, here’s my first run at creating the SOLID software development principles in motivational picture form.

I ‘borrowed’ the images from google image search results. Duck typing. When I see a bird that walks like a duck and swims like a duck and quacks like a duck, I call that bird a duck.[1] In duck typing, a programmer is only concerned with ensuring that objects behave as demanded of them in a given context, rather than ensuring that they are of a specific type.

Duck typing

For example, in a non-duck-typed language, one would create a function that requires that the object passed into it be of type Duck, in order to ensure that that function can then use the object's walk and quack methods. In a duck-typed language, the function would take an object of any type and simply call its walk and quack methods, producing a run-time error if they are not defined. Instead of specifying types formally, duck typing practices rely on documentation, clear code, and testing to ensure correct use.

Concept examples[edit] Liskov substitution principle. Design by contract. "Design by Contract" is a registered trademark[1] of Eiffel Software in the United States, and should not be confused with the general design approach.

Design by contract

Microsoft calls their design-by-contract programming implementation "Code Contracts".[2] History[edit] Design by contract has its roots in work on formal verification, formal specification and Hoare logic. The original contributions include: Description[edit] Lambda cube. The lambda cube.

Lambda cube

Direction of each arrow is direction of inclusion. In mathematical logic and type theory, the λ-cube is a framework for exploring the axes of refinement in Coquand's calculus of constructions, starting from the simply typed lambda calculus (written as in the cube diagram to the right) as the vertex of a cube placed at the origin, and the calculus of constructions (higher order dependently-typed polymorphic lambda calculus; written as λPω in the diagram) as its diametrically opposite vertex.

Logical harmony. Logical harmony, a name coined by Sir Michael Dummett, is a supposed constraint on the rules of inference that can be used in a given logical system.

Logical harmony

The logician Gerhard Gentzen proposed that the meanings of logical connectives could be given by the rules for introducing them into discourse. For example, if one believes that the sky is blue and one also believes that grass is green, then one can introduce the connective and as follows: The sky is blue AND grass is green. Gentzen's idea was that having rules like this is what gives meaning to one's words, or at least to certain words. The idea has also been associated with Wittgenstein's dictum that in many cases we can say, the meaning is the use. Most contemporary logicians prefer to think that the introduction rules and the elimination rules for an expression are equally important. References[edit] Vorlath - Halting Problem Diagonalization. Game Pitches. Service-oriented architecture. Service-Orientation Design Principles. Service-orientation design principles are proposed principles for developing the solution logic of services within service-oriented architectures (SOA).[1][2][3] Overview[edit]

Service-Orientation Design Principles

Orchestration (computing) This usage of orchestration is often discussed in the context of service oriented architecture, virtualization, provisioning, Converged Infrastructure and dynamic datacenter topics.

Orchestration (computing)

Orchestration in this sense is about aligning the business request with the applications, data, and infrastructure. It defines the policies and service levels through automated workflows, provisioning, and change management. This creates an application-aligned infrastructure that can be scaled up or down based on the needs of each application. Orchestration also provides centralized management of the resource pool, including billing, metering, and chargeback for consumption. For example, orchestration reduces the time and effort for deploying multiple instances of a single application.

Web Service Choreography. The main effort to get a choreography, The W3C Web Services Choreography Working Group, was closed on 10 July 2009[1] leaving WS-CDL as a Candidate Recommendation.

Web Service Choreography

Component-based software engineering. An example of two components expressed in UML 2.0. The checkout component, responsible for facilitating the customer's order, requires the card processing component to charge the customer's credit/debit card (functionality that the latter provides). Component-based software engineering (CBSE) (also known as component-based development (CBD)) is a branch of software engineering that emphasizes the separation of concerns in respect of the wide-ranging functionality available throughout a given software system. It is a reuse-based approach to defining, implementing and composing loosely coupled independent components into systems.

This practice aims to bring about an equally wide-ranging degree of benefits in both the short-term and the long-term for the software itself and for organizations that sponsor such software. Service-orientation. Service-orientation has received a lot of attention since 2005 [4] due to the benefits it promises. These include increased return on investment, organisational agility and interoperability as well as a better alignment between business and IT.

It builds heavily on earlier design paradigms and enhances them with standardisation, loose coupling and business involvement.[5] Prefer Composition over Inheritance. When the question came up whether to subclass CCSprite or use some model class to build your game entity hierarchy in the cocos2d forum, i stressed that one should try not to use inheritance and keep the inheritance hierarchy to as few levels as possible. Evolve Your Hierarchy. Refactoring Game Entities with Components Up until fairly recent years, game programmers have consistently used a deep class hierarchy to represent game entities. JavaScript Programming Patterns. JavaScript is meant to be used to add behaviour to a website, might it be for form validation or for more complex operations like drag & drop functionality or performing asynchronous requests to the webserver (aka Ajax). During the past few years, JavaScript libraries became increasingly popular.

Elliott » Denotational design with type class morphisms. I’ve just finished a draft of a paper called Denotational design with type class morphisms, for submission to ICFP 2009. Papers/type-class-morphisms/type-class-morphisms-long.pdf.