9,383 research outputs found
Covariance and Controvariance: a fresh look at an old issue (a primer in advanced type systems for learning functional programmers)
Twenty years ago, in an article titled "Covariance and contravariance:
conflict without a cause", I argued that covariant and contravariant
specialization of method parameters in object-oriented programming had
different purposes and deduced that, not only they could, but actually they
should both coexist in the same language.
In this work I reexamine the result of that article in the light of recent
advances in (sub-)typing theory and programming languages, taking a fresh look
at this old issue.
Actually, the revamping of this problem is just an excuse for writing an
essay that aims at explaining sophisticated type-theoretic concepts, in simple
terms and by examples, to undergraduate computer science students and/or
willing functional programmers.
Finally, I took advantage of this opportunity to describe some undocumented
advanced techniques of type-systems implementation that are known only to few
insiders that dug in the code of some compilers: therefore, even expert
language designers and implementers may find this work worth of reading
A Librarian Looks At American Publishing
How does, and how should, a librarian look at publishing in
1967? As a minor customer buying a small part of the output of a
large industry? As a fellow member of the nation's communications
apparatus ? As one of the last of the Mohicans upon whom the tribe
of McLuhanites is about to count coup? Is the librarian like one of a
boatload of frantic voyagers in immediate danger of drowning in a
roaring river of print loosed by publishers? Or may librarians and
publishers be thought of as linked in a symbiotic relationship like that
of the Egyptian plover and the crocodile? The plover helps the
crocodile as lookout and oral hygienist. In return he gets the delicious
leeches he finds along the crocodile's gums. Both partners benefit.
However one describes the publisher -librarian relationship it is
obvious we each have important functions in the series of processes
from the writing of a book to its publishing, and on to its selection,
acquisition and presentation to the reader. We share in the crucial
responsibilities of maintaining our country's information network.published or submitted for publicatio
JoXSZ: Joint X-SZ fitting code for galaxy clusters
The thermal Sunyaev-Zeldovich (SZ) effect and the X-ray emission offer
separate and highly complementary probes of the thermodynamics of the
intracluster medium. We present JoXSZ, the first publicly available code
designed to jointly fit SZ and X-ray data coming from various instruments to
derive the thermodynamic profiles of galaxy clusters. JoXSZ follows a fully
Bayesian forward-modelling approach, accounts for the SZ calibration
uncertainty and X-ray background level systematic. It improves upon most
state-of-the-art, and not publicly available, analyses because it adopts the
correct Poisson-Gauss expression for the joint likelihood, makes full use of
the information contained in the observations, even in the case of missing
values within the datasets, has a more inclusive error budget, and adopts a
consistent temperature across the various parts of the code, allowing for
differences between X-ray and SZ gas mass weighted temperatures when required
by the user. JoXSZ accounts for beam smearing and data analysis transfer
function, accounts for the temperature and metallicity dependencies of the SZ
and X-ray conversion factors, adopts flexible parametrization for the
thermodynamic profiles, and on user request allows either adopting or relaxing
the assumption of hydrostatic equilibrium (HE). When HE holds, JoXSZ uses a
physical (positive) prior on the radial derivative of the enclosed mass and
derives the mass profile and overdensity radii . For these reasons,
JoXSZ goes beyond simple SZ and electron density fits. We illustrate the use of
JoXSZ by combining Chandra and NIKA data on the high-redshift cluster CL
J1226.9+3332. The code is written in Python, it is fully documented and the
users are free to customize their analysis in accordance with their needs and
requirements. JoXSZ is publicly available on GitHub.Comment: 11 pages, 9 figures, accepted for publication in Astronomy and
Astrophysics. Code available on GitHub at https://github.com/fcastagna/JoXSZ.
v2 updated with language editin
A theory of contracts for web services
<p>Contracts are behavioural descriptions of Web services. We devise a theory of contracts that formalises the compatibility of a client to a service, and the safe replacement of a service with another service. The use of contracts statically ensures the successful completion of every possible interaction between compatible clients and services.</p>
<p>The technical device that underlies the theory is the definition of filters, which are explicit coercions that prevent some possible behaviours of services and, in doing so, they make services compatible with different usage scenarios. We show that filters can be seen as proofs of a sound and complete subcontracting deduction system which simultaneously refines and extends Hennessy's classical axiomatisation of the must testing preorder. The relation is decidable and the decision algorithm is obtained via a cut-elimination process that proves the coherence of subcontracting as a logical system.</p>
<p>Despite the richness of the technical development, the resulting approach is based on simple ideas and basic intuitions. Remarkably, its application is mostly independent of the language used to program the services or the clients. We also outline the possible practical impact of such a work and the perspectives of future research it opens.</p>
EU AND GLOBALIZATION: SOME STYLIZED FACTS
Most of the people all over the world claim that globalization is a result of dynamic interactions between economic, technological, social and political factors. The aim of this paper is to document some stylized facts on this phenomenon in order to takeglobalization, cluster analysis, k-means algorithm, international ranking
Modelling of standard and specialty fibre-based systems using finite element methods
We report on the investigation of an approach for modelling light
transmission through systems consisting of several jointed optical fibres, in
which the analytical modelling of the waveguides was replaced by Finite Element
Modelling (FEM) simulations. To validate this approach we first performed FEM
analysis of standard fibres and used this to evaluate the coupling efficiency
between two singlemode fibres under different conditions. The results of these
simulations were successfully compared with those obtained using classical
analytical approaches, by demonstrating a maximum loss deviation of about 0.4
%. Further, we performed other more complex simulations that we compared again
to the analytical models. FEM simulations allow addressing any type of guiding
structure, without limitations on the complexity of the geometrical waveguide
cross section and involved materials. We propose as example of application the
modelling of the light transmitted through a system made of a hollow core
photonic crystal fibre spliced between two singlemode standard optical fibres,
and qualitatively compare the results of the simulation with experimental
results.Comment: Proceedings article, SPIE conference "Fiber Lasers and Glass
Photonics: Materials through Applications
Set-Theoretic Types for Polymorphic Variants
Polymorphic variants are a useful feature of the OCaml language whose current
definition and implementation rely on kinding constraints to simulate a
subtyping relation via unification. This yields an awkward formalization and
results in a type system whose behaviour is in some cases unintuitive and/or
unduly restrictive. In this work, we present an alternative formalization of
poly-morphic variants, based on set-theoretic types and subtyping, that yields
a cleaner and more streamlined system. Our formalization is more expressive
than the current one (it types more programs while preserving type safety), it
can internalize some meta-theoretic properties, and it removes some
pathological cases of the current implementation resulting in a more intuitive
and, thus, predictable type system. More generally, this work shows how to add
full-fledged union types to functional languages of the ML family that usually
rely on the Hindley-Milner type system. As an aside, our system also improves
the theory of semantic subtyping, notably by proving completeness for the type
reconstruction algorithm.Comment: ACM SIGPLAN International Conference on Functional Programming, Sep
2016, Nara, Japan. ICFP 16, 21st ACM SIGPLAN International Conference on
Functional Programming, 201
HUMAN CAPITAL AND OPENNESS TO INTERNATIONAL TRADE: EVIDENCE FROM THE ENLARGED EUROPE
In the increasingly knowledge-based global economy, a well-educated and highly-skilled labour force and a significant degree of openness to international trade are vital for countries to successfully meet the challenge of worldwide competition. This paperhuman capital, openness to international trade, economic growth
- âŠ