Slideshare uses cookies to improve functionality and performance, and to provide you with relevant advertising. If you continue browsing the site, you agree to the use of cookies on this website. See our User Agreement and Privacy Policy.
Slideshare uses cookies to improve functionality and performance, and to provide you with relevant advertising. If you continue browsing the site, you agree to the use of cookies on this website. See our Privacy Policy and User Agreement for details.
Published on
Slides for my talk at Scala By The Bay 2015 http://scalabythebay2015.sched.org/event/8cbbc52523ac9e5a905361e00d357099
GNU Mathprog is an algebraic modeling language for describing mathematical programming models. The language is a subset of AMPL, the most popular language used for describing such models. One advantage of this languages is the similarity of its syntax with the mathematical notation used to describe optimization problems. In this talk we describe the use of Scala in the construction of an embedded DSL to work with Mathprog models. At construction time, the DSL works as an alternative way to build the AST representing the model, taking advantage of the Scala compiler to check the validity of most expressions. The AST can be created also by parsing Mathprog model files. Once an AST is obtained, the DSL allows to manipulate and transform the AST to extract data or create new models. We show how the use of type classes and implicit conversion prioritization gives us a systematic way to define operators, valid combinations of parameters and result types, and conversions between expressions.
https://github.com/gerferra/amphip
Login to see the comments