Jonni Bidwell

Jonni Bidwell talks pro­gres­sive web apps with Enonic’s co-founder

Linux Format - - CONTENTS - Thomas Sigdestad

talks pro­gres­sive web apps with Enonic founder Thomas Sigdestad

Thomas Sigdestad is CTO and co-founder of Enonic, a com­pany that’s grown from hum­ble be­gin­nings in a garage in down­town Oslo to one of Nor­way’s most suc­cess­ful open source com­pa­nies. It had the bold idea of pro­vid­ing peo­ple with some­thing use­ful and us­able dur­ing the dot­com boom, and that re­mains very much part of its strat­egy to­day. We caught up with him at the O’Reilly Soft­ware Ar­chi­tec­ture 2017 con­fer­ence in Lon­don to talk about the fu­ture of cross plat­form ap­pli­ca­tions: pro­gres­sive web apps. You may not have heard of them, but the chances are, if you’ve gone any­where near a ma­jor web­site re­cently, that you’ve al­ready used one.

New tech­nolo­gies en­able web browsers to do all kinds of things – things that hith­erto were strictly the pre­serve of na­tive ap­pli­ca­tions. This could mean many ex­cit­ing de­vel­op­ments: truly cross-plat­form ap­pli­ca­tions, an end to the scourge of app stores, per­haps even Linux be­com­ing a vi­able op­tion for peo­ple bound by ap­pli­ca­tion re­quire­ments on proprietary OSes. A brave new world awaits, so read on…

Linux For­mat: Hi…

Thomas Sigdestad: So, you’re the same peo­ple that made Ami­gaFor­mat? I still re­mem­ber look­ing for­ward to the disks and the first re­view of the lat­est game. It was pretty ex­pen­sive in Nor­way though – £7 or £8 I guess.

LXF: That’s us… well, not us per­son­ally, but our com­pany. I loved that mag though. My mum used to go men­tal that I’d spend £3 on a magazine. She didn’t un­der­stand the amaz­ing value that rep­re­sented. It wasn’t just the qual­ity jour­nal­ism – the cover disk was a big deal: 880K of PD games and de­mos that would keep me oc­cu­pied for, well four weeks. Ahh, nostal­gia, best not get me started. How did you get into Linux? TS : When I was study­ing I bought a Red Hat box set from the univer­sity book­shop. I spent a lot of time in­ves­ti­gat­ing that. I re­mem­ber think­ing what was re­ally cool, and what I still think is re­ally cool, is net­work boot­ing. You just start the ma­chine, and it goes off and fetches an im­age. This was amaz­ing in 1997.

LXF: I used Red Hat in the early 2000s. As soon as I had a com­puter ca­pa­ble of run­ning Win­dows XP, I dis­cov­ered that I didn’t like it. Not one bit. I’m less mil­i­tant now, but Linux has been my pri­mary OS ever since then.

That’s funny. Our prod­uct is called Enonic XP. The XP is short for eX­pe­ri­ence Plat­form, but it’s noth­ing to do with Win­dows XP. When we re­leased it two years ago we re­ferred to it as a “web op­er­at­ing sys­tem.” If you’re build­ing an An­droid app, then you know how to write to disk and how the graph­ics work and things like that. There aren’t any other de­pen­den­cies, just an An­droid ver­sion. We had the same idea for servers: when you’re build­ing an Enonic app, you only had to spec­ify which ver­sion of XP you were us­ing. So this is an op­er­at­ing sys­tem con­cept at a much higher level – a server dis­trib­uted ap­proach. We went with the XP name for mar­ket­ing rea­sons, but maybe in a few years “web op­er­at­ing sys­tems” will catch on.

LXF: Tell me about your com­pany, Enonic.

TS : We started back in 2000. We wanted to be a soft­ware com­pany, so we worked for a year mak­ing our web por­tal, and then we launched and sur­pris­ingly quickly ended up with some in­ter­est­ing cus­tomers. We’ve used Linux for var­i­ous pur­poses and in var­i­ous guises from day one. We’ve al­ways used Linux for our host­ing.

What we did that made us unique was that we built ev­ery­thing us­ing Java. We had an idea – sort of in­spired by Bill Gates – that Mi­crosoft’s suc­cess came from pig­gy­back­ing off IBM. We more or less did the same thing with our ap­pli­ca­tion server and data­base. We ba­si­cally got cus­tomers that had in­vested in those ar­chi­tec­tures who wanted our so­lu­tions. So stone by stone we built our busi­ness over five years. We made a neat CMS, and saw that things were chang­ing in many ways. We had ap­pli­ca­tion teams work­ing on one stack, data­base teams work­ing on an­other stack and web­site teams work­ing on yet an­other stack. But they were all ul­ti­mately work­ing to cre­ate some user ex­pe­ri­ence and would have to wire these stacks to­gether some­how. We then re­alised that this can be done dif­fer­ently.

When you in­vest in a CMS you have to have a full stack, in­clud­ing the data­base and ev­ery­thing else. So we built ev­ery­thing from the ground up, in a sin­gle piece of

if it worked for mi­crosoft… “We had an idea – in­spired by Bill Gates – that Mi­crosoft’s suc­cess came from pig­gy­back­ing off IBM. We more or less did the same thing with our ap­pli­ca­tion server and data­base.”

soft­ware. And the CMS is the sur­face layer of that stack, so now we’re an ap­pli­ca­tion plat­form with a CMS as an op­tional fea­ture of the stack. But typ­i­cally that’s what our cus­tomers use. Even though we could make many in­ter­est­ing so­lu­tions, we have cho­sen to fo­cus on three key ar­eas: dig­i­tal ex­pe­ri­ences, pro­gres­sive web apps and back-end ser­vices.

LXF: Let’s talk about pro­gres­sive web apps. For­give my ig­no­rance, but what ex­actly are they?

TS : The short ver­sion is they’re web apps where you get the ex­pe­ri­ence of a na­tive app, but built with web tech­nol­ogy. You can see an ex­am­ple at http://of­fice­league.

rocks. It’s a foos­ball app that en­ables any­one to start their own league. It’ll work on any mod­ern browser, desk­top or mo­bile. Ev­ery­thing is driven by JavaScript, so there aren’t con­ven­tional page reloads which down­load the ap­pli­ca­tion code ev­ery time. You get an Elo rat­ing like in chess, and you can watch live games, which is pretty cool.

What’s also cool is that if, for ex­am­ple, I’m play­ing on my phone and I turn on air­plane mode, then the web page de­tects that I’m off­line, but I can still play a game. The app records it, and the mo­ment I go back on­line the app sends the data back to the server. Beyond this, the first time you run it you’ll be prompted if you want to add it to your de­vice. If you agree, you’ll get an icon on the launcher, just like a reg­u­lar ap­pli­ca­tion. And just like a reg­u­lar app, you can look at its in­for­ma­tion in An­droid’s app set­tings, and unin­stall it. You have ac­cess to lots of dif­fer­ent hard­ware fea­tures that you wouldn’t usu­ally ex­pect with a web app.

So a pro­gres­sive web app isn’t a par­tic­u­lar piece of tech­nol­ogy, it’s more a pat­tern of what these apps can do and how they work. To sum­marise: they feel like na­tive apps, they’re cross plat­form so you only need to code it once, rather than build­ing for An­droid, iOS, web and Win­dows separately. They’re also re­spon­sive, so you can have dif­fer­ent screen sizes, and they have off­line sup­port, so there’s re­silience as re­gards net­work con­di­tions. The rea­son they’re called pro­gres­sive is that the core parts of this foos­ball app, for ex­am­ple, work on an iPhone, even if they don’t sup­port the off­line mode or some other fea­tures. So you can have pro­gres­sive en­hance­ments of your app depend­ing on the ca­pa­bil­i­ties of the client.

LXF: What about video ac­cel­er­a­tion? Do they use we­bGL or other trick­ery to give a smooth ex­pe­ri­ence?

: Yeah, they can ba­si­cally use what­ever tech­nol­ogy your browser is ca­pa­ble of on the de­vice and plat­form you’re us­ing. It’s up to the de­vel­oper whether or not that’s used, though. If part of mak­ing that app is that you want hard­core per­for­mance, then you might use We­bGL or maybe even We­bAssem­bly. That’s just one use case though, and not ev­ery­one cares about that. Most busi­ness cases only re­quire stan­dard web tech­nolo­gies to cre­ate apps. LXF: How easy is it to write these things? TS : It’s fairly sim­ple to use as a de­vel­oper, and we be­lieve that two years from now na­tive app de­vel­op­ment will be­come a niche thing, only used when there are spe­cific re­quire­ments. For ex­am­ple, Google just an­nounced the We­bUSB and Pay­ment Re­quest APIs for Chrome (see https://de­vel­oper.chr ome.com/apps/ ap­p_usb and https://de­velop ers.google. com/web/fun­da­men­tals/pay­ments/). These are pretty awe­some. For ex­am­ple, if you’re PayPal, then you can cre­ate a web or na­tive app and reg­is­ter as a pay­ment provider in a given de­vice. Then a web­site can just call the pay­ment re­quest API, and the user will be given a list of pay­ment providers – PayPal, Ap­ple Pay, or what­ever – so this re­moves much of the com­plex­ity in car­ry­ing out the ac­tual trans­ac­tion.

Like­wise We­bUSB opens other new ca­pa­bil­i­ties—so ev­ery­thing from con­trol­ling the cam­era (ev­ery as­pect of it), the mi­cro­phone, ac­cess per­mis­sions, all of these are em­bed­ded in the web now. The web was al­ways in­volved be­hind the scenes, but now it’s come to the fore­front, it’s ab­so­lutely a vi­able al­ter­na­tive to na­tive ap­pli­ca­tions.

LXF: App stores have be­come com­mon the stan­dard way of get­ting apps. Even Gnome’s Soft­ware tool pretty much con­forms to this norm. How do these work for pro­gres­sive web apps?

TS : Well, when you visit a web page there isn’t an app store in­volved, so the whole “pur­chase/down­load from Google Play”, or what­ever step is skipped. So that’s good for de­vel­op­ers and good for users, be­cause it speeds things up. Twit­ter is prob­a­bly the best ex­am­ple of a pro­gres­sive web app. It’s three per cent of the size of the na­tive An­droid app. There are no up­dates: you’re al­ways run­ning the lat­est ver­sion when­ever you visit the web­site.

So this way you get the best of the tra­di­tional web app world, com­bined with the best of the na­tive app world. It’s just a ques­tion of get­ting web browsers to sup­port the nec­es­sary fea­tures. This ini­tia­tive is be­ing pushed hard­est by Google through Chrome and Chromium.

stay­ing up to date is easy… “Twit­ter is the best ex­am­ple of a pro­gres­sive web app. It’s three per cent of the size of the na­tive An­droid app. There are no up­dates: you’re al­ways run­ning the lat­est ver­sion…”

Fire­fox is do­ing a re­ally good job too (see https://de­vel­oper.moz illa.org/en-US/

Apps/Pro­gres­sive). Mi­crosoft is in­volved too, so it’s an­other chance for it to be­come rel­e­vant on the client side. The com­pany’s go­ing to have pro­gres­sive web apps on the Win­dows Store.

LXF: What about Linux? Pre­sum­ably pro­gres­sive web apps can run there as well as any­where else?

TS : They do, and that’s an in­ter­est­ing point. Linux dom­i­nates vir­tu­ally ev­ery other field – the cloud, mo­bile (if we per­mit An­droid to be Linux) – but it never made it to the main­stream desk­top. But with pro­gres­sive web apps, desk­top Linux could be a vi­able al­ter­na­tive to macOS and Win­dows.

LXF: It’s a bit like the browser is be­com­ing the new op­er­at­ing sys­tem then?

TS : Yes, at least if you think about it as the run­time for ap­pli­ca­tions. They’ve be­come the foun­da­tion for client ap­pli­ca­tions. It’s a lit­tle like what Java did for cod­ing server side ap­pli­ca­tions in the late 90s. LXF: It’s funny – back in the day when­ever I saw “Start­ing Java…” in the sta­tus bar of Netscape it sent a shiver down my spine. I knew it was likely my ma­chine was go­ing to be brought to its knees while what­ever ap­plet was loaded. But that was on the client side, and prob­a­bly my 486 was un­der­pow­ered even for those times. On the server side Java en­abled all kinds of things to be big­ger

and faster. I’ve heard this is why Twit­ter was able to scale like it did.

TS : Yes, you could say that, most of the huge so­cial me­dia sites are run­ning Java now. Java alone is good be­cause it helps you with mul­ti­thread­ing and stuff like that. But the com­mu­nity on top of Java, and in par­tic­u­larly the Linux side of that, cre­ates all these cool open source things that make it even bet­ter. Twit­ter had some teething prob­lems ini­tially when it started to get big, but then it started us­ing some of these things to im­prove its search, for ex­am­ple, and this re­ally helped them to scale out. But yes, Java is pretty ubiq­ui­tous – our plat­form is based on Java. We’ve seen a new trend though, one re­lated to pro­gres­sive web apps and the web in gen­eral: JavaScript. When you build apps on our plat­form, you code with JavaScript, both server side and client side.

LXF: That’s an in­ter­est­ing point. A lot of peo­ple aren’t fa­mil­iar with server-side JavaScript, I’m used to clum­sily dump­ing JS code in an HTML file, for ex­am­ple, but

why nor­way’s the place to be… “The tech com­mu­nity in Nor­way is re­ally big. One of the big­gest de­vel­oper con­fer­ences, JavaZone, is held in Oslo. I think there were 2,500 de­vel­op­ers there this year”

things like Node.js con­fuse me. Can you ex­plain how that works?

TS : Es­sen­tially, JavaScript was created by Netscape to do some fancy tricks in the browser. But when you run JS in the browser, it’s a sin­gle UI thread, and typ­i­cally you also have this DOM (doc­u­ment ob­ject model) that you ma­nip­u­late. So that’s typ­i­cally what you see: there’s an event, some JS kicks in, it re­acts and changes some­thing in the DOM.

On the server side there is no DOM, so then there’s a few dif­fer­ent ap­proaches on the server side. There’s the lan­guage it­self and then there’s a huge move­ment around Node.js, which works pretty much the same as in the UI: it’s a sin­gle thread, so you end up start­ing lots of small servers and you have to route the traf­fic into them, which is fine, and it’s also state­less.

It has this same even prin­ci­ple: some­thing comes in, an event is kicked off, and then you can do what­ever asyn­chro­nous trick­ery you want be­tween server and browser. How­ever, we wanted peo­ple to be able to use all the in­vest­ments that had gone into Java, all the mul­ti­thread­ing, and the abil­ity to fully utilise the hard­ware. In ad­di­tion, mul­ti­threaded code is eas­ier than async, it’s sim­pler to de­bug and things like that. So we en­able you to code server-side JavaScript: you get an ini­tial re­quest, a piece of your code is in­voked, and then the JS it­self is run.

Then there’s also an ef­fort called com­monJS, which lets you do in­cludes, ba­si­cally. Stan­dard JS doesn’t sup­port that. These con­cepts are the same for the client and the server, but in node. js you have just this sin­gle thread. Our plat­form has a threaded model. The idea is the same as with any script­ing lan­guage though, you kick off a script and start do­ing stuff pro­gra­mat­i­cally. And you can take ad­van­tage of all the li­braries or util­i­ties out there to help you do stuff.

There’s an­other nice fea­ture too: When you’re cod­ing client side stuff, in

Chrome you can go to De­vel­oper Op­tions and find a de­bug con­sole which makes life eas­ier. With server-side de­vel­op­ment, you’re of­ten at the mercy of the client, so de­bug­ging is harder. But on our plat­form, you can use that same de­bug con­sole to fol­low the code into the server, which is a nice fea­ture for de­vel­op­ers. The Javascript frame­work we use in Enonic XP is also avail­able as a stand­alone project called Pur­pleJS ( http://pur­plejs.io).

LXF: What’s the tech com­mu­nity like in Nor­way?

TS : Oh it’s re­ally big. One of the big­gest de­vel­oper con­fer­ences, JavaZone ( https://javazone.no), is held in Oslo. I think there were 2,500 de­vel­op­ers there this year. One thing that’s a bit sad though in Nor­way, is that 90 per cent of what’s go­ing on [in the tech world] is con­sul­tancy. The govern­ment and big com­pa­nies hire peo­ple through con­sul­tan­cies. So they pick up all the tal­ent, and the cul­ture for prod­uct de­vel­op­ment isn’t that strong. Nowa­days there’s more of a push for peo­ple to get in­volved with star­tups and such, but there’s still too much of a fo­cus on con­sul­tancy.

But some im­por­tant com­pa­nies have come out of Nor­way: Fast Search & Trans­fer (FAST, now part of Mi­crosoft), Qt, ob­vi­ously a big one for Linux, Troll­tech (bought by Nokia). So in Nor­way at least, the suc­cess­ful com­pa­nies tend to get bought up. So maybe Nor­we­gian in­vestors haven’t quite re­alised the po­ten­tial of dig­i­tal. But there’s def­i­nitely lots of skilled peo­ple – there’s no short­age of tal­ent.

Tell us about your talk. I missed it be­cause I have to spend all my time talk­ing to peo­ple smarter than me.

Well, I wrapped pro­gres­sive web apps into a Star Wars-themed dis­cus­sion. Ap­ple was the dark side. It’s good to make these things at least a bit en­ter­tain­ing. The mes­sage is that we’re try­ing to build a plat­form that helps peo­ple cre­ate pow­er­ful web apps. We think pro­gres­sive web apps are go­ing to be mas­sive, but most peo­ple aren’t aware of that yet. It’s only a mat­ter of time be­fore things kick off. And def­i­nitely for na­tive Linux dis­tros, this is go­ing to be re­ally great.

Awe­some, well thanks so much for your time. I think James our pho­tog­ra­pher is now go­ing to or­ches­trate a hero shot out in the lobby “Hero Shot?!” Oh no, I didn’t bring my la­tex out­fit!

Thomas co-launched Enomic back in 2000.

Thomas, seen here with­out his su­per­hero cos­tume, but still hero­ically help­ing peo­ple to cre­ate web apps.

Newspapers in English

Newspapers from Australia

© PressReader. All rights reserved.