The Early History of F

Total Page:16

File Type:pdf, Size:1020Kb

The Early History of F The Early History of F# DON SYME, Microsoft, United Kingdom Shepherd: Philip Wadler, University of Edinburgh, UK This paper describes the genesis and early history of the F# programming language. I start with the origins of strongly-typed functional programming (FP) in the 1970s, 80s and 90s. During the same period, Microsoft was founded and grew to dominate the software industry. In 1997, as a response to Java, Microsoft initiated internal projects which eventually became the .NET programming framework and the C# language. From 1997 the worlds of academic functional programming and industry combined at Microsoft Research, Cambridge. The researchers engaged with the company through Project 7, the initial effort to bring multiple languages to .NET, leading to the initiation of .NET Generics in 1998 and F# in 2002. F# was one of several responses by advocates of strongly-typed functional programming to the “object-oriented tidal wave” of the mid-1990s. The 75 development of the core features of F# 1.0 happened from 2004-2007, and I describe the decision-making process that led to the “productization” of F# by Microsoft in 2007-10 and the release of F# 2.0. The origins of F#’s characteristic features are covered: object programming, quotations, statically resolved type parameters, active patterns, computation expressions, async, units-of-measure and type providers. I describe key developments in F# since 2010, including F# 3.0-4.5, and its evolution as an open source, cross-platform language with multiple delivery channels. I conclude by examining some uses of F# and the influence F# has had on other languages so far. CCS Concepts: • Software and its engineering ! General programming languages; • Social and pro- fessional topics ! History of programming languages. Additional Key Words and Phrases: Programming Languages, Functional Programming, Object-oriented Programming, Pattern Matching, Asynchronous Programming, Type Providers, Units of Measure, Dimensions, F# ACM Reference Format: Don Syme. 2020. The Early History of F#. Proc. ACM Program. Lang. 4, HOPL, Article 75 (June 2020), 58 pages. https://doi.org/10.1145/3386325 Author’s address: Don Syme, Microsoft, United Kingdom, [email protected]. Permission to make digital or hard copies of part or all of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for third-party components of this work must be honored. For all otheruses, contact the owner/author(s). © 2020 Copyright held by the owner/author(s). 2475-1421/2020/6-ART75 https://doi.org/10.1145/3386325 Proc. ACM Program. Lang., Vol. 4, No. HOPL, Article 75. Publication date: June 2020. 75:2 Don Syme Contents Abstract 1 Contents 2 1 Introduction3 2 What is F# in 2020?4 3 Background: Languages, Programmability at Microsoft and the Creation of .NET4 4 Background: Strongly Typed Functional Programming through the 1990s—Calculi, Miranda, OCaml, Haskell and Pizza7 5 Project 7 and .NET Generics 10 6 The Decision to Create F# 13 7 Early F#—2002–2003 18 8 Early F#—Release 20 9 F# 1.0, 2004–2006—Overview 22 9.1 F# 1.0—Pipelines 23 9.2 F# 1.0—Tackling Object Programming 24 9.3 F# 1.0—Improving the Functional Core: Initialization Graphs 26 9.4 F# 1.0—Improving the Functional Core: Overloaded Arithmetic 27 9.5 F# 1.0—Improving the Functional Core: Active Patterns 28 9.6 F# 1.0—Improving the Functional Core: First-Class Events 30 9.7 F# 1.0—Improving the Functional Core: async/await 30 9.8 F# 1.0—Improving the Functional Core: Computation Expressions 32 9.9 F# 1.0—Meta-programming 35 9.10 F# 1.0—Improving the Functional Core: Indentation-Aware Syntax 36 9.11 F# 1.0—IDE Tooling 36 10 Finance and Functional: Microsoft Commits to F#, 2007 37 11 F# 2.0—2007 to 2010 38 12 F# 2.0—Units of Measure 40 13 Type Providers and F# 3.0 41 14 .NET, F# and the Shift to Cloud and Mobile Computing 44 15 A New Dawn for F#, C# and .NET: Open and Cross-Platform, At Last! 45 16 The F# Compiler as a Component 46 17 The F# Community and the F# Software Foundation 46 18 .NET Core: Microsoft take C#, F# and .NET Cross-Platform 47 19 F# for Mobile 48 20 F#, JavaScript and Full Stack Programming 48 21 Retrospective 48 21.1 F#’s Influence 49 21.2 Mistakes and Questions 51 22 Conclusion 52 Acknowledgments 52 References 53 Proc. ACM Program. Lang., Vol. 4, No. HOPL, Article 75. Publication date: June 2020. The Early History of F# 75:3 1 INTRODUCTION The history of the F# programming language is an arc drawn from the 1970s to the present day. Somewhere, back in the early 1970s, an idea was born in the mind of Robin Milner and his colleagues Lockwood Morris and Malcolm Newey of a succinct, fully type-inferred functional programming language suitable for manipulating structured information [Gordon 2000]. Building on the tradition of LISP (and indeed using LISP as their implementation vehicle), this language became ML—Meta Language—and is the root of a tradition of “strongly typed functional programming languages” that includes Edinburgh ML, Miranda, Haskell, Standard ML, OCaml, Elm, ReasonML and PureScript. F# is part of this family. The history of Standard ML has been told elsewhere [MacQueen 2015]. ML-family languages are often associated with formalism, a theme I explore later in this article. However, a primary concern of Milner and co. from the outset was pragmatic usability. This group needed their language for a specific purpose: to succinctly and accurately program the proof rules and transformations (“tactics”) of a theorem proving system called LCF, at that time on PDP-10 machines. Pragmatic choices included the use of mutable state (to allow proof state to be stored in an interactive system) and a type inference system (later called Hindley-Milner or Damas-Milner type inference), allowing the code for derived tactics to be both succinct and automatically generalized. A similar theme of pragmatism ran through later ML dialects as well, including OCaml [Leroy 2014], witnessed by both the language design and tooling such as the OCaml C Foreign Function Interface (FFI). Rolling forward, to the present day, key ideas stemming from the 1970s are at the core of the F# language design and central to the day-to-day experience of using the language. Like all ML-family languages: • The core paradigm supported by F# is still strongly typed functional programming; • The core activity of F# is still defining types (type X) and functions (let f x = ...) and these declarations are type-inferred and generalized automatically; • F# still aims to support a mode of programming where the focus is on the domain being manipulated rather than on the details of programming itself. Today, books are published which extoll the virtues of F# for “Domain Driven Design” [Wlaschin 2018]. This is not so far removed from the early role of ML where the “domain” was the symbolic representation of terms and theorems of the LCF logic. The “spirit” of ML is very much alive in F#, as it was always intended to be. The leap from 1970s to the present day spans a period of massive change in the computing industry: we have shifted from PDP-10s to cloud systems, from punch cards to mobile phones, from edit-line to tooling-rich IDEs, from small to massive storage, from no-network to ubiquitous network. This article tells the story of how F# developed, the industry and academic contexts in which this occurred, the immediate influences on the language and its distinctive contributions. The story intersects with many other histories in programming language design, including the complex histories of functional programming, object-oriented programming, type systems, runtime design, operating systems and open source software, and emphasis is placed on the genesis of F# as one of several reactions to the “object-oriented tidal wave” of the early 1990s. The story is necessarily incomplete and told largely from the personal perspective of the author, the designer of the language, and I apologize for that. Where references are not provided the text is offered as source material based on the recollection of the author.1 I have started with the core idea of the ML-family of programming languages: type-safe, succinct, accurate, domain-oriented functional programming. From my perspective, this idea has “held 1Additional historical material on F# and the ML family of languages has been collected and presented by Rachel Blasucci, see [Blasucci 2016]. Proc. ACM Program. Lang., Vol. 4, No. HOPL, Article 75. Publication date: June 2020. 75:4 Don Syme strong, held true” throughout this era of change. Whether that is through obstinacy, coherence or coincidence is something I leave the reader to assess. 2 WHAT IS F# IN 2020? In 2020, F# is described on its documentation pages as “a functional programming language that runs on .NET.” The F# language guide [Carter 2020] calls out the following major features of the language, providing useful clarity about what the language is today: • functions and modules • pipelines and composition • lists, arrays, sequences • pattern matching • active patterns • type inference • recursive functions • quotations • record types, discriminated union types • option types • units of measure • object programming • asynchronous programming • computation expressions • type providers The documentation continues with an explanation of the main tooling and libraries available for F# programming, including • cross-platform compilation and execution; • the primary F# and .NET libraries; • web, mobile and data programming toolkits; • editing tools from Emacs to Visual Studio, VSCode and JetBrains Rider; • how to use F# with the cloud platform of the company providing the documentation.
Recommended publications
  • Lackwit: a Program Understanding Tool Based on Type Inference
    Lackwit: A Program Understanding Tool Based on Type Inference Robert O’Callahan Daniel Jackson School of Computer Science School of Computer Science Carnegie Mellon University Carnegie Mellon University 5000 Forbes Avenue 5000 Forbes Avenue Pittsburgh, PA 15213 USA Pittsburgh, PA 15213 USA +1 412 268 5728 +1 412 268 5143 [email protected] [email protected] same, there is an abstraction violation. Less obviously, the ABSTRACT value of a variable is never used if the program places no By determining, statically, where the structure of a constraints on its representation. Furthermore, program requires sets of variables to share a common communication induces representation constraints: a representation, we can identify abstract data types, detect necessary condition for a value defined at one site to be abstraction violations, find unused variables, functions, used at another is that the two values must have the same and fields of data structures, detect simple errors in representation1. operations on abstract datatypes, and locate sites of possible references to a value. We compute representation By extending the notion of representation we can encode sharing with type inference, using types to encode other kinds of useful information. We shall see, for representations. The method is efficient, fully automatic, example, how a refinement of the treatment of pointers and smoothly integrates pointer aliasing and higher-order allows reads and writes to be distinguished, and storage functions. We show how we used a prototype tool to leaks to be exposed. answer a user’s questions about a 17,000 line program We show how to generate and solve representation written in C.
    [Show full text]
  • Tortoisemerge a Diff/Merge Tool for Windows Version 1.11
    TortoiseMerge A diff/merge tool for Windows Version 1.11 Stefan Küng Lübbe Onken Simon Large TortoiseMerge: A diff/merge tool for Windows: Version 1.11 by Stefan Küng, Lübbe Onken, and Simon Large Publication date 2018/09/22 18:28:22 (r28377) Table of Contents Preface ........................................................................................................................................ vi 1. TortoiseMerge is free! ....................................................................................................... vi 2. Acknowledgments ............................................................................................................. vi 1. Introduction .............................................................................................................................. 1 1.1. Overview ....................................................................................................................... 1 1.2. TortoiseMerge's History .................................................................................................... 1 2. Basic Concepts .......................................................................................................................... 3 2.1. Viewing and Merging Differences ...................................................................................... 3 2.2. Editing Conflicts ............................................................................................................. 3 2.3. Applying Patches ...........................................................................................................
    [Show full text]
  • Ironpython in Action
    IronPytho IN ACTION Michael J. Foord Christian Muirhead FOREWORD BY JIM HUGUNIN MANNING IronPython in Action Download at Boykma.Com Licensed to Deborah Christiansen <[email protected]> Download at Boykma.Com Licensed to Deborah Christiansen <[email protected]> IronPython in Action MICHAEL J. FOORD CHRISTIAN MUIRHEAD MANNING Greenwich (74° w. long.) Download at Boykma.Com Licensed to Deborah Christiansen <[email protected]> For online information and ordering of this and other Manning books, please visit www.manning.com. The publisher offers discounts on this book when ordered in quantity. For more information, please contact Special Sales Department Manning Publications Co. Sound View Court 3B fax: (609) 877-8256 Greenwich, CT 06830 email: [email protected] ©2009 by Manning Publications Co. All rights reserved. No part of this publication may be reproduced, stored in a retrieval system, or transmitted, in any form or by means electronic, mechanical, photocopying, or otherwise, without prior written permission of the publisher. Many of the designations used by manufacturers and sellers to distinguish their products are claimed as trademarks. Where those designations appear in the book, and Manning Publications was aware of a trademark claim, the designations have been printed in initial caps or all caps. Recognizing the importance of preserving what has been written, it is Manning’s policy to have the books we publish printed on acid-free paper, and we exert our best efforts to that end. Recognizing also our responsibility to conserve the resources of our planet, Manning books are printed on paper that is at least 15% recycled and processed without the use of elemental chlorine.
    [Show full text]
  • Scala−−, a Type Inferred Language Project Report
    Scala−−, a type inferred language Project Report Da Liu [email protected] Contents 1 Background 2 2 Introduction 2 3 Type Inference 2 4 Language Prototype Features 3 5 Project Design 4 6 Implementation 4 6.1 Benchmarkingresults . 4 7 Discussion 9 7.1 About scalac ....................... 9 8 Lessons learned 10 9 Language Specifications 10 9.1 Introdution ......................... 10 9.2 Lexicalsyntax........................ 10 9.2.1 Identifiers ...................... 10 9.2.2 Keywords ...................... 10 9.2.3 Literals ....................... 11 9.2.4 Punctions ...................... 12 9.2.5 Commentsandwhitespace. 12 9.2.6 Operations ..................... 12 9.3 Syntax............................ 12 9.3.1 Programstructure . 12 9.3.2 Expressions ..................... 14 9.3.3 Statements ..................... 14 9.3.4 Blocksandcontrolflow . 14 9.4 Scopingrules ........................ 16 9.5 Standardlibraryandcollections. 16 9.5.1 println,mapandfilter . 16 9.5.2 Array ........................ 16 9.5.3 List ......................... 17 9.6 Codeexample........................ 17 9.6.1 HelloWorld..................... 17 9.6.2 QuickSort...................... 17 1 of 34 10 Reference 18 10.1Typeinference ....................... 18 10.2 Scalaprogramminglanguage . 18 10.3 Scala programming language development . 18 10.4 CompileScalatoLLVM . 18 10.5Benchmarking. .. .. .. .. .. .. .. .. .. .. 18 11 Source code listing 19 1 Background Scala is becoming drawing attentions in daily production among var- ious industries. Being as a general purpose programming language, it is influenced by many ancestors including, Erlang, Haskell, Java, Lisp, OCaml, Scheme, and Smalltalk. Scala has many attractive features, such as cross-platform taking advantage of JVM; as well as with higher level abstraction agnostic to the developer providing immutability with persistent data structures, pattern matching, type inference, higher or- der functions, lazy evaluation and many other functional programming features.
    [Show full text]
  • The Effect of Compression and Expansion on Stochastic Reaction Networks
    IMT School for Advanced Studies, Lucca Lucca, Italy The Effect of Compression and Expansion on Stochastic Reaction Networks PhD Program in Institutions, Markets and Technologies Curriculum in Computer Science and Systems Engineering (CSSE) XXXI Cycle By Tabea Waizmann 2021 The dissertation of Tabea Waizmann is approved. Program Coordinator: Prof. Rocco De Nicola, IMT Lucca Supervisor: Prof. Mirco Tribastone, IMT Lucca The dissertation of Tabea Waizmann has been reviewed by: Dr. Catia Trubiani, Gran Sasso Science Institute Prof. Michele Loreti, University of Camerino IMT School for Advanced Studies, Lucca 2021 To everyone who believed in me. Contents List of Figures ix List of Tables xi Acknowledgements xiii Vita and Publications xv Abstract xviii 1 Introduction 1 2 Background 6 2.1 Multisets . .6 2.2 Reaction Networks . .7 2.3 Ordinary Lumpability . 11 2.4 Layered Queuing Networks . 12 2.5 PEPA . 16 3 Coarse graining mass-action stochastic reaction networks by species equivalence 19 3.1 Species Equivalence . 20 3.1.1 Species equivalence as a generalization of Markov chain ordinary lumpability . 27 3.1.2 Characterization of SE for mass-action networks . 27 3.1.3 Computation of the maximal SE and reduced net- work . 28 vii 3.2 Applications . 31 3.2.1 Computational systems biology . 31 3.2.2 Epidemic processes in networks . 33 3.3 Discussion . 36 4 DiffLQN: Differential Equation Analysis of Layered Queuing Networks 37 4.1 DiffLQN .............................. 38 4.1.1 Architecture . 38 4.1.2 Capabilities . 38 4.1.3 Syntax . 39 4.2 Case Study: Client-Server dynamics . 41 4.3 Discussion .
    [Show full text]
  • IJIRT | Volume 2 Issue 6 | ISSN: 2349-6002
    © November 2015 | IJIRT | Volume 2 Issue 6 | ISSN: 2349-6002 .Net Surbhi Bhardwaj Dronacharya College of Engineering Khentawas, Haryana INTRODUCTION as smartphones. Additionally, .NET Micro .NET Framework (pronounced dot net) is Framework is targeted at severely resource- a software framework developed by Microsoft that constrained devices. runs primarily on Microsoft Windows. It includes a large class library known as Framework Class Library (FCL) and provides language WHAT IS THE .NET FRAMEWORK? interoperability(each language can use code written The .NET Framework is a new and revolutionary in other languages) across several programming platform created by Microsoft for languages. Programs written for .NET Framework developingapplications. execute in a software environment (as contrasted to hardware environment), known as Common It is a platform for application developers. Language Runtime (CLR), an application virtual It is a Framework that supports Multiple machine that provides services such as Language and Cross language integration. security, memory management, and exception handling. FCL and CLR together constitute .NET IT has IDE (Integrated Development Framework. Environment). FCL provides user interface, data access, database Framework is a set of utilities or can say connectivity, cryptography, web building blocks of your application system. application development, numeric algorithms, .NET Framework provides GUI in a GUI and network communications. Programmers manner. produce software by combining their own source code with .NET Framework and other libraries. .NET is a platform independent but with .NET Framework is intended to be used by most new help of Mono Compilation System (MCS). applications created for the Windows platform. MCS is a middle level interface. Microsoft also produces an integrated development .NET Framework provides interoperability environment largely for .NET software called Visual between languages i.e.
    [Show full text]
  • Epmp Command Line Interface User Guide
    USER GUIDE ePMP Command Line Interface ePMP Command Line Interface User Manual Table of Contents 1 Introduction ...................................................................................................................................... 3 1.1 Purpose ................................................................................................................................ 3 1.2 Command Line Access ........................................................................................................ 3 1.3 Command usage syntax ...................................................................................................... 3 1.4 Basic information ................................................................................................................. 3 1.4.1 Context sensitive help .......................................................................................................... 3 1.4.2 Auto-completion ................................................................................................................... 3 1.4.3 Movement keys .................................................................................................................... 3 1.4.4 Deletion keys ....................................................................................................................... 4 1.4.5 Escape sequences .............................................................................................................. 4 2 Command Line Interface Overview ..............................................................................................
    [Show full text]
  • Powerview Command Reference
    PowerView Command Reference TRACE32 Online Help TRACE32 Directory TRACE32 Index TRACE32 Documents ...................................................................................................................... PowerView User Interface ............................................................................................................ PowerView Command Reference .............................................................................................1 History ...................................................................................................................................... 12 ABORT ...................................................................................................................................... 13 ABORT Abort driver program 13 AREA ........................................................................................................................................ 14 AREA Message windows 14 AREA.CLEAR Clear area 15 AREA.CLOSE Close output file 15 AREA.Create Create or modify message area 16 AREA.Delete Delete message area 17 AREA.List Display a detailed list off all message areas 18 AREA.OPEN Open output file 20 AREA.PIPE Redirect area to stdout 21 AREA.RESet Reset areas 21 AREA.SAVE Save AREA window contents to file 21 AREA.Select Select area 22 AREA.STDERR Redirect area to stderr 23 AREA.STDOUT Redirect area to stdout 23 AREA.view Display message area in AREA window 24 AutoSTOre ..............................................................................................................................
    [Show full text]
  • Type Checking Physical Frames of Reference for Robotic Systems
    PhysFrame: Type Checking Physical Frames of Reference for Robotic Systems Sayali Kate Michael Chinn Hongjun Choi Purdue University University of Virginia Purdue University USA USA USA [email protected] [email protected] [email protected] Xiangyu Zhang Sebastian Elbaum Purdue University University of Virginia USA USA [email protected] [email protected] ABSTRACT Engineering (ESEC/FSE ’21), August 23–27, 2021, Athens, Greece. ACM, New A robotic system continuously measures its own motions and the ex- York, NY, USA, 16 pages. https://doi.org/10.1145/3468264.3468608 ternal world during operation. Such measurements are with respect to some frame of reference, i.e., a coordinate system. A nontrivial 1 INTRODUCTION robotic system has a large number of different frames and data Robotic systems have rapidly growing applications in our daily life, have to be translated back-and-forth from a frame to another. The enabled by the advances in many areas such as AI. Engineering onus is on the developers to get such translation right. However, such systems becomes increasingly important. Due to the unique this is very challenging and error-prone, evidenced by the large characteristics of such systems, e.g., the need of modeling the phys- number of questions and issues related to frame uses on developers’ ical world and satisfying the real time and resource constraints, forum. Since any state variable can be associated with some frame, robotic system engineering poses new challenges to developers. reference frames can be naturally modeled as variable types. We One of the prominent challenges is to properly use physical frames hence develop a novel type system that can automatically infer of reference.
    [Show full text]
  • Salesforce CLI Plug-In Developer Guide
    Salesforce CLI Plug-In Developer Guide Salesforce, Winter ’22 @salesforcedocs Last updated: July 21, 2021 © Copyright 2000–2021 salesforce.com, inc. All rights reserved. Salesforce is a registered trademark of salesforce.com, inc., as are other names and marks. Other marks appearing herein may be trademarks of their respective owners. CONTENTS Salesforce CLI Plug-In Developer Guide . 1 Salesforce CLI Plug-Ins . 1 Salesforce CLI Architecture . 3 Get Started with Salesforce CLI Plug-In Generation . 5 Naming and Messages for Salesforce CLI Plug-Ins . 7 Customize Your Salesforce CLI Plug-In . 13 Test Your Salesforce CLI Plug-In . 32 Debug Your Salesforce CLI Plug-In . 33 Best Practices for Salesforce CLI Plug-In Development . 33 Resources for Salesforce CLI Plug-In Development . 35 SALESFORCE CLI PLUG-IN DEVELOPER GUIDE Discover how to develop your own plug-ins for Salesforce CLI. Explore the Salesforce CLI architecture. Learn how to generate a plug-in using Salesforce Plug-In Generator, use Salesforce’s libraries to add functionality to your plug-in, and debug issues. Learn about our suggested style guidelines for naming and messages and our recommended best practices for plug-ins. Salesforce CLI Plug-Ins A plug-in adds functionality to Salesforce CLI. Some plug-ins are provided by Salesforce and are installed by default when you install the CLI. Some plug-ins, built by Salesforce and others, you install. When you have a requirement that an existing plug-in doesn’t meet, you can build your own using Node.js. Salesforce CLI Architecture Before you get started with adding functionality to Salesforce CLI, let’s take a high-level look at how the CLI and its dependencies and plug-ins work together.
    [Show full text]
  • Dynamic Extension of Typed Functional Languages
    Dynamic Extension of Typed Functional Languages Don Stewart PhD Dissertation School of Computer Science and Engineering University of New South Wales 2010 Supervisor: Assoc. Prof. Manuel M. T. Chakravarty Co-supervisor: Dr. Gabriele Keller Abstract We present a solution to the problem of dynamic extension in statically typed functional languages with type erasure. The presented solution re- tains the benefits of static checking, including type safety, aggressive op- timizations, and native code compilation of components, while allowing extensibility of programs at runtime. Our approach is based on a framework for dynamic extension in a stat- ically typed setting, combining dynamic linking, runtime type checking, first class modules and code hot swapping. We show that this framework is sufficient to allow a broad class of dynamic extension capabilities in any statically typed functional language with type erasure semantics. Uniquely, we employ the full compile-time type system to perform run- time type checking of dynamic components, and emphasize the use of na- tive code extension to ensure that the performance benefits of static typing are retained in a dynamic environment. We also develop the concept of fully dynamic software architectures, where the static core is minimal and all code is hot swappable. Benefits of the approach include hot swappable code and sophisticated application extension via embedded domain specific languages. We instantiate the concepts of the framework via a full implementation in the Haskell programming language: providing rich mechanisms for dy- namic linking, loading, hot swapping, and runtime type checking in Haskell for the first time. We demonstrate the feasibility of this architecture through a number of novel applications: an extensible text editor; a plugin-based network chat bot; a simulator for polymer chemistry; and xmonad, an ex- tensible window manager.
    [Show full text]
  • Q# Introduction
    Introduction to Q# Q# (Q-sharp) is a domain-specific and open-sourced programming language, part of Microsoft's Quantum Development Kit (QDK), used for expressing quantum algorithms. It is to be used for writing subroutines that execute on an adjunct quantum processing unit (QPU), under the control of a classical host program and computer. Q# can be installed on Windows 10, OSX and Linux. The instructions to install Q# can be found in the online documentation here. If you prefer not to install Q# on your local computer, you can use one of the machines in CSE’s Virtual Lab found here. The Windows 10 machines already have .Net Core SDK, Visual Studio and VS Code installed to get your started, you should still install the Q# extension to get syntax- highlighting, code complete, etc. To get help with Q# and the QDK, feel free to ask questions on our messages board, come to office hours as posted on the calendar, or ask in stackoverflow. The Q# team is constantly monitoring any questions posted there with the "q#" tag. Writing Q# programs. Operations and functions are the basic unit of execution in Q#. They are roughly equivalent to a function in C or C++ or Python, or a static method in C# or Java. A Q# operation is a quantum subroutine. That is, it is a callable routine that contains quantum operations. A Q# function is a classical subroutine used within a quantum algorithm. It may contain classical code but no quantum operations. Specifically, functions may not allocate or borrow qubits, nor may they call operations.
    [Show full text]