The document provides an overview of past and future developments for the Groovy programming language. It summarizes highlights from Groovy version 1.6, including performance improvements, new features like multiple assignments and annotation processing, and the addition of the Grape module system. It then previews new features for Groovy 1.7 such as anonymous inner classes, improved annotation handling, and tools for working with AST transformations. The presentation concludes by looking ahead to future versions 1.8 and beyond.
WebGL brings hardware accelerated 3D to your browser. The code may be complex, but the possibilities are amazing. Given as a lecture in the fh ooe in Hagenberg, Austria in December 2011.
There sure are a lot of "Core" frameworks in iOS, but what do they do for you? Core Foundation is often assumed to just be a C version of the familiar Objective-C objects in Foundation, but wait... what's this CFPlugIn? That sure doesn't have an NS-equivalent. And collections like CFBagRef and CFTreeRef, what are they? What's this CFUUID that Apple says I have to use instead of -[UIDevice uniqueIDentifier]?
That's just the beginning: beyond Core Foundation, there's even more C-only functionality to be had. Core Graphics' CGPDF functions let you draw to and from PDFs, and even parse their notoriously nasty innards. And there are more interesting C-only treats in Core Text, Core Telephony, and others.
In this session, we'll make peace with iOS' C frameworks by getting used to the conventions of allocators, opaque types, run loops, and the toll-free bridge, and tour some of the unique functionality that's only available at this level of the iOS stack.
GoLightly: A Go Library For Building Virtual MachinesEleanor McHugh
GoLightly is a flexible library for building virtual machines in Go. Instead of a single general purpose VM it encourages the use of many small, specialised VMs working in concert.
WebGL brings hardware accelerated 3D to your browser. The code may be complex, but the possibilities are amazing. Given as a lecture in the fh ooe in Hagenberg, Austria in December 2011.
There sure are a lot of "Core" frameworks in iOS, but what do they do for you? Core Foundation is often assumed to just be a C version of the familiar Objective-C objects in Foundation, but wait... what's this CFPlugIn? That sure doesn't have an NS-equivalent. And collections like CFBagRef and CFTreeRef, what are they? What's this CFUUID that Apple says I have to use instead of -[UIDevice uniqueIDentifier]?
That's just the beginning: beyond Core Foundation, there's even more C-only functionality to be had. Core Graphics' CGPDF functions let you draw to and from PDFs, and even parse their notoriously nasty innards. And there are more interesting C-only treats in Core Text, Core Telephony, and others.
In this session, we'll make peace with iOS' C frameworks by getting used to the conventions of allocators, opaque types, run loops, and the toll-free bridge, and tour some of the unique functionality that's only available at this level of the iOS stack.
GoLightly: A Go Library For Building Virtual MachinesEleanor McHugh
GoLightly is a flexible library for building virtual machines in Go. Instead of a single general purpose VM it encourages the use of many small, specialised VMs working in concert.
Gor Nishanov, C++ Coroutines – a negative overhead abstractionSergey Platonov
C++ coroutines are one of the few major features that may land in C++17. We will look at the current standardization status, available experimental implementations and develop a small coroutine adapter over raw C networking APIs that will beat hand-crafted state machine in performance.
This module explains several additional important concepts. These include properties of QObjects, data types, QString and various list types.
Special classes in Qt provide even more convenient APIs if you want to save settings in the right way for the target platform.
At the end, a guide walks you through what you need to know about embedding files and resources into your application.
Gor Nishanov, C++ Coroutines – a negative overhead abstractionSergey Platonov
C++ coroutines are one of the few major features that may land in C++17. We will look at the current standardization status, available experimental implementations and develop a small coroutine adapter over raw C networking APIs that will beat hand-crafted state machine in performance.
This module explains several additional important concepts. These include properties of QObjects, data types, QString and various list types.
Special classes in Qt provide even more convenient APIs if you want to save settings in the right way for the target platform.
At the end, a guide walks you through what you need to know about embedding files and resources into your application.
Clojure is a new dialect of LISP that runs on the Java Virtual Machine (JVM). As a functional language, it offers great benefits in terms of programmer productivity; as a language that runs on the JVM, it also offers the opportunity to reuse existing Java libraries. Simon’s interest is in using Clojure to build desktop applications with the Java Swing GUI library. In this presentation Simon discusses how the power of Clojure can be applied to Swing, and whether it hits the sweet spot.
Kotlin is a statically typed programming language for the JVM, Android and the browser.
More and more in the Android community start using Kotlin, we’ll see why and how you can do it too.
Part presentation, part debate about the future of the language while touching base on the current state of the industry with respect to ES6/ES2015, and the possibilities of using it today in web applications and frameworks, the different options, and the things to keep in mind. Additionally, we will do a walk-through on the new features included in ES7/ES2016 draft, and those that are being discussed for ES8/ES2017.
What is new with JavaScript in Gnome: The 2021 editionIgalia
Philip Chimento gives the 2021 edition of this yearly series at
GUADEC about improvements made in GNOME's JavaScript platform. If you are writing code for a GNOME app or shell extension that uses JavaScript and you want to know how to modernize your code or use new language features, this talk will be interesting for you. If you are curious about the progress made on the garbage collection bug, and what needs to happen before it can be fixed, this talk will be interesting for you. And if you are interested in working on a JavaScript engine and want some ideas for projects to get started with, from beginner through expert level, this talk will definitely be interesting for you!
Go 1.10 Release Party, featuring what's new in Go 1.10 and a few deep dives into how Go works.
Presented at the PDX Go Meetup on April 24th, 2018.
https://www.meetup.com/PDX-Go/events/248938586/
Introduction to Gradle in 45min as done at JBCN 2016. Covers the basics of Gradle for people familiar with other build tools. Includes building Java, Scala, Groovy & Kotlin projects
Fort de ses 1.7 millions de téléchargements l'an passé, Groovy continue son bonhomme de chemin en tête parmi les langages de programmation alternatifs pour la JVM.
Groovy 2.0, sorti l'an passé, introduisait dans son offre de la modularité, le support de JDK 7 au niveau syntaxique avec "Project Coin" autant qu'au niveau JVM avec l'utilisation d'"invoke dynamic", et proposait des fonctionnalités de typage et de compilation statique.
Groovy 2.1, quant à lui, s'appuie sur ces bases pour compléter le support d'"invoke dynamic" pour plus de performances. Il propose des améliorations permettant de documenter, d'aider les IDEs, et de vérifier statiquement les Domain-Specific Languages construits avec Groovy. Vous pourrez créer des méta-annotations regroupant d'autres annotations, pour éviter l'annotation "hell". Et enfin, vous irez encore plus loin dans la customisation du compilateur !
Accrochez votre ceinture, paré au décollage !
"Groovy 2.0 and beyond" presentation given at the Groovy/Grails eXchange conference.
Video can be seen here:
http://skillsmatter.com/podcast/groovy-grails/keynote-speech
Groovy Domain Specific Languages - SpringOne2GX 2012Guillaume Laforge
Paul King, Andrew Eisenberg and Guillaume Laforge present about implementation of Domain-Specific Languages in Groovy, while at the SpringOne2GX 2012 conference in Washington DC.
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdfPaige Cruz
Monitoring and observability aren’t traditionally found in software curriculums and many of us cobble this knowledge together from whatever vendor or ecosystem we were first introduced to and whatever is a part of your current company’s observability stack.
While the dev and ops silo continues to crumble….many organizations still relegate monitoring & observability as the purview of ops, infra and SRE teams. This is a mistake - achieving a highly observable system requires collaboration up and down the stack.
I, a former op, would like to extend an invitation to all application developers to join the observability party will share these foundational concepts to build on:
Securing your Kubernetes cluster_ a step-by-step guide to success !KatiaHIMEUR1
Today, after several years of existence, an extremely active community and an ultra-dynamic ecosystem, Kubernetes has established itself as the de facto standard in container orchestration. Thanks to a wide range of managed services, it has never been so easy to set up a ready-to-use Kubernetes cluster.
However, this ease of use means that the subject of security in Kubernetes is often left for later, or even neglected. This exposes companies to significant risks.
In this talk, I'll show you step-by-step how to secure your Kubernetes cluster for greater peace of mind and reliability.
Essentials of Automations: The Art of Triggers and Actions in FMESafe Software
In this second installment of our Essentials of Automations webinar series, we’ll explore the landscape of triggers and actions, guiding you through the nuances of authoring and adapting workspaces for seamless automations. Gain an understanding of the full spectrum of triggers and actions available in FME, empowering you to enhance your workspaces for efficient automation.
We’ll kick things off by showcasing the most commonly used event-based triggers, introducing you to various automation workflows like manual triggers, schedules, directory watchers, and more. Plus, see how these elements play out in real scenarios.
Whether you’re tweaking your current setup or building from the ground up, this session will arm you with the tools and insights needed to transform your FME usage into a powerhouse of productivity. Join us to discover effective strategies that simplify complex processes, enhancing your productivity and transforming your data management practices with FME. Let’s turn complexity into clarity and make your workspaces work wonders!
Epistemic Interaction - tuning interfaces to provide information for AI supportAlan Dix
Paper presented at SYNERGY workshop at AVI 2024, Genoa, Italy. 3rd June 2024
https://alandix.com/academic/papers/synergy2024-epistemic/
As machine learning integrates deeper into human-computer interactions, the concept of epistemic interaction emerges, aiming to refine these interactions to enhance system adaptability. This approach encourages minor, intentional adjustments in user behaviour to enrich the data available for system learning. This paper introduces epistemic interaction within the context of human-system communication, illustrating how deliberate interaction design can improve system understanding and adaptation. Through concrete examples, we demonstrate the potential of epistemic interaction to significantly advance human-computer interaction by leveraging intuitive human communication strategies to inform system design and functionality, offering a novel pathway for enriching user-system engagements.
PHP Frameworks: I want to break free (IPC Berlin 2024)Ralf Eggert
In this presentation, we examine the challenges and limitations of relying too heavily on PHP frameworks in web development. We discuss the history of PHP and its frameworks to understand how this dependence has evolved. The focus will be on providing concrete tips and strategies to reduce reliance on these frameworks, based on real-world examples and practical considerations. The goal is to equip developers with the skills and knowledge to create more flexible and future-proof web applications. We'll explore the importance of maintaining autonomy in a rapidly changing tech landscape and how to make informed decisions in PHP development.
This talk is aimed at encouraging a more independent approach to using PHP frameworks, moving towards a more flexible and future-proof approach to PHP development.
Removing Uninteresting Bytes in Software FuzzingAftab Hussain
Imagine a world where software fuzzing, the process of mutating bytes in test seeds to uncover hidden and erroneous program behaviors, becomes faster and more effective. A lot depends on the initial seeds, which can significantly dictate the trajectory of a fuzzing campaign, particularly in terms of how long it takes to uncover interesting behaviour in your code. We introduce DIAR, a technique designed to speedup fuzzing campaigns by pinpointing and eliminating those uninteresting bytes in the seeds. Picture this: instead of wasting valuable resources on meaningless mutations in large, bloated seeds, DIAR removes the unnecessary bytes, streamlining the entire process.
In this work, we equipped AFL, a popular fuzzer, with DIAR and examined two critical Linux libraries -- Libxml's xmllint, a tool for parsing xml documents, and Binutil's readelf, an essential debugging and security analysis command-line tool used to display detailed information about ELF (Executable and Linkable Format). Our preliminary results show that AFL+DIAR does not only discover new paths more quickly but also achieves higher coverage overall. This work thus showcases how starting with lean and optimized seeds can lead to faster, more comprehensive fuzzing campaigns -- and DIAR helps you find such seeds.
- These are slides of the talk given at IEEE International Conference on Software Testing Verification and Validation Workshop, ICSTW 2022.
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...James Anderson
Effective Application Security in Software Delivery lifecycle using Deployment Firewall and DBOM
The modern software delivery process (or the CI/CD process) includes many tools, distributed teams, open-source code, and cloud platforms. Constant focus on speed to release software to market, along with the traditional slow and manual security checks has caused gaps in continuous security as an important piece in the software supply chain. Today organizations feel more susceptible to external and internal cyber threats due to the vast attack surface in their applications supply chain and the lack of end-to-end governance and risk management.
The software team must secure its software delivery process to avoid vulnerability and security breaches. This needs to be achieved with existing tool chains and without extensive rework of the delivery processes. This talk will present strategies and techniques for providing visibility into the true risk of the existing vulnerabilities, preventing the introduction of security issues in the software, resolving vulnerabilities in production environments quickly, and capturing the deployment bill of materials (DBOM).
Speakers:
Bob Boule
Robert Boule is a technology enthusiast with PASSION for technology and making things work along with a knack for helping others understand how things work. He comes with around 20 years of solution engineering experience in application security, software continuous delivery, and SaaS platforms. He is known for his dynamic presentations in CI/CD and application security integrated in software delivery lifecycle.
Gopinath Rebala
Gopinath Rebala is the CTO of OpsMx, where he has overall responsibility for the machine learning and data processing architectures for Secure Software Delivery. Gopi also has a strong connection with our customers, leading design and architecture for strategic implementations. Gopi is a frequent speaker and well-known leader in continuous delivery and integrating security into software delivery.
zkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex ProofsAlex Pruden
This paper presents Reef, a system for generating publicly verifiable succinct non-interactive zero-knowledge proofs that a committed document matches or does not match a regular expression. We describe applications such as proving the strength of passwords, the provenance of email despite redactions, the validity of oblivious DNS queries, and the existence of mutations in DNA. Reef supports the Perl Compatible Regular Expression syntax, including wildcards, alternation, ranges, capture groups, Kleene star, negations, and lookarounds. Reef introduces a new type of automata, Skipping Alternating Finite Automata (SAFA), that skips irrelevant parts of a document when producing proofs without undermining soundness, and instantiates SAFA with a lookup argument. Our experimental evaluation confirms that Reef can generate proofs for documents with 32M characters; the proofs are small and cheap to verify (under a second).
Paper: https://eprint.iacr.org/2023/1886
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...UiPathCommunity
💥 Speed, accuracy, and scaling – discover the superpowers of GenAI in action with UiPath Document Understanding and Communications Mining™:
See how to accelerate model training and optimize model performance with active learning
Learn about the latest enhancements to out-of-the-box document processing – with little to no training required
Get an exclusive demo of the new family of UiPath LLMs – GenAI models specialized for processing different types of documents and messages
This is a hands-on session specifically designed for automation developers and AI enthusiasts seeking to enhance their knowledge in leveraging the latest intelligent document processing capabilities offered by UiPath.
Speakers:
👨🏫 Andras Palfi, Senior Product Manager, UiPath
👩🏫 Lenka Dulovicova, Product Program Manager, UiPath
Welcome to the first live UiPath Community Day Dubai! Join us for this unique occasion to meet our local and global UiPath Community and leaders. You will get a full view of the MEA region's automation landscape and the AI Powered automation technology capabilities of UiPath. Also, hosted by our local partners Marc Ellis, you will enjoy a half-day packed with industry insights and automation peers networking.
📕 Curious on our agenda? Wait no more!
10:00 Welcome note - UiPath Community in Dubai
Lovely Sinha, UiPath Community Chapter Leader, UiPath MVPx3, Hyper-automation Consultant, First Abu Dhabi Bank
10:20 A UiPath cross-region MEA overview
Ashraf El Zarka, VP and Managing Director MEA, UiPath
10:35: Customer Success Journey
Deepthi Deepak, Head of Intelligent Automation CoE, First Abu Dhabi Bank
11:15 The UiPath approach to GenAI with our three principles: improve accuracy, supercharge productivity, and automate more
Boris Krumrey, Global VP, Automation Innovation, UiPath
12:15 To discover how Marc Ellis leverages tech-driven solutions in recruitment and managed services.
Brendan Lingam, Director of Sales and Business Development, Marc Ellis
UiPath Test Automation using UiPath Test Suite series, part 4DianaGray10
Welcome to UiPath Test Automation using UiPath Test Suite series part 4. In this session, we will cover Test Manager overview along with SAP heatmap.
The UiPath Test Manager overview with SAP heatmap webinar offers a concise yet comprehensive exploration of the role of a Test Manager within SAP environments, coupled with the utilization of heatmaps for effective testing strategies.
Participants will gain insights into the responsibilities, challenges, and best practices associated with test management in SAP projects. Additionally, the webinar delves into the significance of heatmaps as a visual aid for identifying testing priorities, areas of risk, and resource allocation within SAP landscapes. Through this session, attendees can expect to enhance their understanding of test management principles while learning practical approaches to optimize testing processes in SAP environments using heatmap visualization techniques
What will you get from this session?
1. Insights into SAP testing best practices
2. Heatmap utilization for testing
3. Optimization of testing processes
4. Demo
Topics covered:
Execution from the test manager
Orchestrator execution result
Defect reporting
SAP heatmap example with demo
Speaker:
Deepak Rai, Automation Practice Lead, Boundaryless Group and UiPath MVP
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdfPeter Spielvogel
Building better applications for business users with SAP Fiori.
• What is SAP Fiori and why it matters to you
• How a better user experience drives measurable business benefits
• How to get started with SAP Fiori today
• How SAP Fiori elements accelerates application development
• How SAP Build Code includes SAP Fiori tools and other generative artificial intelligence capabilities
• How SAP Fiori paves the way for using AI in SAP apps
In his public lecture, Christian Timmerer provides insights into the fascinating history of video streaming, starting from its humble beginnings before YouTube to the groundbreaking technologies that now dominate platforms like Netflix and ORF ON. Timmerer also presents provocative contributions of his own that have significantly influenced the industry. He concludes by looking at future challenges and invites the audience to join in a discussion.
Elevating Tactical DDD Patterns Through Object CalisthenicsDorra BARTAGUIZ
After immersing yourself in the blue book and its red counterpart, attending DDD-focused conferences, and applying tactical patterns, you're left with a crucial question: How do I ensure my design is effective? Tactical patterns within Domain-Driven Design (DDD) serve as guiding principles for creating clear and manageable domain models. However, achieving success with these patterns requires additional guidance. Interestingly, we've observed that a set of constraints initially designed for training purposes remarkably aligns with effective pattern implementation, offering a more ‘mechanical’ approach. Let's explore together how Object Calisthenics can elevate the design of your tactical DDD patterns, offering concrete help for those venturing into DDD for the first time!
2. to infinity
and beyond!
Guillaume Laforge
SpringSource, a division of VMWare
mercredi 19 mai 2010
3. Guillaume Laforge
Groovy Project Manager
on Groovy since 2003!
JSR-241 Spec Lead
Head of Groovy Development
at SpringSource (division of VMWare)
Initiator of the Grails framework
Creator of the Gaelyk toolkit
Co-author of Groovy in Action
International speaker
mercredi 19 mai 2010
4. Agenda
Past
Groovy 1.6 flashback
Present
Groovy 1.7 novelties
A few Groovy 1.7.x refinements
Future
What’s cooking for 1.8 and beyond
mercredi 19 mai 2010
6. Big highlights of Groovy 1.6
Greater compile-time and runtime performance
Multiple assignments
Optional return for if/else and try/catch/finally
Java 5 annotation definition
AST Transformations
The Grape module and dependency system
Various Swing related improvements
JMX Builder
Metaprogramming additions
JSR-223 scripting engine built-in
Out-of-the-box OSGi support
mercredi 19 mai 2010
7. Multiple assignement
// multiple assignment
def (a, b) = [1, 2]
assert a == 1 && b == 2
// with typed variables
def (int c, String d) = [3, "Hi"]
assert c == 3 && d == "Hi"
def geocode(String place) { [48.8, 2.3] }
def lat, lng
// assignment to existing variables
(lat, lng) = geocode('Paris')
// classical variable swaping example
(a, b) = [b, a]
mercredi 19 mai 2010
8. More optional return
// optional return for if statements
def m1() {
if (true) 1
else 0
}
assert m1() == 1
// optional return for try/catch/finally
def m2(bool) {
try {
if (b) throw new Exception()
1
} catch (any) { 2 }
finally { 3 }
}
assert m2(true) == 2 && m2(false) == 1
mercredi 19 mai 2010
9. AST Transformation (1/2)
Groovy 1.6 introduced AST Transformations
AST: Abstract Syntax Tree
Ability to change what’s being compiled by the
Groovy compiler... at compile time
No runtime impact!
Change the semantics of your programs! Even hijack the
Groovy syntax!
Implementing recurring patterns in your code base
Remove boiler-plate code
Two kinds: global and local (triggered by anno)
mercredi 19 mai 2010
10. AST Transformations (2/2)
Transformations introduced in 1.6
@Singleton
@Immutable, @Lazy, @Delegate
@Newify
@Category, @Mixin
@PackageScope
Swing’s @Bindable and @Vetoable
Grape’s own @Grab
mercredi 19 mai 2010
11. @Immutable
To properly implement immutable classes
No mutations — state musn’t change
Private final fields
Defensive copying of mutable components
Proper equals() / hashCode() / toString()
for comparisons or fas keys in maps
@Immutable class Coordinates {
Double lat, lng
}
def c1 = new Coordinates(lat: 48.8, lng: 2.5)
def c2 = new Coordinates(48.8, 2.5)
assert c1 == c2
mercredi 19 mai 2010
12. Grab a grape!
Simple distribution and sharing of Groovy scripts
Dependencies stored locally
Can even use your own local repositories
@Grab(group = 'org.mortbay.jetty',
module = 'jetty‐embedded',
version = '6.1.0')
def startServer() {
def srv = new Server(8080)
SIONS)
def ctx = new Context(srv , "/", SES
ctx.resourceBase = "."
ovy")
ctx.addServlet(GroovyServlet, "*.gro
srv.start()
}
mercredi 19 mai 2010
17. Big highlights of Groovy 1.7
Anonymous Inner Classes and Nested Classes
Annotations anywhere
Grape improvements
Power Asserts
AST Viewer
AST Builder
Customize the Groovy Truth!
Rewrite of the GroovyScriptEngine
Groovy Console improvements
SQL support refinements
mercredi 19 mai 2010
18. AIC and NC
Anonymous Inner Classe and Nested Classes
mercredi 19 mai 2010
19. AIC and NC
Anonymous Inner Classe and Nested Classes
For J ava
pa ste
co py’n
pa tibi lity
com
sak e :-)
mercredi 19 mai 2010
20. Annonymous Inner Classes
bo olean called = false
Timer ti mer = new Timer()
timer.schedule(n ew TimerTask() {
void run() {
called = true
}
}, 0)
sleep 100
assert called
mercredi 19 mai 2010
21. Annonymous Inner Classes
bo olean called = false
Timer ti mer = new Timer()
timer.schedule(n ew TimerTask() {
void run() {
called = true
}
{ called = true }
}, 0) as TimerTask
sleep 100
assert called
mercredi 19 mai 2010
22. Nested Classes
class Environment {
static class Production
extends Environment {}
static class Development
extends Environment {}
}
new Environment.Production()
mercredi 19 mai 2010
23. Anotations anywhere
You can now put annotations
on imports
on packages
on variable declarations
Examples with @Grab following...
mercredi 19 mai 2010
24. Grape improvements (1/3)
@Grab on import
@Grab(group = 'net.sf.json‐lib',
module = 'json‐lib',
version = '2.3',
classifier = 'jdk15')
import net.sf.json.groovy.*
assert new JsonSlurper().parseText(
new JsonGroovyBuilder().json {
book(title: "Groovy in Action",
author:"Dierk König et al")
ion"
}.toString()).book.title == "Groovy in Act
mercredi 19 mai 2010
25. Grape improvements (2/3)
Shorter module / artifact / version parameter
Example of an annotation on a variable declaration
@Grab('net.sf.json‐lib:json‐lib:2.3:jdk15')
()
def builder = new net.sf.json.groovy.JsonGroovyBuilder
def books = builder.books {
nig")
book(title: "Groovy in Action", author: "Dierk Koe
}
assert books.toString() ==
'{"books":{"book":{"title":"Groovy in Action",' +
'"author":"Dierk Koenig"}}}'''
mercredi 19 mai 2010
26. Grape improvements (3/3)
Groovy 1.7 introduced Grab resolver
For when you need to specify a specific repository
for a given dependency
@GrabResolver(
name = 'restlet.org',
root = 'http://maven.restlet.org')
@Grab('org.restlet:org.restlet:1.1.6')
import org.restlet.Restlet
mercredi 19 mai 2010
27. Power Asserts (1/2)
Much better assert statement!
Invented and developed in the Spock framework
Given this script...
def energy = 7200 * 10**15 + 1
def mass = 80
def celerity = 300000000
assert energy == mass * celerity ** 2
mercredi 19 mai 2010
28. Power Asserts (2/2)
You’ll get a more comprehensible output
mercredi 19 mai 2010
30. Easier AST Transformations
AST Transformations are a very powerful feature
But are still rather hard to develop
Need to know the AST API closely
To help with authoring your own transformations,
we’ve introduced
the AST Viewer in the Groovy Console
the AST Builder
mercredi 19 mai 2010
32. AST Builder
// Ability to build AST parts
// ‐‐> from a String
new AstBui lder().buildFromString(''' "Hello" ''')
// ‐‐> from code
new AstBuilder().buildFromCode { "Hello" }
// ‐‐> from a specification
{
List<ASTNo de> nodes = new AstBuilder().buildFromSpec
block {
returnStatement {
constant "Hello"
}
}
}
mercredi 19 mai 2010
33. Customize the Groovy Truth!
Ability to customize the truth by implementing a
boolean asBoolean() method
class Predicate {
boolean value
boolean asBoolean() { value }
}
def tr uePred = new Predicate(value: true)
def fals ePred = new Predicate(value: false)
assert truePred && !falsePred
mercredi 19 mai 2010
34. SQL support refinements
// batch statements
sql.withBatch { stmt ‐>
e ‐>
["Paul", "Jochen", "Guillaume"].each { nam e)"
stmt.addBat ch "insert into PERSON (name) values ($nam
}
}
// transaction support
def persons = sql.dataSet("person")
sql.withTransaction {
persons.add name: "Paul"
persons.add name: "Jochen"
persons.add name: "Guillaume"
persons.add name: "Roshan"
}
mercredi 19 mai 2010
35. Groovy 1.7.x changes
Groovy 1.7.1 and 1.7.2 have been released
Groovy 1.7.3 is coming soon
Here’s what’s new!
mercredi 19 mai 2010
36. Map improvements
// map auto‐vification
def m = [:].withDefault { key ‐> "Default" }
assert m['z'] == "Default"
assert m['a'] == "Default"
// default sort
m.sort()
// sort with a comparator
m.sort({ a, b ‐> a <=> b } as Comparator)
mercredi 19 mai 2010
37. XML back to String
Ability to retrieve the XML string from a node
from an XmlSlurper GPathResult
def xml = """
<books>
<book isbn="12345">Groovy in Action</book>
</books>
"""
def root = new XmlSlurper().parseText(xml)
def someNode = root.book
def bu ilder = new StreamingMarkupBuilder()
assert build er.bindNode(someNode).toString() ==
"<book isbn='12345'>Groovy in Action</book>"
mercredi 19 mai 2010
38. Currying improvements
// right currying
def divide = { a, b ‐> a / b }
def halver = divide.rcurry(2)
assert halver(8) == 4
// currying n‐th parameter
def jo inWithSeparator = { one, sep, two ‐>
one + sep + two
}
def joinWithComma =
jo inWithSeparator.ncurry(1, ', ')
assert joinWithComma('a', 'b') == 'a, b'
mercredi 19 mai 2010
39. New icon for the Swing console
mercredi 19 mai 2010
40. New icon for the Swing console
mercredi 19 mai 2010
45. What we’re working on
More runtime performance improvements
Closure annotations
Gradle build
Modularizing Groovy
Align with JDK 7 / Java 7 / Project Coin
Enhanced DSL support
AST Templates
Towards MOP 2
mercredi 19 mai 2010
47. Closure annotations
Groovy 1.5 brought Java 5 annotations
What if... we could go beyond what Java offered?
In 1.7, we can put annotations on packages, imports and
variable declarations
But annotations are still limited in terms of parameters
they allow
Here comes closure annotations!
Groovy 1.8 will give us the ability to access annotation
with closure parameters at runtime
mercredi 19 mai 2010
48. GContracts
Closures are already allowed in the Groovy 1.7
Antlr grammar
Andre Steingreß created GContracts,
a «design by contract» module
// a class invariant
@I nvariant({ name.size() > 0 && age > ageLimit() })
// a method pre‐condition
@Requires({ message != null })
// a method post‐condition
@Ensures({ returnResult % 2 == 0 })
mercredi 19 mai 2010
51. bu ild
dh oc oo vy
ore a lar Gr
M du s!
o
e m rom H an
Mor ef
M or
mercredi 19 mai 2010
52. More modular build
«Not everybody needs everything!» ™
A lighter Groovy-core
what’s in groovy-all?
Modules
test, jmx, swing, xml, sql, web, template
integration (bsf, jsr-223)
tools (groovydoc, groovyc, shell, console, java2groovy)
mercredi 19 mai 2010
53. Java 7 / JDK 7 / Project Coin
JSR-292 InvokeDynamic
Simple Closures?
Proposals from Project Coin
Strings in switch
Automatic Resource Management
Improved generics type inference (diamond <>)
Simplified varargs method invocation
Better integral literals
Language support for collections
mercredi 19 mai 2010
54. Improved DSL support
GEP-3: an extended command expression DSL
Groovy Extension Proposal #3
A Google Summer of Code student will work on that
Command expressions
basically top-level statements without parens
combine named and non-named arguments in the mix
for nicer Domain-Specific Languages
mercredi 19 mai 2010
55. Before GEP-3
The idea: extend command-expressions, beyond
top-level statements, for chained method calls
Before
send("Hello").to("Jochen")
send("Hello", from: "Guillaume").to("Jochen")
sell(100.shares).of(MSFT)
take(2.pills).of(chloroquinine).in(6.hours)
every(10.minutes).execute { }
given { }.when { }.then { }
blend(red, green).of(acrylic)
mercredi 19 mai 2010
56. With GEP-3
The idea: extend command-expressions, beyond
top-level statements, for chained method calls
After
send "Hello" to "Jochen"
send "Hello", from: "Guillaume" to "Jochen"
sell 100.shares of MSFT
take 2.pills of chloroquinine in 6.hours
every 10.minutes execute { }
given { } when { } then { }
blend red, green of acrylic
mercredi 19 mai 2010
57. With GEP-3
The idea: extend command-expressions, beyond
top-level statements, for chained method calls
After
send "Hello" to "Jochen"
send "Hello", from: "Guillaume" to "Jochen"
sell 100.shares of MSFT
Less
pare
take 2.pills of chloroquinine in 6.hours
& co ns
every 10.minutes execute { }
mm
given { } when { } then { } as
blend red, green of acrylic
mercredi 19 mai 2010
58. AST Templates
Since AST, it’s easier to write AST Transformations
But we can even do better!
Hamlet D’Arcy is working on a new proposal
GEP-4 — AST Templates
mercredi 19 mai 2010
60. Towards a new MOP?
The Meta-Object Protocol show its age
different stratification layers
DGM, categories, custom MetaClasses, ExpandoMetaClass...
different characteristics
scope: global, local, thread-bound
works across the hierarchy or not
A better MOP could...
help for performance
offer more granularity
let the developer choose the characteristics he needs
provide a layered approach of changes
mercredi 19 mai 2010
61. Some potential modules
GPars was considered a potential module for
addition into core
but got a life of its own!
Parser combinators
for when you hit the walls of the Groovy syntax
and AST transformations won’t cut it
Pattern matching
mercredi 19 mai 2010
62. Summary (1/2)
No need to wait for Java 7, 8, 9...
closures, properties, interpolated strings, extended
annotations, metaprogramming, [YOU NAME IT]...
mercredi 19 mai 2010
63. Summary (1/2)
No need to wait for Java 7, 8, 9...
closures, properties, interpolated strings, extended
annotations, metaprogramming, [YOU NAME IT]...
oov y’s
Gr ive
no vat
sti ll in
20 03!
si nce
mercredi 19 mai 2010
64. Summary (2/2)
But it’s more than just a language, it’s a very rich
and active ecosystem!
Grails, Griffon, Gradle, GPars, Spock, Gaelyk...
mercredi 19 mai 2010
65. Thanks for your attention!
e
aforg pment
ume L Develo
Guilla Groovy om
He ad of e@ gmail.c
glaforg rge
Email: @glafo
:
Twitter
mercredi 19 mai 2010