SlideShare a Scribd company logo

"Xapi-lang For declarative code generation" By James Nelson

GWTcon
GWTcon
GWTcon Firenze, Italy

"Xapi-lang For declarative code generation" By James Nelson #GWTcon2017 Florence September 28-29th 2017

"Xapi-lang For declarative code generation" By James Nelson

1 of 23
Download to read offline
Xapi-lang
For Declarative Code Generation
James Nelson
Vertispan.com WeTheInter.net (wti.net)
Game Plan
● Why I (still) choose GWT
● Code generation, deferred binding & J2CL
● What is Xapi?
● What is Xapi-lang?
● What can I do with Xapi-lang?
● Code generation Best Practices
● Gwt 3 and beyond
● Shameless plug
● Q & A
● Save the world and get rich doing it :-)
Why I chose GWT
● The state of the web in 2007
● Javascript sucked
● IE6 sucked
● Code generators!
● Transpilers!
● Optimizing Compilation!
● Type safety!
● Java Tools!
Why I still choose GWT
● Plays nicely with Javascript
● Plays nicely with Android and IOS *
● Code generators!
● Transpilers!
● Optimizing Compilation!
● Type safety!
● Java Tools!
● Mature, well tested framework
* Java can target web, mobile, desktop and server
Codegen, Deferred Binding & J2CL
● Code generation, like alcohol,
is good in moderation (Alex Lowe)
● GWT is the first (only?) web framework with compile-
time code generation
● Automate away boilerplate
● More declarative, less typos
● Express intent with annotations and interfaces
● Why do at runtime
what you can do at compile time?
● Going away in J2CL :-(
Codegen, Deferred Binding & J2CL
● Why is it called deferred binding?
– In the expression level “JJS AST”, GWT.create() calls
are converted to nodes which contain an expression for
each permutation, to be distilled into distinct
permutations (unless you have collapsed permutations)
● Enables you to inject “magic” at compile time
– While purists prefer to avoid magic, sometimes the best
practical solution is to hide your complexity in the
compiler instead of polluting your runtime or requiring
repetitive copy-pasta “solutions”.
● Major selling point in the days of extreme browser
fragmentation
● Going away in J2CL :-(
Ad

Recommended

Gradle: The Build System you have been waiting for!
Gradle: The Build System you have been waiting for!Gradle: The Build System you have been waiting for!
Gradle: The Build System you have been waiting for!Corneil du Plessis
 
Qt test framework
Qt test frameworkQt test framework
Qt test frameworkICS
 
Integrating React.js Into a PHP Application
Integrating React.js Into a PHP ApplicationIntegrating React.js Into a PHP Application
Integrating React.js Into a PHP ApplicationAndrew Rota
 
The world of gradle - an introduction for developers
The world of gradle  - an introduction for developersThe world of gradle  - an introduction for developers
The world of gradle - an introduction for developersTricode (part of Dept)
 
GWT is Smarter Than You
GWT is Smarter Than YouGWT is Smarter Than You
GWT is Smarter Than YouRobert Cooper
 
Scala and Play with Gradle
Scala and Play with GradleScala and Play with Gradle
Scala and Play with GradleWei Chen
 
Best Practices in Qt Quick/QML - Part III
Best Practices in Qt Quick/QML - Part IIIBest Practices in Qt Quick/QML - Part III
Best Practices in Qt Quick/QML - Part IIIICS
 
Gradle - the Enterprise Automation Tool
Gradle  - the Enterprise Automation ToolGradle  - the Enterprise Automation Tool
Gradle - the Enterprise Automation ToolIzzet Mustafaiev
 

More Related Content

What's hot

Angular 2 Migration - JHipster Meetup 6
Angular 2 Migration - JHipster Meetup 6Angular 2 Migration - JHipster Meetup 6
Angular 2 Migration - JHipster Meetup 6William Marques
 
My "Perfect" Toolchain Setup for Grails Projects
My "Perfect" Toolchain Setup for Grails ProjectsMy "Perfect" Toolchain Setup for Grails Projects
My "Perfect" Toolchain Setup for Grails ProjectsGR8Conf
 
Gradle - time for a new build
Gradle - time for a new buildGradle - time for a new build
Gradle - time for a new buildIgor Khotin
 
Serving QML applications over the network
Serving QML applications over the networkServing QML applications over the network
Serving QML applications over the networkJeremy Lainé
 
React Lifecycle and Reconciliation
React Lifecycle and ReconciliationReact Lifecycle and Reconciliation
React Lifecycle and ReconciliationZhihao Li
 
Angular Weekend
Angular WeekendAngular Weekend
Angular WeekendTroy Miles
 
Building Grails Plugins - Tips And Tricks
Building Grails Plugins - Tips And TricksBuilding Grails Plugins - Tips And Tricks
Building Grails Plugins - Tips And TricksMike Hugo
 
A Tour of the Modern Java Platform
A Tour of the Modern Java PlatformA Tour of the Modern Java Platform
A Tour of the Modern Java PlatformVMware Tanzu
 
An Introduction to Gradle for Java Developers
An Introduction to Gradle for Java DevelopersAn Introduction to Gradle for Java Developers
An Introduction to Gradle for Java DevelopersKostas Saidis
 
GWT 2 Is Smarter Than You
GWT 2 Is Smarter Than YouGWT 2 Is Smarter Than You
GWT 2 Is Smarter Than YouRobert Cooper
 
The Making of the Oracle R2DBC Driver and How to Take Your Code from Synchron...
The Making of the Oracle R2DBC Driver and How to Take Your Code from Synchron...The Making of the Oracle R2DBC Driver and How to Take Your Code from Synchron...
The Making of the Oracle R2DBC Driver and How to Take Your Code from Synchron...VMware Tanzu
 
Modularizing your Grails Application with Private Plugins - SpringOne 2GX 2012
Modularizing your Grails Application with Private Plugins - SpringOne 2GX 2012Modularizing your Grails Application with Private Plugins - SpringOne 2GX 2012
Modularizing your Grails Application with Private Plugins - SpringOne 2GX 2012kennethaliu
 
"Technical Challenges behind Visual IDE for React Components" Tetiana Mandziuk
"Technical Challenges behind Visual IDE for React Components" Tetiana Mandziuk"Technical Challenges behind Visual IDE for React Components" Tetiana Mandziuk
"Technical Challenges behind Visual IDE for React Components" Tetiana MandziukFwdays
 
Gradle 3.0: Unleash the Daemon!
Gradle 3.0: Unleash the Daemon!Gradle 3.0: Unleash the Daemon!
Gradle 3.0: Unleash the Daemon!Eric Wendelin
 
Using React with Grails 3
Using React with Grails 3Using React with Grails 3
Using React with Grails 3Zachary Klein
 

What's hot (20)

Angular 2 Migration - JHipster Meetup 6
Angular 2 Migration - JHipster Meetup 6Angular 2 Migration - JHipster Meetup 6
Angular 2 Migration - JHipster Meetup 6
 
My "Perfect" Toolchain Setup for Grails Projects
My "Perfect" Toolchain Setup for Grails ProjectsMy "Perfect" Toolchain Setup for Grails Projects
My "Perfect" Toolchain Setup for Grails Projects
 
Gradle - time for a new build
Gradle - time for a new buildGradle - time for a new build
Gradle - time for a new build
 
Workshop React.js
Workshop React.jsWorkshop React.js
Workshop React.js
 
Drools & jBPM Workshop London 2013
Drools & jBPM Workshop London 2013Drools & jBPM Workshop London 2013
Drools & jBPM Workshop London 2013
 
Serving QML applications over the network
Serving QML applications over the networkServing QML applications over the network
Serving QML applications over the network
 
React Lifecycle and Reconciliation
React Lifecycle and ReconciliationReact Lifecycle and Reconciliation
React Lifecycle and Reconciliation
 
Angular Weekend
Angular WeekendAngular Weekend
Angular Weekend
 
Building Grails Plugins - Tips And Tricks
Building Grails Plugins - Tips And TricksBuilding Grails Plugins - Tips And Tricks
Building Grails Plugins - Tips And Tricks
 
A Tour of the Modern Java Platform
A Tour of the Modern Java PlatformA Tour of the Modern Java Platform
A Tour of the Modern Java Platform
 
An Introduction to Gradle for Java Developers
An Introduction to Gradle for Java DevelopersAn Introduction to Gradle for Java Developers
An Introduction to Gradle for Java Developers
 
Gradle
GradleGradle
Gradle
 
GWT 2 Is Smarter Than You
GWT 2 Is Smarter Than YouGWT 2 Is Smarter Than You
GWT 2 Is Smarter Than You
 
The Making of the Oracle R2DBC Driver and How to Take Your Code from Synchron...
The Making of the Oracle R2DBC Driver and How to Take Your Code from Synchron...The Making of the Oracle R2DBC Driver and How to Take Your Code from Synchron...
The Making of the Oracle R2DBC Driver and How to Take Your Code from Synchron...
 
Real World Java 9
Real World Java 9Real World Java 9
Real World Java 9
 
Gradle : An introduction
Gradle : An introduction Gradle : An introduction
Gradle : An introduction
 
Modularizing your Grails Application with Private Plugins - SpringOne 2GX 2012
Modularizing your Grails Application with Private Plugins - SpringOne 2GX 2012Modularizing your Grails Application with Private Plugins - SpringOne 2GX 2012
Modularizing your Grails Application with Private Plugins - SpringOne 2GX 2012
 
"Technical Challenges behind Visual IDE for React Components" Tetiana Mandziuk
"Technical Challenges behind Visual IDE for React Components" Tetiana Mandziuk"Technical Challenges behind Visual IDE for React Components" Tetiana Mandziuk
"Technical Challenges behind Visual IDE for React Components" Tetiana Mandziuk
 
Gradle 3.0: Unleash the Daemon!
Gradle 3.0: Unleash the Daemon!Gradle 3.0: Unleash the Daemon!
Gradle 3.0: Unleash the Daemon!
 
Using React with Grails 3
Using React with Grails 3Using React with Grails 3
Using React with Grails 3
 

Similar to "Xapi-lang For declarative code generation" By James Nelson

Php on the Web and Desktop
Php on the Web and DesktopPhp on the Web and Desktop
Php on the Web and DesktopElizabeth Smith
 
Bring the fun back to java
Bring the fun back to javaBring the fun back to java
Bring the fun back to javaciklum_ods
 
Java - A broad introduction
Java - A broad introductionJava - A broad introduction
Java - A broad introductionBirol Efe
 
Javascript as a target language - GWT KickOff - Part 2/2
Javascript as a target language - GWT KickOff - Part 2/2Javascript as a target language - GWT KickOff - Part 2/2
Javascript as a target language - GWT KickOff - Part 2/2JooinK
 
Going to Mars with Groovy Domain-Specific Languages
Going to Mars with Groovy Domain-Specific LanguagesGoing to Mars with Groovy Domain-Specific Languages
Going to Mars with Groovy Domain-Specific LanguagesGuillaume Laforge
 
GQuery a jQuery clone for Gwt, RivieraDev 2011
GQuery a jQuery clone for Gwt, RivieraDev 2011GQuery a jQuery clone for Gwt, RivieraDev 2011
GQuery a jQuery clone for Gwt, RivieraDev 2011Manuel Carrasco Moñino
 
Angular JS in 2017
Angular JS in 2017Angular JS in 2017
Angular JS in 2017Ayush Sharma
 
WebNet Conference 2012 - Designing complex applications using html5 and knock...
WebNet Conference 2012 - Designing complex applications using html5 and knock...WebNet Conference 2012 - Designing complex applications using html5 and knock...
WebNet Conference 2012 - Designing complex applications using html5 and knock...Fabio Franzini
 
MobileConf 2021 Slides: Let's build macOS CLI Utilities using Swift
MobileConf 2021 Slides:  Let's build macOS CLI Utilities using SwiftMobileConf 2021 Slides:  Let's build macOS CLI Utilities using Swift
MobileConf 2021 Slides: Let's build macOS CLI Utilities using SwiftDiego Freniche Brito
 
Xopus Application Framework
Xopus Application FrameworkXopus Application Framework
Xopus Application FrameworkJady Yang
 
SF JUG - GWT Can Help You Create Amazing Apps - 2009-10-13
SF JUG - GWT Can Help You Create Amazing Apps - 2009-10-13SF JUG - GWT Can Help You Create Amazing Apps - 2009-10-13
SF JUG - GWT Can Help You Create Amazing Apps - 2009-10-13Fred Sauer
 
JavaScript Miller Columns
JavaScript Miller ColumnsJavaScript Miller Columns
JavaScript Miller ColumnsJonathan Fine
 
Cannibalising The Google App Engine
Cannibalising The  Google  App  EngineCannibalising The  Google  App  Engine
Cannibalising The Google App Enginecatherinewall
 
Smoothing Your Java with DSLs
Smoothing Your Java with DSLsSmoothing Your Java with DSLs
Smoothing Your Java with DSLsintelliyole
 
TypeScript - Silver Bullet for the Full-stack Developers
TypeScript - Silver Bullet for the Full-stack DevelopersTypeScript - Silver Bullet for the Full-stack Developers
TypeScript - Silver Bullet for the Full-stack DevelopersRutenis Turcinas
 
A intro to (hosted) Shiny Apps
A intro to (hosted) Shiny AppsA intro to (hosted) Shiny Apps
A intro to (hosted) Shiny AppsDaniel Koller
 
Groovy Update - JavaPolis 2007
Groovy Update - JavaPolis 2007Groovy Update - JavaPolis 2007
Groovy Update - JavaPolis 2007Guillaume Laforge
 

Similar to "Xapi-lang For declarative code generation" By James Nelson (20)

Php on the Web and Desktop
Php on the Web and DesktopPhp on the Web and Desktop
Php on the Web and Desktop
 
Bring the fun back to java
Bring the fun back to javaBring the fun back to java
Bring the fun back to java
 
Java - A broad introduction
Java - A broad introductionJava - A broad introduction
Java - A broad introduction
 
Javascript as a target language - GWT KickOff - Part 2/2
Javascript as a target language - GWT KickOff - Part 2/2Javascript as a target language - GWT KickOff - Part 2/2
Javascript as a target language - GWT KickOff - Part 2/2
 
Going to Mars with Groovy Domain-Specific Languages
Going to Mars with Groovy Domain-Specific LanguagesGoing to Mars with Groovy Domain-Specific Languages
Going to Mars with Groovy Domain-Specific Languages
 
GQuery a jQuery clone for Gwt, RivieraDev 2011
GQuery a jQuery clone for Gwt, RivieraDev 2011GQuery a jQuery clone for Gwt, RivieraDev 2011
GQuery a jQuery clone for Gwt, RivieraDev 2011
 
Angular JS in 2017
Angular JS in 2017Angular JS in 2017
Angular JS in 2017
 
WebNet Conference 2012 - Designing complex applications using html5 and knock...
WebNet Conference 2012 - Designing complex applications using html5 and knock...WebNet Conference 2012 - Designing complex applications using html5 and knock...
WebNet Conference 2012 - Designing complex applications using html5 and knock...
 
MobileConf 2021 Slides: Let's build macOS CLI Utilities using Swift
MobileConf 2021 Slides:  Let's build macOS CLI Utilities using SwiftMobileConf 2021 Slides:  Let's build macOS CLI Utilities using Swift
MobileConf 2021 Slides: Let's build macOS CLI Utilities using Swift
 
Xopus Application Framework
Xopus Application FrameworkXopus Application Framework
Xopus Application Framework
 
Javascript Best Practices
Javascript Best PracticesJavascript Best Practices
Javascript Best Practices
 
SF JUG - GWT Can Help You Create Amazing Apps - 2009-10-13
SF JUG - GWT Can Help You Create Amazing Apps - 2009-10-13SF JUG - GWT Can Help You Create Amazing Apps - 2009-10-13
SF JUG - GWT Can Help You Create Amazing Apps - 2009-10-13
 
JavaScript Miller Columns
JavaScript Miller ColumnsJavaScript Miller Columns
JavaScript Miller Columns
 
Cannibalising The Google App Engine
Cannibalising The  Google  App  EngineCannibalising The  Google  App  Engine
Cannibalising The Google App Engine
 
Smoothing Your Java with DSLs
Smoothing Your Java with DSLsSmoothing Your Java with DSLs
Smoothing Your Java with DSLs
 
TypeScript - Silver Bullet for the Full-stack Developers
TypeScript - Silver Bullet for the Full-stack DevelopersTypeScript - Silver Bullet for the Full-stack Developers
TypeScript - Silver Bullet for the Full-stack Developers
 
API Design
API DesignAPI Design
API Design
 
A intro to (hosted) Shiny Apps
A intro to (hosted) Shiny AppsA intro to (hosted) Shiny Apps
A intro to (hosted) Shiny Apps
 
DSLs in JavaScript
DSLs in JavaScriptDSLs in JavaScript
DSLs in JavaScript
 
Groovy Update - JavaPolis 2007
Groovy Update - JavaPolis 2007Groovy Update - JavaPolis 2007
Groovy Update - JavaPolis 2007
 

More from GWTcon

"Jclays, A global solution for application design and automatic GWT code gene...
"Jclays, A global solution for application design and automatic GWT code gene..."Jclays, A global solution for application design and automatic GWT code gene...
"Jclays, A global solution for application design and automatic GWT code gene...GWTcon
 
In defense of GWT-RPC By Colin Alworth
In defense of GWT-RPC By Colin AlworthIn defense of GWT-RPC By Colin Alworth
In defense of GWT-RPC By Colin AlworthGWTcon
 
DIY: Split GWT Applications using TURDUCKEN approach By Alberto Mancini
DIY: Split GWT Applications using TURDUCKEN approach By Alberto ManciniDIY: Split GWT Applications using TURDUCKEN approach By Alberto Mancini
DIY: Split GWT Applications using TURDUCKEN approach By Alberto ManciniGWTcon
 
Unirex Lean tools By Dario Carotenuto
Unirex Lean tools By Dario CarotenutoUnirex Lean tools By Dario Carotenuto
Unirex Lean tools By Dario CarotenutoGWTcon
 
The future of GWT 2.x - By Colin Alworth
The future of GWT 2.x - By Colin AlworthThe future of GWT 2.x - By Colin Alworth
The future of GWT 2.x - By Colin AlworthGWTcon
 
Web components with java by Haijian Wang
Web components with java by Haijian WangWeb components with java by Haijian Wang
Web components with java by Haijian WangGWTcon
 
UI Framework Development using GWT and HTML Canvas - By Iarosla Kobyliukh
UI Framework Development using GWT and HTML Canvas - By Iarosla KobyliukhUI Framework Development using GWT and HTML Canvas - By Iarosla Kobyliukh
UI Framework Development using GWT and HTML Canvas - By Iarosla KobyliukhGWTcon
 
Best Practices - By Lofi Dewanto
Best Practices - By Lofi DewantoBest Practices - By Lofi Dewanto
Best Practices - By Lofi DewantoGWTcon
 
"Migrate large gwt applications - Lessons Learned" By Harald Pehl
"Migrate large gwt applications - Lessons Learned" By Harald Pehl"Migrate large gwt applications - Lessons Learned" By Harald Pehl
"Migrate large gwt applications - Lessons Learned" By Harald PehlGWTcon
 
GWT Development for Handheld Devices
GWT Development for Handheld DevicesGWT Development for Handheld Devices
GWT Development for Handheld DevicesGWTcon
 
GWT vs CSS3
GWT vs CSS3GWT vs CSS3
GWT vs CSS3GWTcon
 
WebTram: una WebApp GWT per l'editing di dati cartografici e topologici di un...
WebTram: una WebApp GWT per l'editing di dati cartografici e topologici di un...WebTram: una WebApp GWT per l'editing di dati cartografici e topologici di un...
WebTram: una WebApp GWT per l'editing di dati cartografici e topologici di un...GWTcon
 
GWT Web Socket and data serialization
GWT Web Socket and data serializationGWT Web Socket and data serialization
GWT Web Socket and data serializationGWTcon
 
GWTcon 2014 - Apertura
GWTcon 2014 - AperturaGWTcon 2014 - Apertura
GWTcon 2014 - AperturaGWTcon
 
GWT videocall: power-up your mobile & web app with WebRTC
GWT videocall:  power-up your mobile & web app with WebRTCGWT videocall:  power-up your mobile & web app with WebRTC
GWT videocall: power-up your mobile & web app with WebRTCGWTcon
 

More from GWTcon (15)

"Jclays, A global solution for application design and automatic GWT code gene...
"Jclays, A global solution for application design and automatic GWT code gene..."Jclays, A global solution for application design and automatic GWT code gene...
"Jclays, A global solution for application design and automatic GWT code gene...
 
In defense of GWT-RPC By Colin Alworth
In defense of GWT-RPC By Colin AlworthIn defense of GWT-RPC By Colin Alworth
In defense of GWT-RPC By Colin Alworth
 
DIY: Split GWT Applications using TURDUCKEN approach By Alberto Mancini
DIY: Split GWT Applications using TURDUCKEN approach By Alberto ManciniDIY: Split GWT Applications using TURDUCKEN approach By Alberto Mancini
DIY: Split GWT Applications using TURDUCKEN approach By Alberto Mancini
 
Unirex Lean tools By Dario Carotenuto
Unirex Lean tools By Dario CarotenutoUnirex Lean tools By Dario Carotenuto
Unirex Lean tools By Dario Carotenuto
 
The future of GWT 2.x - By Colin Alworth
The future of GWT 2.x - By Colin AlworthThe future of GWT 2.x - By Colin Alworth
The future of GWT 2.x - By Colin Alworth
 
Web components with java by Haijian Wang
Web components with java by Haijian WangWeb components with java by Haijian Wang
Web components with java by Haijian Wang
 
UI Framework Development using GWT and HTML Canvas - By Iarosla Kobyliukh
UI Framework Development using GWT and HTML Canvas - By Iarosla KobyliukhUI Framework Development using GWT and HTML Canvas - By Iarosla Kobyliukh
UI Framework Development using GWT and HTML Canvas - By Iarosla Kobyliukh
 
Best Practices - By Lofi Dewanto
Best Practices - By Lofi DewantoBest Practices - By Lofi Dewanto
Best Practices - By Lofi Dewanto
 
"Migrate large gwt applications - Lessons Learned" By Harald Pehl
"Migrate large gwt applications - Lessons Learned" By Harald Pehl"Migrate large gwt applications - Lessons Learned" By Harald Pehl
"Migrate large gwt applications - Lessons Learned" By Harald Pehl
 
GWT Development for Handheld Devices
GWT Development for Handheld DevicesGWT Development for Handheld Devices
GWT Development for Handheld Devices
 
GWT vs CSS3
GWT vs CSS3GWT vs CSS3
GWT vs CSS3
 
WebTram: una WebApp GWT per l'editing di dati cartografici e topologici di un...
WebTram: una WebApp GWT per l'editing di dati cartografici e topologici di un...WebTram: una WebApp GWT per l'editing di dati cartografici e topologici di un...
WebTram: una WebApp GWT per l'editing di dati cartografici e topologici di un...
 
GWT Web Socket and data serialization
GWT Web Socket and data serializationGWT Web Socket and data serialization
GWT Web Socket and data serialization
 
GWTcon 2014 - Apertura
GWTcon 2014 - AperturaGWTcon 2014 - Apertura
GWTcon 2014 - Apertura
 
GWT videocall: power-up your mobile & web app with WebRTC
GWT videocall:  power-up your mobile & web app with WebRTCGWT videocall:  power-up your mobile & web app with WebRTC
GWT videocall: power-up your mobile & web app with WebRTC
 

Recently uploaded

21ST CENTURY LITERACY FROM TRADITIONAL TO MODERN
21ST CENTURY LITERACY FROM TRADITIONAL TO MODERN21ST CENTURY LITERACY FROM TRADITIONAL TO MODERN
21ST CENTURY LITERACY FROM TRADITIONAL TO MODERNRonnelBaroc
 
Enhancing Productivity and Insight A Tour of JDK Tools Progress Beyond Java 17
Enhancing Productivity and Insight  A Tour of JDK Tools Progress Beyond Java 17Enhancing Productivity and Insight  A Tour of JDK Tools Progress Beyond Java 17
Enhancing Productivity and Insight A Tour of JDK Tools Progress Beyond Java 17Ana-Maria Mihalceanu
 
Power of 2024 - WITforce Odyssey.pptx.pdf
Power of 2024 - WITforce Odyssey.pptx.pdfPower of 2024 - WITforce Odyssey.pptx.pdf
Power of 2024 - WITforce Odyssey.pptx.pdfkatalinjordans1
 
Introduction to Multimodal LLMs with LLaVA
Introduction to Multimodal LLMs with LLaVAIntroduction to Multimodal LLMs with LLaVA
Introduction to Multimodal LLMs with LLaVARobert McDermott
 
Introduction to Serverless with AWS Lambda in C#.pptx
Introduction to Serverless with AWS Lambda in C#.pptxIntroduction to Serverless with AWS Lambda in C#.pptx
Introduction to Serverless with AWS Lambda in C#.pptxBrandon Minnick, MBA
 
Manual Eurotronic Thermostatic Valve Comry Z-Wave
Manual Eurotronic Thermostatic Valve Comry Z-WaveManual Eurotronic Thermostatic Valve Comry Z-Wave
Manual Eurotronic Thermostatic Valve Comry Z-WaveDomotica daVinci
 
Heltun_HE-RS01_User_Manual_B9AH.pdf
Heltun_HE-RS01_User_Manual_B9AH.pdfHeltun_HE-RS01_User_Manual_B9AH.pdf
Heltun_HE-RS01_User_Manual_B9AH.pdfMarielaL5
 
"Running Open-Source LLM models on Kubernetes", Volodymyr Tsap
"Running Open-Source LLM models on Kubernetes",  Volodymyr Tsap"Running Open-Source LLM models on Kubernetes",  Volodymyr Tsap
"Running Open-Source LLM models on Kubernetes", Volodymyr TsapFwdays
 
Manual sensor Zigbee 3.0 MOES ZSS-X-PIRL-C
Manual  sensor Zigbee 3.0 MOES ZSS-X-PIRL-CManual  sensor Zigbee 3.0 MOES ZSS-X-PIRL-C
Manual sensor Zigbee 3.0 MOES ZSS-X-PIRL-CDomotica daVinci
 
Dynamical systems simulation in Python for science and engineering
Dynamical systems simulation in Python for science and engineeringDynamical systems simulation in Python for science and engineering
Dynamical systems simulation in Python for science and engineeringMassimo Talia
 
Enhancing SaaS Performance: A Hands-on Workshop for Partners
Enhancing SaaS Performance: A Hands-on Workshop for PartnersEnhancing SaaS Performance: A Hands-on Workshop for Partners
Enhancing SaaS Performance: A Hands-on Workshop for PartnersThousandEyes
 
5 Things You Shouldn’t Do at Salesforce World Tour Sydney 2024!
5 Things You Shouldn’t Do at Salesforce World Tour Sydney 2024!5 Things You Shouldn’t Do at Salesforce World Tour Sydney 2024!
5 Things You Shouldn’t Do at Salesforce World Tour Sydney 2024!XfilesPro
 
LLMs, LMMs, their Improvement Suggestions and the Path towards AGI.pdf
LLMs, LMMs, their Improvement Suggestions and the Path towards AGI.pdfLLMs, LMMs, their Improvement Suggestions and the Path towards AGI.pdf
LLMs, LMMs, their Improvement Suggestions and the Path towards AGI.pdfThomas Poetter
 
Z-Wave Fan coil Thermostat Heltun_HE-HT01_User_Manual.pdf
Z-Wave Fan coil Thermostat Heltun_HE-HT01_User_Manual.pdfZ-Wave Fan coil Thermostat Heltun_HE-HT01_User_Manual.pdf
Z-Wave Fan coil Thermostat Heltun_HE-HT01_User_Manual.pdfDomotica daVinci
 
My sample product research idea for you!
My sample product research idea for you!My sample product research idea for you!
My sample product research idea for you!KivenRaySarsaba
 
Bringing nullability into existing code - dammit is not the answer.pptx
Bringing nullability into existing code - dammit is not the answer.pptxBringing nullability into existing code - dammit is not the answer.pptx
Bringing nullability into existing code - dammit is not the answer.pptxMaarten Balliauw
 
Revolutionizing The Banking Industry: The Monzo Way
Revolutionizing The Banking Industry: The Monzo WayRevolutionizing The Banking Industry: The Monzo Way
Revolutionizing The Banking Industry: The Monzo WayProduct School
 
Artificial-Intelligence-in-Marketing-Data.pdf
Artificial-Intelligence-in-Marketing-Data.pdfArtificial-Intelligence-in-Marketing-Data.pdf
Artificial-Intelligence-in-Marketing-Data.pdfIsidro Navarro
 
zigbee motion sensor user manual NAS-PD07B2.pdf
zigbee motion sensor user manual NAS-PD07B2.pdfzigbee motion sensor user manual NAS-PD07B2.pdf
zigbee motion sensor user manual NAS-PD07B2.pdfDomotica daVinci
 
Synergy in Leadership and Product Excellence: A Blueprint for Growth
Synergy in Leadership and Product Excellence: A Blueprint for GrowthSynergy in Leadership and Product Excellence: A Blueprint for Growth
Synergy in Leadership and Product Excellence: A Blueprint for GrowthProduct School
 

Recently uploaded (20)

21ST CENTURY LITERACY FROM TRADITIONAL TO MODERN
21ST CENTURY LITERACY FROM TRADITIONAL TO MODERN21ST CENTURY LITERACY FROM TRADITIONAL TO MODERN
21ST CENTURY LITERACY FROM TRADITIONAL TO MODERN
 
Enhancing Productivity and Insight A Tour of JDK Tools Progress Beyond Java 17
Enhancing Productivity and Insight  A Tour of JDK Tools Progress Beyond Java 17Enhancing Productivity and Insight  A Tour of JDK Tools Progress Beyond Java 17
Enhancing Productivity and Insight A Tour of JDK Tools Progress Beyond Java 17
 
Power of 2024 - WITforce Odyssey.pptx.pdf
Power of 2024 - WITforce Odyssey.pptx.pdfPower of 2024 - WITforce Odyssey.pptx.pdf
Power of 2024 - WITforce Odyssey.pptx.pdf
 
Introduction to Multimodal LLMs with LLaVA
Introduction to Multimodal LLMs with LLaVAIntroduction to Multimodal LLMs with LLaVA
Introduction to Multimodal LLMs with LLaVA
 
Introduction to Serverless with AWS Lambda in C#.pptx
Introduction to Serverless with AWS Lambda in C#.pptxIntroduction to Serverless with AWS Lambda in C#.pptx
Introduction to Serverless with AWS Lambda in C#.pptx
 
Manual Eurotronic Thermostatic Valve Comry Z-Wave
Manual Eurotronic Thermostatic Valve Comry Z-WaveManual Eurotronic Thermostatic Valve Comry Z-Wave
Manual Eurotronic Thermostatic Valve Comry Z-Wave
 
Heltun_HE-RS01_User_Manual_B9AH.pdf
Heltun_HE-RS01_User_Manual_B9AH.pdfHeltun_HE-RS01_User_Manual_B9AH.pdf
Heltun_HE-RS01_User_Manual_B9AH.pdf
 
"Running Open-Source LLM models on Kubernetes", Volodymyr Tsap
"Running Open-Source LLM models on Kubernetes",  Volodymyr Tsap"Running Open-Source LLM models on Kubernetes",  Volodymyr Tsap
"Running Open-Source LLM models on Kubernetes", Volodymyr Tsap
 
Manual sensor Zigbee 3.0 MOES ZSS-X-PIRL-C
Manual  sensor Zigbee 3.0 MOES ZSS-X-PIRL-CManual  sensor Zigbee 3.0 MOES ZSS-X-PIRL-C
Manual sensor Zigbee 3.0 MOES ZSS-X-PIRL-C
 
Dynamical systems simulation in Python for science and engineering
Dynamical systems simulation in Python for science and engineeringDynamical systems simulation in Python for science and engineering
Dynamical systems simulation in Python for science and engineering
 
Enhancing SaaS Performance: A Hands-on Workshop for Partners
Enhancing SaaS Performance: A Hands-on Workshop for PartnersEnhancing SaaS Performance: A Hands-on Workshop for Partners
Enhancing SaaS Performance: A Hands-on Workshop for Partners
 
5 Things You Shouldn’t Do at Salesforce World Tour Sydney 2024!
5 Things You Shouldn’t Do at Salesforce World Tour Sydney 2024!5 Things You Shouldn’t Do at Salesforce World Tour Sydney 2024!
5 Things You Shouldn’t Do at Salesforce World Tour Sydney 2024!
 
LLMs, LMMs, their Improvement Suggestions and the Path towards AGI.pdf
LLMs, LMMs, their Improvement Suggestions and the Path towards AGI.pdfLLMs, LMMs, their Improvement Suggestions and the Path towards AGI.pdf
LLMs, LMMs, their Improvement Suggestions and the Path towards AGI.pdf
 
Z-Wave Fan coil Thermostat Heltun_HE-HT01_User_Manual.pdf
Z-Wave Fan coil Thermostat Heltun_HE-HT01_User_Manual.pdfZ-Wave Fan coil Thermostat Heltun_HE-HT01_User_Manual.pdf
Z-Wave Fan coil Thermostat Heltun_HE-HT01_User_Manual.pdf
 
My sample product research idea for you!
My sample product research idea for you!My sample product research idea for you!
My sample product research idea for you!
 
Bringing nullability into existing code - dammit is not the answer.pptx
Bringing nullability into existing code - dammit is not the answer.pptxBringing nullability into existing code - dammit is not the answer.pptx
Bringing nullability into existing code - dammit is not the answer.pptx
 
Revolutionizing The Banking Industry: The Monzo Way
Revolutionizing The Banking Industry: The Monzo WayRevolutionizing The Banking Industry: The Monzo Way
Revolutionizing The Banking Industry: The Monzo Way
 
Artificial-Intelligence-in-Marketing-Data.pdf
Artificial-Intelligence-in-Marketing-Data.pdfArtificial-Intelligence-in-Marketing-Data.pdf
Artificial-Intelligence-in-Marketing-Data.pdf
 
zigbee motion sensor user manual NAS-PD07B2.pdf
zigbee motion sensor user manual NAS-PD07B2.pdfzigbee motion sensor user manual NAS-PD07B2.pdf
zigbee motion sensor user manual NAS-PD07B2.pdf
 
Synergy in Leadership and Product Excellence: A Blueprint for Growth
Synergy in Leadership and Product Excellence: A Blueprint for GrowthSynergy in Leadership and Product Excellence: A Blueprint for Growth
Synergy in Leadership and Product Excellence: A Blueprint for Growth
 

"Xapi-lang For declarative code generation" By James Nelson

  • 1. Xapi-lang For Declarative Code Generation James Nelson Vertispan.com WeTheInter.net (wti.net)
  • 2. Game Plan ● Why I (still) choose GWT ● Code generation, deferred binding & J2CL ● What is Xapi? ● What is Xapi-lang? ● What can I do with Xapi-lang? ● Code generation Best Practices ● Gwt 3 and beyond ● Shameless plug ● Q & A ● Save the world and get rich doing it :-)
  • 3. Why I chose GWT ● The state of the web in 2007 ● Javascript sucked ● IE6 sucked ● Code generators! ● Transpilers! ● Optimizing Compilation! ● Type safety! ● Java Tools!
  • 4. Why I still choose GWT ● Plays nicely with Javascript ● Plays nicely with Android and IOS * ● Code generators! ● Transpilers! ● Optimizing Compilation! ● Type safety! ● Java Tools! ● Mature, well tested framework * Java can target web, mobile, desktop and server
  • 5. Codegen, Deferred Binding & J2CL ● Code generation, like alcohol, is good in moderation (Alex Lowe) ● GWT is the first (only?) web framework with compile- time code generation ● Automate away boilerplate ● More declarative, less typos ● Express intent with annotations and interfaces ● Why do at runtime what you can do at compile time? ● Going away in J2CL :-(
  • 6. Codegen, Deferred Binding & J2CL ● Why is it called deferred binding? – In the expression level “JJS AST”, GWT.create() calls are converted to nodes which contain an expression for each permutation, to be distilled into distinct permutations (unless you have collapsed permutations) ● Enables you to inject “magic” at compile time – While purists prefer to avoid magic, sometimes the best practical solution is to hide your complexity in the compiler instead of polluting your runtime or requiring repetitive copy-pasta “solutions”. ● Major selling point in the days of extreme browser fragmentation ● Going away in J2CL :-(
  • 7. Codegen, Deferred Binding & J2CL ● J2CL only handles translating .java into .java.js ● Any and all code generation, browser quirks or magic must exist outside of the J2CL compiler ● Any and all solutions that work for J2CL will also work for GWT 2.X ● Contrary to some popular philosophy, I believe we need more and better magic in our toolchain ● For existing applications to upgrade to GWT 3, we need working solutions for the magic we depend on – It is far easier to say “just don’t do it” than it is to undo “it”
  • 8. What is Xapi? ● Stands for “Extremely Extensible Cross Platform API” ● Acts like deferred binding for the entire java ecosystem ● Highly modularized “kitchen sink” of tools ● Services that run in Gwt, Javafx, servers and Android (IOS support when time is found for J2ObjC) ● Contains a vast array of code generation and build tools ● Uses a custom fork of GWT that has support for java reflection and “magic method injection” – GWT.create() is the only “stock” magic method – Xapi lets you define your own magic methods ● WARNING: The current version is a prototype!
  • 9. What is Xapi-lang? ● Java parser enhanced with new expression structure – Forked from http://github.com/javaparser/javaparser ● <xml-like syntax=supported() /> ● { json-like: syntax(), supported: [ true ] } ● .css-like { syntax: supported(); } ● `template strings? Oh ya, supported too!` ● Any expression can contain valid java, but java can only contain `template strings`
  • 10. Xapi-lang: Under the hood ● Xapi-lang is not executable (no interpreter) ● Parses your document into an Abstract Syntax Tree, representing the structure of your code ● You apply various visitors to analyze the AST, and produce meaningful output ● Can be used for templating, code generation, or creating a “Domain Specific Dialect” – While the language itself allows you to mix and match xml, json, css and java, your AST consumer can permit only specific structures (like various xml tag names or attributes that are only allowed in certain tags).
  • 11. Xapi-lang Use Case: Class Templating // you can supply replacements for any $name package $myPackage; import the.good.Stuff; public class $MyClass implements Stuff { public void doStuff(@NonNull String s) { // you can also create “magic methods”, // which are called, with parsed arguments, at build time // and can return one or more expressions to add to the source System.out.println($compilerMagicGoesHere(s)); } }
  • 12. Xapi-lang Use Case: Class Templating Expression $compilerMagicGoesHere(Expression argument) { boolean notNull = argument.hasAnnotation(“NotNull”); if (notNull) { return new BinaryExpr(argument, StringLiteralExpr.of(“ is not null”), Operator.plus); } else { return new ConditionalExpr( new BinaryExpr(argument, NullLiteralExpr.NULL, Operator.equals), StringLiteralExpr.of(“argument is null”), new BinaryExpr(argument, StringLiteralExpr.of(“ is not null”), Operator.plus) ); } } new ApiGenerator(“MyTemplate.xapi”) .generateWith(“myPackage”, “com.foo”, “MyClass”, “Classname”);
  • 13. Xapi-lang Use Case: Class Templating // you can supply replacements for any $name package com.foo; import the.good.Stuff; public class Classname implements Stuff { public void doStuff(@NonNull String s) { // you can also create “magic methods”, // which are called, with parsed arguments, at build time // and can return one or more expressions to add to the source System.out.println(s + “ is not null”); } }
  • 14. Xapi-lang Use Case: API Generator <generateInterface var = { size : 5, typeParams : $range(1, $size, $i->`In$i`), } template = public interface Function$size <$typeParams, Out> { @unfold(from = 1, to = $size, var = i) Out apply(In$i ... in$i); @unfold(from = 1, to = $size, var = i) @var( name = mapParams, value = $range(1, $size, $p -> $p == $i ? To : `In$p`) ) @var( name = lambdaParams, value = $range(1, $size, $p -> in$p ) ) default <To> Function$size<$mapParams, Out> map$i(Function1<In$i, To> mapper){ return ( $lambdaParams ) -> apply( range(1, $size, $a -> $a == $n ? mapper.apply(in$a) : in$a ) ); } } />
  • 15. Xapi-lang Use Case: API Generator public interface Function1<In1, Out> { Out apply(In1 in1); default <To> Function1<To, Out> map1(Function1<In1, To> mapper){ return ( in1 ) -> apply( mapper.apply(in1) ) ); } } public interface Function2<In1, In2, Out> { Out apply(In1 in1, In2 in2); default <To> Function2<To, In2, Out> map1(Function1<In1, To> mapper){ return ( in1, in2 ) -> apply( mapper.apply(in1), in2 ) ); } default <To> Function2<In1, To, Out> map2(Function1<In2, To> mapper){ return ( in1, in2 ) -> apply( in1, mapper.apply(in2) ) ); } }
  • 16. Xapi-lang Use Case: Ui Generation <define-tag name = “my-input” model = { value: String, placeholder: @Nullable String, label: @Nullable String, } ui = <box> <if notNull=$model::label whenTrue = <label>$model::label</label> /if> <native-element gwt=<input value=$model::value placeholder=$model::placeholder /input> javafx=<javafx.scene.text.Text … /> /native-element> </box> /define-tag>
  • 17. Xapi-lang Use Case: Ui Generation public interface MyInputModel extends Model { String getValue(); void setValue(String value); String getPlaceholder(); void setPlaceholder(String placeholder); String getLabel(); void setLabel(String label); } public abstract class MyInputBase <Element> extends IsModelComponent <Element, MyInputModel> { void render(DomBuffer dom) { DomBuffer box = dom.makeTag(“box”); MyInputModel model = getModel(); if ( model.getLabel() != null ) { box.makeTag(“label”) .append(model.getLabel()); } appendNativeElement0(box); } protected abstract void appendNativeElement0(DomBuffer dom); } public class MyInputGwt extends MyInputBase <elemental2.dom.Element> { protected void appendNativeElement0(DomBuffer dom) { MyInputModel model = getModel(); dom.makeTag(“input”) .setAttribute(“placeholder”, model.getPlaceholder()) .setAttribute(“value”, model.getValue()); } }
  • 18. Xapi-lang Use Case: Ui Binding ● Not actually implemented, but certainly possible ● Use apt, asm, javassist, reflection or xapi to read @Ui annotations ● Visit xml using xapi to identify nodes to bind ● Generate html with a means to perform node replacement – Xapi has a PotentialNode class which lets you build html and add callbacks to elements that have not been created yet ● Performs code generation outside of Gwt toolchain – Less work during compile – Leverages incremental compilation – Actually readable for your debugging pleasure
  • 19. Code Generation Best Practices ● Code generation, like alcohol, is best in moderation (Alex Lowe) ● Do not pound in nails with a sledgehammer ● Most problems that can be solved by code generation should not be solved by code generation (especially when you are on the clock!) – Dynamic, repetitive or very complex code is better to generate ● If you are generating any methods that are not dynamic, you should probably refactor them out of your generator ● When generating code, the last thing to write is the generator – Start by writing your input template (unless your generator is reading artifacts produced elsewhere) – Next, write at least three implementations by hand – Then, write tests for your manual implementations – Finally, write a generator to produce the output that passes tests
  • 20. GWT 3 and Beyond ● Before we can even think of releasing GWT 3, we need to rebuild the GWT toolchain on top of J2CL ● Code generators, linkers and deferred binding support most of the (good) stuff in gwt-user. ● We, the community, must rebuild these tools using standard java tooling, and then apply J2CL at the end of our build ● Xapi has prototypes of many tools we will need to do this job – Apt / Javac compiler plugins – Code generators tools – Xapi-lang – “Deferred binding for Java” (X_Inject) – Both Gwtc and Javac compiler services (much easier to debug compilers from IDE when you don’t need remote process debugging) – Useful abstractions to build opinionated implementations that downstream users can replace with their own version if they don’t like ours
  • 21. Shameless Plug ● Colin Alworth, Justin Hickman and myself are launching a new company called Vertispan ● We are selling support contracts for the Gwt ecosystem (you can buy N hours per month for us to help you fix your problems) ● We are selling consulting services to write code for you (yes, we do charge more to work on your proprietary codebase) ● We are going to support GWT 2.X and migration to GWT 3 ● If you have a bug in GWT itself, you now have the option to pay to get it fixed (we want to fix everything, but time is limited!) – In most cases, all fixes will be shared with the community – If you need a crazy hack and are willing to accept that responsibility, we will push jars to a private repo for you ● When we find the time, we also want to build a new GWT framework – Colin and Justin have both been lead GXT developers
  • 22. Q & A Ask me anything Come chat @ http://gitter.im/gwtproject/gwt Tell your friends!
  • 23. Save The World, And Get Rich Doing It ● You thought I was joking, didn’t you? ● Xapi is not just a fun project for evenings and weekends ● We The Internet, the other company on my cover slide, is a project to build tools to fix our political system – Currently a private prototype that still isn’t ready for public – Includes a structured markup language for developing complex ideas that can still be presented concisely – Will use a git-like model for users to collaborate on ideas – Will include tools for voting and debating on ideas – Will include tools to draft and vote on laws – The final form is meant to be an implementation of distributed, real-time direct democracy (spread power too thin to be abused) ● The project, once launched, will distribute most of its profits to users – People with great ideas to fix the world should get paid to work on it – Everyone else can support those leaders by using the site – Will use in-app purchases, but must be “Free to Win” (not “Pay to Win”) ● If you want to be a beta tester, please email James@WeTheInter.net