Skip to main content

Parallel and Distributed Web Programming with Actors

  • Chapter
  • First Online:

Part of the book series: Lecture Notes in Computer Science ((LNPSE,volume 10789))

Abstract

JavaScript is the predominant language when it comes to developing applications for the web. Many of today’s web-based systems are implemented solely in JavaScript due to its applicability to both client and server-side development. Programmers have an ever-growing need to express parallelism due to the computationally intensive nature of modern web applications. Currently, JavaScript tries to satisfy this need through actor-based parallelism constructs. However, we argue that these constructs suffer from design flaws which hamper programmers to elegantly express parallelism in web applications. In this paper we present Spiders.ts, a unified actor framework to express both parallelism and distribution. In Spiders.ts, programmers can easily specify the coarse-grained parallelism needs of modern web applications. Moreover, Spiders.ts’ built-in distribution features allow programmers to express client-to-server, server-to-server and client-to-client communication simply by using actors. Through benchmarks we show that our framework is able to substantially improve the performance of web applications. Moreover, we demonstrate its expressive power by comparing implementations of a distributed case study application.

F. Myter—Funded by Innoviris (the Brussels Institute for Research and Innovation) through the Doctiris program (grant number 15-doct-07).

This is a preview of subscription content, log in via an institution.

Buying options

Chapter
USD   29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD   39.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD   54.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Learn about institutional subscriptions

Notes

  1. 1.

    https://github.com/myter/Spiders.js.

  2. 2.

    A typed superset of JavaScript which compiles to standard JavaScript.

  3. 3.

    https://github.com/myter/Spiders.js/tree/master/CoCode.

  4. 4.

    https://github.com/kriskowal/q-connection.

  5. 5.

    http://www.appcelerator.com.

  6. 6.

    https://github.com/myter/Spiders.js/tree/master/SpiderPong.

References

  1. Usage of JavaScript for websites. https://w3techs.com/technologies/details/cp-javascript/all/all. Accessed 3 June 2016

  2. Boix, E.G., Scholliers, C., Larrea, N., De Meuter, W.: Connect. js. Technical report, Vrije Universiteit Brussel (2015). http://soft.vub.ac.be/AGERE15/papers/AGERE_2015_paper_20.pdf

  3. Cutsem, T.V., et al.: AmbientTalk: programming responsive mobile peer-to-peer applications with actors. Comput. Lang. Syst. Struct. 40(3–4), 112–136 (2014)

    Google Scholar 

  4. De Koster, J., Van Cutsem, T., De Meuter, W.: 43 years of actors: a taxonomy of actor models and their key properties. In: Proceedings of the 6th International Workshop on Programming Based on Actors, Agents, and Decentralized Control, AGERE 2016, pp. 31–40. ACM, New York (2016)

    Google Scholar 

  5. Fortuna, E., Anderson, O., Ceze, L., Eggers, S.: A limit study of JavaScript parallelism. In: Proceedings of the IEEE International Symposium on Workload Characterization, IISWC 2010, pp. 1–10. IEEE Computer Society, Washington, DC (2010)

    Google Scholar 

  6. Gal, A., et al.: Trace-based just-in-time type specialization for dynamic languages. In: Proceedings of the 30th ACM SIGPLAN Conference on Programming Language Design and Implementation, PLDI 2009, pp. 465–478. ACM, New York (2009)

    Google Scholar 

  7. Garnock-Jones, T., Felleisen, M.: Coordinated concurrent programming in Syndicate. In: Thiemann, P. (ed.) ESOP 2016. LNCS, vol. 9632, pp. 310–336. Springer, Heidelberg (2016). https://doi.org/10.1007/978-3-662-49498-1_13

    Chapter  Google Scholar 

  8. Imam, S., Sarkar, V.: Savina-an actor benchmark suite. In: 4th International Workshop on Programming based on Actors, Agents, and Decentralized Control, AGERE! (2014)

    Google Scholar 

  9. Krauweel, M., Jongmans, S.-S.T.Q.: Simpler coordination of JavaScript web workers. In: Jacquet, J.-M., Massink, M. (eds.) COORDINATION 2017. LNCS, vol. 10319, pp. 40–58. Springer, Cham (2017). https://doi.org/10.1007/978-3-319-59746-1_3

    Chapter  Google Scholar 

  10. Martinsen, J.K., Grahn, H., Isberg, A.: An argument for thread-level speculation and just-in-time compilation in the Google’s V8 JavaScript engine. In: Proceedings of the 11th ACM Conference on Computing Frontiers, CF 2014, pp. 25:1–25:2. ACM, New York (2014)

    Google Scholar 

  11. Miller, H., Haller, P., Odersky, M.: Spores: a type-based foundation for closures in the age of concurrency and distribution. In: Jones, R. (ed.) ECOOP 2014. LNCS, vol. 8586, pp. 308–333. Springer, Heidelberg (2014). https://doi.org/10.1007/978-3-662-44202-9_13

    Chapter  Google Scholar 

  12. Miller, M.S., Tribble, E.D., Shapiro, J.: Concurrency among strangers: programming in E as plan coordination. In: De Nicola, R., Sangiorgi, D. (eds.) TGC 2005. LNCS, vol. 3705, pp. 195–229. Springer, Heidelberg (2005). https://doi.org/10.1007/11580850_12

    Chapter  Google Scholar 

  13. Miller, M.S., Van Cutsem, T.: Communicating event loops, an exploration in JavaScript (2011). http://soft.vub.ac.be/tvcutsem/talks/presentations/WGLD_CommEventLoops.pdf

  14. Myter, F., Scholliers, C., De Meuter, W.: Many spiders make a better web: a unified web-based actor framework. In: Proceedings of the 6th International Workshop on Programming Based on Actors, Agents, and Decentralized Control, AGERE 2016, pp. 51–60. ACM, New York (2016)

    Google Scholar 

  15. Stivan, G., Peruffo, A., Haller, P.: Akka.js: towards a portable actor runtime environment. In: Proceedings of the 5th International Workshop on Programming Based on Actors, Agents, and Decentralized Control, AGERE! 2015, pp. 57–64. ACM, New York (2015)

    Google Scholar 

  16. Tilkov, S., Vinoski, S.: Node.js: using JavaScript to build high-performance network programs. IEEE Internet Comput. 14(6), 80 (2010)

    Article  Google Scholar 

  17. Welc, A., Hudson, R.L., Shpeisman, T., Adl-Tabatabai, A.R.: Generic workers: towards unified distributed and parallel JavaScript programming model. In: Programming Support Innovations for Emerging Distributed Applications, PSI EtA 2010, pp. 1:1–1:5. ACM, New York (2010)

    Google Scholar 

  18. Xanthopoulos, S., Xinogalos, S.: A comparative analysis of cross-platform development approaches for mobile applications. In: Proceedings of the 6th Balkan Conference in Informatics, BCI 2013, pp. 213–220. ACM, New York (2013)

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Florian Myter .

Editor information

Editors and Affiliations

Appendices

A Highlighted Native Implementation of Pong

1.1 A.1 Server Implementation

figure d

1.2 A.2 Server Implementation

figure e

1.3 A.3 Client Implementation

figure f

1.4 A.4 Client Implementation

figure g

1.5 A.5 Client Implementation

figure h

B Highlighted Spiders.ts Implementation of Pong

1.1 B.1 Server Implementation

figure i

1.2 B.2 Client Implementation

figure j

1.3 B.3 Client Implementation

figure k

Rights and permissions

Reprints and permissions

Copyright information

© 2018 Springer Nature Switzerland AG

About this chapter

Check for updates. Verify currency and authenticity via CrossMark

Cite this chapter

Myter, F., Scholliers, C., De Meuter, W. (2018). Parallel and Distributed Web Programming with Actors. In: Ricci, A., Haller, P. (eds) Programming with Actors. Lecture Notes in Computer Science(), vol 10789. Springer, Cham. https://doi.org/10.1007/978-3-030-00302-9_1

Download citation

  • DOI: https://doi.org/10.1007/978-3-030-00302-9_1

  • Published:

  • Publisher Name: Springer, Cham

  • Print ISBN: 978-3-030-00301-2

  • Online ISBN: 978-3-030-00302-9

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics