Xitrum Web Framework Live Coding Demos / Xitrum Web Framework ライブコーディングscalaconfjp
Xitrum is an asynchronous and clustered Scala web framework and HTTP server built on top of Netty and Akka. It is feature-rich, easy to use, and high performance. Xitrum can scale to a cluster of servers using Akka Cluster and Hazelcast. It is used in production systems in various countries. The document provides information on Xitrum's architecture, features, annotations, and examples of actions and SockJS messaging.
The document discusses differences between Ruby and Scala programming languages. Some key similarities include both being class-based object-oriented languages with functional features. Differences include Scala using explicit types while Ruby is dynamically typed, and Scala having separate concepts of methods and functions while Ruby blurs the distinction. The document also compares features like class definitions, collections, functions as values, and enhancing existing classes.
What's a macro?: Learning by Examples / Scalaのマクロに実用例から触れてみよう!scalaconfjp
Macros allow code to generate code by replacing expressions during compilation. They enable simplifying code and improving efficiency. While macros are powerful, their implementation can be complex, requiring knowledge of compiler internals. The scala.meta library aims to simplify metaprogramming by representing programs as trees without losing information, making macros easier to write without deep compiler expertise.
- The document discusses how Scala code is compiled to Java Virtual Machine (JVM) bytecodes. It begins with an introduction to Koichi Sakata, the presenter, and an overview that the session will look at JVM bytecodes for beginners.
- The presentation then asks if attendees know what happens when Scala code is compiled. It is explained that Scala code, like code from other JVM languages, is compiled to class files that contain JVM bytecodes.
- An example Java class file is opened in a binary editor to show the JVM bytecode format. It is explained that class files have a defined format with elements like magic number, version, and bytecode instructions.
Scala Matsuri 2016: Japanese Text Mining with Scala and SparkEduardo Gonzalez
This document provides an overview and examples of text mining Japanese documents with Scala and Spark. It discusses preprocessing Japanese text with word segmentation tools like Kuromoji, building topic models with LDA, and generating word embeddings with Word2Vec. Examples are given for segmenting Japanese text, creating document corpora, training LDA models to extract topics, and using Word2Vec to find word similarities. The document emphasizes that high quality word vectors require large datasets.
A presentation at Twitter's official developer conference, Chirp, about why we use the Scala programming language and how we build services in it. Provides a tour of a number of libraries and tools, both developed at Twitter and otherwise.
This document provides an overview of the Scala programming language. Some key points:
- Scala runs on the Java Virtual Machine and was created by Martin Odersky at EPFL.
- It has been around since 2003 and the current stable release is 2.7.7. Release 2.8 beta 1 is due out soon.
- Scala combines object-oriented and functional programming. It has features like pattern matching, actors, XML literals, and more that differ from Java. Everything in Scala is an object.
Presented at BJUG, 6/12/2012 by Roger Brinkley
This talk is on 55 new features in Java 7 you (probably) didn't hear about in an ignite format of one per minute. No stopping, no going back....Questions, sure but only if time remains (otherwise save for later).
Node.js vs Play Framework (with Japanese subtitles)Yevgeniy Brikman
Video: http://www.nicovideo.jp/watch/1410857293
Here's the showdown you've been waiting for: Node.js vs Play Framework. Both are popular open source web frameworks that are built for developer productivity, asynchronous I/O, and the real time web. But which one is easier to learn, test, deploy, debug, and scale? Should you pick Javascript or Scala? The Google v8 engine or the JVM? NPM or Ivy? Grunt or SBT? Two frameworks enter, one framework leaves.
This version of the presentation has Japanese subtitles. For the English only version, see http://www.slideshare.net/brikis98/nodejs-vs-play-framework
The document provides an overview of Scala and discusses its advantages compared to other programming languages. Some key points:
- Scala is a multi-paradigm language that supports both object-oriented and functional programming. It runs on the JVM and can access Java libraries.
- Functional programming in Scala enables easier concurrency and scalability compared to imperative programming. Static typing also adds type safety.
- Scala provides flexibility to write code in different styles depending on one's skill level, without restricting creativity. Its REPL environment makes it easy to learn interactively.
- While Scala compilation times can be long, its hybrid approach enables gradual learning from both object-oriented and functional perspectives
Java 7 was released in July 2011 with improvements to performance, concurrency, and memory management. Plans for Java 8 include modularity, lambda expressions, and date/time APIs. The Java Community Process is also being improved to increase transparency, participation, and agility through JSR 348. Overall, the Java ecosystem continues to grow with new languages on the JVM and an active community.
This document discusses using Akka and actors for building scalable and concurrent applications in Scala. It introduces actors as fundamental units of computation that communicate asynchronously via message passing. Akka provides tools for creating actor systems and hierarchies. The document uses a monitoring application called Scotchdog as an example, with actors to represent services that are monitored by a watchdog actor. It describes how messages are used to start, stop and check services, and how the watchdog can aggregate status from child actors. The document also briefly mentions using Akka's scheduler and finite state machines to implement more complex actor behaviors.
This document discusses extending Oracle E-Business Suite using Ruby on Rails. It provides an overview of how to extend EBS functionality by embedding EBS data in other systems or customizing forms and reports. It then discusses the evolution of EBS extension approaches over time from custom PL/SQL to various Java-based frameworks. It introduces Ruby on Rails as an alternative approach, describing how Rails uses an MVC architecture and Active Record pattern. It demonstrates how to connect Rails to Oracle databases using enhanced Oracle adapters and call PL/SQL from Ruby. Finally, it discusses deployment options and provides references for more information.
JavaFX 2 and Scala - Like Milk and Cookies (33rd Degrees)Stephen Chin
JavaFX 2.0 is the next version of a revolutionary rich client platform for developing immersive desktop applications. One of the new features in JavaFX 2.0 is a set of pure Java APIs that can be used from any JVM language, opening up tremendous possibilities. This presentation demonstrates the benefits of using JavaFX 2.0 together with the Scala programming language to provide a type-safe declarative syntax with support for lazy bindings and collections. Advanced language features, such as DelayedInit and @specialized will be discussed, as will ways of forcing prioritization of implicit conversions for n-level cases. Those who survive the pure technical geekiness of this talk will be rewarded with plenty of JavaFX UI eye candy.
Akka and the Zen of Reactive System DesignLightbend
In order to be successful with asynchronous programming, when coming from synchronous execution models you need to change your mindset and look at things from a slightly different perspective. In order to use Akka at it's best, you will have to change the way you think about application design (loosen coupling in space and time between components), and re-think what you've maybe learned in the past.
In this talk we uncover a number of rules that serve as a guide in designing concurrent distributed applications, how those apply to Akka, and how they can help you in daily app development.
Aimed at developers through architects, Akka team happy hAkker, Konrad Malawski, bends your parameters with regards to application design and asynchronous execution models.
This document provides an overview of Scala-ActiveRecord, a type-safe Active Record model library for Scala. It discusses features such as being type-safe, having Rails ActiveRecord-like functionality, automatic transaction control, and support for associations and validations. The document also covers getting started, defining schemas, CRUD operations, queries, caching queries, validations, callbacks, and relationships.
Building Concurrent WebObjects applications with ScalaWO Community
This document discusses using Scala for concurrent programming in WebObjects applications. It begins by explaining why concurrent programming is important due to increasing numbers of processor cores. It then discusses challenges with traditional threading and locks and introduces the actor model as an easier and more scalable approach using message passing. The document demonstrates how to build concurrent WebObjects applications using Scala actors for processing tasks like video encoding. It shows how properties can configure WebObjects for concurrent requests and how ERXEC provides thread safety. Benchmarks show the Scala actor approach outperforms traditional threading. The document argues that Scala is a powerful, safe and easy language for concurrent programming in WebObjects.
This document provides an introduction to JVM bytecode, including how to inspect, generate, and understand bytecode. It discusses two main parts - JVM bytecode itself such as basic instructions and stack operations, and the JVM JIT compiler which compiles bytecode to machine code. Various tools for working with bytecode like javap and ASM are also introduced. The document is intended to help readers gain a better understanding of how the Java platform works from the lowest level.
Fast Web Applications Development with Ruby on Rails on OracleRaimonds Simanovskis
This document provides an overview of Ruby on Rails and how it can be used to develop fast web applications with an Oracle database backend. It discusses key Rails concepts like MVC architecture and Active Record. It also demonstrates how to connect Rails to Oracle using gems like ruby-oci8, activerecord-oracle_enhanced-adapter, and ruby-plsql to access Oracle data types, stored procedures, and full-text search capabilities. The document concludes with deployment options and pointers to related sessions.
This document summarizes how to use Ruby on Rails with legacy Oracle databases. It discusses using the ruby-oci8 and jruby-oci8 gems to connect to Oracle from Ruby. It also covers using the activerecord-oracle_enhanced-adapter gem to connect to Oracle from Rails. It provides examples of calling PL/SQL functions from Ruby using the ruby-plsql gem and overriding ActiveRecord methods to call custom PL/SQL packages. Finally, it diagrams a typical Rails application architecture when using an Oracle database.
This document provides an overview of search and indexing in Adobe Experience Manager using Apache Oak. It discusses Oak query implementation, cost calculation, and various index implementations like property, ordered, Lucene, Solr, and traversing indexes. It provides details on how indexes are defined, when to reindex, debugging cost calculation, and troubleshooting Solr. The primary messages are that search is significantly different between CRX2 and Oak, Oak provides more optimization opportunities but requires more configuration, and indexes need to be understood to optimize query performance.
The document discusses bytecode and the Java Virtual Machine (JVM). It provides an example of decompiling the "Hello World" Java program using javap to view the bytecode instructions. It also covers bytecode fundamentals like the stack machine model, instruction types, and how the operand stack and frames work. Finally, it demonstrates some common stack manipulation instructions.
A short introduction (with many examples) to the Scala programming language and also an introduction to using the Play! Framework for modern, safe, efffcient and reactive web applications.
GitBucket: The perfect Github clone by Scalatakezoe
GitBucket is an open-source GitHub clone written in Scala that provides features like public and private repositories, wiki, issues, pull requests, and more. It uses Scala web frameworks like Scalatra and Twirl for the backend and JVM technologies like JGit, H2 database, and Apache MINA for key functions. GitBucket aims to be easy to install, run purely on the JVM, and provide an alternative for those unable to access GitHub due to political restrictions.
Introduction to Spark SQL and Catalyst / Spark SQLおよびCalalystの紹介scalaconfjp
SparkSQL is a Spark component that allows SQL queries to be executed on Spark. It uses Catalyst, which provides an execution planning framework for relational operations like SQL parsing, logical optimization, and physical planning. Catalyst defines logical and physical operators, expressions, data types and provides rule-based optimizations to transform query plans. The SQL core in SparkSQL builds SchemaRDDs to represent queries and allows reading/writing to Parquet and JSON formats.
This document provides an overview of the Scala programming language. Some key points:
- Scala runs on the Java Virtual Machine and was created by Martin Odersky at EPFL.
- It has been around since 2003 and the current stable release is 2.7.7. Release 2.8 beta 1 is due out soon.
- Scala combines object-oriented and functional programming. It has features like pattern matching, actors, XML literals, and more that differ from Java. Everything in Scala is an object.
Presented at BJUG, 6/12/2012 by Roger Brinkley
This talk is on 55 new features in Java 7 you (probably) didn't hear about in an ignite format of one per minute. No stopping, no going back....Questions, sure but only if time remains (otherwise save for later).
Node.js vs Play Framework (with Japanese subtitles)Yevgeniy Brikman
Video: http://www.nicovideo.jp/watch/1410857293
Here's the showdown you've been waiting for: Node.js vs Play Framework. Both are popular open source web frameworks that are built for developer productivity, asynchronous I/O, and the real time web. But which one is easier to learn, test, deploy, debug, and scale? Should you pick Javascript or Scala? The Google v8 engine or the JVM? NPM or Ivy? Grunt or SBT? Two frameworks enter, one framework leaves.
This version of the presentation has Japanese subtitles. For the English only version, see http://www.slideshare.net/brikis98/nodejs-vs-play-framework
The document provides an overview of Scala and discusses its advantages compared to other programming languages. Some key points:
- Scala is a multi-paradigm language that supports both object-oriented and functional programming. It runs on the JVM and can access Java libraries.
- Functional programming in Scala enables easier concurrency and scalability compared to imperative programming. Static typing also adds type safety.
- Scala provides flexibility to write code in different styles depending on one's skill level, without restricting creativity. Its REPL environment makes it easy to learn interactively.
- While Scala compilation times can be long, its hybrid approach enables gradual learning from both object-oriented and functional perspectives
Java 7 was released in July 2011 with improvements to performance, concurrency, and memory management. Plans for Java 8 include modularity, lambda expressions, and date/time APIs. The Java Community Process is also being improved to increase transparency, participation, and agility through JSR 348. Overall, the Java ecosystem continues to grow with new languages on the JVM and an active community.
This document discusses using Akka and actors for building scalable and concurrent applications in Scala. It introduces actors as fundamental units of computation that communicate asynchronously via message passing. Akka provides tools for creating actor systems and hierarchies. The document uses a monitoring application called Scotchdog as an example, with actors to represent services that are monitored by a watchdog actor. It describes how messages are used to start, stop and check services, and how the watchdog can aggregate status from child actors. The document also briefly mentions using Akka's scheduler and finite state machines to implement more complex actor behaviors.
This document discusses extending Oracle E-Business Suite using Ruby on Rails. It provides an overview of how to extend EBS functionality by embedding EBS data in other systems or customizing forms and reports. It then discusses the evolution of EBS extension approaches over time from custom PL/SQL to various Java-based frameworks. It introduces Ruby on Rails as an alternative approach, describing how Rails uses an MVC architecture and Active Record pattern. It demonstrates how to connect Rails to Oracle databases using enhanced Oracle adapters and call PL/SQL from Ruby. Finally, it discusses deployment options and provides references for more information.
JavaFX 2 and Scala - Like Milk and Cookies (33rd Degrees)Stephen Chin
JavaFX 2.0 is the next version of a revolutionary rich client platform for developing immersive desktop applications. One of the new features in JavaFX 2.0 is a set of pure Java APIs that can be used from any JVM language, opening up tremendous possibilities. This presentation demonstrates the benefits of using JavaFX 2.0 together with the Scala programming language to provide a type-safe declarative syntax with support for lazy bindings and collections. Advanced language features, such as DelayedInit and @specialized will be discussed, as will ways of forcing prioritization of implicit conversions for n-level cases. Those who survive the pure technical geekiness of this talk will be rewarded with plenty of JavaFX UI eye candy.
Akka and the Zen of Reactive System DesignLightbend
In order to be successful with asynchronous programming, when coming from synchronous execution models you need to change your mindset and look at things from a slightly different perspective. In order to use Akka at it's best, you will have to change the way you think about application design (loosen coupling in space and time between components), and re-think what you've maybe learned in the past.
In this talk we uncover a number of rules that serve as a guide in designing concurrent distributed applications, how those apply to Akka, and how they can help you in daily app development.
Aimed at developers through architects, Akka team happy hAkker, Konrad Malawski, bends your parameters with regards to application design and asynchronous execution models.
This document provides an overview of Scala-ActiveRecord, a type-safe Active Record model library for Scala. It discusses features such as being type-safe, having Rails ActiveRecord-like functionality, automatic transaction control, and support for associations and validations. The document also covers getting started, defining schemas, CRUD operations, queries, caching queries, validations, callbacks, and relationships.
Building Concurrent WebObjects applications with ScalaWO Community
This document discusses using Scala for concurrent programming in WebObjects applications. It begins by explaining why concurrent programming is important due to increasing numbers of processor cores. It then discusses challenges with traditional threading and locks and introduces the actor model as an easier and more scalable approach using message passing. The document demonstrates how to build concurrent WebObjects applications using Scala actors for processing tasks like video encoding. It shows how properties can configure WebObjects for concurrent requests and how ERXEC provides thread safety. Benchmarks show the Scala actor approach outperforms traditional threading. The document argues that Scala is a powerful, safe and easy language for concurrent programming in WebObjects.
This document provides an introduction to JVM bytecode, including how to inspect, generate, and understand bytecode. It discusses two main parts - JVM bytecode itself such as basic instructions and stack operations, and the JVM JIT compiler which compiles bytecode to machine code. Various tools for working with bytecode like javap and ASM are also introduced. The document is intended to help readers gain a better understanding of how the Java platform works from the lowest level.
Fast Web Applications Development with Ruby on Rails on OracleRaimonds Simanovskis
This document provides an overview of Ruby on Rails and how it can be used to develop fast web applications with an Oracle database backend. It discusses key Rails concepts like MVC architecture and Active Record. It also demonstrates how to connect Rails to Oracle using gems like ruby-oci8, activerecord-oracle_enhanced-adapter, and ruby-plsql to access Oracle data types, stored procedures, and full-text search capabilities. The document concludes with deployment options and pointers to related sessions.
This document summarizes how to use Ruby on Rails with legacy Oracle databases. It discusses using the ruby-oci8 and jruby-oci8 gems to connect to Oracle from Ruby. It also covers using the activerecord-oracle_enhanced-adapter gem to connect to Oracle from Rails. It provides examples of calling PL/SQL functions from Ruby using the ruby-plsql gem and overriding ActiveRecord methods to call custom PL/SQL packages. Finally, it diagrams a typical Rails application architecture when using an Oracle database.
This document provides an overview of search and indexing in Adobe Experience Manager using Apache Oak. It discusses Oak query implementation, cost calculation, and various index implementations like property, ordered, Lucene, Solr, and traversing indexes. It provides details on how indexes are defined, when to reindex, debugging cost calculation, and troubleshooting Solr. The primary messages are that search is significantly different between CRX2 and Oak, Oak provides more optimization opportunities but requires more configuration, and indexes need to be understood to optimize query performance.
The document discusses bytecode and the Java Virtual Machine (JVM). It provides an example of decompiling the "Hello World" Java program using javap to view the bytecode instructions. It also covers bytecode fundamentals like the stack machine model, instruction types, and how the operand stack and frames work. Finally, it demonstrates some common stack manipulation instructions.
A short introduction (with many examples) to the Scala programming language and also an introduction to using the Play! Framework for modern, safe, efffcient and reactive web applications.
GitBucket: The perfect Github clone by Scalatakezoe
GitBucket is an open-source GitHub clone written in Scala that provides features like public and private repositories, wiki, issues, pull requests, and more. It uses Scala web frameworks like Scalatra and Twirl for the backend and JVM technologies like JGit, H2 database, and Apache MINA for key functions. GitBucket aims to be easy to install, run purely on the JVM, and provide an alternative for those unable to access GitHub due to political restrictions.
Introduction to Spark SQL and Catalyst / Spark SQLおよびCalalystの紹介scalaconfjp
SparkSQL is a Spark component that allows SQL queries to be executed on Spark. It uses Catalyst, which provides an execution planning framework for relational operations like SQL parsing, logical optimization, and physical planning. Catalyst defines logical and physical operators, expressions, data types and provides rule-based optimizations to transform query plans. The SQL core in SparkSQL builds SchemaRDDs to represent queries and allows reading/writing to Parquet and JSON formats.
Scarab: SAT-based Constraint Programming System in Scala / Scala上で実現された制約プログラ...scalaconfjp
This document discusses Scarab, a SAT-based constraint programming system developed in Scala. Scarab provides a domain-specific language and APIs for modeling constraint satisfaction problems and solving them using SAT encodings and SAT solvers like Sat4j. It aims to provide an expressive, efficient and customizable workbench for developing SAT-based systems. The document gives examples of using Scarab to model and solve the graph coloring problem and pandiagonal Latin square problem. It also discusses Scarab's features like efficiency, portability and ability to leverage advanced SAT solving techniques.
Weaving Dataflows with Silk - ScalaMatsuri 2014, TokyoTaro L. Saito
Silk is a framework for building dataflows in Scala. In Silk users write data processing code with collection operators (e.g., map, filter, reduce, join, etc.). Silk uses Scala Macros to construct a DAG of dataflows, nodes of which are annotated with variable names in the program. By using these variable names as markers in the DAG, Silk can support interruption and resume of dataflows and querying the intermediate data. By separating dataflow descriptions from its computation, Silk enables us to switch executors, called weavers, for in-memory or cluster computing without modifying the code. In this talk, we will show how Silk helps you run data-processing pipelines as you write the code.
Vector and ListBuffer have similar performance for random reads. Benchmarking showed no significant difference in throughput, average time, or sample times between reading randomly from a Vector versus a ListBuffer. Vectors are generally faster than Lists for random access due to Vectors being implemented as arrays under the hood.
Scala - The Simple Parts, SFScala presentationMartin Odersky
These are the slides of the talk I gave on May 22, 2014 to the San Francisco Scala user group. Similar talks were given before at GOTO Chicago, keynote, at Gilt Groupe and Hunter College in New York, at JAX Mainz and at FlatMap Oslo.
This document discusses ways to create lightweight Ruby solutions by simplifying frameworks and components. It suggests replacing ActiveRecord with the simpler and faster Sequel ORM. It also recommends using Zepto.js instead of jQuery for mobile apps, and Rack and Sinatra to build lightweight web apps instead of full Rails applications. Benchmarks show these lightweight approaches can significantly improve performance compared to default Rails. Tools mentioned that aid lightweight development include Pow for local web serving and rbenv for Ruby version management. The document concludes by reminding developers not to see Ruby as the only solution and to consider other languages like Erlang, Scala and C++ for certain problems.
The document discusses frustrations experienced using Scala in a large project that ported a Java web application to Scala, including long compilation times, issues with ScalaIDE and sbt, and limitations of frameworks like Anorm; it then provides solutions the author developed to address these challenges, such as libraries to improve validation, ORM usage, and integration with Play frameworks.
Beginning Scala with Skinny Framework #jjug_cccKazuhiro Sera
This document provides an overview of the Skinny Framework for building Scala web applications. It discusses how to get started with a basic Skinny application, the MVC structure used in Skinny, database modeling and access using Skinny ORM, and other features like validation, routing and scaffolding. Key points covered include bootstrapping a Skinny app, writing basic controllers and views, defining models and relationships, and generating CRUD pages automatically with scaffolding.
A talk on front-end developer tools including Yeoman, Grunt.js, Require.js, Bower, and SASS given at Drupal Camp LA 2013.
This talk doesn't address Drupal specifically, but it was aimed to give the audience of drupal developers a look into the state of the art.
Scala.js is a compiler that compiles Scala source code to equivalent Javascript code. It can be seen as the start of a revolution in developing web application. In this talk, I'll present Scala.js project, common libraries for having a pleasure web development (such as scalatags, autowire and upickle) and integration with well known javascript libraries such as AngularJS and React.js.
The document discusses Scala.js, a compiler that converts Scala code into JavaScript. It covers why Scala.js is useful for developing web applications in Scala instead of JavaScript, how to set up projects using SBT, popular Scala.js libraries for tasks like making RPC calls and building user interfaces, tips for interfacing Scala code with JavaScript libraries, and React integration with Scala.js.
Intro to node.js - Ran Mizrahi (28/8/14)Ran Mizrahi
This document provides an introduction to Node.js, including what it is, how it works, and some common frameworks and tools used with Node.js. Node.js is a JavaScript runtime built on Chrome's V8 JavaScript engine that uses an event-driven, non-blocking I/O model to handle requests. It allows for easy development of scalable network applications. The document discusses Node.js' event loop architecture, non-blocking I/O, and provides examples of using Express, Socket.IO, Mongoose and testing with Mocha/Chai.
Intro to node.js - Ran Mizrahi (27/8/2014)Ran Mizrahi
Node.js is a platform built on Chrome V8 javascript runtime engine for building fast and scalable, non-blocking, real-time and network applications. In this session Ran will introduce node.js and how to develop large code bases using it. He'll cover the following aspects:
• What is node.js?
• Apache vs. Nginx performance (One thread per connection vs. event loop) and what it has to do with node.js.
• Why node was written in Javascript?
• Main tools and frameworks (Express, socket.io, mongoose etc.)
• TDD/BDD with node.js using mocha and Chai.
Ran Mizrahi, Founder of CoCycles, Passionate entrepreneur and software engineer who loves to continuously innovate and deliver meaningful products while having true fun with the right team.
The document introduces the Play Framework version 2.1 and highlights its key features. It demonstrates building a sample application in Scala using Play's reactive, non-blocking architecture. Key features discussed include Play's built-in support for Scala, reactive programming, JSON APIs, routing, templates, and testing.
The Typesafe Stack includes Scala, Akka, and Play frameworks for building scalable applications. Scala is a statically typed, functional programming language that runs on the JVM and interoperates with Java. Akka is an event-driven middleware for building distributed, fault-tolerant applications using actors. Play is a web framework that enables fast development of RESTful APIs and web applications using Scala templates. Together, these frameworks provide tools for building scalable, distributed systems with easy development.
Alberto Maria Angelo Paro - Isomorphic programming in Scala and WebDevelopmen...Codemotion
Scala is the only language that can be used to produce code that can be "trans/compiled" for the JVM, in Javascript and in native binary. This allows to write libraries that are usable in JVM and JS using the power of functional programming (i.e. cats, scalaz), generic programming (i.e. shapeless) and macro/scalameta available in Scala. In this talk, we will see how to write a Scala application backend and a SPA (scala.js/scala-js-react) that share the same code as a business logic, datamodels and transparent API call (JVM/JS) in Scala (via autowire/akka-http/circe).
Rack provides a simple interface for building web applications in Ruby. This document outlines how to build a basic web framework on top of Rack by leveraging existing Rack middleware and tools. It demonstrates how to add features like routing, controllers, views, ORM, authentication, testing, and a console using middleware like Usher, Tilt, DataMapper, Warden, rack-test, and racksh. The goal is to create a simple but full-featured framework with minimal code by combining existing Rack components.
WebNet Conference 2012 - Designing complex applications using html5 and knock...Fabio Franzini
This document provides an overview of designing complex applications using HTML5 and KnockoutJS. It discusses HTML5 and why it is useful, introduces JavaScript and frameworks like KnockoutJS and SammyJS that help manage complexity. It also summarizes several JavaScript libraries and patterns including the module pattern, revealing module pattern, and MV* patterns. Specific libraries and frameworks discussed include RequireJS, AmplifyJS, UnderscoreJS, and LINQ.js. The document concludes with a brief mention of server-side tools like ScriptSharp.
MSc Enterprise Systems Development Guest Lecture at UniS (2/12/09)Daniel Bryant
A guest lecture I presented to MSc Level Enterprise Systems Development students within the Department of Computing at the University of Surrey. This was a very similar presentation to the L2 lecture delivered the week earlier, but also included more advanced material.
The document provides an introduction to Typesafe Activator and the Play Framework. It discusses how Activator is a tool that helps developers get started with the Typesafe Reactive Platform and Play applications. It also covers some core features of Play like routing, templates, assets, data access with Slick and JSON, and concurrency with Futures, Actors, and WebSockets.
Spark Job Server and Spark as a Query Engine (Spark Meetup 5/14)Evan Chan
This was a talk that Kelvin Chu and I just gave at the SF Bay Area Spark Meetup 5/14 at Palantir Technologies.
We discussed the Spark Job Server (http://github.com/ooyala/spark-jobserver), its history, example workflows, architecture, and exciting future plans to provide HA spark job contexts.
We also discussed the use case of the job server at Ooyala to facilitate fast query jobs using shared RDD and a shared job context, and how we integrate with Apache Cassandra.
Alfresco’s highly customizable repository can often seem overwhelming. Learn approaches for adding common customizations requests (Extending Javascript API, Content Modeling, Permission Modeling, packaging, etc.) from current and former Alfresco consulting staff. Learn where we often see the most common errors and participate in open Q&A.
Ruby on Rails is a web application framework written in Ruby that emphasizes convention over configuration and rapid development. It includes modules for modeling data with ActiveRecord, handling requests and responses with ActionController and ActionView, and additional features like routing and internationalization. The document then provides more details on the history, philosophy, main components, and features of Rails.
All I learned while working on a Scala OSS project for over six years #ScalaM...Kazuhiro Sera
* http://2018.scalamatsuri.org/index_en.html
* https://www.youtube.com/watch?v=y7BxvT-Jm6w
In 2011, I started a Scala open source project named ScalikeJDBC. Thanks to many contributors, I am still working on the project after six years. In the meantime, the Scala community has been growing sharply, and the trends have been continuously changing. Despite the fact that the number of developers who work on OSS projects has increased, there are not many developers who have been working on a Scala project for several years. In this talk, I will share my experiences and pieces of knowledge through maintaining the OSS project for more than six years.
Skinny 2 was recently released on November 19th. The update includes moving from Scalatra to Skinny Micro for the servlet layer. Upgrading to Skinny 2 is easy and provides improvements like making async controllers safer when using Scala Futures. The documentation website was also renewed with archived 1.x docs.
This document discusses using Futures in Servlet applications. It notes that while Futures are standard in Scala, directly accessing mutable Servlet API objects like the request from Future threads can cause issues. It describes problems like request objects being recycled before Futures complete. It also discusses how Scalatra's use of DynamicScope for the request/response can cause problems when used with Futures. The document outlines improvements in Skinny Framework that avoid these issues, such as passing a stable Context object and avoiding DynamicScope.
English version is here: http://www.slideshare.net/seratch/future-on-servlet-scalaks
http://summit.scala-kansai.org/ でのプレゼンです
[Japanese] Skinny Framework で始める Scala #jjug_ccc #ccc_r24Kazuhiro Sera
English version is here: http://www.slideshare.net/seratch/jjug-ccc-2014springeng
http://www.java-users.jp/?page_id=1048#R2-4
Skinny is a lightweight web framework for Scala that aims to provide a Rails-like development experience. It offers features like routing, CRUD templates, validation, ORM, database migrations, asset compilation, and mail sending. Some benefits highlighted include an easy setup process, statically typed but simple code, and suitability for replacing legacy systems. The framework is under active development with a 1.0 release planned for this week and continued work on future versions.
Skinny Framework is a Scala web framework similar to Rails that aims for apps and frameworks to be "skinny" or lightweight. Version 0.9.17 added features like scaffold generation and database migrations. Version 1.0.0 is planned for Q4 2013 and will focus on fixing issues and establishing stable APIs before continuing development of new features. Contributors are welcome and the framework can be easily tested by running the included blank app template.
Kabukiza.tech 1 LT - ScalikeJDBC-Async & Skinny Framework #kbkz_techKazuhiro Sera
This document introduces ScalikeJDBC, a type-safe SQL library for Scala that provides a non-blocking approach to database access. It summarizes ScalikeJDBC's features, including its DSL for writing queries, SQL interpolation support, and an asynchronous version called ScalikeJDBC-Async. It also briefly introduces a new Scala web framework called Skinny that is inspired by Ruby on Rails and uses ScalikeJDBC.
1. Solid and Sustainable
Development in Scala
Kazuhiro Sera @seratch
ScalikeJDBC / Skinny Framework
Founder & Lead Developer
2. Ask Me Later!
• 3 mags for questioners at the end of this
session! Don’t miss it!
2
3. Who Am I
• Kazuhiro Sera • @seratch on Twitter/GitHub • Scala enthusiast since 2010 • ScalikeJDBC, Skinny Framework, AWScala
founder & project lead • A web developer at M3, Inc (We’re a Gold
Sponsor)
5. ScalikeJDBC
• scalikejdbc.org • “Scala-like JDBC” • Provides Scala-ish APIs • Started as a better querulous / Anorm • “Just write SQL and get things done” • QueryDSL for smoothness & type-safety • Stable enough: lots of companies already
use it in production
7. Basic Usage
import scalikejdbc._!
!
ConnectionPool.singleton(!
“jdbc:h2:mem:matsuri”, !
“user”, “secret”)!
SQL statement!
(PreparedStatement)
!
DB autoCommit { implicit session =>!
Side effect !
with DB connection
sql”create table attendee (name varchar(32))”.execute.apply()!
val name = “seratch”!
sql”insert into attendee (name) values ($name)”.update.apply()!
}!
!
val names: Seq[String] = DB readOnly { implicit s =>!
sql”select name from attendee”!
.map(_.string(“name”)).list.apply()!
}
execute/update!
(JDBC operation)
Extractor
8. QueryDSL
import scalikejdbc._!
case class Attendee(name: String)!
object Attendee extends SQLSyntaxSupport[Attendee] {!
def apply(rs: WrappedResultSet, a: ResultName[Attendee]) = !
new Attendee(rs.get(a.name))
}!
!
implicit val session = AutoSession!
!
!
val a = Attendee.syntax(“a”)!
val seratch: Option[Attendee] = withSQL {!
QueryDSL!
(Mostly SQL)
Actual SQL Query
select.from(Attendee as a).where.eq(a.name, “seratch”)!
}.map(rs => new Attendee(rs, a)).single.apply()!
!
// select a.name as n_on_a from attendee a where a.name = ?
9. Skinny Framework
• skinny-framework.org • “Scala on Rails” • For Rails / Play1 lovers • 1.0.0 was out on 28th March • Already several experiences in production • Full-stack features: Web infrastructure,
Scaffold generator, ORM, DB migration,
JSON stuff, HTTP client, Mail sender, Job
workers, Assets controller, etc..
10. Boot in 2 minutes
!
// install skinny command!
brew tap skinny-framework/alt!
brew install skinny!
!
// create app and start!
skinny new myapp!
cd myapp!
skinny run!
!
// access localhost:8080 from your browser!
11. Model (DAO)
import skinny.orm._!
Entity
import scalikejdbc._!
!
case class User(id: Long, name: Option[String])!
!
// companion: data mapper!
object User extends SkinnyCRUDMapper[User] {!
def defaultAlias = createAlias(“u”)!
def extract(rs: WrappedResultSet, u: ResultName[User])!
= autoConstruct(rs, u)
}!
CRUD Mapper Object!
!
(No need to be companion)
User.findById(123)!
User.count()!
User.createWithAttributes(‘name -> “Alice”)!
User.updateById(123).withAttributes(‘name -> “Bob”)!
User.deleteBy(sqls.eq(u.name, “Bob”))
Smooth APIs
12. Controller + Route
package controller!
class UsersController extends ApplicationController {!
def showUsers = {!
set(“users”, User.findAll())!
render(“/users/index”)
}
}!
!
// Routings!
object Controllers {!
Set value in request scope!
(Visible in views)
Expects “src/main/webapp/!
WEB-INF/views/users/index.html.ssp”
val users = new UsersController with Routes {!
get(“/users/”)(showUsers).as(‘showUsers)
}!
def mount(ctx: ServletContext): Unit = {!
users.mount(ctx)!
}
}
14. Web Development
• Interactive feedback loop is most
important especially when changing UI • Actually Scala compilation is so slow that
waiting view templates compilation makes
developers much stressed • Skinny doesn’t compile all the view
templates when developing (unlike Twirl)
16. My Good Parts
•Simplified Class-based OOP And
Immutable Data Structure
•Working On Problems Without
Overkill Abstraction
•Writing Tests Without Question
•Keep Infrastructure Lightweight
•No Surprises For Newcomer
18. Class-based OOP
• Already so popular (Java, Ruby, Python ..) • Old style is friendly with mutability (e.g.
setters, bang methods), but that’s not a
prerequisite • OOP can be more solid and safer by
keeping immutability and avoiding
inheritance anti-patterns
19. Scala or Java 8?
• Scala case class is simpler than Java
beans with (great) Lombok • Scala high-order functions are simpler
than Java 8 Stream API • Immutability is well-treated in Scala • Fairness: Java decisively beats Scala in
comparison with compilation speed..
20. Immutability
• Do away with mutable states • Re-assignment? No way! Don’t use `var` • Immutability makes your apps not only
scalable but also more solid • When you modify a case class, call
#copy() and return new state instead of
using setters for mutability inside
21. Immutable Entity
// entity with behaviors!
case class User(id: Long, name: Option[String])!
extends SkinnyRecord[User] {!
override def skinnyCRUDMapper = User
}!
// data mapper!
object User extends SkinnyCRUDMapper[User] {!
override def defaultAlias = createAlias(“u”)!
override def extract(rs: WrappedResultSet, u: ResultName[User])!
= autoConstruct(rs, u)
}!
!
val noNames: Seq[User] = User.where(‘name -> “”).apply()!
val anons: Seq[User] = noNames.map { user => !
user.copy(name = “Anonymous”).save()!
}
Both of “noNames” and
“anons” are immutable
22. Trait Chaos
• Mixing traits can show you terrible chaos • We should have self-discipline • Prefer `override` modifier to detect API
changes when mixing many traits • Collect the same sort of traits and place
them in same place to avoid code
duplication or unwanted complexity
23. Web Controller
package controller!
class MainController extends ApplicationController !
with concern.TimeLogging {!
def index = logElapsedTime { render(“/main/index”) }!
}!
!
// for controllers!
package controller.concern!
trait TimeLogging { self: SkinnyController with Logging =>!
The “concern” just follows Rails style.
Anyway, naming should be simple and!
easy-to-understand for anyone
def millis: Long = System.currentTimeMillis !
def logElapsedTime[A](action: => A): A = {!
val before = millis!
val result = action!
logger.debug(“Elapsed time: ${millis - before} millis”)!
result
}!
}
24. Coding Style Tips
• Use sbt-scalariform without question
(similar: go-lang’s fmt) • Don’t toss similar classes or traits into
single scala file except `sealed` pattern • Don’t place classes under different
package directory (although it’s possible) • Do you really need cake pattern? • Prefer eloquent method signature than
explaining a lot in scaladocs
26. The Real As-Is
• Abstraction often improves things, but
that’s not always the best way to solve
real-world problems • I/O issue is a typical case that we should
comprehend problems as-is • Database access / SQL is not a collection
but just an external I/O operation • Overkill abstraction makes your code
difficult to maintain for other developers
27. Don’t Hide the SQL
• “You don’t need another DSL to access
relational databases” - Anorm • You must recognize what is working
effectively in the SQL layer • Utility to write DAO easily is fine but
hiding SQL is not good • Need to grab the cause from raw queries
when dealing with troubles (comfortable
logging also can help)
28. SQL Ops As-Is
// A programmer belongs to a company and has several skills!
!
implicit val session = AutoSession!
!
val p: Option[Programmer] = withSQL {!
I believe everybody can
understand this code
select.from(Programmer as p)!
.leftJoin(Company as c).on(p.companyId, c.id)!
.leftJoin(ProgrammerSkill as ps).on(ps.programmerId, p.id)!
.leftJoin(Skill as s).on(ps.skillId, s.id)!
.where.eq(p.id, 123).and.isNull(p.deletedAt)!
}!
.one(rs => Programmer(rs, p, c))!
Extracts one-to-many
.toMany(rs => Skill.opt(rs, s))!
relationships here
.map { (programmer, skills) => programmer.copy(skills = skills) }!
.single!
.apply()
29. Skinny ORM
• ORM built on ScalikeJDBC • Highly inspired by Rails ActiveRecord • SQL queries for CRUD apps are common
enough, so it’s reasonable to avoid writing
mostly same code everywhere • Skinny ORM doesn't prevent you from
using ScaikeJDBC APIs directly • A part of Skinny Framework but you can
use it in Play apps too
31. Mappers
// entities!
case class Company(id: Long, name: String)!
case class Employee(id: Long, name: String,!
companyId: Long, company: Option[Company])!
!
// mappers!
object Company extends SkinnyCRUDMapper[Company] {!
def extract(rs: WrappedResultSet, rn: ResultName[Company]) =!
autoConstruct(rs, rn)
}!
object Employee extends SkinnyCRUDMapper[Employee] {!
def extract(rs: WrappedResultSet, rn: ResultName[Employee]) =!
autoConstruct(rs, rn, “company”)!
// simple association definition!
lazy val companyRef = belongsTo[Company](!
Company, (e, c) => e.copy(company = c))
}
32. Reasonable?
Right, these CRUD operations are not SQL-ish. However, I believe
they’re reasonable because these patterns are already common enough.
!
!
val companyId = Company.createWithAttributes(‘name -> “Sun”)!
val empId = Employee.createWithAttributes(!
‘name -> “Alice”, ‘companyId -> companyId)!
!
val emp: Option[Employee] = Employee.findById(empId)!
val empWithCompany: Option[Employee] = !
Employee.joins(companyRef).findById(123)!
!
Company.updateById(companyId).withAttributes(‘name -> “Oracle”)!
!
val e = Employee.defaultAlias!
Employee.deleteBy(sqls.eq(e.id, empId))!
Using ScalikeJBDC API!
Company.deleteById(companyId)
is also possible
34. Not Only Compiler
• It’s true that compiler helps you by
detecting mistakes in coding • Writing tests is a reasonable way to verify
your code meets requirements /
specifications as expected • You can’t skip automated tests even if
your apps are written in Scala
35. scoverage
• At this time, the only option available for
us is scoverage (SCCT inheritor) • Add the dependency into your projects
right now if you don’t use it yet
37. Avoid SBT Hacks
• sbt is not so easy for Scala newbies,
upgrading sbt is all the more so • Play depends on sbt version (e.g. Play 2.1
w/ sbt 0.12), upgrading Play is about not
only Play API changes but sbt things • Your own sbt plugins/hacks make your
projects difficult to maintain for a long
period and involve others • Don’t try to do everything there
38. Skinny TaskRunner
• Just want a simple and “rake”-like task
runner (no sbt plugin) • Simplistic but pragmatic idea: “mainClass”
of “task” sbt project can be dispatcher of
task runner system • Tasks are written in Scala (no sbt plugin) • Not only writing code but upgrading
scala/sbt version become pretty easy
39. Tasks
// sbt settings!
// mainClass := Some("TaskRunner")!
!
// task/src/main/scala/TaskRunner.scala!
object TaskRunner extends skinny.task.TaskLauncher {!
register("assets:precompile", (params) => {!
val buildDir = params.headOption.getOrElse(“build")!
// AssetsPrecompileTask is a Scala object!
skinny.task.AssetsPrecompileTask.main(Array(buildDir))!
})!
}!
Pure Scala function!
!
// skinny task:run assets:precompile [dir]
task name
mainClass as the dispatcher
40. Use Only Essentials
• The same issue as Ruby gems, what’s
worse, Scala’s eco-system is still so
smaller than Ruby’s one • Binary incompatibility makes existing
libraries outdated every Scala major
version release • Are you really ready to fork them? • Using Java assets (e.g. commons)
internally is also worth thinking about
42. Can Feel Welcome?
• Is joining your Scala projects easy? Can
newcomer understand overview at once? • Don’t stick to doing on the sbt, don’t
disfavor using other tools (e.g. Grunt) • Well-known style (e.g. Rails style) is
preferred for collaborative works • Is asynchronosity really required now? • Indeed, your DSL is very simple but easy
to modify them (for others)?
43. Newcomers may not
know Scala well.
Attract them to Scala!
(Don’t scare them)