Designing and Interpreting a Mathematical Programming Language

The syntax of the programming languages has a significant impact on the definition and validation of mathematical calculations. In particular, the management of code identification and validation processes can be made easier and faster, depending on the parametric behavior of the functions. In this article, a programming language that supports the use of mathematical function structures is designed and an interpreter, which can evaluate the source code written in this language, is developed. The language syntax is represented by an LL (k) grammar defined in the BNF notation. The interpreter consists of several basic components such as parser, semantic controller and code evaluator, each of which makes a different kind of code interpretation. The LL (k) parser component used for the syntactic analysis of the language is generated via an automatic code generation tool called JavaCC. The other components work on the abstract syntactic tree that this parser generates. To illustrate the use of the language with code samples, several mathematical algorithms that include calculations on different sequences of numbers, are programmed and interpreted. The paper also performs a comparative analysis of the language with some related ones. The paper also performs a comparative analysis of the language with some related ones based on some design principles and mathematical aspects.

___

[1] L. K. C. Louden, “Programming Languages: Principles and Practices", Cengage Learning, 2011.

[2] R. Harper, "Practical Principles for Programming Languages", 2nd ed., Cambridge University Press, 2016.

[3] B. W. Kernighan and D. M. Ritchie, "The C Programming Language", Prentice Hall Professional Technical Reference, 1988.

[4] L. Wall, T. Christiansen and J. Orwant, "Programming Perl", 3rd ed., O'Reilly Media, 2000.

[5] M. Mateas and N. Montfort, "A Box, Darkly: Obfuscation, Weird Languages, and Code Aesthetics", In Digital Arts and Culture: Digital Experience: Design, Aesthetics, Practice (DAC 2005), Copenhagen, Denmark, 2005.

[6] International Obfuscated C Code Contest., https://www.ioccc.org/, 2018.

[7] J. Wakerly, "The programming language Pascal", Microprocessors and Microsystems, vol. 3, no. 7, pp. 321-326, 1979.

[8] K. Arnold, J. Gosling, and D. Holmes, "The Java programming language", Addison Wesley Professional, 2005.

[9] A. Hejlsberg, M. Torgersen, S. Wiltamuth, and P. Golde, "C# Programming Language", Addison-Wesley Professional, 2010.

[10] G. Sussman and G. L. Steele, Jr., "Scheme: A interpreter for extended lambda calculus", Higher-Order and Symbolic Computation, vol. 11, no. 4, pp. 405-439, 1998.

[11] S. P. Jones. "Haskell 98 language and libraries: the revised report", Cambridge University Press, 2003.

[12] L. Sterling and E.Y. Shapiro, "The Art of Prolog: Advanced Programming Techniques", 2nd ed., The MIT Press, 1994.

[13] M. V. Hermenegildo, F. Bueno, M. Carro, P. López-García, E. Mera, J. F. Morales and G. Puebla, "An overview of Ciao and its design philosophy", Theory and Practice of Logic Programming - Prolog Systems, vol.12, no. 1-2, pp. 219-252, 2012.

[14] W. T. Richter, "TEX and Scripting Languages", Proceedings of the Practical TEX 2004 Conference, TUGboat, vol. 25, no. 1, pp. 71-88, 2004.

[15] L. Lamport, "LateX : A document preparation system", 2nd ed., AddisonWesley, 1994.

[16] F. Houlette, "SQL: A Beginner's Guide", McGraw-Hill Education, New York, US, 2000.

[17] IBM Security QRadar, "Ariel Query Language (AQL) Guide v7.3.1", IBM Corp., 2017.

[18] D. J. Higham , N. J. Higham, The Matlab Guide, 3rd ed., SIAM, 2017.

[19] M. Trott, "The Mathematica guidebook for programming", Springer, 2014.

[20] D. E. Thomas, P. R. Moorby, "The Verilog Hardware Description Language", 5th ed., Springer, 2002.

[21] D. L. Perry, "VHDL: Programming by Example", McGraw-Hill Education, 2002.

[22] M. McKinley, "The Game Animator's Guide to Maya", Sybex, 2006.

[23] A. Tavakkoli, "Game Development and Simulation with Unreal Technology", Routledge, 2015.

[24] J. Kallrath, "Modeling Languages in Mathematical Optimization", Springer, Boston, MA, 2004

[25] J. R. Levine, J. R. Levine, T. Mason and D. Brown, "Lex & Yacc", O’Reilly Media, Inc., Sebastopol, CA, USA, 1992.

[26] E. M. Gagnon and L. J. Hendren, "SableCC, an object-oriented compiler framework", In TOOLS USA 98 (Technology of ObjectOriented Languages and Systems), IEEE, 1998.

[27] V. Kodaganallur, "Incorporating language processing into Java applications: A JavaCC tutorial", IEEE Software, vol. 21, no. 4, pp. 70–77, 2004.

[28] A. J. Dos Reis, "Compiler Construction Using Java, JavaCC, and Yacc", IEEE Computer Society, Inc., 2012.

[29] E. Gamma, R. Helm, R. Johnson, and J. Vlissides, "Design Patterns: Elements of Reusable Object-Oriented Software", Addison-Wesley Reading, MA, 1995.

[30] R. Harper, Practical Principles for Programming Languages, 2nd ed., Cambridge University Press, 2016.