Although run-time language composition is common, it normally takes the form of a crude Foreign Function Interface (FFI). While useful, such compositions tend to be coarse-grained and slow. In this paper we introduce a novel fine-grained syntactic composition of PHP and Python which allows users to embed each language inside the other, including referencing variables across languages. This composition raises novel design and implementation challenges. We show that good solutions can be found to the design challenges; and that the resulting implementation imposes an acceptable performance overhead of, at most, 2.6x.
There has been a long-standing desire for language composition (see e.g. @cite_17 ), and many flavours have developed since then. Extensible languages (e.g. @cite_27 @cite_29 @cite_4 ) aim to grow a language as required by a user. However, the base language places restrictions on what extensions are possible (e.g. due to parsing restrictions) and performant @cite_19 . Translating one language into another (with e.g. Stratego @cite_0 ) removes many of the limitations on what is expressible, but full-scale translations are complex (e.g. @cite_1 ) and typically suffer the same performance issues as extensible languages. However, for small use cases, or where performance is not important, either approach can work well.
@cite_4 @cite_29 @cite_1 @cite_0 @cite_19 @cite_27 @cite_17
2085595137 1506525786 2099031744 2016630033
Our discussion of the motivation for extensible languages rests on a basic premise, namely that there exist diverse programming language requirements which are becoming continually more diverse, and that it is of critical importance that each user in the spectrum of users be supplied with a language facility appropriate to his problem area. That is, there are, in fact, "scientific" problems, "data processing" problems," information retrieval" problems, "symbol manipulation" problems, "system programming" problems, and so on and each problem area has its particular and peculiar units of data, unit transactions, and preferred ways of writing. For example, the kinds of unit data and unit transactions include integers which are to be added, floating point numbers to be multiplied, "infinite" precision rational numbers to be divided, strings to be concatenated, records into which a field is to be inserted, files to be sorted, matrices to be inverted, equations to be simplified, sets to be unioned, and so on. A part of our premise is that it is not enough to have a language which is formally sufficient to host the particular data and unit transactions some user has in mind. Rather, it is of critical importance that the kinds of data and unit transactions which he wants to think of as primitive be available, effectively as primitives, in his language facility. We implement a variant of the algorithm described by Yarowsky and Ngai in [21] to induce an HMM POS tagger for an arbitrary target language using only an existing POS tagger for a source language and an unannotated parallel corpus between the source and target languages. We extend this work by projecting from multiple source languages onto a single target language. We hypothesize that systematic transfer errors from differing source languages will cancel out, improving the quality of bootstrapped resources in the target language. Our experiments confirm the hypothesis. Each experiment compares three cases: (a) source data comes from a single language A, (b) source data comes from a single language B, and (c) source data comes from both A and B, but half as much from each. Apart from the source language, other conditions are held constant in all three cases – including the total amount of source data used. The null hypothesis is that performance in the mixed case would be an average of performance in the single-language cases, but in fact, mixed-case performance always exceeds the maximum of the single-language cases. We observed this effect in all six experiments we ran, involving three different source-language pairs and two different target languages. Due to the globalization on the Web, many companies and institutions need to efficiently organize and search repositories containing multilingual documents. The management of these heterogeneous text collections increases the costs significantly because experts of different languages are required to organize these collections. Cross-language text categorization can provide techniques to extend existing automatic classification systems in one language to new languages without requiring additional intervention of human experts. In this paper, we propose a learning algorithm based on the EM scheme which can be used to train text classifiers in a multilingual environment. In particular, in the proposed approach, we assume that a predefined category set and a collection of labeled training data is available for a given language L sub 1 . A classifier for a different language L sub 2 is trained by translating the available labeled training set for L sub 1 to L sub 2 and by using an additional set of unlabeled documents from L sub 2 . This technique allows us to extract correct statistical properties of the language L sub 2 which are not completely available in automatically translated examples, because of the different characteristics of language L sub 1 and of the approximation of the translation process. Our experimental results show that the performance of the proposed method is very promising when applied on a test document set extracted from newsgroups in English and Italian. This paper describes a system and set of algorithms for automatically inducing stand-alone monolingual part-of-speech taggers, base noun-phrase bracketers, named-entity taggers and morphological analyzers for an arbitrary foreign language. Case studies include French, Chinese, Czech and Spanish.Existing text analysis tools for English are applied to bilingual text corpora and their output projected onto the second language via statistically derived word alignments. Simple direct annotation projection is quite noisy, however, even with optimal alignments. Thus this paper presents noise-robust tagger, bracketer and lemmatizer training procedures capable of accurate system bootstrapping from noisy and incomplete initial projections.Performance of the induced stand-alone part-of-speech tagger applied to French achieves 96 core part-of-speech (POS) tag accuracy, and the corresponding induced noun-phrase bracketer exceeds 91 F-measure. The induced morphological analyzer achieves over 99 lemmatization accuracy on the complete French verbal system.This achievement is particularly noteworthy in that it required absolutely no hand-annotated training data in the given language, and virtually no language-specific knowledge or resources beyond raw text. Performance also significantly exceeds that obtained by direct annotation projection.