Clojure's history of web development began with using Clojure as a library for Java servlets in 2007. In 2009, Ring was introduced as a standard for request-response processing using Clojure maps and middleware. This was inspired by Rack and WSGI. Compojure provided routing capabilities. Early frameworks like Noir and Conjure bundled technologies but lacked flexibility. More recent options like Pedestal, Duct, Arachne, and Luminus integrate Clojure libraries for full-stack development with options for asynchronous processing, components, and Node.js support. The ecosystem continues to be driven by community contributions.
This document discusses monadic programming (MP) in Clojure. It begins with introductions to monads and monadic programming in Haskell. It then discusses reasons for using MP in Clojure despite it not having static typing or being purely functional. It explains two libraries for MP in Clojure - clojure.algo.monads and funcool/cats - and how they implement monads using macros and protocols. Examples are given of using monads for error handling in a reverse Polish notation calculator and for representing probability distributions.
Clojure's history of web development began with using Clojure as a library for Java servlets in 2007. In 2009, Ring was introduced as a standard for request-response processing using Clojure maps and middleware. This was inspired by Rack and WSGI. Compojure provided routing capabilities. Early frameworks like Noir and Conjure bundled technologies but lacked flexibility. More recent options like Pedestal, Duct, Arachne, and Luminus integrate Clojure libraries for full-stack development with options for asynchronous processing, components, and Node.js support. The ecosystem continues to be driven by community contributions.
This document discusses monadic programming (MP) in Clojure. It begins with introductions to monads and monadic programming in Haskell. It then discusses reasons for using MP in Clojure despite it not having static typing or being purely functional. It explains two libraries for MP in Clojure - clojure.algo.monads and funcool/cats - and how they implement monads using macros and protocols. Examples are given of using monads for error handling in a reverse Polish notation calculator and for representing probability distributions.
Xtend is a Java-compatible language developed by Eclipse. It has a simpler syntax than Java and compiles to Java bytecode. Xtend supports features like lambda expressions, extension methods, and switch expressions. It has strong tooling support in Eclipse and IntelliJ IDEs. Xtend aims to be a pragmatic alternative to Java for development while maintaining full interoperability.
Journey of Migrating Millions of Queries on The Cloudtakezoe
This document discusses challenges in upgrading a query engine and summarizing strategies for efficiently simulating queries to test compatibility and performance. It proposes grouping queries by signature and narrowing data scans to reduce the number of queries tested. It also recommends automating result verification by generating human-readable reports and excluding uncheckable queries. Assistance tools are proposed to aid investigation of differences, which helped discover real bugs in the target version.
GitBucket: Open source self-hosting Git server built by Scalatakezoe
This document provides information about GitBucket, an open source self-hosting Git server created by Naoki Takezoe using Scala. Some key points:
- GitBucket is an open source self-hosting Git server built using Scala and Java technologies. It allows hosting both public and private repositories.
- It has over 8,000 stars on GitHub and supports features like issues, pull requests, wiki pages, and plugins.
- The developer chose Scala for its interoperability with Java libraries and broad ecosystem. This helped minimize development costs, which is important for sustainability of personal open source projects.
Testing Distributed Query Engine as a Servicetakezoe
Naoki Takezoe from Treasure Data discussed testing their distributed query engine Presto as a service. They developed a tool called presto-query-simulator to test using production data and queries in a safe manner. The tool reduces testing time by grouping similar queries and narrowing data scans. It also helps analyze results and find problematic queries. Future work includes running tests more frequently and improving coverage.
This document discusses different approaches to dependency injection in Scala, including Google Guice, implicit parameters, the cake pattern, Reader monad, MacWire, and Airframe. It compares runtime DI approaches like Guice and Airframe to compile-time approaches. The best approach depends on whether auto-wiring is needed, whether compile-time checking or dynamic binding is preferred, and whether life-cycle management is required.
How to keep maintainability of long life Scala applicationstakezoe
Naoki Takezoe discusses maintaining long-term Scala applications. He outlines two main difficulties: programming style differences that impact understandability and upgrades that require coordinating framework, Scala, and Java version changes. Case studies show upgrades can be blocked until dependent libraries support new versions. Solutions include reducing dependencies, using popular libraries, custom libraries for core components, and considering Java alternatives. Regular maintenance and preparing for breaking changes are key to sustainable Scala applications.
GitBucket: Git Centric Software Development Platform by Scalatakezoe
GitBucket is an open source Git server platform written in Scala that provides easy installation and setup. It allows for public and private repositories along with features like issue tracking, pull requests, wikis, and notifications. While based on traditional Java technologies like Jetty and JGit, it uses the Scalatra framework to integrate these components and provide a unified web interface for managing Git repositories and collaboration.
Zipkin is a distributed tracing system created by Twitter that allows services to record and query traces of requests across microservices. It uses HTTP headers to propagate trace data between services and stores trace data in storage backends like Cassandra, MySQL, or Elasticsearch. The Brave library can be used to instrument Java applications to send trace data to a Zipkin server.
This document discusses using Scala and Scala.js for type-safe front-end web development. It introduces Scala.js, which compiles Scala code to JavaScript, enabling the use of Scala on the front-end. It also discusses related libraries like ScalaTags for type-safe HTML generation and ScalaCSS for type-safe CSS. While Scala.js enables fully type-safe front-ends, the document acknowledges challenges like large JavaScript file sizes and lack of type mappings for existing JavaScript libraries. It proposes an approach where Scala programmers provide Scala.js interfaces for front-end code, while JavaScript programmers implement the user interface using frameworks like React.
This document compares various Scala frameworks for building web applications and interacting with databases. It discusses alternatives to the standard Play and Slick frameworks, including Finagle, Akka HTTP, Skinny Micro, Quill, doobie, and ScalikeJDBC. For web frameworks, all the alternatives look promising but Play is also still viable. For databases, there is no clear standard yet, but ScalikeJDBC appears suitable for most users.
This document discusses macros in Scala. Macros allow code to be generated at compile time by expanding directives or generating abstract syntax trees (ASTs). Examples show how macros can be used for validation, type generation, domain-specific languages (DSLs), and optimization without runtime overhead. The document explains macro types in Scala, how to construct ASTs using AST models, reify, and quasiquotes, and future plans to replace scala.reflect with the safer scala.meta metaprogramming toolkit.
The document discusses Reactive Slick, a new version of the Slick database access library for Scala that provides reactive capabilities. It allows parallel database execution and streaming of large query results using Reactive Streams. Reactive Slick is suitable for composite database tasks, combining async tasks, and processing large datasets through reactive streams.
markedj: The best of markdown processor on JVMtakezoe
This document discusses selecting a markdown parser for a Scala-based GitHub clone called GitBucket. It evaluates several Java-based markdown parsers but finds them lacking support for features like GitHub Flavored Markdown tables and fences. It describes initially trying to port the JavaScript markdown parser marked.js to Scala but facing issues with its use of regular expressions and mutability. The document then explains the decision to port marked.js to Java instead, resulting in the new markdown parser markedj, which supports GFM and has a simple API. GitBucket plans to switch to using markedj starting in its next version.
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.
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.