Parallel Programming with Futures/Isolates

DSC05195Morten Kromberg went right to it with his well-prepared workshop on the prototype features that were introduced in version 14.0 of Dyalog APL. The features are still partly modelled in APL to allow the first wave of users to pass judgement on the design. Throughout the workshop, we were asked for feedback, to ensure that the new primitives will be as well implemented as possible.

Everyone is encouraged to apply the new tools in practice so they can be adjusted and possibly get expanded functionality based on feedback from actual use-cases.

There is no denying the the obvious performance gains that Morten demonstrated: He was able to let the computer waste 9 idle seconds in only slightly more than 3 seconds!

Joking aside, one practical example that showed how useful parallel processing can be, was collating character counts from online news sites. Because of latency in loading these pages over the internet, starting many parallel threads that each requested a page greatly reduced the wait time. DSC05197 One workshop participant volunteered a piece of code that needed to be parallelized got up and pair programmed this with immediately achieving significant performance gains.

The idea of Futures is allowing the continuation of other work before an asynchronously launched calculation is finished. All selection and structural functions can be used on an array containing futures without blocking to wait for the result, as long as no actual data values are required. Meanwhile, other processes (or computers!) could be finishing the evaluation in the background.

It was captivating to observe output being printed and check the status while the calculation work progressed, or accessing parts of an array while other parts still reported as in progress. Morten even had a graphical representation of how load is distributed across processor cores.

Maybe the most exciting thing about all this is that we will soon welcome several new APL squiggles; Isolate (¤) and Parallel (). And at the end of the day, Morten even pulled a pet (pun intended) card out of his sleeve: A Schrödinger’s cat operator! The symbol is of course a question mark in a box (), signifying how the evaluation of the cat’s life (or in our case – the result) does not even begin until actually queried. This is a novel way to specify specific lazy evaluation.

All in all, an exciting look at what possibilities for parallelism the future will bring.

Building a Web Application with MiServer

IMG_4875
One of Sunday’s tracks was Brian Becker’s engaging workshop on MiServer 3.0 – the newest version of Dyalog’s APL-based web application framework that allows you to develop a cross platform application for stand-alone use or delivery via the web.

The motto of MiServer is that everyone who can develop an APL application should also be able to make it available via the web, allowing users to access the application via their favourite browser. In other words, MiServer is browser and platform agnostic.

The main take-away from the morning’s workshop is that if you are used to developing your GUI using ⎕WC, developing the GUI in MiServer 3.0 creates some slightly different rules. First we were showed where to download MiServer, and then Brian guided us though building out very first one-page website. The interactive nature of the workshop captivated us all. Before we knew of it, it was time for lunch.

IMG_4869After lunch – instead of having a sleep inducing talk, Brian challenged us to build a website for a Big Brian’s Burger Bistro offering ordering facility for various products with side orders, and a dashboard to monitor the ordering, product category, speed of order processing, and – most importantly from a management point of view – keep an eye on revenue and which products generate most revenue, with auto update when new orders where processed and paid.

It may have been down to the eating habits of the delegates in terms of their love for burgers, fries etc., but the enthusiasm with which we attacked the challenge was probably more due to how Brian managed to whip up and present MiServer 3.0’s capabilities during the morning. Actually, we got so engrossed in the afternoon that we almost missed our coffee break!

A group of participants was tasked with creating a dashboard, and after some discussion decided on two tables, which would pull data from the business logic, do a bit of calculation, and auto update when new orders got processed.

Hugely entertaining, and we actually managed – courtesy of Rick Proctors swift keyboard handling and deep understanding of APL – to get the code for the dashboard done, working and showcased before we ended the workshop.

We are all looking forward to the MiServer UI Controls presentation on Tuesday morning where we will get a chance to see some the many fancy widgets that MiServer 3.0 offers.

 

Postcard from Dyalog ’15 – Sicily

IMG_4877We’re here, we’re excited and Naxos greeted us with sweltering temperatures and beautiful sunshine on Saturday. Being the oldest Greek settlement in Sicily, founded before Syracuse, around 735 BC, Naxos has a lot to offer. The Atahotel Naxos venue, where the user meeting is taking place, is situated right on the coast with a fantastic view to the impressive Mount Etna – by far the largest of Europe’s active volcanos.

After some people arriving without luggage, due to huge thunderstorms in Rome both Friday and Saturday, we’re now settled and the luggage issues have been sorted. Today, the weather changed to overcast, thunder and light rain and a more bearable temperature. Which was just as well, as Sunday is WORKSHOP day.

IMG_4894You will find more detailed blog posts from a couple of today’s workshops:

Another noticeable workshop today was Dan Baronet’s Recent Language Features in Practice, covering the recently added operators Rank () and Key ().

Tomorrow the user meeting sessions kick off, and we’re anticipating some hugely interesting and engaging days. This year, the Viking challenge has been swapped for an excursion to Mount Etna, which is scheduled for Wednesday afternoon. Sensible walking shoes recommended. We are looking forward to loads a pictures with ‘thumbs up’ when we get to the top!

Thursday 25 September at Dyalog ’14

This was originally posted to Catalyst PR’s Facebook page and is reproduced here to make it accessible to people who don’t have Facebook accounts.

For information on the presentations at Dyalog ’14, see http://www.dyalog.com/user-meetings/dyalog14.htm.

On Thursday 25 September we were in for an impressive presentation called School Laser System with NFC Registration and Alerts by Chris “Ziggi” Paul, Laser Learning Ltd (U.K.).

Ziggi has previously developed other applications in Dyalog APL – most notably an ePortfolio-based nursery training solution for the Childcare company (see Dyalog’s case study at http://www.dyalog.com/case-studies/childcare.htm) which won the Nursery Supplier/Innovator 2008 Award at the Nursery Management Today Awards.

Since then the company has grown substantially and have branched out into Carer’s Careers – a company that is focused on training people who work with caring for others – and now the School Laser System with Near Field Communications (NFC).

The background for the School Laser System with NFC is that the principals are now also working with a new Academy free school. The School has 728 pupils, aged 4-11, and they need to be accounted for at all times during the day. The school is located over two main sites and has an external catering hall and a swimming pool. It also provides before-school and after-school clubs and mini-bus services.

The school “LASER” system is designed as a complete communication and information system between parents and school staff; recently it has been expanded to NFC in order to provide teachers and staff with up-to-date, relevant information. Each pupil in the school is issued with an NFC wristband and tags for their bags and key items of the uniform. Staff use NFC-enabled mobile phones or NFC readers connected to PCs to log a pupil at key points, for example, on and off a bus or at the dining hall. The NFC tags let the lunch staff know what food order the parents have requested each day and can give a full itinerary of clubs and school activities. Alerts of allergies or other critical medical information is displayed when a tag is scanned.

Ziggi showed us the parents’ interface to the system, as well as that used by the staff. The security around the system is obviously very high, using encryption and secure log-in. There is no data stored on the wristbands, bag tags or uniform items. If a child has forgotten to bring their wristband, a substitute – which only works for that day – is issued.

I believe that the system has great potential. There is a market not only for other UK infant and junior schools to implement this applications, but catering firms supplying school dinners could also benefit greatly from using this application.

NOTE for readers not familiar with the requirements for UK school staff concerning reporting, tracking, tracing, accounting for, etc. all children at all times – and who may have concerns regarding “big brother” tracking of children’s movements during the time they’re at school or attending after school clubs, etc.: This system is developed for tracking children aged 4-11. The application saves the school staff an enormous amount of admin. Parents love it, and as for issues around data protection, for example, medical information, no data is stored on the items the children carry around (wristband, bag tag or uniform items). It is already common practice that children with allergies and other medical conditions have their own little poster with their picture, age, condition and actions required in case of an incident posted in the classroom and the teacher room.

This is my final post from Dyalog ’14 – see you at Dyalog ’15, which seems to be going in the direction of Italy (TBC).

Postcard from Dyalog ’14 – Thursday

This is the last day of Dyalog ’14 so this is the last of six daily postcards from Eastbourne – we hope you have enjoyed getting a flavour of things as they happened. We expect there will be more discussion to come once we’re back and rested!

Last Night’s Banquet

Yesterday culminated in the traditional banquet dinner – the highlight of the social element of the user meeting. This year it was held at The Grand Hotel Eastbourne and consisted of a Champagne reception and formal three course dinner with live music from a string trio.

During the banquet the winners of the scavenger hunt were presented with their prizes – the ducks and other “British” items we saw on Sunday’s postcard! There was also a quiz to identify Dyalog employees from a list of clues. Exquisite food and wonderful company meant an exceptionally late night (early morning!) …

Delegates arrive at The Grand Hotel

Delegates arrive at The Grand Hotel

Banquet Dinner

Banquet Dinner

Team Herring celebrate their win in the quiz

Team Herring celebrate their win in the quiz

Moris and Luana with their prizes

Moris and Luana with their prizes

Discussion Point: Read-only Component Files

In his presentation today on component files and the Dyalog File Server (DFS), Richard mentioned a perhaps little-known problem with restricting access permissions on component files for users that nominally only ever read them. Setting read-only permission at the file level – that is, imposed by the operating system – could add a level of security to the file but it is in fact the case that component file reads can occasionally require write access to the file.

For example, suppose User A is reading and writing to a journaled component file and User B is simply ⎕FREADing it. If User A is interrupted whilst updating the file (perhaps the APL session is killed or a network connection is lost) and User B is the next to read it then as part of that read the interpreter will detect the journal and complete the unfinished update – a process which requires write access. If the systems administrator who set up the file permissions for User B had only granted read-only file permission to the file then the ⎕FREAD would fail.

Richard explained that this restriction might be lifted in future and that read operations would be truly read only – even with a journal present – but there is another issue to be aware of too. Access to component files is controlled using file locks. As might be expected, exclusive access is obtained on an exclusive tie and shared access is obtained on a share tie. In addition, writes to a share tied file require exclusive access for the duration of the write so that no other client is able to read it while it is being updated. Exclusive locks are write locks and thus require write permission. Therefore, if there is no write access to the file the interpreter cannot exclusively tie it – it can only share tie it.

Where file access has to be locked down as securely as possible, the DFS is able to resolve the above issues and more besides – client access to all component files is only possible via APL, users are fully authenticated and individual rights are controlled by the access matrix.

And Also …

Some of the other things we saw and heard today:

  • Andy showed us how to close trace windows without cutting back the stack
  • Ziggi pointed out that a loss rate of one in 700 is acceptable when delivering wine but not when delivering children
  • We would like your suggestions and comments about the user meeting programme and structure, and preferred location for next year – please email us at conference@dyalog.com

Eastbourne

Eastbourne has not let us down and even the British weather (which is always unpredictable) defied the odds and rendered the ponchos and umbrellas unnecessary. The View Hotel started life as a conference centre and was purpose built for holding meetings such as ours. We have certainly found it to be an ideal venue and feedback from delegates has been overwhelmingly positive.

The View Hotel

The View Hotel

The View Hotel

The View Hotel

The picture of the pier below was carefully framed not to show the fire damaged part! The fire that destroyed part of it back in July was headline news; the pier is closed as a result but should partially reopen next week. Perhaps we will have to return when it is fully restored!

Eastbourne Pier

Eastbourne Pier

Bandstand with The View Hotel behind

Bandstand with The View Hotel behind

Signing Off

And so Dyalog ’14 has come to an end. It has been the best-attended Dyalog conference anyone can remember and reflects the growing success of Dyalog and its users. Here begins the countdown to Dyalog ’15!

Wednesday 24 September at Dyalog ’14

This was originally posted to Catalyst PR’s Facebook page and is reproduced here to make it accessible to people who don’t have Facebook accounts.

For information on the presentations at Dyalog ’14, see http://www.dyalog.com/user-meetings/dyalog14.htm.

During Dyalog ’13, Dyalog Ltd announced an agreement with Syncfusion Inc. The agreement stated that Syncfusion’s Windows Presentation Foundation (WPF) and JavaScript libraries would be bundled with Dyalog version 14.0 (see http://www.dyalog.com/news/81/420/Dyalog-Agreement-with-Syncfusion.htm).

On Wednesday the 25th it was, therefore, a pleasure to attend the presentation by Claus Madsen of Fine Analytics (Denmark), where he presented the company’s InRisk Asset Allocation Platform.

The application is written purely in Dyalog and is aimed at professional investors. Fine Analytics have taken advantage of the WPF capabilities and Syncfusion controls available with Dyalog 14.0 to build a generic asset allocation platform with special focus on the professional investor. A specially designed .NET class facilitates the separation of the administrative and analytical sections of the application and a flexible calculation engine that allows a user to define type/structure/order is an integral part of the platform. All assumptions can be controlled from the professional-looking user interface; the user interface can also be used to change/import/construct/delete/add/copy/export a portfolio as well as add new assets in asset groups.