Morpho-lang / morpho

The Morpho language 🦋. Morpho is a small embeddable language for scientific computing applications.
MIT License
33 stars 11 forks source link

Morpho v0.6.0 #247

Closed softmattertheory closed 8 months ago

softmattertheory commented 8 months ago

Move v0.6.0 into main.

Morpho now built as a shared library

Rather than the previous monolithic strucutre, the Morpho codebase has been divided into a shared library ("libmorpho") and a terminal application ("morpho-cli"). This means that Morpho can easily be embedded in other applications, and improves maintainability as these components can be updated separately. Morphoview has been migrated to a separate repository.

Internal improvements

Improved quadrature

Functionals like LineIntegral, AreaIntegral and VolumeIntegral can now make use of a greatly improved quadrature routine. This will become the default in future versions of Morpho. Particularly in 3D, the new routine offers significantly improved performance, and can be extended in future. To use the new quadrature routine simply set the method optional argument:

var a = AreaIntegral(integrandfn, method = {})

The method Dictionary can specifically request particular quadrature rules or orders; more information will be in the dev guide.

Namespaces

You can now use the import keyword with a new keyword, as, to import the contents of a module into a given namespace:

import color as col

print col.Red 

This helps Morpho programs avoid library conflicts and improves modularization.

Tuple data type

Morpho now supports Tuples, an ordered immutable collection. The syntax is similar to Python:

var t = (0,1,2,3)

Tuples act much like Lists, but can be used as keys in a Dictionary.

JSON import and export

Morpho now provides a JSON class which supports import and output using the JavaScript Object Notation (JSON) format, widely used for data interchange.

var a = JSON.parse("[1,2,3]")
print a 

Minor new features

Improved documentation

Many previously un- or under-documented features have now been added to the interactive help. If you notice something that isn't well documented, please alert us via the issue tracker in Github.

Minor fixes