skip to main content
research-article

From APIs to languages: generalising method names

Published:21 October 2015Publication History
Skip Abstract Section

Abstract

Method names with multiple separate parts are a feature of many dynamic languages derived from Smalltalk. Generalising the syntax of method names to allow parts to be repeated, optional, or alternatives, means a single definition can respond to a whole family of method requests. We show how generalising method names can support flexible APIs for domain-specific languages, complex initialisation tasks, and control structures defined in libraries. We describe how we have extended Grace to support generalised method names, and prove that such an extension can be integrated into a gradually-typed language while preserving type soundness.

References

  1. A UGUSTSSON, L., M ANSELL, H., AND S ITTAMPALAM, G. Paradise: a two-stage DSL embedded in Haskell. In ICFP (2008), pp. 225–228. Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. B ENTLEY, J. Programming pearls: Little languages. CACM 29, 8 (Aug. 1986), 711–721. Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. B ENZAKEN, V., C ASTAGNA, G., AND F RISCH, A. CDuce: An XML-centric general-purpose language. In ICFP (2003), pp. 51–63. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. B LACK, A. P., B RUCE, K. B., H OMER, M., AND N OBLE, J. Grace: the absence of (inessential) difficulty. In Onward! (2012), pp. 85–98. Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. B RACHA, G., VON DER A H É, P., B YKOV, V., K ASHAI, Y., M ADDOX, W., AND M IRANDA 6, E. Modules as objects in Newspeak. In ECOOP (2010). Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. B URMAKO, E., O DERSKY, M., V OGT, C., Z EIGER, S., AND M OORS, A. Scala macros. http://scalamacros.org, Apr. 2012.Google ScholarGoogle Scholar
  7. C OX, B. Object Oriented Programming: An Evolutionary Approach. Addison Wesley, 1991. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. C UCUMBER L TD. Cucumber. https://cucumber.io/.Google ScholarGoogle Scholar
  9. C ULPEPPER, R., T OBIN -H OCHSTADT, S., AND F LATT, M. Advanced macrology and the implementation of Typed Scheme. In ICFP workshop on Scheme and Functional Programming (2007).Google ScholarGoogle Scholar
  10. EPFL. Environment, universes, and mirrors - Scala documentation. http://docs.scala-lang.org/overviews/ reflection/environment-universes-mirrors.html, 2013.Google ScholarGoogle Scholar
  11. E RDWEG, S., R ENDEL, T., K ÄSTNER, C., AND O STER - MANN, K. SugarJ: Library-based syntactic language extensibility. In OOPSLA (2011). Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. E RDWEG, S., R IEGER, F., R ENDEL, T., AND O STER - MANN, K. Layout-sensitive language extensibility with SugarHaskell. In HASKELL (2012), pp. 149–160. Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. E RDWEG, S., VAN DER S TORM, T., V ÖLTER, M., B OERSMA, M., B OSMAN, R., C OOK, W., G ERRITSEN, A., H ULSHOUT, A., K ELLY, S., L OH, A., K ONAT, G., M OLINA, P., P ALATNIK, M., P OHJONEN, R., S CHINDLER, E., S CHINDLER, K., S OLMI, R., V ERGU, V., V ISSER, E., VAN DER V LIST, K., W ACHSMUTH, G., AND VAN DER W ONING, J. The state of the art in language workbenches. In Software Language Engineering, vol. 8225 of Lecture Notes in Computer Science. Springer International Publishing, 2013.Google ScholarGoogle ScholarCross RefCross Ref
  14. F INDLER, R. B., C LEMENTS, J., F LANAGAN, C., F LATT, M., K RISHNAMURTHI, S., S TECKLER, P., AND F ELLEISEN, M. DrScheme: a programming environment for Scheme. J. Funct. Program. 12, 2 (3 2002), 159–182. Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. F OWLER, M. Domain Specific Languages. Addison-Wesley, 2011.Google ScholarGoogle Scholar
  16. F RISCH, A. OCaml + XDuce. In ICFP (2006), pp. 192–200. Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. G AMMA, E., H ELM, R., J OHNSON, R. E., AND V LISSIDES, J. Design Patterns. Addison-Wesley, 1994.Google ScholarGoogle Scholar
  18. G IL, J. Y., AND L ENZ, K. Keyword- and defaultparameters in Java. Journal of Object Technology 11, 1 (2011), 1:1–17.Google ScholarGoogle Scholar
  19. H OLT, R. C., AND W ORTMAN, D. B. A sequence of structured subsets of PL/I. SIGCSE Bull. 6, 1 (Jan. 1974), 129–132. Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. H OMER, M., J ONES, T., N OBLE, J., B RUCE, K. B., AND B LACK, A. P. Graceful dialects. In ECOOP (2014), pp. 131– 156.Google ScholarGoogle Scholar
  21. H OMER, M., AND N OBLE, J. A tile-based editor for a textual programming language. In Proceedings of IEEE Working Conference on Software Visualization (Sept 2013), VISSOFT’13, pp. 1–4.Google ScholarGoogle Scholar
  22. H OMER, M., AND N OBLE, J. Combining tiled and textual views of code. In Proceedings of IEEE Working Conference on Software Visualization (Sept 2014), VISSOFT’14. Google ScholarGoogle ScholarDigital LibraryDigital Library
  23. H OMER, M., N OBLE, J., B RUCE, K. B., B LACK, A. P. ., AND P EARCE, D. J. Patterns as objects in Grace. In DLS (2012), pp. 17–28. Google ScholarGoogle ScholarDigital LibraryDigital Library
  24. H OSOYA, H., V OUILLON, J., AND P IERCE, B. C. Regular expression types for XML. In ICFP (2000), pp. 11–22. Google ScholarGoogle ScholarDigital LibraryDigital Library
  25. I NGALLS, D. H. H. The Smalltalk-76 programming system design and implementation. In POPL (1978). Google ScholarGoogle ScholarDigital LibraryDigital Library
  26. J ONES, M. P. Experience report: playing the DSL card. In ICFP (2008). Google ScholarGoogle ScholarDigital LibraryDigital Library
  27. J ONES, T., AND N OBLE, J. Tinygrace: A simple, safe and structurally typed language. In FTFJP (2014). Google ScholarGoogle ScholarDigital LibraryDigital Library
  28. K ATS, L. C., AND V ISSER, E. The Spoofax language workbench: rules for declarative specification of languages and IDEs. In OOPSLA (2010). Google ScholarGoogle ScholarDigital LibraryDigital Library
  29. K LINT, P., V AN D ER S TORM, T., AND V INJU, J. Rascal: A domain specific language for source code analysis and manipulation. In SCAM (2009), pp. 168–177. Google ScholarGoogle ScholarDigital LibraryDigital Library
  30. L ORENZ, D. H., AND R OSENAN, B. Cedalion: a language for language oriented programming. In OOPSLA (Oct. 2011). Google ScholarGoogle ScholarDigital LibraryDigital Library
  31. M EIJER, E., B ECKMAN, B., AND B IERMAN, G. LINQ: Reconciling object, relations and XML in the .NET framework. In SIGMOD (2006), pp. 706–706. Google ScholarGoogle ScholarDigital LibraryDigital Library
  32. M OON, D., S TALLMAN, R., AND W EINREB, D. The Lisp Machine Manual, third ed. MIT AI Lab, 1981. Google ScholarGoogle ScholarDigital LibraryDigital Library
  33. O DERSKY, M. The Scala language specification. Tech. rep., Programming Methods Laboratory, EPFL, 2011.Google ScholarGoogle Scholar
  34. R EM O BJECTS S OFTWARE. The Oxygene language. elementscompiler.com/elements/oxygene/, 2015.Google ScholarGoogle Scholar
  35. R OMPF, T., AND O DERSKY, M. Lightweight modular staging: a pragmatic approach to runtime code generation and compiled DSLs. In GPCE (2010), pp. 127–136. Google ScholarGoogle ScholarDigital LibraryDigital Library
  36. T OBIN -H OCHSTADT, S., S T -A MOUR, V., C ULPEPPER, R., F LATT, M., AND F ELLEISEN, M. Languages as libraries. In PLDI (2011). Google ScholarGoogle ScholarDigital LibraryDigital Library
  37. T ORGERSEN, M. Querying in C#: How language integrated query (LINQ) works. In OOPSLA Companion (2007). Google ScholarGoogle ScholarDigital LibraryDigital Library
  38. U NGAR, D., AND S MITH, R. B. SELF: the Power of Simplicity. Lisp and Symbolic Computation 4, 3 (June 1991). Google ScholarGoogle ScholarDigital LibraryDigital Library
  39. V OELTER, M. DSL Engineering: Designing, Implementing and Using Domain-Specific Languages. dslbook.org, 2013.Google ScholarGoogle Scholar

Index Terms

  1. From APIs to languages: generalising method names

    Recommendations

    Comments

    Login options

    Check if you have access through your login credentials or your institution to get full access on this article.

    Sign in

    Full Access

    PDF Format

    View or Download as a PDF file.

    PDF

    eReader

    View online with eReader.

    eReader
    About Cookies On This Site

    We use cookies to ensure that we give you the best experience on our website.

    Learn more

    Got it!