SlideShare a Scribd company logo
1 of 67
Download to read offline
What's new with JavaScript in GNOME
The 2020 edition
Philip Chimento •  pchimento •   ptomato •  @therealptomato
GUADEC Online, July 25, 2020
Introduction: What we will talk about
Same thing we talk about every year!
What's new in GJS?
Including a bit about a lesser-known corner: Intl
What's next in GJS?
We need some help! Here's what you can do
Introduction
🗣 Shout-outs are a thank-you to someone who contributed a feature
Presentation is full of links if you want to click through later
If you want to follow along: ptomato.name/guadec2020
What's new in JavaScript land for
GNOME 3.36 and 3.38?
Developer experience
gjs-docs is now way easier to maintain and contribute to 🗣 Meg Ford
Documentation added for GNOME Shell internals 🗣 Andy Holmes
Crash fixes
It shouldn't be possible to crash GNOME Shell
just by writing JS code.
Crash fixes
9 crashing bugs still open
6 fixed, 5 new since last GUADEC
Improvements to type safety 🗣 Marco Trevisan
Performance fixes
Looking up properties that may come from C:
e.g. myWindow.present()
Don't look up myWindow.customProperty
Negative lookup cache 🗣 Daniel Van Vugt
Performance fixes
Calling C functions
Translating arguments is slow
e.g. void gtk_c_func(int arg1, double arg2) →
Gtk.c_func(number, number)
Argument cache 🗣 Giovanni Campagna
GObject properties
Adding GObject properties to your class was always really verbose
Easy to do notifications incorrectly, for example
Now you can leave out the boring part:
// Just delete all this!
get my_property() {
return this._myProperty;
}
set my_property(value) {
if (this._myProperty === value)
return;
this._myProperty = value;
this.notify('my-property');
}
New edition of JS language
JavaScript is gaining features every year
No longer the language that everyone loved to hate
Which of these new features can you use in GJS?
New JS language features in 3.36
String.trimStart() , String.trimEnd()
String.matchAll()
Array.flat()
Array.flatMap()
Object.fromEntries()
globalThis
BigInt , BigInt64Array , BigUint64Array
String generics removed
New Intl features
String generics removed
Nonstandard way of calling String
methods on a non-string object
Use moz68tool to scan your code
for them
Don't use array generics either,
Mozilla will remove them soon
let num = 15;
String.endsWith(num, 5);
String.prototype.endsWith.call(num, 5);
String(num).endsWith(5);
`${num}`.endsWith(5);
// ⇒ true
New Intl features
Intl.RelativeTimeFormat
Useful for user interfaces
rtf = new Intl.RelativeTimeFormat('en',
{style: 'narrow'})
rtf.format(-1, 'day')
// ⇒ "1 day ago"
rtf = new Intl.RelativeTimeFormat('es',
{numeric: 'auto'})
rtf.format(2, 'day')
// ⇒ "pasado mañana"
A small digression about Intl
Intl
A global object
Does internationalization stuff for you
Some things awkward to do with gettext . Intl makes them easy
Some things gettext does well. Intl mostly doesn't do those
Intl
Intl.Collator - locale-sensitive sorting
Intl.DateTimeFormat - printing dates and times ( "Fri Jul 17" )
Intl.NumberFormat - printing numbers ( "€ 0,00" )
Intl.RelativeTimeFormat - printing relative times ( "3 days ago" )
More in future editions of JS!
Why you should use Intl
/* Translators: this is the month name and day number
followed by a time string in 24h format.
i.e. "May 25, 14:30" */
format = N_("%B %-d, %Hu2236%M");
How does the translator know what to put there for their locale?
“Well why don't they just read the
manual for strftime?”
Why you should use Intl
#. Translators: this is the month name and day number
#. followed by a time string in 24h format.
#. i.e. "May 25, 14:30"
#: js/misc/util.js:255
#, no-c-format
msgid "%B %-d, %H∶%M"
msgstr "%j, %R %p"
Why you should use Intl
More readable, even if longer
Less burden on GNOME
translators
format = new Intl.DateTimeFormat(myLocale, {
month: 'short',
day: 'numeric',
hour: '2-digit',
minute: '2-digit',
hourCycle: 'h24',
})
format.format(Date.now())
// ⇒ "Jul. 17, 18:01" in my locale
Why you should use Intl
Who does translate those, anyway?
ICU project
Unicode Common Locale Data Repository (CLDR)
They have the power of major browser vendors behind them
Why you should use Intl
What if I don't like the ICU/CLDR's translations in my UI?
You can still customize them using formatToParts()
Supported by most Intl formatters
Why you should use Intl
What if I don't like the ICU/CLDR's translations in my UI?
You can still customize them using formatToParts()
Supported by most Intl formatters
12:00 12∶00
What's next in GJS?
What's upcoming in 2020–2021?
Progress towards removing the Big Hammer
Progress towards ES Modules
Following edition of JS language (based on Firefox 78)
Big Hammer
What is the Big Hammer?
Why does it need to be removed?
Why isn't it removed yet?
What is the Big Hammer?
I gave a talk about this at GUADEC last year
Some objects accidentally survive a garbage collection
The “Big Hammer” detects this and runs an extra garbage collection
Why does it need to be removed?
When memory is constantly being used and discarded, extra garbage
collections happen quite often
Bad for performance
Why isn't it removed yet?
We have a fix and it (mostly) works
Except for a few strange cases... 🗣 Evan Welsh
Why isn't it removed yet?
Ironically, the fix leads to higher average memory usage
Public relations catastrophe!
Why isn't it removed yet?
We need to tune the garbage collector to work better for our use case
We need help quantifying acceptable memory usage
Why isn't it removed yet?
We need to tune the garbage collector to work better for our use case
We need help quantifying acceptable memory usage
We need to figure out some solution that fits:
Shell
Apps
Random scripts that don't even run a main loop
ES Modules
What are ES modules?
When can we use them?
“The typical JavaScript program is only
one line.”
“The typical JavaScript program is only
one line.”
<input type="text" id="phone-number"
onchange="if ($('phone-number').val().length !== 10) alert('Invalid phone number!')">
What are ES modules?
GJS had its own module system: imports
const System = imports.system; // loads built-in System module
const {Gtk} = imports.gi; // loads binding for Gtk
imports.searchPath.unshift('.');
const MyModule = imports.src.myModule; // loads ./src/myModule.js
What are ES modules?
Now we have one solution for this across JavaScript platforms
Standardized in ECMAScript 2015: "ES Modules"
import System from 'system';
import {Gtk} from 'gi';
import MyModule from './src/myModule.js';
When can we use ES modules?
Currently working on a way to use the two module systems side by side
🗣 Evan Welsh
Technically, ES modules are a slightly different syntax than regular
JavaScript
Next edition of JS
Based on Firefox 78 🗣 Evan Welsh
Next edition of JS
?? operator
?. operator
Static class fields
Numeric separators ( 1_000_000 )
String.replaceAll()
Promise.allSettled()
Intl.Locale
Intl.ListFormat
Help!
Improving the developer experience
For GNOME Shell
For apps
For shell extensions
Developer experience: shell extensions
Shell extensions seen as "separate" from GNOME
One of the biggest sources of community unhappiness
Sri gave a talk on Friday on this topic
Join the unconference session on Sunday 18:00 UTC!
Developer experience: Shell and apps
Despite some improvements, developer tools are still not very good
Here are some ideas
These projects are not too large
Can be picked up without knowledge of all of the internals of GJS
Improve console output
gjs> ({a:5, b:3, foo:true})
[object Object]
gjs> [undefined, null]
,
gjs>
Issue #104 — Better console interpreter output
Improve debugger
Debugger is quite bare-bones
Doesn't handle multiple source files very well
Most code is spread over multiple source files
Issue #207 — Source locations and list command
Issue #208 — backtrace full command
What else do we need help with?
Become a code reviewer for GJS
Create a good workflow for people who want to get started
contributing to GJS
Create a good process for measuring performance and memory usage
in GNOME Shell
Let's hack!
Thanks
🗣 GJS contributors from 3.36 and 3.38
Background pattern by Randy Merrill — MIT license
License
Presentation licensed under Creative Commons BY-NC-ND 4.0
Questions?Questions?Questions?Questions?Questions?
Image: IRCat from Pixabay
Appendix
New String features
String.trimStart() ,
String.trimEnd()
New standardized methods for
trimming whitespace
replaces the old nonstandard
trimLeft , trimRight
' foo '.trimStart()
// ⇒ "foo "
' foo '.trimEnd()
// ⇒ " foo"
' foo '.trimLeft()
' foo '.trimRight()
New String features
String.matchAll()
Easier access to regular
expression capture groups
Easier iterating through multiple
matches in a string
const s = 'GNOME 3.36 and 3.38';
const pat = /(d+).(d+)/g;
for (let [v, major, minor] of s.matchAll(pat)) {
// On first iteration:
// v = '3.36'
// major = '3'
// minor = '36'
// On second iteration:
// v = '3.38'
// major = '3'
// minor = '38'
}
New Array features
Array.flat()
Well known from lodash and
friends
[1, 2, [3, 4]].flat()
// ⇒ [1, 2, 3, 4]
New Array features
Array.flatMap()
A sort of reverse Array.filter()
You can add elements while
iterating functional-style
function dashComponents(strings) {
return strings.flatMap(s => s.split('-'));
}
dashComponents(['foo-bar', 'a-b-c'])
// ⇒ ['foo', 'bar', 'a', 'b', 'c']
New Object features
Object.fromEntries()
Create an object from iterable
key-value pairs
o = Object.fromEntries(['a', 1], ['b', 2])
o.a
// ⇒ 1
o.b
// ⇒ 2
New environment features
globalThis
Ever find it weird that GJS's global
object is named window ?
if (typeof globalThis.foo === 'undefined')
if (typeof window.foo === 'undefined')
BigInt
Large numbers in JS are inexact
BigInt is a new type in JS,
arbitrary-precision integers
BigInt literals are a number
suffixed with n
Number.MAX_SAFE_INTEGER
// ⇒ 9007199254740991
9007199254740992 === 9007199254740993
// ⇒ true
BigInt(Number.MAX_SAFE_INTEGER)
// ⇒ 9007199254740991n
9007199254740992n === 9007199254740993n
// ⇒ false
When you should use BigInt
If you didn't already need to use it? Probably ignore it for now
In the future, 64-bit APIs will accept BigInt as well as numbers
Looking for a way to change the type of constants like GLib.MAXINT64
without breaking existing code 🗣 Evan Welsh
BigInt
Also two new typed array types
for BigInts that fit in 64 bits
let s = new BigInt64Array([-1n, -2n]);
let u = new BigUint64Array([1n, 2n]);
What's new with JavaScript in GNOME: The 2020 edition (GUADEC 2020)
What's new with JavaScript in GNOME: The 2020 edition (GUADEC 2020)

More Related Content

What's hot

Fixing Gaps. Strengthening the Chromium platform for content blocking
Fixing Gaps. Strengthening the Chromium platform for content blockingFixing Gaps. Strengthening the Chromium platform for content blocking
Fixing Gaps. Strengthening the Chromium platform for content blockingIgalia
 
Kiosk-mode browser using Chromium Embedded Framework (CEF)
Kiosk-mode browser using Chromium Embedded Framework (CEF)Kiosk-mode browser using Chromium Embedded Framework (CEF)
Kiosk-mode browser using Chromium Embedded Framework (CEF)Igalia
 
HTML5 Apps on AGL Platform with the Web Application Manager (Automotive Grade...
HTML5 Apps on AGL Platform with the Web Application Manager (Automotive Grade...HTML5 Apps on AGL Platform with the Web Application Manager (Automotive Grade...
HTML5 Apps on AGL Platform with the Web Application Manager (Automotive Grade...Igalia
 
The pathway to Chromium on Wayland (Web Engines Hackfest 2018)
The pathway to Chromium on Wayland (Web Engines Hackfest 2018)The pathway to Chromium on Wayland (Web Engines Hackfest 2018)
The pathway to Chromium on Wayland (Web Engines Hackfest 2018)Igalia
 
Inject the Web into your GStreamer pipeline with WPE using a GStreamer/WebKit...
Inject the Web into your GStreamer pipeline with WPE using a GStreamer/WebKit...Inject the Web into your GStreamer pipeline with WPE using a GStreamer/WebKit...
Inject the Web into your GStreamer pipeline with WPE using a GStreamer/WebKit...Igalia
 
Essential parts to implement own Ozone backend
Essential parts to implement own Ozone backendEssential parts to implement own Ozone backend
Essential parts to implement own Ozone backendIgalia
 
WebKit2 And You (GUADEC 2013)
WebKit2 And You (GUADEC 2013)WebKit2 And You (GUADEC 2013)
WebKit2 And You (GUADEC 2013)Igalia
 
An Overview of the Open Source Vulkan Driver for Raspberry Pi 4
An Overview of the Open Source Vulkan Driver for Raspberry Pi 4An Overview of the Open Source Vulkan Driver for Raspberry Pi 4
An Overview of the Open Source Vulkan Driver for Raspberry Pi 4Igalia
 
Contributions to an open source project: Igalia and the Chromium project
Contributions to an open source project: Igalia and the Chromium projectContributions to an open source project: Igalia and the Chromium project
Contributions to an open source project: Igalia and the Chromium projectIgalia
 
WebXR and Browsers
WebXR and BrowsersWebXR and Browsers
WebXR and BrowsersIgalia
 
LaCrOs Progress
LaCrOs ProgressLaCrOs Progress
LaCrOs ProgressIgalia
 
A Browser for the Automotive: Introduction to WebKit for Wayland (Automotive ...
A Browser for the Automotive: Introduction to WebKit for Wayland (Automotive ...A Browser for the Automotive: Introduction to WebKit for Wayland (Automotive ...
A Browser for the Automotive: Introduction to WebKit for Wayland (Automotive ...Igalia
 
Introduction to Google Web Toolkit
Introduction to Google Web ToolkitIntroduction to Google Web Toolkit
Introduction to Google Web ToolkitDidier Girard
 
Chromium on Wayland Desktop (BlinkOn 7)
Chromium on Wayland Desktop (BlinkOn 7)Chromium on Wayland Desktop (BlinkOn 7)
Chromium on Wayland Desktop (BlinkOn 7)Igalia
 
Webkit overview
Webkit overviewWebkit overview
Webkit overviewEun Cho
 
Waylandifying Chromium: From downstream to shipping (ELCE 2020)
Waylandifying Chromium: From downstream to shipping (ELCE 2020)Waylandifying Chromium: From downstream to shipping (ELCE 2020)
Waylandifying Chromium: From downstream to shipping (ELCE 2020)Igalia
 
Quick Review of Desktop and Native Apps using Javascript
Quick Review of Desktop and Native Apps using JavascriptQuick Review of Desktop and Native Apps using Javascript
Quick Review of Desktop and Native Apps using JavascriptRobert Ellen
 
Hybrid Desktop/Web applications with WebKitGTK+ (COSCUP 2010)
Hybrid Desktop/Web applications with WebKitGTK+ (COSCUP 2010)Hybrid Desktop/Web applications with WebKitGTK+ (COSCUP 2010)
Hybrid Desktop/Web applications with WebKitGTK+ (COSCUP 2010)Igalia
 
WebKit Clutter Port Present and Future; WebKitGtk Status and Roadmap to WebKi...
WebKit Clutter Port Present and Future; WebKitGtk Status and Roadmap to WebKi...WebKit Clutter Port Present and Future; WebKitGtk Status and Roadmap to WebKi...
WebKit Clutter Port Present and Future; WebKitGtk Status and Roadmap to WebKi...Igalia
 
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
 

What's hot (20)

Fixing Gaps. Strengthening the Chromium platform for content blocking
Fixing Gaps. Strengthening the Chromium platform for content blockingFixing Gaps. Strengthening the Chromium platform for content blocking
Fixing Gaps. Strengthening the Chromium platform for content blocking
 
Kiosk-mode browser using Chromium Embedded Framework (CEF)
Kiosk-mode browser using Chromium Embedded Framework (CEF)Kiosk-mode browser using Chromium Embedded Framework (CEF)
Kiosk-mode browser using Chromium Embedded Framework (CEF)
 
HTML5 Apps on AGL Platform with the Web Application Manager (Automotive Grade...
HTML5 Apps on AGL Platform with the Web Application Manager (Automotive Grade...HTML5 Apps on AGL Platform with the Web Application Manager (Automotive Grade...
HTML5 Apps on AGL Platform with the Web Application Manager (Automotive Grade...
 
The pathway to Chromium on Wayland (Web Engines Hackfest 2018)
The pathway to Chromium on Wayland (Web Engines Hackfest 2018)The pathway to Chromium on Wayland (Web Engines Hackfest 2018)
The pathway to Chromium on Wayland (Web Engines Hackfest 2018)
 
Inject the Web into your GStreamer pipeline with WPE using a GStreamer/WebKit...
Inject the Web into your GStreamer pipeline with WPE using a GStreamer/WebKit...Inject the Web into your GStreamer pipeline with WPE using a GStreamer/WebKit...
Inject the Web into your GStreamer pipeline with WPE using a GStreamer/WebKit...
 
Essential parts to implement own Ozone backend
Essential parts to implement own Ozone backendEssential parts to implement own Ozone backend
Essential parts to implement own Ozone backend
 
WebKit2 And You (GUADEC 2013)
WebKit2 And You (GUADEC 2013)WebKit2 And You (GUADEC 2013)
WebKit2 And You (GUADEC 2013)
 
An Overview of the Open Source Vulkan Driver for Raspberry Pi 4
An Overview of the Open Source Vulkan Driver for Raspberry Pi 4An Overview of the Open Source Vulkan Driver for Raspberry Pi 4
An Overview of the Open Source Vulkan Driver for Raspberry Pi 4
 
Contributions to an open source project: Igalia and the Chromium project
Contributions to an open source project: Igalia and the Chromium projectContributions to an open source project: Igalia and the Chromium project
Contributions to an open source project: Igalia and the Chromium project
 
WebXR and Browsers
WebXR and BrowsersWebXR and Browsers
WebXR and Browsers
 
LaCrOs Progress
LaCrOs ProgressLaCrOs Progress
LaCrOs Progress
 
A Browser for the Automotive: Introduction to WebKit for Wayland (Automotive ...
A Browser for the Automotive: Introduction to WebKit for Wayland (Automotive ...A Browser for the Automotive: Introduction to WebKit for Wayland (Automotive ...
A Browser for the Automotive: Introduction to WebKit for Wayland (Automotive ...
 
Introduction to Google Web Toolkit
Introduction to Google Web ToolkitIntroduction to Google Web Toolkit
Introduction to Google Web Toolkit
 
Chromium on Wayland Desktop (BlinkOn 7)
Chromium on Wayland Desktop (BlinkOn 7)Chromium on Wayland Desktop (BlinkOn 7)
Chromium on Wayland Desktop (BlinkOn 7)
 
Webkit overview
Webkit overviewWebkit overview
Webkit overview
 
Waylandifying Chromium: From downstream to shipping (ELCE 2020)
Waylandifying Chromium: From downstream to shipping (ELCE 2020)Waylandifying Chromium: From downstream to shipping (ELCE 2020)
Waylandifying Chromium: From downstream to shipping (ELCE 2020)
 
Quick Review of Desktop and Native Apps using Javascript
Quick Review of Desktop and Native Apps using JavascriptQuick Review of Desktop and Native Apps using Javascript
Quick Review of Desktop and Native Apps using Javascript
 
Hybrid Desktop/Web applications with WebKitGTK+ (COSCUP 2010)
Hybrid Desktop/Web applications with WebKitGTK+ (COSCUP 2010)Hybrid Desktop/Web applications with WebKitGTK+ (COSCUP 2010)
Hybrid Desktop/Web applications with WebKitGTK+ (COSCUP 2010)
 
WebKit Clutter Port Present and Future; WebKitGtk Status and Roadmap to WebKi...
WebKit Clutter Port Present and Future; WebKitGtk Status and Roadmap to WebKi...WebKit Clutter Port Present and Future; WebKitGtk Status and Roadmap to WebKi...
WebKit Clutter Port Present and Future; WebKitGtk Status and Roadmap to WebKi...
 
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
 

Similar to What's new with JavaScript in GNOME: The 2020 edition (GUADEC 2020)

Overview Of Parallel Development - Ericnel
Overview Of Parallel Development -  EricnelOverview Of Parallel Development -  Ericnel
Overview Of Parallel Development - Ericnelukdpe
 
Skiron - Experiments in CPU Design in D
Skiron - Experiments in CPU Design in DSkiron - Experiments in CPU Design in D
Skiron - Experiments in CPU Design in DMithun Hunsur
 
L Fu - Dao: a novel programming language for bioinformatics
L Fu - Dao: a novel programming language for bioinformaticsL Fu - Dao: a novel programming language for bioinformatics
L Fu - Dao: a novel programming language for bioinformaticsJan Aerts
 
GWT is Smarter Than You
GWT is Smarter Than YouGWT is Smarter Than You
GWT is Smarter Than YouRobert Cooper
 
Hacking the Kinect with GAFFTA Day 1
Hacking the Kinect with GAFFTA Day 1Hacking the Kinect with GAFFTA Day 1
Hacking the Kinect with GAFFTA Day 1benDesigning
 
Java 5 6 Generics, Concurrency, Garbage Collection, Tuning
Java 5 6 Generics, Concurrency, Garbage Collection, TuningJava 5 6 Generics, Concurrency, Garbage Collection, Tuning
Java 5 6 Generics, Concurrency, Garbage Collection, TuningCarol McDonald
 
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
 
Oh the compilers you'll build
Oh the compilers you'll buildOh the compilers you'll build
Oh the compilers you'll buildMark Stoodley
 
Sandboxing JS and HTML. A lession Learned
Sandboxing JS and HTML. A lession LearnedSandboxing JS and HTML. A lession Learned
Sandboxing JS and HTML. A lession LearnedMinded Security
 
What is new with JavaScript in Gnome: The 2021 edition
What is new with JavaScript in Gnome: The 2021 editionWhat is new with JavaScript in Gnome: The 2021 edition
What is new with JavaScript in Gnome: The 2021 editionIgalia
 
Google Web Toolkit
Google Web ToolkitGoogle Web Toolkit
Google Web Toolkitchris be
 
Consequences of using the Copy-Paste method in C++ programming and how to dea...
Consequences of using the Copy-Paste method in C++ programming and how to dea...Consequences of using the Copy-Paste method in C++ programming and how to dea...
Consequences of using the Copy-Paste method in C++ programming and how to dea...Andrey Karpov
 
maXbox Starter 45 Robotics
maXbox Starter 45 RoboticsmaXbox Starter 45 Robotics
maXbox Starter 45 RoboticsMax Kleiner
 
Production Debugging at Code Camp Philly
Production Debugging at Code Camp PhillyProduction Debugging at Code Camp Philly
Production Debugging at Code Camp PhillyBrian Lyttle
 
Power Leveling your TypeScript
Power Leveling your TypeScriptPower Leveling your TypeScript
Power Leveling your TypeScriptOffirmo
 
Automated JavaScript Deobfuscation - PacSec 2007
Automated JavaScript Deobfuscation - PacSec 2007Automated JavaScript Deobfuscation - PacSec 2007
Automated JavaScript Deobfuscation - PacSec 2007Stephan Chenette
 
Javascript, the GNOME way (JSConf EU 2011)
Javascript, the GNOME way (JSConf EU 2011)Javascript, the GNOME way (JSConf EU 2011)
Javascript, the GNOME way (JSConf EU 2011)Igalia
 
Down With JavaScript!
Down With JavaScript!Down With JavaScript!
Down With JavaScript!Garth Gilmour
 
Testing of javacript
Testing of javacriptTesting of javacript
Testing of javacriptLei Kang
 

Similar to What's new with JavaScript in GNOME: The 2020 edition (GUADEC 2020) (20)

Overview Of Parallel Development - Ericnel
Overview Of Parallel Development -  EricnelOverview Of Parallel Development -  Ericnel
Overview Of Parallel Development - Ericnel
 
Skiron - Experiments in CPU Design in D
Skiron - Experiments in CPU Design in DSkiron - Experiments in CPU Design in D
Skiron - Experiments in CPU Design in D
 
L Fu - Dao: a novel programming language for bioinformatics
L Fu - Dao: a novel programming language for bioinformaticsL Fu - Dao: a novel programming language for bioinformatics
L Fu - Dao: a novel programming language for bioinformatics
 
GWT is Smarter Than You
GWT is Smarter Than YouGWT is Smarter Than You
GWT is Smarter Than You
 
Hacking the Kinect with GAFFTA Day 1
Hacking the Kinect with GAFFTA Day 1Hacking the Kinect with GAFFTA Day 1
Hacking the Kinect with GAFFTA Day 1
 
Java 5 6 Generics, Concurrency, Garbage Collection, Tuning
Java 5 6 Generics, Concurrency, Garbage Collection, TuningJava 5 6 Generics, Concurrency, Garbage Collection, Tuning
Java 5 6 Generics, Concurrency, Garbage Collection, Tuning
 
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
 
10 Ways To Improve Your Code
10 Ways To Improve Your Code10 Ways To Improve Your Code
10 Ways To Improve Your Code
 
Oh the compilers you'll build
Oh the compilers you'll buildOh the compilers you'll build
Oh the compilers you'll build
 
Sandboxing JS and HTML. A lession Learned
Sandboxing JS and HTML. A lession LearnedSandboxing JS and HTML. A lession Learned
Sandboxing JS and HTML. A lession Learned
 
What is new with JavaScript in Gnome: The 2021 edition
What is new with JavaScript in Gnome: The 2021 editionWhat is new with JavaScript in Gnome: The 2021 edition
What is new with JavaScript in Gnome: The 2021 edition
 
Google Web Toolkit
Google Web ToolkitGoogle Web Toolkit
Google Web Toolkit
 
Consequences of using the Copy-Paste method in C++ programming and how to dea...
Consequences of using the Copy-Paste method in C++ programming and how to dea...Consequences of using the Copy-Paste method in C++ programming and how to dea...
Consequences of using the Copy-Paste method in C++ programming and how to dea...
 
maXbox Starter 45 Robotics
maXbox Starter 45 RoboticsmaXbox Starter 45 Robotics
maXbox Starter 45 Robotics
 
Production Debugging at Code Camp Philly
Production Debugging at Code Camp PhillyProduction Debugging at Code Camp Philly
Production Debugging at Code Camp Philly
 
Power Leveling your TypeScript
Power Leveling your TypeScriptPower Leveling your TypeScript
Power Leveling your TypeScript
 
Automated JavaScript Deobfuscation - PacSec 2007
Automated JavaScript Deobfuscation - PacSec 2007Automated JavaScript Deobfuscation - PacSec 2007
Automated JavaScript Deobfuscation - PacSec 2007
 
Javascript, the GNOME way (JSConf EU 2011)
Javascript, the GNOME way (JSConf EU 2011)Javascript, the GNOME way (JSConf EU 2011)
Javascript, the GNOME way (JSConf EU 2011)
 
Down With JavaScript!
Down With JavaScript!Down With JavaScript!
Down With JavaScript!
 
Testing of javacript
Testing of javacriptTesting of javacript
Testing of javacript
 

More from Igalia

A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 
Building End-user Applications on Embedded Devices with WPE
Building End-user Applications on Embedded Devices with WPEBuilding End-user Applications on Embedded Devices with WPE
Building End-user Applications on Embedded Devices with WPEIgalia
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
Automated Testing for Web-based Systems on Embedded Devices
Automated Testing for Web-based Systems on Embedded DevicesAutomated Testing for Web-based Systems on Embedded Devices
Automated Testing for Web-based Systems on Embedded DevicesIgalia
 
Embedding WPE WebKit - from Bring-up to Maintenance
Embedding WPE WebKit - from Bring-up to MaintenanceEmbedding WPE WebKit - from Bring-up to Maintenance
Embedding WPE WebKit - from Bring-up to MaintenanceIgalia
 
Optimizing Scheduler for Linux Gaming.pdf
Optimizing Scheduler for Linux Gaming.pdfOptimizing Scheduler for Linux Gaming.pdf
Optimizing Scheduler for Linux Gaming.pdfIgalia
 
Running JS via WASM faster with JIT
Running JS via WASM      faster with JITRunning JS via WASM      faster with JIT
Running JS via WASM faster with JITIgalia
 
To crash or not to crash: if you do, at least recover fast!
To crash or not to crash: if you do, at least recover fast!To crash or not to crash: if you do, at least recover fast!
To crash or not to crash: if you do, at least recover fast!Igalia
 
Implementing a Vulkan Video Encoder From Mesa to GStreamer
Implementing a Vulkan Video Encoder From Mesa to GStreamerImplementing a Vulkan Video Encoder From Mesa to GStreamer
Implementing a Vulkan Video Encoder From Mesa to GStreamerIgalia
 
8 Years of Open Drivers, including the State of Vulkan in Mesa
8 Years of Open Drivers, including the State of Vulkan in Mesa8 Years of Open Drivers, including the State of Vulkan in Mesa
8 Years of Open Drivers, including the State of Vulkan in MesaIgalia
 
Introducción a Mesa. Caso específico dos dispositivos Raspberry Pi por Igalia
Introducción a Mesa. Caso específico dos dispositivos Raspberry Pi por IgaliaIntroducción a Mesa. Caso específico dos dispositivos Raspberry Pi por Igalia
Introducción a Mesa. Caso específico dos dispositivos Raspberry Pi por IgaliaIgalia
 
2023 in Chimera Linux
2023 in Chimera                    Linux2023 in Chimera                    Linux
2023 in Chimera LinuxIgalia
 
Building a Linux distro with LLVM
Building a Linux distro        with LLVMBuilding a Linux distro        with LLVM
Building a Linux distro with LLVMIgalia
 
turnip: Update on Open Source Vulkan Driver for Adreno GPUs
turnip: Update on Open Source Vulkan Driver for Adreno GPUsturnip: Update on Open Source Vulkan Driver for Adreno GPUs
turnip: Update on Open Source Vulkan Driver for Adreno GPUsIgalia
 
Graphics stack updates for Raspberry Pi devices
Graphics stack updates for Raspberry Pi devicesGraphics stack updates for Raspberry Pi devices
Graphics stack updates for Raspberry Pi devicesIgalia
 
Delegated Compositing - Utilizing Wayland Protocols for Chromium on ChromeOS
Delegated Compositing - Utilizing Wayland Protocols for Chromium on ChromeOSDelegated Compositing - Utilizing Wayland Protocols for Chromium on ChromeOS
Delegated Compositing - Utilizing Wayland Protocols for Chromium on ChromeOSIgalia
 
MessageFormat: The future of i18n on the web
MessageFormat: The future of i18n on the webMessageFormat: The future of i18n on the web
MessageFormat: The future of i18n on the webIgalia
 
Replacing the geometry pipeline with mesh shaders
Replacing the geometry pipeline with mesh shadersReplacing the geometry pipeline with mesh shaders
Replacing the geometry pipeline with mesh shadersIgalia
 
I'm not an AMD expert, but...
I'm not an AMD expert, but...I'm not an AMD expert, but...
I'm not an AMD expert, but...Igalia
 
Status of Vulkan on Raspberry
Status of Vulkan on RaspberryStatus of Vulkan on Raspberry
Status of Vulkan on RaspberryIgalia
 

More from Igalia (20)

A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Building End-user Applications on Embedded Devices with WPE
Building End-user Applications on Embedded Devices with WPEBuilding End-user Applications on Embedded Devices with WPE
Building End-user Applications on Embedded Devices with WPE
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
Automated Testing for Web-based Systems on Embedded Devices
Automated Testing for Web-based Systems on Embedded DevicesAutomated Testing for Web-based Systems on Embedded Devices
Automated Testing for Web-based Systems on Embedded Devices
 
Embedding WPE WebKit - from Bring-up to Maintenance
Embedding WPE WebKit - from Bring-up to MaintenanceEmbedding WPE WebKit - from Bring-up to Maintenance
Embedding WPE WebKit - from Bring-up to Maintenance
 
Optimizing Scheduler for Linux Gaming.pdf
Optimizing Scheduler for Linux Gaming.pdfOptimizing Scheduler for Linux Gaming.pdf
Optimizing Scheduler for Linux Gaming.pdf
 
Running JS via WASM faster with JIT
Running JS via WASM      faster with JITRunning JS via WASM      faster with JIT
Running JS via WASM faster with JIT
 
To crash or not to crash: if you do, at least recover fast!
To crash or not to crash: if you do, at least recover fast!To crash or not to crash: if you do, at least recover fast!
To crash or not to crash: if you do, at least recover fast!
 
Implementing a Vulkan Video Encoder From Mesa to GStreamer
Implementing a Vulkan Video Encoder From Mesa to GStreamerImplementing a Vulkan Video Encoder From Mesa to GStreamer
Implementing a Vulkan Video Encoder From Mesa to GStreamer
 
8 Years of Open Drivers, including the State of Vulkan in Mesa
8 Years of Open Drivers, including the State of Vulkan in Mesa8 Years of Open Drivers, including the State of Vulkan in Mesa
8 Years of Open Drivers, including the State of Vulkan in Mesa
 
Introducción a Mesa. Caso específico dos dispositivos Raspberry Pi por Igalia
Introducción a Mesa. Caso específico dos dispositivos Raspberry Pi por IgaliaIntroducción a Mesa. Caso específico dos dispositivos Raspberry Pi por Igalia
Introducción a Mesa. Caso específico dos dispositivos Raspberry Pi por Igalia
 
2023 in Chimera Linux
2023 in Chimera                    Linux2023 in Chimera                    Linux
2023 in Chimera Linux
 
Building a Linux distro with LLVM
Building a Linux distro        with LLVMBuilding a Linux distro        with LLVM
Building a Linux distro with LLVM
 
turnip: Update on Open Source Vulkan Driver for Adreno GPUs
turnip: Update on Open Source Vulkan Driver for Adreno GPUsturnip: Update on Open Source Vulkan Driver for Adreno GPUs
turnip: Update on Open Source Vulkan Driver for Adreno GPUs
 
Graphics stack updates for Raspberry Pi devices
Graphics stack updates for Raspberry Pi devicesGraphics stack updates for Raspberry Pi devices
Graphics stack updates for Raspberry Pi devices
 
Delegated Compositing - Utilizing Wayland Protocols for Chromium on ChromeOS
Delegated Compositing - Utilizing Wayland Protocols for Chromium on ChromeOSDelegated Compositing - Utilizing Wayland Protocols for Chromium on ChromeOS
Delegated Compositing - Utilizing Wayland Protocols for Chromium on ChromeOS
 
MessageFormat: The future of i18n on the web
MessageFormat: The future of i18n on the webMessageFormat: The future of i18n on the web
MessageFormat: The future of i18n on the web
 
Replacing the geometry pipeline with mesh shaders
Replacing the geometry pipeline with mesh shadersReplacing the geometry pipeline with mesh shaders
Replacing the geometry pipeline with mesh shaders
 
I'm not an AMD expert, but...
I'm not an AMD expert, but...I'm not an AMD expert, but...
I'm not an AMD expert, but...
 
Status of Vulkan on Raspberry
Status of Vulkan on RaspberryStatus of Vulkan on Raspberry
Status of Vulkan on Raspberry
 

Recently uploaded

DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamUiPathCommunity
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistandanishmna97
 
Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxRemote DBA Services
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...apidays
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native ApplicationsWSO2
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxRustici Software
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024The Digital Insurer
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusZilliz
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...apidays
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...apidays
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityWSO2
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontologyjohnbeverley2021
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businesspanagenda
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...DianaGray10
 

Recently uploaded (20)

DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptx
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital Adaptability
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontology
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 

What's new with JavaScript in GNOME: The 2020 edition (GUADEC 2020)

  • 1. What's new with JavaScript in GNOME The 2020 edition Philip Chimento •  pchimento •   ptomato •  @therealptomato GUADEC Online, July 25, 2020
  • 2. Introduction: What we will talk about Same thing we talk about every year! What's new in GJS? Including a bit about a lesser-known corner: Intl What's next in GJS? We need some help! Here's what you can do
  • 3. Introduction 🗣 Shout-outs are a thank-you to someone who contributed a feature Presentation is full of links if you want to click through later If you want to follow along: ptomato.name/guadec2020
  • 4. What's new in JavaScript land for GNOME 3.36 and 3.38?
  • 5. Developer experience gjs-docs is now way easier to maintain and contribute to 🗣 Meg Ford Documentation added for GNOME Shell internals 🗣 Andy Holmes
  • 7. It shouldn't be possible to crash GNOME Shell just by writing JS code.
  • 8. Crash fixes 9 crashing bugs still open 6 fixed, 5 new since last GUADEC Improvements to type safety 🗣 Marco Trevisan
  • 9. Performance fixes Looking up properties that may come from C: e.g. myWindow.present() Don't look up myWindow.customProperty Negative lookup cache 🗣 Daniel Van Vugt
  • 10. Performance fixes Calling C functions Translating arguments is slow e.g. void gtk_c_func(int arg1, double arg2) → Gtk.c_func(number, number) Argument cache 🗣 Giovanni Campagna
  • 11. GObject properties Adding GObject properties to your class was always really verbose Easy to do notifications incorrectly, for example Now you can leave out the boring part: // Just delete all this! get my_property() { return this._myProperty; } set my_property(value) { if (this._myProperty === value) return; this._myProperty = value; this.notify('my-property'); }
  • 12. New edition of JS language JavaScript is gaining features every year No longer the language that everyone loved to hate Which of these new features can you use in GJS?
  • 13. New JS language features in 3.36 String.trimStart() , String.trimEnd() String.matchAll() Array.flat() Array.flatMap() Object.fromEntries() globalThis BigInt , BigInt64Array , BigUint64Array String generics removed New Intl features
  • 14. String generics removed Nonstandard way of calling String methods on a non-string object Use moz68tool to scan your code for them Don't use array generics either, Mozilla will remove them soon let num = 15; String.endsWith(num, 5); String.prototype.endsWith.call(num, 5); String(num).endsWith(5); `${num}`.endsWith(5); // ⇒ true
  • 15. New Intl features Intl.RelativeTimeFormat Useful for user interfaces rtf = new Intl.RelativeTimeFormat('en', {style: 'narrow'}) rtf.format(-1, 'day') // ⇒ "1 day ago" rtf = new Intl.RelativeTimeFormat('es', {numeric: 'auto'}) rtf.format(2, 'day') // ⇒ "pasado mañana"
  • 16. A small digression about Intl
  • 17. Intl A global object Does internationalization stuff for you Some things awkward to do with gettext . Intl makes them easy Some things gettext does well. Intl mostly doesn't do those
  • 18. Intl Intl.Collator - locale-sensitive sorting Intl.DateTimeFormat - printing dates and times ( "Fri Jul 17" ) Intl.NumberFormat - printing numbers ( "€ 0,00" ) Intl.RelativeTimeFormat - printing relative times ( "3 days ago" ) More in future editions of JS!
  • 19. Why you should use Intl /* Translators: this is the month name and day number followed by a time string in 24h format. i.e. "May 25, 14:30" */ format = N_("%B %-d, %Hu2236%M"); How does the translator know what to put there for their locale?
  • 20. “Well why don't they just read the manual for strftime?”
  • 21.
  • 22. Why you should use Intl #. Translators: this is the month name and day number #. followed by a time string in 24h format. #. i.e. "May 25, 14:30" #: js/misc/util.js:255 #, no-c-format msgid "%B %-d, %H∶%M" msgstr "%j, %R %p"
  • 23. Why you should use Intl More readable, even if longer Less burden on GNOME translators format = new Intl.DateTimeFormat(myLocale, { month: 'short', day: 'numeric', hour: '2-digit', minute: '2-digit', hourCycle: 'h24', }) format.format(Date.now()) // ⇒ "Jul. 17, 18:01" in my locale
  • 24. Why you should use Intl Who does translate those, anyway? ICU project Unicode Common Locale Data Repository (CLDR) They have the power of major browser vendors behind them
  • 25. Why you should use Intl What if I don't like the ICU/CLDR's translations in my UI? You can still customize them using formatToParts() Supported by most Intl formatters
  • 26. Why you should use Intl What if I don't like the ICU/CLDR's translations in my UI? You can still customize them using formatToParts() Supported by most Intl formatters 12:00 12∶00
  • 28. What's upcoming in 2020–2021? Progress towards removing the Big Hammer Progress towards ES Modules Following edition of JS language (based on Firefox 78)
  • 29. Big Hammer What is the Big Hammer? Why does it need to be removed? Why isn't it removed yet?
  • 30.
  • 31. What is the Big Hammer? I gave a talk about this at GUADEC last year Some objects accidentally survive a garbage collection The “Big Hammer” detects this and runs an extra garbage collection
  • 32. Why does it need to be removed? When memory is constantly being used and discarded, extra garbage collections happen quite often Bad for performance
  • 33. Why isn't it removed yet? We have a fix and it (mostly) works Except for a few strange cases... 🗣 Evan Welsh
  • 34. Why isn't it removed yet? Ironically, the fix leads to higher average memory usage Public relations catastrophe!
  • 35. Why isn't it removed yet? We need to tune the garbage collector to work better for our use case We need help quantifying acceptable memory usage
  • 36.
  • 37. Why isn't it removed yet? We need to tune the garbage collector to work better for our use case We need help quantifying acceptable memory usage We need to figure out some solution that fits: Shell Apps Random scripts that don't even run a main loop
  • 38. ES Modules What are ES modules? When can we use them?
  • 39. “The typical JavaScript program is only one line.”
  • 40. “The typical JavaScript program is only one line.” <input type="text" id="phone-number" onchange="if ($('phone-number').val().length !== 10) alert('Invalid phone number!')">
  • 41. What are ES modules? GJS had its own module system: imports const System = imports.system; // loads built-in System module const {Gtk} = imports.gi; // loads binding for Gtk imports.searchPath.unshift('.'); const MyModule = imports.src.myModule; // loads ./src/myModule.js
  • 42. What are ES modules? Now we have one solution for this across JavaScript platforms Standardized in ECMAScript 2015: "ES Modules" import System from 'system'; import {Gtk} from 'gi'; import MyModule from './src/myModule.js';
  • 43. When can we use ES modules? Currently working on a way to use the two module systems side by side 🗣 Evan Welsh Technically, ES modules are a slightly different syntax than regular JavaScript
  • 44. Next edition of JS Based on Firefox 78 🗣 Evan Welsh
  • 45. Next edition of JS ?? operator ?. operator Static class fields Numeric separators ( 1_000_000 ) String.replaceAll() Promise.allSettled() Intl.Locale Intl.ListFormat
  • 46. Help!
  • 47. Improving the developer experience For GNOME Shell For apps For shell extensions
  • 48. Developer experience: shell extensions Shell extensions seen as "separate" from GNOME One of the biggest sources of community unhappiness Sri gave a talk on Friday on this topic Join the unconference session on Sunday 18:00 UTC!
  • 49. Developer experience: Shell and apps Despite some improvements, developer tools are still not very good Here are some ideas These projects are not too large Can be picked up without knowledge of all of the internals of GJS
  • 50. Improve console output gjs> ({a:5, b:3, foo:true}) [object Object] gjs> [undefined, null] , gjs> Issue #104 — Better console interpreter output
  • 51. Improve debugger Debugger is quite bare-bones Doesn't handle multiple source files very well Most code is spread over multiple source files Issue #207 — Source locations and list command Issue #208 — backtrace full command
  • 52. What else do we need help with? Become a code reviewer for GJS Create a good workflow for people who want to get started contributing to GJS Create a good process for measuring performance and memory usage in GNOME Shell
  • 54. Thanks 🗣 GJS contributors from 3.36 and 3.38 Background pattern by Randy Merrill — MIT license License Presentation licensed under Creative Commons BY-NC-ND 4.0
  • 57. New String features String.trimStart() , String.trimEnd() New standardized methods for trimming whitespace replaces the old nonstandard trimLeft , trimRight ' foo '.trimStart() // ⇒ "foo " ' foo '.trimEnd() // ⇒ " foo" ' foo '.trimLeft() ' foo '.trimRight()
  • 58. New String features String.matchAll() Easier access to regular expression capture groups Easier iterating through multiple matches in a string const s = 'GNOME 3.36 and 3.38'; const pat = /(d+).(d+)/g; for (let [v, major, minor] of s.matchAll(pat)) { // On first iteration: // v = '3.36' // major = '3' // minor = '36' // On second iteration: // v = '3.38' // major = '3' // minor = '38' }
  • 59. New Array features Array.flat() Well known from lodash and friends [1, 2, [3, 4]].flat() // ⇒ [1, 2, 3, 4]
  • 60. New Array features Array.flatMap() A sort of reverse Array.filter() You can add elements while iterating functional-style function dashComponents(strings) { return strings.flatMap(s => s.split('-')); } dashComponents(['foo-bar', 'a-b-c']) // ⇒ ['foo', 'bar', 'a', 'b', 'c']
  • 61. New Object features Object.fromEntries() Create an object from iterable key-value pairs o = Object.fromEntries(['a', 1], ['b', 2]) o.a // ⇒ 1 o.b // ⇒ 2
  • 62. New environment features globalThis Ever find it weird that GJS's global object is named window ? if (typeof globalThis.foo === 'undefined') if (typeof window.foo === 'undefined')
  • 63. BigInt Large numbers in JS are inexact BigInt is a new type in JS, arbitrary-precision integers BigInt literals are a number suffixed with n Number.MAX_SAFE_INTEGER // ⇒ 9007199254740991 9007199254740992 === 9007199254740993 // ⇒ true BigInt(Number.MAX_SAFE_INTEGER) // ⇒ 9007199254740991n 9007199254740992n === 9007199254740993n // ⇒ false
  • 64. When you should use BigInt If you didn't already need to use it? Probably ignore it for now In the future, 64-bit APIs will accept BigInt as well as numbers Looking for a way to change the type of constants like GLib.MAXINT64 without breaking existing code 🗣 Evan Welsh
  • 65. BigInt Also two new typed array types for BigInts that fit in 64 bits let s = new BigInt64Array([-1n, -2n]); let u = new BigUint64Array([1n, 2n]);