This document provides an overview of the history of programming languages and object-oriented development. It discusses some of the limitations of the object-oriented paradigm, such as complexity, brittle hierarchies, and difficulties modeling real-world objects. The document then introduces Clojure as a functional programming language that avoids these issues by using immutable data and focusing on equality rather than object identity. It provides examples of Clojure's features like persistent collections, and discusses how Clojure code is evaluated through its reader and evaluator.
This document provides an introduction and history of functional programming, including key concepts like pure functions, immutable data, and avoiding side effects. It discusses early functional languages like Lisp, Scheme, ML, and Haskell, as well as more modern languages like Erlang, Scala, and Clojure. The document recommends learning functional programming by doing exercises to relearn programming concepts from a functional perspective, and covers specific Scala features like tail call optimization, map/reduce/filter, currying, pattern matching, and advanced typeclasses.
This document provides a brief history of functional programming, beginning with the lambda calculus developed by Alonzo Church in 1936. It discusses the development of Lisp by John McCarthy in 1958, which pioneered many functional concepts. Peter Landin then developed the ISWIM language in 1966, which influenced ML, SASL, and Miranda. John Backus' 1977 paper promoted functional programming research. Concurrently, ML was developed, introducing strong static typing and type inference. David Turner then created SASL, KRC and Miranda between 1972-1985. Erlang was developed in 1986 for distributed systems. Haskell was developed in 1990, drawing from Miranda with purity, laziness and strong typing. Many other languages now support functional paradig
Zaratan is a project management tool written in Go that allows users to easily manage and orchestrate Docker projects without extensive technical skills. It acts as a wrapper for the docker-compose library and lets users create and use custom templates to set up new projects quickly in a local environment. The tool was created by a student as a learning project and continues to be improved with features like a GUI, template registry, and integrated DNS management.
A Static Type Analyzer of Untyped Ruby Code for Ruby 3mametter
- Matz's plan for Ruby 3 includes Ruby Signature (RBS), Type inference for non-annotated code (Type Profiler), and type checking for annotated code.
- RBS is the standard language for describing Ruby program types and will ship with Ruby 3. Type Profiler infers types for non-annotated Ruby code by running code in a "type-level".
- A demonstration of Type Profiler showed it generating prototypes of signatures for the ao.rb and optcarrot codebases in under a minute, though improvements are still needed to handle more language features.
This document discusses Perl 5 meta programming and provides examples of how to implement meta programming in Perl 5. It describes techniques like string eval, modifying the symbol table and typeglobs, using AUTOLOAD, Package::Stash, B:: modules, Class::Inspector, Class::Method::Modifiers, and Moo to get and set information about classes and define/modify methods and packages at runtime. It emphasizes writing tests and solving problems with existing modules when possible.
Type Profiler: An Analysis to guess type signaturesmametter
This document discusses type profiling, which is a technique for extracting type information from Ruby code without requiring type annotations. It proposes three type profilers:
1. Static Analysis 1 (SA1) guesses type signatures for method parameters based on which methods are called on those parameters.
2. Static Analysis 2 (SA2) focuses on guessing types for built-in classes.
3. Dynamic Analysis (DA) enhances the existing RubyTypeInference tool by running test suites and monitoring method calls and returns to aggregate type information.
The document evaluates SA1 on a sample WEBrick codebase and finds some common failures in the guessed types. Overall, type profiling aims to extract type information automatically as an alternative
Lock-free algorithms for Kotlin CoroutinesRoman Elizarov
The document discusses lock-free algorithms for Kotlin coroutines. It covers the implementation of a lock-free doubly linked list using single-word compare-and-swap operations. It also discusses how to build more complex atomic operations, like a multi-word compare-and-swap, to enable select expressions in Kotlin coroutines.
Comparing Golang and understanding Java Value TypesPéter Verhás
This document summarizes a presentation comparing Go and Java value types. It discusses key differences between Go and Java, such as Go not having exceptions or inheritance. Go uses structs instead of objects and has no object headers. The presentation explains value types coming to Java to help performance by allocating types like Date on the stack instead of the heap. While Java is good, value types will make it better and learning Go can help programmers write better Java code.
This document provides an introduction and history of functional programming, including key concepts like pure functions, immutable data, and avoiding side effects. It discusses early functional languages like Lisp, Scheme, ML, and Haskell, as well as more modern languages like Erlang, Scala, and Clojure. The document recommends learning functional programming by doing exercises to relearn programming concepts from a functional perspective, and covers specific Scala features like tail call optimization, map/reduce/filter, currying, pattern matching, and advanced typeclasses.
This document provides a brief history of functional programming, beginning with the lambda calculus developed by Alonzo Church in 1936. It discusses the development of Lisp by John McCarthy in 1958, which pioneered many functional concepts. Peter Landin then developed the ISWIM language in 1966, which influenced ML, SASL, and Miranda. John Backus' 1977 paper promoted functional programming research. Concurrently, ML was developed, introducing strong static typing and type inference. David Turner then created SASL, KRC and Miranda between 1972-1985. Erlang was developed in 1986 for distributed systems. Haskell was developed in 1990, drawing from Miranda with purity, laziness and strong typing. Many other languages now support functional paradig
Zaratan is a project management tool written in Go that allows users to easily manage and orchestrate Docker projects without extensive technical skills. It acts as a wrapper for the docker-compose library and lets users create and use custom templates to set up new projects quickly in a local environment. The tool was created by a student as a learning project and continues to be improved with features like a GUI, template registry, and integrated DNS management.
A Static Type Analyzer of Untyped Ruby Code for Ruby 3mametter
- Matz's plan for Ruby 3 includes Ruby Signature (RBS), Type inference for non-annotated code (Type Profiler), and type checking for annotated code.
- RBS is the standard language for describing Ruby program types and will ship with Ruby 3. Type Profiler infers types for non-annotated Ruby code by running code in a "type-level".
- A demonstration of Type Profiler showed it generating prototypes of signatures for the ao.rb and optcarrot codebases in under a minute, though improvements are still needed to handle more language features.
This document discusses Perl 5 meta programming and provides examples of how to implement meta programming in Perl 5. It describes techniques like string eval, modifying the symbol table and typeglobs, using AUTOLOAD, Package::Stash, B:: modules, Class::Inspector, Class::Method::Modifiers, and Moo to get and set information about classes and define/modify methods and packages at runtime. It emphasizes writing tests and solving problems with existing modules when possible.
Type Profiler: An Analysis to guess type signaturesmametter
This document discusses type profiling, which is a technique for extracting type information from Ruby code without requiring type annotations. It proposes three type profilers:
1. Static Analysis 1 (SA1) guesses type signatures for method parameters based on which methods are called on those parameters.
2. Static Analysis 2 (SA2) focuses on guessing types for built-in classes.
3. Dynamic Analysis (DA) enhances the existing RubyTypeInference tool by running test suites and monitoring method calls and returns to aggregate type information.
The document evaluates SA1 on a sample WEBrick codebase and finds some common failures in the guessed types. Overall, type profiling aims to extract type information automatically as an alternative
Lock-free algorithms for Kotlin CoroutinesRoman Elizarov
The document discusses lock-free algorithms for Kotlin coroutines. It covers the implementation of a lock-free doubly linked list using single-word compare-and-swap operations. It also discusses how to build more complex atomic operations, like a multi-word compare-and-swap, to enable select expressions in Kotlin coroutines.
Comparing Golang and understanding Java Value TypesPéter Verhás
This document summarizes a presentation comparing Go and Java value types. It discusses key differences between Go and Java, such as Go not having exceptions or inheritance. Go uses structs instead of objects and has no object headers. The presentation explains value types coming to Java to help performance by allocating types like Date on the stack instead of the heap. While Java is good, value types will make it better and learning Go can help programmers write better Java code.
Kirill Shabordin, CTO, Social Quantum
Is Lua a panacea or a dead end? Is OOP necessary for gamedev? How many Lua scripters does it take to change a light bulb?
Python is a readable, dynamic, flexible and powerful programming language. It is multi-purpose, object-oriented, interpreted and strongly/dynamically typed with a focus on readability and productivity. Python is used by many organizations like Google, PBS and NASA. It was created in 1989 and the latest version is Python 2.7. Python uses indentation for code blocks rather than brackets.
Elixir and Crystal are both descendants of the Ruby programming language, applying Ruby syntax and ideas to extremely different functional and OOP foundations. This talk compares all three languages and suggests appropriate cases for applying them.
The document discusses regular expressions (regex), listing some of their key traits like being declarative and domain-specific languages without whitespace or delimiters. It then lists different concepts involved with regex like quantifiers, backtracking, lazy quantifiers, character classes, captures, anchors, and more. It also mentions an upcoming regex training course being held in Stockholm on March 5th.
This document discusses the jpmobile Ruby gem, which provides mobile device detection and formatting filters for Rails applications. It works as a Rack middleware and allows detection of mobile devices and formatting responses appropriately. The document outlines support for Rails 3.0+, use of request.mobile to detect devices, and formatting responses with Shift_JIS encoding. It also mentions the jpmobilathon conference in 2010 and details for contacting the project or getting involved.
This document provides an introduction and overview of Ruby and the Rails web framework. It outlines what Ruby and Rails are, why they are useful, and some of their major features. The document demonstrates Ruby concepts like objects, classes, and blocks through interactive examples. It also provides a brief demo of generating a TODO list application in Rails. Finally, it recommends resources for learning more about Ruby and Rails.
PyData Frankfurt - (Efficient) Data Exchange with "Foreign" EcosystemsUwe Korn
As a Data Scientist/Engineer in Python, we focus in our work to solve problems with large amounts of data but still stay in Python. This is where we are the most effective and feel comfortable. Libraries like Pandas and NumPy provide us with efficient interfaces to deal with this data while still getting optimal performance. The main problem appears when we have to deal with systems outside of our comfort ecosystem. We need to write cumbersome and mostly slow conversion code that ingests data from there into our pipeline until we can work efficiently. Using Apache Arrow and Parquet as base technologies, we get a set of tools that eases this interaction and also brings us a huge performance improvement. As part of the talk we will show a basic problem where we take data coming from a Java application through Python into using these tools.
This document covers various object-oriented programming concepts in C++ including constructors, destructors, copy constructors, interfaces, abstract classes, inheritance, namespaces, shallow copying, deep copying, static variables, functions and more. It provides examples and explanations of these concepts and asks questions to test understanding.
This document discusses why the author loves Ruby over other programming languages like Java. It provides a brief history of Ruby, describing it as an interpreted, object-oriented scripting language created in 1995. It highlights several reasons for preferring Ruby, such as its simplicity, dynamic typing, support for duck typing, reflection capabilities, ability to monkey patch, emphasis on testing, use of domain-specific languages, large library ecosystem, and focus on giving programmers freedom. The author encourages learning Ruby through tools like IRB, Try Ruby, and Ruby Learning.
Type Profiler: Ambitious Type Inference for Ruby 3mametter
Type Profiler is a tool that performs type inference for Ruby code without requiring any type annotations. It analyzes Ruby code and generates type signatures in the RBS format. The goals of Type Profiler are to enable better tooling support for Ruby like autocompletion, catch bugs earlier, and provide type-guided development experiences. It uses inter-procedural analysis to infer types based on method usages rather than just analyzing methods in isolation. Type Profiler was demonstrated on simple, real-world, and library code examples, generating RBS that was mostly accurate while also highlighting current limitations. Future plans include improving support for more Ruby features and frameworks to enable analyzing plain Ruby code and applications.
This document discusses key concepts in computer science including object orientation, data structures, recursion, and algorithms. It covers topics like inheritance, encapsulation, polymorphism, queues, stacks, trees, graphs, Big O notation, and functional programming. Examples are provided in languages like C#, Python, Ruby, Scala, and F#. The document also discusses future trends like cloud computing utilities and implicit vs explicit programming.
We introduce Haskell. Why is it interesting. Where did it come from. What is it like. How to get started.
We show a GHCi session. We introduce simple recursive function and data. And we demo QuickCheck for testing properties of automatically generated data.
What can Ruby learn from Python (and vice versa)?Reuven Lerner
Ruby and Python are similar programming languages in many ways. But each has made different design decisions that affect how programmers in these languages think and work. In this talk, I contrast Ruby and Python, and some of the ways in which the languages differ.
This document introduces Ruby and Rails. It provides an overview of what Ruby and Rails are, why they are useful, and some of their major features. Key aspects covered include Ruby being an object-oriented scripting language, Rails making database-driven web app development easy, and demonstrations of building a TODO list app in Rails. The document recommends resources for learning more about Ruby and Rails.
De-mystifying contributing to PostgreSQLLætitia Avrot
Lætitia Avrot gives a presentation on demystifying contributions to PostgreSQL. She discusses the PostgreSQL community and projects, how to get involved through tasks like reporting bugs, creating documentation, or submitting code patches. She then shares her personal experience of submitting her first patch to fix a missing section in the ALTER TABLE documentation. She encourages others to contribute however they can, from answering user questions to organizing local user groups, and stresses that anyone can help improve PostgreSQL.
Polyglot and Functional Programming (OSCON 2012)Martijn Verburg
The document discusses introducing polyglot and functional programming concepts to Java developers. It explains that while Java is a powerful language, other JVM languages can offer advantages like more rapid development, concise coding, and taking advantage of non-object oriented and dynamic approaches. It provides examples of using functional concepts like map and filter to more declaratively operate on collections of data in a Java program. The document suggests exposing developers to these concepts through libraries and by experimenting with other JVM languages.
Lexing and parsing involves breaking down input like code, markup languages, or configuration files into individual tokens and analyzing the syntax and structure according to formal grammars. Common techniques include using lexer generators to tokenize input and parser generators to construct parse trees and abstract syntax trees based on formal grammars. While regular expressions are sometimes useful, lexers and parsers are better suited for many formal language tasks and ensure well-formed syntax.
Reuven Lerner is a web developer and consultant who primarily works with Ruby on Rails and PostgreSQL. He teaches Rails courses and uses various tools like iTerm2, RVM, IRB gems, Emacs, Firefox plugins, Growl, and Pow in his development environment. Emacs is his editor of choice, which he has highly customized over the years using Lisp functions and key bindings.
The document discusses challenges in implementing the Ruby programming language on the Java Virtual Machine (JVM) using JRuby. It covers areas like parsing Ruby, implementing different interpreters and compilers, utilizing JVM tricks, ensuring compatibility with features like strings and fibers, and integrating native capabilities. The author also shares decisions they have made around these challenges and future work.
Oplægget blev holdt ved et seminar i InfinIT-interessegruppen Højniveausprog til Indlejrede Systemer den 2. oktober 2013. Læs mere om interessegruppen her: http://infinit.dk/dk/interessegrupper/hoejniveau_sprog_til_indlejrede_systemer/hoejniveau_sprog_til_indlejrede_systemer.htm
Kirill Shabordin, CTO, Social Quantum
Is Lua a panacea or a dead end? Is OOP necessary for gamedev? How many Lua scripters does it take to change a light bulb?
Python is a readable, dynamic, flexible and powerful programming language. It is multi-purpose, object-oriented, interpreted and strongly/dynamically typed with a focus on readability and productivity. Python is used by many organizations like Google, PBS and NASA. It was created in 1989 and the latest version is Python 2.7. Python uses indentation for code blocks rather than brackets.
Elixir and Crystal are both descendants of the Ruby programming language, applying Ruby syntax and ideas to extremely different functional and OOP foundations. This talk compares all three languages and suggests appropriate cases for applying them.
The document discusses regular expressions (regex), listing some of their key traits like being declarative and domain-specific languages without whitespace or delimiters. It then lists different concepts involved with regex like quantifiers, backtracking, lazy quantifiers, character classes, captures, anchors, and more. It also mentions an upcoming regex training course being held in Stockholm on March 5th.
This document discusses the jpmobile Ruby gem, which provides mobile device detection and formatting filters for Rails applications. It works as a Rack middleware and allows detection of mobile devices and formatting responses appropriately. The document outlines support for Rails 3.0+, use of request.mobile to detect devices, and formatting responses with Shift_JIS encoding. It also mentions the jpmobilathon conference in 2010 and details for contacting the project or getting involved.
This document provides an introduction and overview of Ruby and the Rails web framework. It outlines what Ruby and Rails are, why they are useful, and some of their major features. The document demonstrates Ruby concepts like objects, classes, and blocks through interactive examples. It also provides a brief demo of generating a TODO list application in Rails. Finally, it recommends resources for learning more about Ruby and Rails.
PyData Frankfurt - (Efficient) Data Exchange with "Foreign" EcosystemsUwe Korn
As a Data Scientist/Engineer in Python, we focus in our work to solve problems with large amounts of data but still stay in Python. This is where we are the most effective and feel comfortable. Libraries like Pandas and NumPy provide us with efficient interfaces to deal with this data while still getting optimal performance. The main problem appears when we have to deal with systems outside of our comfort ecosystem. We need to write cumbersome and mostly slow conversion code that ingests data from there into our pipeline until we can work efficiently. Using Apache Arrow and Parquet as base technologies, we get a set of tools that eases this interaction and also brings us a huge performance improvement. As part of the talk we will show a basic problem where we take data coming from a Java application through Python into using these tools.
This document covers various object-oriented programming concepts in C++ including constructors, destructors, copy constructors, interfaces, abstract classes, inheritance, namespaces, shallow copying, deep copying, static variables, functions and more. It provides examples and explanations of these concepts and asks questions to test understanding.
This document discusses why the author loves Ruby over other programming languages like Java. It provides a brief history of Ruby, describing it as an interpreted, object-oriented scripting language created in 1995. It highlights several reasons for preferring Ruby, such as its simplicity, dynamic typing, support for duck typing, reflection capabilities, ability to monkey patch, emphasis on testing, use of domain-specific languages, large library ecosystem, and focus on giving programmers freedom. The author encourages learning Ruby through tools like IRB, Try Ruby, and Ruby Learning.
Type Profiler: Ambitious Type Inference for Ruby 3mametter
Type Profiler is a tool that performs type inference for Ruby code without requiring any type annotations. It analyzes Ruby code and generates type signatures in the RBS format. The goals of Type Profiler are to enable better tooling support for Ruby like autocompletion, catch bugs earlier, and provide type-guided development experiences. It uses inter-procedural analysis to infer types based on method usages rather than just analyzing methods in isolation. Type Profiler was demonstrated on simple, real-world, and library code examples, generating RBS that was mostly accurate while also highlighting current limitations. Future plans include improving support for more Ruby features and frameworks to enable analyzing plain Ruby code and applications.
This document discusses key concepts in computer science including object orientation, data structures, recursion, and algorithms. It covers topics like inheritance, encapsulation, polymorphism, queues, stacks, trees, graphs, Big O notation, and functional programming. Examples are provided in languages like C#, Python, Ruby, Scala, and F#. The document also discusses future trends like cloud computing utilities and implicit vs explicit programming.
We introduce Haskell. Why is it interesting. Where did it come from. What is it like. How to get started.
We show a GHCi session. We introduce simple recursive function and data. And we demo QuickCheck for testing properties of automatically generated data.
What can Ruby learn from Python (and vice versa)?Reuven Lerner
Ruby and Python are similar programming languages in many ways. But each has made different design decisions that affect how programmers in these languages think and work. In this talk, I contrast Ruby and Python, and some of the ways in which the languages differ.
This document introduces Ruby and Rails. It provides an overview of what Ruby and Rails are, why they are useful, and some of their major features. Key aspects covered include Ruby being an object-oriented scripting language, Rails making database-driven web app development easy, and demonstrations of building a TODO list app in Rails. The document recommends resources for learning more about Ruby and Rails.
De-mystifying contributing to PostgreSQLLætitia Avrot
Lætitia Avrot gives a presentation on demystifying contributions to PostgreSQL. She discusses the PostgreSQL community and projects, how to get involved through tasks like reporting bugs, creating documentation, or submitting code patches. She then shares her personal experience of submitting her first patch to fix a missing section in the ALTER TABLE documentation. She encourages others to contribute however they can, from answering user questions to organizing local user groups, and stresses that anyone can help improve PostgreSQL.
Polyglot and Functional Programming (OSCON 2012)Martijn Verburg
The document discusses introducing polyglot and functional programming concepts to Java developers. It explains that while Java is a powerful language, other JVM languages can offer advantages like more rapid development, concise coding, and taking advantage of non-object oriented and dynamic approaches. It provides examples of using functional concepts like map and filter to more declaratively operate on collections of data in a Java program. The document suggests exposing developers to these concepts through libraries and by experimenting with other JVM languages.
Lexing and parsing involves breaking down input like code, markup languages, or configuration files into individual tokens and analyzing the syntax and structure according to formal grammars. Common techniques include using lexer generators to tokenize input and parser generators to construct parse trees and abstract syntax trees based on formal grammars. While regular expressions are sometimes useful, lexers and parsers are better suited for many formal language tasks and ensure well-formed syntax.
Reuven Lerner is a web developer and consultant who primarily works with Ruby on Rails and PostgreSQL. He teaches Rails courses and uses various tools like iTerm2, RVM, IRB gems, Emacs, Firefox plugins, Growl, and Pow in his development environment. Emacs is his editor of choice, which he has highly customized over the years using Lisp functions and key bindings.
The document discusses challenges in implementing the Ruby programming language on the Java Virtual Machine (JVM) using JRuby. It covers areas like parsing Ruby, implementing different interpreters and compilers, utilizing JVM tricks, ensuring compatibility with features like strings and fibers, and integrating native capabilities. The author also shares decisions they have made around these challenges and future work.
Oplægget blev holdt ved et seminar i InfinIT-interessegruppen Højniveausprog til Indlejrede Systemer den 2. oktober 2013. Læs mere om interessegruppen her: http://infinit.dk/dk/interessegrupper/hoejniveau_sprog_til_indlejrede_systemer/hoejniveau_sprog_til_indlejrede_systemer.htm
Rust is a systems programming language that focuses on safety, concurrency, and speed. It prevents errors like segfaults and guarantees thread safety. Cargo is Rust's package manager and build tool. A basic Rust project can be created with cargo new and contains Cargo.toml for metadata and src/main.rs for code. Rust uses many familiar concepts like variables, functions, conditionals, loops, and more, but also introduces ideas like ownership, borrowing, and error handling via Result to ensure memory safety.
Introduction to Kotlin Language and its application to Android platformEastBanc Tachnologies
Author: Oleg Godovykh, eastbanctech.com
Kotlin is a new programming language built by Jetbrains and is a new member of JVM family. As opposed to typical reason to introduce some new language, Kotlin main goal isn't to create new paradigm or fill a new niche, but to make routine tasks much easier and safer. Kotlin gains popularity across Android developer community, and in this presentation it is shown how Kotlin usage can dramatically simplify typical mobile app development.
This document summarizes a presentation about hunting for anglerfish in data lakes. It thanks several people for their contributions and introduces the topic of serializing data using Avro, which it describes as terrible. It also briefly discusses related technologies like HBase, Kafka, and Spark that are used for reading applications. The bulk of the document focuses on explaining the benefits of using recursion schemes for serializing nested and recursive data structures over alternatives like Avro. It acknowledges some limitations of the current approach and outlines next steps to address issues and add features.
Lisp was one of the earliest programming languages, developed in the 1950s. It was based on mathematical functions and widely adopted for artificial intelligence programming due to its support for symbolic computing, list processing, and recursion. Early Lisp lacked local variables, iterative control structures, and compilers. Over time, various Lisp dialects were developed that added these features. Common Lisp was later standardized to combine the best attributes of different Lisps. Lisp code and data both use S-expressions (lists) and all variables are pointers, making it easy to manipulate and generate code.
- Lisp was developed by John McCarthy in the late 1950s as a list processing language for artificial intelligence and symbolic computing applications. It used recursive functions and linked lists instead of loops and local variables.
- Early Lisp dialects were interpreted and lacked features like compilers, local variables, and static scoping. Over time, various dialects like Scheme and Common Lisp were developed to address these issues and standardize the language.
- Common Lisp combined the best features of dialects like MacLisp, Interlisp, and Scheme. It was later standardized by ANSI and added object-oriented capabilities through CLOS, making it a powerful and flexible language. However, its complexity limited widespread adoption outside of AI research.
Lisp was one of the earliest programming languages, developed in the 1950s. It was based on mathematical functions and list processing. Early Lisp had no local variables, loops, or compiler. It used dynamic scoping and was interpreted, making it easy to build large systems. Over time, various Lisp dialects were developed to address inefficiencies and usability issues. Common Lisp was later standardized to combine the best features while ensuring consistency, expressiveness, efficiency and portability. Common Lisp is very powerful but also complex, with many functions and capabilities. It remains useful for AI and other domains due to its flexibility and support for functional programming concepts like recursion.
Introduction to functional programming (In Arabic)Omar Abdelhafith
Functional programming is a declarative programming paradigm where programs are built around mathematical functions and immutable data transformation (1). Key aspects include using pure functions that always return the same output for the same input and avoid side effects, immutable data that does not change state, representing everything as expressions rather than statements, and treating functions as data that can be passed into other functions or returned from them (2). These characteristics allow functional programs to be deterministic, avoid bugs from mutable state, and more easily write parallel and distributed programs (3).
Presentation from March 18th, 2013 Triangle Java User Group on Taming Text. Presentation covers search, question answering, clustering, classification, named entity recognition, etc. See http://www.manning.com/ingersoll for more.
This document provides an overview of the speaker's experience with programming languages and introduction to functional programming concepts. It discusses that the speaker was initially taught imperative languages like BASIC and C++ in college but was also exposed to Lisp, an early functional language. Several core FP concepts pioneered by Lisp like recursion, higher-order functions, and homoiconicity are explained. The document advocates using some FP principles like immutability and map/filter/reduce in other languages to gain benefits while not needing to be a "pure" functional programmer.
This document discusses concurrency and parallelism in Ruby. It defines concurrency as performing two operations in tandem, while parallelism refers to performing two operations literally at the same time using multiple cores. The document examines traditional approaches to concurrency like threads and locks in Ruby and their limitations. It advocates for adopting models from other languages like actors and software transactional memory that can provide safer concurrency through message passing and transactions rather than shared mutable state and locks. The document reviews several Ruby libraries that implement actors and proposes areas for further improvement in Ruby's core support for concurrent programming.
Erlang is a functional programming language built for concurrency, distribution, and fault tolerance. It uses an immutable data structure and avoids loops with tail recursion. The OTP framework provides tools like supervision trees, behaviors, and hot code swapping. While Erlang syntax looks like Prolog, it can integrate with Ruby via bridges or messaging and runs on Heroku. The document recommends resources for learning Erlang and OTP and participating in the local Erlang meetup.
Tommi Reiman discusses optimizing Clojure performance and abstractions. He shares lessons learned from optimizing middleware performance and JSON serialization. Data-driven approaches can enable high performance while maintaining abstraction. Reitit is a new routing library that aims to have the fastest performance through techniques like compiled routing data. Middleware can also benefit from data-driven approaches without runtime penalties. Overall performance should be considered but not obsessively, as many apps do not require extreme optimization.
Messaging, interoperability and log aggregation - a new frameworkTomas Doran
In this talk, I will talk about why log files are horrible, logging log lines, and more structured performance metrics from large scale production applications as well as building reliable, scaleable and flexible large scale software systems in multiple languages.
Why (almost) all log formats are horrible will be explained, and why JSON is a good solution for logging will be discussed, along with a number of message queuing, middleware and network transport technologies, including STOMP, AMQP and ZeroMQ.
The Message::Passing framework will be introduced, along with the logstash.net project which the perl code is interoperable with. These are pluggable frameworks in ruby/java/jruby and perl with pre-written sets of inputs, filters and outputs for many many different systems, message formats and transports.
They were initially designed to be aggregators and filters of data for logging. However they are flexible enough to be used as part of your messaging middleware, or even as a replacement for centralised message queuing systems.
You can have your cake and eat it too - an architecture which is flexible, extensible, scaleable and distributed. Build discrete, loosely coupled components which just pass messages to each other easily.
Integrate and interoperate with your existing code and code bases easily, consume from or publish to any existing message queue, logging or performance metrics system you have installed.
Simple examples using common input and output classes will be demonstrated using the framework, as will easily adding your own custom filters. A number of common messaging middleware patterns will be shown to be trivial to implement.
Some higher level use-cases will also be explored, demonstrating log indexing in ElasticSearch and how to build a responsive platform API using webhooks.
Interoperability is also an important goal for messaging middleware. The logstash.net project will be highlighted and we'll discuss crossing the single language barrier, allowing us to have full integration between java, ruby and perl components, and to easily write bindings into libraries we want to reuse in any of those languages.
Understanding Typing. Understanding Ruby.Justin Lin
- What is typing?
- Pros and cons of type declarations.
- What does quacking like a dock mean?
- Static Typing vs Unit Testing.
- Making us better at Ruby.
你可以在以下鏈結找到中文說明:
http://www.codedata.com.tw/social-coding/understanding-typing-understanding-ruby/
Similar to Not Everything is an Object - Rocksolid Tour 2013 (20)
The document discusses setting up a Raspberry Pi from initial hardware setup to installing an operating system and connecting to it remotely. It goes through obtaining the necessary equipment like the Raspberry Pi board, SD card, and case. Steps shown include downloading BerryBoot to install an operating system on the SD card, selecting Raspbian as the OS, and obtaining the IP address. Putty and PuttyGen are used to connect remotely using an SSH key pair for secure access. Basic applications are then built on the Pi like a radio stream player to demonstrate its capabilities.
This document discusses the concept of "marginal gains" in software development. It describes how small improvements in many areas, such as the developer's skills, tools, and processes, can lead to significant overall gains in productivity and performance, just as marginal gains achieved success for British Cycling. The document provides examples of marginal gains that could be made for developers, including improving language fluency, tool and framework knowledge, desk and chair ergonomics, keyboard usage, monitor setups, IDE customization, logging and debugging practices, work item definition, meeting processes, coding standards, testing, and continuous integration. It argues these small changes applied systematically across many areas could yield performance increases of 30-40% over traditional approaches to software development
.Net Collection Classes Deep Dive - Rocksolid Tour 2013Gary Short
This document discusses various collection classes in .NET and their performance characteristics. It provides examples and recommendations for choosing the right collection class based on usage needs. List is generally good but can be slow for many additions due to capacity growth requiring copying. LinkedList is better for fast insertion/removal but slower for lookups. Dictionary enables fast lookups but only allows a single value per key. Lookup supports multiple values per key. Concurrent collections provide thread-safety for multi-threaded applications. The document demonstrates examples and provides best practices for optimizing performance with different collection classes.
This document summarizes a presentation on algorithm performance and asymptotic analysis. It introduces common algorithm analysis techniques like Big O notation and the master method for solving recurrences. Specific algorithms like insertion sort and merge sort are analyzed. Insertion sort is shown to have quadratic worst-case runtime while merge sort achieves linearithmic runtime through a divide and conquer approach. Overall the presentation aims to demonstrate how asymptotic analysis can provide insights into algorithm optimization.
2. What this Session is not…
• OO hating
• Deep dive of Clojure
• If you’ve written a Clojure App, you’ll probably
not learn anything.
3. What this Session is…
• Point out why OO dev is hard sometimes
• Show you that there is an alternative
• “It shouldn’t be this hard”.
4. Introduction
• Gary Short
• Head of Gibraltar Labs
– “Skunk Works” division of Gibraltar Software
• MVP C#
– Python
– NodeJS
• gary.short@gibraltarsoftware.com
• @garyshort
• Facebook.com/theOtherGaryShort
4
5. The Road to Here
http://www.flickr.com/photos/fyngyrz/
6. Ada Lovelace
• 1842 - 1843 Lovelace translated a memoir of
an Italian mathematician on Charles Baggage’s
newest proposed machine... the Analytical
Engine. The article she wrote contained the
entire specification of how to calculate
Bernoulli numbers with the Engine. This is
believed to be the first ever computer
program.
7. The 1940s
• Then in the 1940’s along comes the first
recognisable computers and we get
programming languages to go with them...
• 1943 - Plankalkül (Konrad Zuse)
• 1943 - Colossus
• 1949 - C-10
8. The 1950s
• In the 1950s the first three modern programming
languages whose descendants are still in
widespread use today were designed:
• FORTRAN (1955), the "FORmula
TRANslator", invented by John Backus et al.;
• LISP, the "LISt Processor", invented by John
McCarthy et al.;
• COBOL, the COmmon Business Oriented
Language, created by the Short Range
Committee, heavily influenced by Grace Hopper.
9. More 1950s
• 1951 - Regional Assembly Language
• 1952 - Autocode
• 1954 - FORTRAN
• 1954 - IPL (forerunner to LISP)
• 1955 - FLOW-MATIC (forerunner to COBOL)
• 1957 - COMTRAN (forerunner to COBOL)
• 1958 - LISP
• 1958 - ALGOL 58
• 1959 - FACT (forerunner to COBOL)
• 1959 - COBOL
21. What Does it Mean to be Functional?
• First order functions
• Function like constructs
• Stateless
• Immutable data
22. Clojure
• A Lisp • JVM
• Dynamic • Java Interop
• Functional • Fast
– Impure • Persistent collections
• “Lockless” Concurrency • Easy to learn.
• Macros
23. Introduction to Clojure
• Java.Lang.Object
• Arbitrary sized numbers
• Ratios: 18/20
• Nil is null and is treated as false
24. Persistent Collections
• Immutable
– Cheap to copy
• Examples
– (1 2 3)
• List – sequential lookup time
– [1 2 3]
• Vector – logarithmic lookup time
– {“key” 1, 3 7, “foo” “bar”}
• Hashmap – unordered, key value pairs
25. Equality Vs Identity
• Equality
– Two objects are equal
• Two cylinders maybe equal if their volumes are equal
– Identity
• Two pointers to the same object
– Clojure favours equality :-O
26. Clojure is Impure so has Mutability
• Var
– Mutable pointer to immutable data
• You can’t change the data
• But you can change what data the var points to
• But vars hold global data, function defs etc .
• This data won’t change
• So why are vars mutable?
• So we can patch running software.
27. The Reader
• Other programming languages
– Compiler
• Text -> lexing and parsing -> AST
• Clojure
– The Reader
• Text -> lexing and parsing -> Literals (Data)
• As soon as it reads a complete literal it’s passed to...
28. The Evaluator
• Compile Phase
– Traverses the data
• Symbol evaluation
– Symbols evaluate into Vars
» Symbol Dog evaluates to a var in the current namespace
» Symbol MyPets/Dog evaluates to var in namespace MyPets
• List evaluation
– Lists evaluate into function calls
» (+ 1 2 3)
• Process macros
– Execute phase
• Effects the special forms
• Calls functions.
29. Special Forms
• Reserved symbol
– Denotes special list evaluation
• Not a function call – it’s “something else”
• Def, if, do, let, quote, var, fn, loop, recur, throw, tr
y, ., new, set!
• If a list starts with any of those it’s evaluated in a
special way particular to that form
• (if condition a b?)
• (if (been_drinking) (hungover) (happy))
• (if (have_beers) (drink))
Programming languages pre date computers themselves...Starting in 1842 and finishing in 1843 Ada Lovelace translated a memoir of an Italian mathematician on Charles Baggage’s newest proposed machine... the Analytical Engine. The article she wrote contained the entire specification of how to calculate Bernoulli numbers with the Engine. This is believed to be the first ever computer program.Then in the 1940’s along comes the first recognisable computers and we get programming languages to go with them...1943 - Plankalkül (KonradZuse) 1943 - ENIAC coding system1949 - C-10In the 1950s the first three modern programming languages whose descendants are still in widespread use today were designed:FORTRAN (1955), the "FORmulaTRANslator", invented by John Backus et al.; LISP, the "LIStProcessor", invented by John McCarthy et al.; COBOL, the COmmonBusiness Oriented Language, created by the Short Range Committee, heavily influenced by Grace Hopper. 1951 - Regional Assembly Language1952 - Autocode1954 - FORTRAN1954 - IPL (forerunner to LISP) 1955 - FLOW-MATIC (forerunner to COBOL) 1957 - COMTRAN (forerunner to COBOL) 1958 - LISP1958 - ALGOL 581959 - FACT (forerunner to COBOL) 1959 - COBOL1962 - APL1962 - Simula1964 - BASIC1964 - PL/I1970 - Pascal1970 - Forth1972 - C1972 - Smalltalk1972 - Prolog1973 - ML1975 - Scheme1978 - SQL (initially only a query language, later extended with programming constructs) 1983 - Ada1983 - C++1985 - Eiffel1986 - Erlang1987 - Perl1989 - FL (Backus) 1990 - Haskell1991 - Python1991 - Java1993 - Ruby1993 - Lua1994 - ANSI Common Lisp1995 - JavaScript1995 - PHP1997 - Rebol2000 - C#2008 - JavaFX Script
Through the 1990s and up until today, OO languages are in the ascendency due to: the GUI. A GUI lends itself well to the concept of discrete objects due to: having their own knowledge and behaviour messaging each other in an event driven model. Low cost of memory
Modelling object graph where objects are passing messagesModelling state changeModelling problem domains where the actors are hierarchal in natureEvent driven programming
Object graphs or sub graphs mean lots of shared dataShared data bad for concurrencyRequires lockingLocking is bad because it is either coarse grained which is expensive in time or it’s fine grained which is expensive in terms of management.Locking management is hard because there is no compiler or VM support, it’s down to you to work out how to do itExample: lock objects by alphabetical orderYou have to remember to do it that wayErrors are next to impossible to test for, hard to debug
First order functions means that functions can be treated like values and can be return from and passed into other functionsFunction like constructs means that flow control constructs are more like functions in that they may return the last value etcStateless because it’s functional in the sense of a mathematical function. Values are passed in, those values are operated upon and a new value is passed out. The function does not depend on any outside state. If the function is pure it has no side effects.The advantage of this is that a pure function is simple to understand, the whole essence of the function is encapsulated within the function itself. Easy to testEasy to debugConcurrency – if there is no dependency on shared state then work can be easily parallelised.
Pure functional language = no side effects allowedImpure functional language = side effects are not restrictedLockless concurrency does not mean there are no locks, just that the language manages them for you.
Nil is null and is treated as false kinda sucks.Here is a value and it is trueHere is a value and it is falseNil/null should mean there is no value.
Mutable collection you can modify the collection: add, remove etcImmutable collections cannot be modified but instead you get a new copy of the collection with the changes.Key idea is that copies are cheap, both in terms of time and memoryHow does this work?Copies of mutable collections take time and memory, copying 100 items needs 100+ operations but..Because data is immutable, it’s not going to change, so I don’t have to copy the data, just provide a pointer to it.If I want your data with a new member added then I get a collection which shares most of the data but has my deltas
Clojure favours equality but this is not a big problem as data is immutable and so objects and object graphs have a hash, since this can’t change equality simply compares the hash values and not the data in the graphThe only exception to this is string comparisons because Clojure strings are just Java stringsNot a big problem as string comparison is efficient in JavaFirst check identityThen check lengthThen check equality
Vars must be defined before first useThey must be def’d but not necessarily boundWhat is a macro?A macro is a function that modifies reader data
If is a special form as code execution is conditionalIf the condition is true then a will be returnedIf the condition is false then b will be returnedThe ? Denotes that b is optionalI said before that if were function likeFirst example returns the result of hungover if true else the result of happySecond example returns the result of drink else nil
Prefix notation
Tail RecursionSpecial form of recursion whereby the last thing a function does is to call itselfFunctions need a stack frameCall a function 1,000 times recursively then you need 1,000 stackframesBut if calling the function is the last thing you are going to doThen you are not coming back to the calling functionSo there’s an optimisation where you can just overwrite the stackframe of the calling funcSo you only ever need one stack frameMost lisp dialects have this tail recursion optimisationClojure doesn’t as there is not tail recursion on the JMV