PYMT5: Multi-Mode Translation of Natural Language and PYTHON Code with Transformers

Total Page:16

File Type:pdf, Size:1020Kb

PYMT5: Multi-Mode Translation of Natural Language and PYTHON Code with Transformers PYMT5: multi-mode translation of natural language and PYTHON code with transformers Colin B. Clement∗ Dawn Drain Microsoft Cloud and AI Microsoft Cloud and AI [email protected] [email protected] Jonathan Timchecky Alexey Svyatkovskiy Stanford University Microsoft Cloud and AI [email protected] [email protected] Neel Sundaresan Microsoft Cloud and AI [email protected] Abstract generation (summarization), and achieved a ROUGE-L F-score of 24.8 for method Simultaneously modeling source code generation and 36.7 for docstring genera- and natural language has many excit- tion. ing applications in automated software development and understanding. Pur- 1 Introduction suant to achieving such technology, we introduce PYMT5, the PYTHON method Software is a keystone of modern society, text-to-text transfer transformer, which is touching billions of people through services trained to translate between all pairs of and devices daily. Writing and documenting PYTHON method feature combinations: a the source code of this software are challeng- single model that can both predict whole ing and labor-intensive tasks; software devel- methods from natural language documen- opers need to repeatedly refer to online doc- tation strings (docstrings) and summarize code into docstrings of any common style. umentation resources in order to understand We present an analysis and modeling ef- existing code bases to make progress. Devel- fort of a large-scale parallel corpus of 26 oper productivity can be improved by the pres- million PYTHON methods and 7.7 mil- ence of source code documentation and a de- lion method-docstring pairs, demonstrat- velopment environment featuring intelligent, ing that for docstring and method gen- machine-learning-based code completion and eration, PYMT5 outperforms similarly- analysis tools. sized auto-regressive language models Recent progress in natural language process- (GPT2) which were English pre-trained arXiv:2010.03150v1 [cs.LG] 7 Oct 2020 or randomly initialized. On the CODE- ing (NLP), especially encoder/decoder-based SEARCHNET test set, our best model pre- transformer models (Vaswani et al., 2017) dicts 92.1% syntactically correct method and pre-training (Radford et al., 2018; Lewis bodies, achieved a BLEU score of 8.59 for et al., 2019), has led to state-of-the-art per- method generation and 16.3 for docstring formance on language modeling, classifica- ∗Corresponding author tion (Devlin et al., 2018), translation (Raffel y Work done during a Microsoft internship et al., 2019), summarization (Liu and Lap- ata, 2019), grammar correction (Bryant et al., (2017) and treat PYTHON and its docstrings 2017), entity recognition, dialogue genera- as fundamentally no different than other ‘natu- tion (Budzianowski and Vulic´, 2019), and ral’ languages, representing both source code more. Along with these quantitative advances and natural language docstrings as sequences have come deeper understanding of the learned of tokens sharing the same vocabulary. Here hidden representations which power transform- we present a multi-mode translation method ers (Kovaleva et al., 2019; Voita et al., 2019; resulting in PYMT5, the PYTHON method Clark et al., 2019; Ethayarajh, 2019). While text-to-text transfer transformer (inspired by they are arguably not ‘natural,’ programming the text-to-text transfer transformer T5 (Raffel languages are increasingly becoming model- et al., 2019)). Our single model can both learn ing playgrounds for NLP modeling. Since code/language generation and understand the these languages by definition have a gram- relationships between them. mar, syntax, and known relationships between The paper is organized as follows: we entities, they offer enticing opportunities for begin in sec.2 by presenting examples of an even deeper probing of NLP models and the performance of our novel multi-mode tasks. Beyond theoretical importance, many PYMT5 —the PYTHON method text-to-text NLP tasks have practical utility in software transfer transformer model—which we trained development environments: language model- to translate between all pairs of combinations ing or generation can be used for code com- of method signatures, docstrings, and bod- pletion (Raychev et al., 2014; Bruch et al., ies which do not have the same feature in 2009; Svyatkovskiy et al., 2019, 2020), transla- both the source and target. In sec. 2.1 we de- tion/summarization to generate documentation scribe our training data and the pre-processing or natural language summaries (Moreno et al., steps for source code and natural language 2013; Scalabrino et al., 2017; Wan et al., 2018; we followed, and compared it to existing par- Alon et al., 2018) or even summarize a set of allel docstring-method corpora like CODE- code changes (Moreno et al., 2014), transla- SEARCHNET (CSN)(Husain et al., 2019) and tion and grammar error correction to patch and that presented by Barone et al (Barone and Sen- detect bugs (Zhai et al., 2019), and joint em- nrich, 2017). In sec.2.2 we explain our BART- bedding of code and natural language for code like (Lewis et al., 2019) pre-training scheme, search (Husain et al., 2019; Gu et al., 2018). demonstrating a 25× speed-up in training time for docstring generation. Next, in sec. 2.3 we In this work we focus on jointly modeling analyze and classify PYTHON docstrings, en- both source code (PYTHON) and concomitant abling style-conditioned docstring generation natural language documentation (docstrings) in PYMT5. In sections3 and4, we discuss with transformers, through the study of dual PYMT5 results on method generation and doc- tasks: generating method code bodies from string generation respectively and compare it signatures and docstrings, and generating doc- to two GPT2 models randomly initialized and strings from signatures and method code bod- pre-trained on English. ies. While previous work (Allamanis et al., 2015; Yin and Neubig, 2017) has leveraged the 2 Multi-mode training grammar of code to extract features like the Ab- stract Syntax Tree for modeling (treating code Figure1 shows examples of inputs and out- and natural language as separate modalities), puts of our model PYMT5 for 3 example tasks: we follow examples like Barone and Sennrich (top, blue) predicting a body from a method Figure 1: Real examples of PYMT5 performing method generation using combinations of signatures and docstrings. A leading comment in the input sequence instructs the model to output a particular combination of features, e.g. ‘# target signature and body’ instructs PYMT5 to predict both a signature and body. """Count the number of even numbers # target docstring style oneline in a list""" def count_even_numbers_in_list(lst): count=0 """Count the number of even for example in lst: numbers in a list. if ((example%2) ==0): count +=1 Parameters return count ---------- PYMT5 lst : list The list to count even # target docstring style numpydoc numbers in. def count_even_numbers_in_list(lst): count=0 Returns for example in lst: ------- if ((example%2) ==0): int count +=1 The number of even numbers return count in the list.""" Figure 2: PYMT5 performing docstring generation on an example method, showing the output when the target prefix indicates one line (top, blue) and Numpydoc docstring (bottom, red) styles. signature, (middle, red) predicting a whole types of ‘lst’ and ‘numbers’ to be iterables method from a natural language docstring, containing numbers. and (bottom, green) predicting a body from PYMT5 can also be prompted with source a signature and docstring. Note that the com- code to produce a docstring summary in ment ‘# target <specification>’ in- various styles. Figure2 shows the model structs the model to choose a particular form prompted with one of the methods generated of output. Further note that PYMT5 correctly by PYMT5 in Fig.1 (top, blue), in both a learns to interpret natural language: it inter- ‘one line’ (top, blue) style and a ‘Numpydoc’ prets ‘even’ as being related to ‘(example (bottom, red) style. It infers the intent from the %2) == 0’, and ‘greater than 1000’ signature name and code, and even infers that as ‘number > 1000’. The model also pro- type of the argument is a list and return type duces syntactically correct code (as we will int. It produces the same terse one sentence discuss later, we never show the model syntac- summary of the function in both cases. tically incorrect code), and correctly infers the In order to teach PYMT5 to maximally re- late the separate method features (signatures, space or tab conventions, successfully parsing docstrings, bodies), we trained it to translate 97.3% of the 2.3 million unique PYTHON files. between all pairs of feature combinations in We used the PYTHON module astunparse which the same feature does not appear in both to take the AST for each method and unparse the source and target. This scheme is also ad- them back into source code, so that our fine- vantageous as our corpus is unbalanced, with tuned model was never trained on syntactically only 1/5 methods featuring docstrings, and so incorrect code. The statistics of our method- the model can learn to leverage all the features docstring corpus are summarized in Table.1. whether they are present or not. Additionally, it Our parallel method-docstring corpus is twice has been shown that code is more ‘predictable’ as large as the next largest irrespective of lan- than natural language (Hindle et al., 2012). If guage and over 15× as large as the next largest the method and argument names are a domi- PYTHON parallel corpus, both in CSN. nating signal due to their relatively rigid struc- For each method, we ignored comments as ture, the model may learn to ignore the content they generally represent trivia and are not part of docstrings. This multi-mode method over- of the normal language syntax. We cleaned the comes that by training the model to generate docstrings by removing non-ASCII characters, method bodies from docstrings alone. See the normalizing Unicode, and replacing commit appendix for a more detailed description of the hashes, file paths, and URLs with placeholder multi-mode training scheme.
Recommended publications
  • SETL for Internet Data Processing
    SETL for Internet Data Processing by David Bacon A dissertation submitted in partial fulfillment of the requirements for the degree of Doctor of Philosophy Computer Science New York University January, 2000 Jacob T. Schwartz (Dissertation Advisor) c David Bacon, 1999 Permission to reproduce this work in whole or in part for non-commercial purposes is hereby granted, provided that this notice and the reference http://www.cs.nyu.edu/bacon/phd-thesis/ remain prominently attached to the copied text. Excerpts less than one PostScript page long may be quoted without the requirement to include this notice, but must attach a bibliographic citation that mentions the author’s name, the title and year of this disser- tation, and New York University. For my children ii Acknowledgments First of all, I would like to thank my advisor, Jack Schwartz, for his support and encour- agement. I am also grateful to Ed Schonberg and Robert Dewar for many interesting and helpful discussions, particularly during my early days at NYU. Terry Boult (of Lehigh University) and Richard Wallace have contributed materially to my later work on SETL through grants from the NSF and from ARPA. Finally, I am indebted to my parents, who gave me the strength and will to bring this labor of love to what I hope will be a propitious beginning. iii Preface Colin Broughton, a colleague in Edmonton, Canada, first made me aware of SETL in 1980, when he saw the heavy use I was making of associative tables in SPITBOL for data processing in a protein X-ray crystallography laboratory.
    [Show full text]
  • 1. with Examples of Different Programming Languages Show How Programming Languages Are Organized Along the Given Rubrics: I
    AGBOOLA ABIOLA CSC302 17/SCI01/007 COMPUTER SCIENCE ASSIGNMENT ​ 1. With examples of different programming languages show how programming languages are organized along the given rubrics: i. Unstructured, structured, modular, object oriented, aspect oriented, activity oriented and event oriented programming requirement. ii. Based on domain requirements. iii. Based on requirements i and ii above. 2. Give brief preview of the evolution of programming languages in a chronological order. 3. Vividly distinguish between modular programming paradigm and object oriented programming paradigm. Answer 1i). UNSTRUCTURED LANGUAGE DEVELOPER DATE Assembly Language 1949 FORTRAN John Backus 1957 COBOL CODASYL, ANSI, ISO 1959 JOSS Cliff Shaw, RAND 1963 BASIC John G. Kemeny, Thomas E. Kurtz 1964 TELCOMP BBN 1965 MUMPS Neil Pappalardo 1966 FOCAL Richard Merrill, DEC 1968 STRUCTURED LANGUAGE DEVELOPER DATE ALGOL 58 Friedrich L. Bauer, and co. 1958 ALGOL 60 Backus, Bauer and co. 1960 ABC CWI 1980 Ada United States Department of Defence 1980 Accent R NIS 1980 Action! Optimized Systems Software 1983 Alef Phil Winterbottom 1992 DASL Sun Micro-systems Laboratories 1999-2003 MODULAR LANGUAGE DEVELOPER DATE ALGOL W Niklaus Wirth, Tony Hoare 1966 APL Larry Breed, Dick Lathwell and co. 1966 ALGOL 68 A. Van Wijngaarden and co. 1968 AMOS BASIC FranÇois Lionet anConstantin Stiropoulos 1990 Alice ML Saarland University 2000 Agda Ulf Norell;Catarina coquand(1.0) 2007 Arc Paul Graham, Robert Morris and co. 2008 Bosque Mark Marron 2019 OBJECT-ORIENTED LANGUAGE DEVELOPER DATE C* Thinking Machine 1987 Actor Charles Duff 1988 Aldor Thomas J. Watson Research Center 1990 Amiga E Wouter van Oortmerssen 1993 Action Script Macromedia 1998 BeanShell JCP 1999 AngelScript Andreas Jönsson 2003 Boo Rodrigo B.
    [Show full text]
  • Python in Education Teach, Learn, Program
    ANALYZING THE ANALYZERS THE ANALYZING Python in Education Teach, Learn, Program Nicholas H. Tollervey ISBN: 978-1-491-92462-4 Python in Education Teach, Learn, Program Nicholas H.Tollervey Python in Education by Nicholas H. Tollervey Copyright © 2015 O’Reilly Media, Inc. All rights reserved. Printed in the United States of America. Published by O’Reilly Media, Inc., 1005 Gravenstein Highway North, Sebastopol, CA 95472. O’Reilly books may be purchased for educational, business, or sales promotional use. Online editions are also available for most titles (http://safaribooksonline.com). For more information, contact our corporate/institutional sales department: 800-998-9938 or [email protected]. Editor: Meghan Blanchette Interior Designer: David Futato Production Editor: Kristen Brown Cover Designer: Karen Montgomery Copyeditor: Gillian McGarvey Illustrator: Rebecca Demarest April 2015: First Edition Revision History for the First Edition 2015-03-11: First Release See http://oreilly.com/catalog/errata.csp?isbn=9781491924624 for release details. The O’Reilly logo is a registered trademark of O’Reilly Media, Inc. Python in Educa‐ tion, the cover image, and related trade dress are trademarks of O’Reilly Media, Inc. While the publisher and the author have used good faith efforts to ensure that the information and instructions contained in this work are accurate, the publisher and the author disclaim all responsibility for errors or omissions, including without limi‐ tation responsibility for damages resulting from the use of or reliance on this work. Use of the information and instructions contained in this work is at your own risk. If any code samples or other technology this work contains or describes is subject to open source licenses or the intellectual property rights of others, it is your responsi‐ bility to ensure that your use thereof complies with such licenses and/or rights.
    [Show full text]
  • Study of Twitter Sentiment Analysis Using Machine Learning Algorithms on Python
    International Journal of Computer Applications (0975 – 8887) Volume 165 – No.9, May 2017 Study of Twitter Sentiment Analysis using Machine Learning Algorithms on Python Bhumika Gupta, PhD Monika Negi, Kanika Vishwakarma, Goldi Assistant Professor, C.S.E.D Rawat, Priyanka Badhani G.B.P.E.C, Pauri, Uttarakhand, India B.Tech, C.S.E.D G.B.P.E.C Uttarakhand, India ABSTRACT 2. ABOUT SENTIMENT ANALYSIS Twitter is a platform widely used by people to express their Sentiment analysis is a process of deriving sentiment of a opinions and display sentiments on different occasions. particular statement or sentence. It’s a classification technique Sentiment analysis is an approach to analyze data and retrieve which derives opinion from the tweets and formulates a sentiment that it embodies. Twitter sentiment analysis is an sentiment and on the basis of which, sentiment classification application of sentiment analysis on data from Twitter is performed. (tweets), in order to extract sentiments conveyed by the user. In the past decades, the research in this field has consistently Sentiments are subjective to the topic of interest. We are grown. The reason behind this is the challenging format of the required to formulate that what kind of features will decide for tweets which makes the processing difficult. The tweet format the sentiment it embodies. is very small which generates a whole new dimension of In the programming model, sentiment we refer to, is class of problems like use of slang, abbreviations etc. In this paper, we entities that the person performing sentiment analysis wants to aim to review some papers regarding research in sentiment find in the tweets.
    [Show full text]
  • An Introduction to Python (PDF)
    Introduction to Python Heavily based on presentations by Matt Huenerfauth (Penn State) Guido van Rossum (Google) Richard P. Muller (Caltech) ... Monday, October 19, 2009 Python • Open source general-purpose language. • Object Oriented, Procedural, Functional • Easy to interface with C/ObjC/Java/Fortran • Easy-ish to interface with C++ (via SWIG) • Great interactive environment • Downloads: http://www.python.org • Documentation: http://www.python.org/doc/ • Free book: http://www.diveintopython.org Monday, October 19, 2009 2.5.x / 2.6.x / 3.x ??? • “Current” version is 2.6.x • “Mainstream” version is 2.5.x • The new kid on the block is 3.x You probably want 2.5.x unless you are starting from scratch. Then maybe 3.x Monday, October 19, 2009 Technical Issues Installing & Running Python Monday, October 19, 2009 Binaries • Python comes pre-installed with Mac OS X and Linux. • Windows binaries from http://python.org/ • You might not have to do anything! Monday, October 19, 2009 The Python Interpreter • Interactive interface to Python % python Python 2.5 (r25:51908, May 25 2007, 16:14:04) [GCC 4.1.2 20061115 (prerelease) (SUSE Linux)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> • Python interpreter evaluates inputs: >>> 3*(7+2) 27 • Python prompts with ‘>>>’. • To exit Python: • CTRL-D Monday, October 19, 2009 Running Programs on UNIX % python filename.py You could make the *.py file executable and add the following #!/usr/bin/env python to the top to make it runnable. Monday, October 19, 2009 Batteries Included • Large collection of proven modules included in the standard distribution.
    [Show full text]
  • An Introduction to Python Release 2.2.2
    An Introduction to Python Release 2.2.2 Guido van Rossum Fred L. Drake, Jr., editor PythonLabs Email: [email protected] A catalogue record for this book is available from the British Library. First printing, April 2003 (14/4/2003). Published by Network Theory Limited. 15 Royal Park Clifton Bristol BS8 3AL United Kingdom Email: [email protected] ISBN 0-9541617-6-9 Further information about this book is available from http://www.network-theory.co.uk/python/manual/ Additional section authors: Using Lists as Stacks by Ka-Ping Yee Floating Point Arithmetic — Issues and Limitations by Tim Peters Unicode Strings by Marc-Andre Lemburg Summary of changes made for this edition by Network Theory Ltd: Minor editing of text and examples for formatting as a book. Added Publisher’s preface. Moved Abstract to Introduction. Additional entries and modifications to index. Some paragraphs, sentences and footnotes removed/edited for con- ciseness. A complete set of differences can be found at http://www.network- theory.co.uk/python/manual/src/ Copyright c 2001Python Software Foundation. All rights reserved. Copyright c 2000 BeOpen.com. All rights reserved. Copyright c 1995-2000 Corporation for National Research Initiatives. All rights reserved. Copyright c 1991-1995 Stichting Mathematisch Centrum. All rights re- served. See the end of this document for complete license and permissions infor- mation. Contents Publisher’s Preface 1 Introduction 3 1 Whetting Your Appetite 5 1.1 WhereFromHere...................... 6 2 Using the Python Interpreter 7 2.1InvokingtheInterpreter................... 7 2.2 TheInterpreterandItsEnvironment........... 9 3 An Informal Introduction to Python 11 3.1Using Python as a Calculator ...............
    [Show full text]
  • Python Is Eating the World: How One Developer’S Side Project Became the Hottest Programming Language on the Planet
    Python is eating the world: How one developer’s side project became the hottest programming language on the planet By Nick Heath Image: Dan Stroud under the Creative Commons licence Guido van Rossum at Dropbox headquarters in 2014. Frustrated by programming language shortcomings, Guido van Rossum created Python. With the language now used by millions, Nick Heath talks to van Rossum about Python’s past and explores what’s next. In late 1994, a select group of programmers from across the US met to discuss their new secret weapon. Barry Warsaw was one of the 20 or so developers present at that first-ever workshop for the newly- created Python programming language and recalls the palpable excitement among those early users. “I can remember one person in particular who said, ‘You cannot tell anybody that I’m here because our use of Python is a competitive advantage.’ It was their secret weapon, right?” Even at that early meeting, at the then US National Standards Bureau in Maryland, Warsaw says it was evident that Python offered something new in how easy it was to write code and simply get things done. “When I first was introduced to Python, I knew there was something special. It was some combination of readability, and there was a joy to writing Python code,” he remembers. Today enthusiasm for Python has spread far beyond that initial circle of developers, and some are predicting it will soon become the most popular programming language in the world, as it continues to add new users faster than any other language.
    [Show full text]
  • (Pdf) of the School of Squiggol: a History of the Bird−Meertens
    The School of Squiggol A History of the Bird{Meertens Formalism Jeremy Gibbons University of Oxford Abstract. The Bird{Meertens Formalism, colloquially known as \Squig- gol", is a calculus for program transformation by equational reasoning in a function style, developed by Richard Bird and Lambert Meertens and other members of IFIP Working Group 2.1 for about two decades from the mid 1970s. One particular characteristic of the development of the Formalism is fluctuating emphasis on novel `squiggly' notation: sometimes favouring notational exploration in the quest for conciseness and precision, and sometimes reverting to simpler and more rigid nota- tional conventions in the interests of accessibility. This paper explores that historical ebb and flow. 1 Introduction In 1962, IFIP formed Working Group 2.1 to design a successor to the seminal algorithmic language Algol 60 [4]. WG2.1 eventually produced the specification for Algol 68 [63, 64]|a sophisticated language, presented using an elaborate two- level description notation, which received a mixed reception. WG2.1 continues to this day; technically, it retains responsibility for the Algol languages, but practi- cally it takes on a broader remit under the current name Algorithmic Languages and Calculi. Over the years, the Group has been through periods of focus and periods of diversity. But after the Algol 68 project, the period of sharpest focus covered the two decades from the mid 1970s to the early 1990s, when what later became known as the Bird{Meertens Formalism (BMF) drew the whole group together again. It is the story of those years that is the subject of this paper.
    [Show full text]
  • Introduction to Computational & Quantitative Biology (G4120)
    ICQB Introduction to Computational & Quantitative Biology (G4120) Fall 2019 Oliver Jovanovic, Ph.D. Columbia University Department of Microbiology & Immunology Lecture 5: Introduction to Programming October 15, 2019 History of Programming 1831 Lady Ada Lovelace writes the first computer program for Charles Babbage’s Analytical Engine. 1936 Alan Turing develops the theoretical concept of the Turing Machine, forming the basis of modern computer programming. 1943 Plankalkül, the first formal computer language, is developed by Konrad Zuse, a German engineer, which he later applies to, among other things, chess. 1945 John von Neumann develops the theoretical concepts of shared program technique and conditional control transfer. 1949 Short Code, the first computer language actually used on an electronic computer, appears. 1951 A-O, the first widely used complier, is designed by Grace Hopper at Remington Rand. 1954 FORTRAN (FORmula TRANslating system) language is developed by John Backus at IBM for scientific computing. 1958 ALGOL, the first programming language with a formal grammar, is developed by John Backus for scientific applications 1958 LISP (LISt Processing) language is created by John McCarthy of MIT for Artificial Intelligence (AI) research. 1959 COBOL is created by the Conference on Data Systems and Languages (CODASYL) for business programming, and becomes widely used with the support of Admiral Grace Hopper. 1964 BASIC (Beginner’s All-purpose Symbolic Instruction Code) is created by John Kemeny and Thomas Kurtz as an introductory programming
    [Show full text]
  • “It All Started with ABC, a Wonderful Teaching Language That I Had Helped Create in the Early Eighties
    ABC language the mother of Python “It all started with ABC, a wonderful teaching language that I had helped create in the early eighties. It was an incredibly elegant and powerful language, aimed at non-professional programmers.” Guido van Rossum, ABC team member and creator of Python1 ABC 1.05 Python 3.2 SIEVE TO procedure definition >>> HOW TO SIEVE TO n: >>> def sieve(n): HOW TO SIEVE TO n: ... numbers = set(range(2, n+1)) PUT {2..n} IN numbers ... while numbers: condition must be a test WHILE numbers <> {}: ... p = min(numbers) PUT min numbers IN p ... print(p, end=' ') WRITE p ... for m in range(1, int(n/p)+1): FOR m IN {1..floor(n/p)}: ... if m*p in numbers: IF m*p in numbers: ... numbers.remove(m*p) REMOVE m*p FROM numbers 21 years later, Python still has a lot of ABC in it ... >>> sieve(50) >>> SIEVE TO 50 2 3 5 7 11 13 17 19 23 29 31 37 41 43 47 2 3 5 7 11 13 17 19 23 29 31 37 41 43 47 1. Foreword for "Programming Python" (1st ed.) http://www.python.org/doc/essays/foreword/ Basic Types Numbers Text ▪ Numbers are either exact or inexact. ▪ Mutable ASCII strings of arbitrary length. ▪ Exact numbers are stored as ratios of ▪ First character position is @ 1. integers of arbitrary length. ▪ Slicing is done with operators @ and | (pipe), ▪ Basic arithmetic (+, -, *, /) with exact see examples below. numbers always produce exact results. ABC 1.05 ▪ Some functions, such as root, sin, log etc.
    [Show full text]
  • Thorn—Robust, Concurrent, Extensible Scripting on the JVM
    Thorn—Robust, Concurrent, Extensible Scripting on the JVM Bard Bloom1, John Field1, Nathaniel Nystrom2∗, Johan Ostlund¨ 3, Gregor Richards3, Rok Strnisaˇ 4, Jan Vitek3, Tobias Wrigstad5† 1 IBM Research 2 University of Texas at Arlington 3 Purdue University 4 University of Cambridge 5 Stockholm University Abstract 1. Introduction Scripting languages enjoy great popularity due to their sup- Scripting languages are lightweight, dynamic programming port for rapid and exploratory development. They typically languages designed to maximize short-term programmer have lightweight syntax, weak data privacy, dynamic typing, productivity by offering lightweight syntax, weak data en- powerful aggregate data types, and allow execution of the capsulation, dynamic typing, powerful aggregate data types, completed parts of incomplete programs. The price of these and the ability to execute the completed parts of incomplete features comes later in the software life cycle. Scripts are programs. Important modern scripting languages include hard to evolve and compose, and often slow. An additional Perl, Python, PHP, JavaScript, and Ruby, plus languages weakness of most scripting languages is lack of support for like Scheme that are not originally scripting languages but concurrency—though concurrency is required for scalability have been adapted for it. Many of these languages were orig- and interacting with remote services. This paper reports on inally developed for specialized domains (e.g., web servers the design and implementation of Thorn, a novel program- or clients), but are increasingly being used more broadly. ming language targeting the JVM. Our principal contribu- The rising popularity of scripting languages can be at- tions are a careful selection of features that support the evo- tributed to a number of key design choices.
    [Show full text]
  • Practical System Skills Fall 2019 Edition Leonhard Spiegelberg [email protected] Open Questions from Last Lecture
    CS6 Practical System Skills Fall 2019 edition Leonhard Spiegelberg [email protected] Open questions from last lecture 2 15.20 Checking out remote tags ⇒ clone the repo first via git clone, then you can list available tags via git tag -l ⇒ checkout a specific tag via git checkout tags/<tagname> Example: git clone https://github.com/ethereum/go-ethereum.git && cd go-ethereum && git checkout tags/v1.0.2 3 / 46 15.21 git checkout --ours / --theirs in rebase ⇒ To rebase on the master run git checkout feature && git rebase master ⇒ you can use git checkout --ours or git checkout --theirs → Note: Meaning of theirs/ours is flipped in rebase mode, i.e. --theirs is referring to the feature branch --ours is referring to the master branch → to continue the rebase if no changes are made to the commit, use git rebase --skip 4 / 59 16 Python CS6 Practical System Skills Fall 2019 Leonhard Spiegelberg [email protected] 16.01 What is python? ⇒ developed by Guido van Rossum in the early 1990s → named after Monty Python, has a snake as mascot ⇒ python is an interpreted language ⇒ dynamically typed, i.e. the type of a variable is determined during runtime ⇒ high-level language with many built-in features like lists, tuples, dictionaries (hashmaps), sets, ... 6 / 59 16.02 Who uses python? Web backend Data analysis + many more + many more Note: An interesting talk why Instagram choose Python https://www.youtube.com/watch?v=66XoCk79kjM 7 / 59 16.02 Python resources Official tutorial: https://docs.python.org/3.7/tutorial/index.html Other useful resources: https://www.codecademy.com/learn/learn-python-3 https://www.programiz.com/python-programming/tutorial + many more available online on Udemy, Coursera, ..
    [Show full text]