Releases: Morpho-lang/morpho
v0.6.1
Release notes for 0.6.1
We're pleased to announce Morpho 0.6.1, which incorporates very important new language features and sets morpho up for future improvements.
Types
Morpho now supports types. Variables can be declared with a specified type like so
String s = "Hello"
and the type of function parameters can be specified like
fn f(String s, List l) { }
Multiple dispatch
Morpho now supports multiple dispatch, whereby you can define multiple implementations of a function that accept different parameter types. The correct implementation to use is selected at runtime:
fn f(String x) { }
fn f(List x) { }
Methods defined on classes also support this mechanism. You can still specify parameters that without a type, in which case all types are accepted. Multiple dispatch is implemented efficiently (it incurs only a small overhead relative to a traditional function call) and is very useful to remove complex type checking. We are using this feature to improve how morpho works internally, as well as to implement new morpho packages.
Additional hessians
LineCurvatureSq and LineTorsionSq now provide the hessian() method.
Preliminary support for finite element discretizations
We have begun to include support for additional discretizations beyond the linear elements supported by prior versions of Morpho in the codebase. This feature is a work in progress and not yet completely ready for use; we expect to complete it in forthcoming releases.
Minor fixes
- Bugfixes to parallelization.
- Bugfixes to sparse linear algebra.
- Error messages now refer to the module in which the error was found.
- Can now call throw() and warning() directly on the Error class.
v0.6.1
Release notes for 0.6.1
We're pleased to announce Morpho 0.6.1, which incorporates very important new language features and sets morpho up for future improvements.
Types
Morpho now supports types. Variables can be declared with a specified type like so
String s = "Hello"
and the type of function parameters can be specified like
fn f(String s, List l) { }
Multiple dispatch
Morpho now supports multiple dispatch, whereby you can define multiple implementations of a function that accept different parameter types. The correct implementation to use is selected at runtime:
fn f(String x) { }
fn f(List x) { }
Methods defined on classes also support this mechanism. You can still specify parameters that without a type, in which case all types are accepted. Multiple dispatch is implemented efficiently (it incurs only a small overhead relative to a traditional function call) and is very useful to remove complex type checking. We are using this feature to improve how morpho works internally, as well as to implement new morpho packages.
Additional hessians
LineCurvatureSq and LineTorsionSq now provide the hessian() method.
Preliminary support for finite element discretizations
We have begun to include support for additional discretizations beyond the linear elements supported by prior versions of Morpho in the codebase. This feature is a work in progress and not yet completely ready for use; we expect to complete it in forthcoming releases.
Minor fixes
- Bugfixes to parallelization.
- Error messages now refer to the module in which the error was found.
- Can now call throw() and warning() directly on the Error class.
v0.6.0
Release notes for 0.6.0
We're pleased to announce Morpho 0.6.0, which represents a great deal of behind-the-scenes work to ready the Morpho codebase for future developments. See our Roadmap document for more details.
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
- Major code reorganization to improve the logical structure and maintainability of the morpho codebase.
- Transitioned to Cmake build system to improve cross-platform compilation.
- Rewritten parser to improve error reporting and enable reuse across Morpho.
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
- Formatted output for numbers is now available using the
format
method on theInt
andFloat
classes. - Errors can now be raised as "warnings", which are alerts to the user that do not interrupt execution.
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
- Many improvements to the debugger, including better support for printing object properties.
- Improved calculation of derivatives.
- Bugfixes to closures, string interpolation, parallel force and energy calculations and many others.
v0.6.0 prerelease
Prerelease for v0.6.0.
v0.5.7
0.5.7 is the final release in the 0.5 series. This release contains a number of improvements and bugfixes:
Windows install instructions fixed
We have updated the installation instructions for Windows with this release to work with either WSL1 or WSL2.
Gradients in AreaIntegral and VolumeIntegral
You can now compute the local gradient of a field using the grad() function within the integrand supplied to AreaIntegral and VolumeIntegral. This significantly enhances the number of models morpho can handle.
Improved System class
-
System.print(), System.readline() and System.sleep() methods added.
-
System.clock() now reports wall time (useful for testing the effect of parallelization)
-
System.arguments() provides access to the command line options morpho was run with.
Minor improvements
-
New Matrix.roll() and List.roll() methods shift the contents of a List or Matrix respectively.
-
Field.linearize() provides access to the underlying Matrix store.
-
IdentityMatrix() constructor function.
-
Debugger now supports printing of global variables and object properties.
-
Fix issues with compilation on some platforms.
-
Experimental support for accessing integrand values for individual elements on some functionals.
-
Numerous minor bugfixes.
v0.5.6
- Parallelized force and energy calculations
- New ways to extend morpho
- New manual chapter on visualization
- Many improvements and bugfixes
Parallelized Force and Energy calculations
Morpho now supports parallelized force and energy calculations, which can lead to significant speedups for some programs. To use these, run morpho with -w flag and supply the number of worker threads to use:
morpho5 -w4 program.morpho
Further features for parallel programming will appear in future releases.
Resources and Packages
The morpho runtime can now look for resource files---help files, morpho files, etc.---in multiple places. The default location is now configurable at installation, and also via a .morphopackages file stored in the user home directory. This enables morpho modules to live in their own git repository, together with resource files, and should make it easier for users to contribute to morpho. More details are in the dev guide.
Extensions
It's now possible to extend morpho through dynamic libraries written in C and linked at runtime. From the user's perspective, these work just like modules using the import
keyword.
New manual chapter on visualization
We continue to improve the manual, and now include a chapter on visualization. The developer guide has also been updated.
Other improvements
- Improvements to morpho's object model. New Function, Closures and Invocation classes provided that respond to standard methods.
- Fixes to some functionals to work correctly with 2D meshes.
- You can now supply anonymous functions in the arguments to a function.
- You can set the minimum and maximum values for plotfield using the optional cmin and cmax and arguments.
- Manual contains additional information on installation
Morpho 0.5.6 Release candidate 1
Morpho 0.5.6 includes:
Parallelized Force and Energy calculations
Morpho now supports parallelized force and energy calculations, which can lead to significant speedups for some programs. To use these, run morpho with -w flag and supply the number of worker threads to use:
morpho5 -w4 program.morpho
Further features for parallel programming will appear in future releases.
Resources and Packages
The morpho runtime can now look for resource files---help files, morpho files, etc.---in multiple places. The default location is now configurable at installation, and also via a .morphopackages file stored in the user home directory. This enables morpho modules to live in their own git repository, together with resource files, and should make it easier for users to contribute to morpho. More details are in the dev guide.
Extensions
It's now possible to extend morpho through dynamic libraries written in C and linked at runtime. From the user's perspective, these work just like modules using the import
keyword.
Other improvements
- Improvements to morpho's object model. New Function, Closures and Invocation classes provided that respond to standard methods.
- Fixes to some functionals to work correctly with 2D meshes.
- You can now supply anonymous functions in the arguments to a function.
- You can set the minimum and maximum values for plotfield using the optional cmin and cmax and arguments.
- Manual contains additional information on installation
v0.5.5
Release notes for 0.5.5
- Significantly improved performance, particularly on mesh generation.
- Improved manual and new developer's guide.
- New developer tools, including a debugger and profiler.
- Improvements to linear algebra functionality.
- Mixins
Documentation
We have added two new chapters to the manual, one on working with Meshes and the other describing the examples in detail. Additional chapters to follow. We've also improved the formatting of the manual, and a number of previously undocumented features are now documented in the manual and in the interactive help. A first draft of a developers guide, to be expanded on further, is also included.
Developer tools
Morpho now provides a profiler and a rewritten debugger. To use these, run with -profile or -debug respectively. Upon completion, the profiler will produce a report of the fraction of program execution time spent in each morpho function, allowing the programmer to identify optimization targets. We've used this tool to significantly improve a number of morpho components.
Mixins
You can now create a class from multiple other classes (called a mixin) using the new with
keyword:
class Foo is Boo with Hoo, Moo { ... }
Boo is the superclass of Foo, but methods defined in Hoo and Moo are copied into Foo before Foo's methods are defined. This enables greater modularity and facilitates code reuse.
New linear algebra features
Its now possible to convert Sparse matrices to dense matrices and vice-versa by passing them to the relevant constructor function, e.g.
var a = Sparse([[0,0,1],[1,1,1]])
var b = Matrix(a)
You can assemble matrices in block form using other matrices:
var c = Matrix([[a,0],[0,a]])
You can compute the eigenvalues and eigenvectors of a matrix with the new eigenvalues() and eigensystem() methods.
Preliminary work for numerical hessians is in place.
Other improvements
- Interactive mode now supports UTF8 characters.
- Object now provides respondsto() and has() to determine the available methods and properties respectively.
- Optimizing compiler [off by default; run with -O flag] lays the groundwork for significant future performance improvements.
- MeshGen and Delauney modules run significantly faster.
- Hydrogel functional is faster and dimensionally independent.
- Numerous minor bugfixes.
v0.5.4
v0.5.4, Oct 3 2022
- Morphoview now supports text rendering. The
graphics
,plot
andpovray
modules have been updated to support this, including newScaleBar
andplotmeshlabels
. - Meshtools extensively revised, including new
MeshPruner
class to coarsen meshes. 3D refinement now supported. Improved refinement of Selections. - Variadic functions can accept variable numbers of parameters.
- New
System
class will become a repository for new system-related functionality. - Many bugfixes.
Detailed notes:
Meshtools
The meshtools
module has been extensively revised with many new features:
- New
MeshPruner
class added that enables coarsening of meshes, analogous toMeshRefiner
. - Refinement of 3D elements.
- Refinement of selections is improved.
- Bugfixes for
MeshRefiner
andMeshMerge
to prevent duplicate elements being generated in some circumstances.
Text
The morphoview
application now supports text rendering. A number of modules have been updated to take advantage of this:
plot
now providesScaleBar
objects that are useful forplotfield
, as well asplotmeshlabels
to label a mesh with element ids.graphics
now provides aText
class for textual elements, and has some performance improvements.color
now provides a number of newColorMap
s:ViridisMap
,InfernoMap
,MagmaMap
andPlasmaMap
, all of which are more friendly for people with color vision deficiency.
Variadic functions
You can now create functions that accept a variable number of parameters. Arguments passed to a function can be accessed as a List
.
fn func(x, ...v) {
for (a in v) print a
}
Other improvements:
- New
VolumeIntegral
module to complementAreaIntegral
andLineIntegral
. - Internal improvements to the morpho virtual machine.
- A
System
class to enable you to get platform information. - Numerous bugfixes.
- Numerous improvements to the documentation.
- Improvements to the
povray
module. - New examples for
plot
module. - You can now translate the view in
morphoview
by right click and dragging or using alt-arrow keys.
0.5.3
This version includes the following highlights:
- Support for complex numbers with a Complex class.
- FloryHuggins replaced with Hydrogel functional.
- GaussianCurvature can now use geodesic curvature.
- MeshSlice module enables taking a cross section of a mesh (often useful for visualization)
- Added catenoid example.
- Support for M1 processor (use Makefile.m1 to compile).
- Improvements to continuous testing infrastructure.
- Numerous bug fixes including in the File class, mesh saving, the vtk module, meshgen, and many others.
Detailed notes:
- Fix register allocation issue in list creation by @softmattertheory in #115
- Fix Mesh saving by @softmattertheory in #106
- Fix107 by @softmattertheory in #113
- Bug fix by @ConduitDan in #108
- Minor bugfixes in meshgen by @softmattertheory in #117
- VTK fixes and improvements by @joshichaitanya3 in #109
- Added Complex Class by @ConduitDan in #104
- Hydrogel functional to replace the Flory-Huggins functional by @joshichaitanya3 in #120
- Change morpho_isfalse by @softmattertheory in #125
- Added option for geodesic curvature in the GaussCurvature functional by @joshichaitanya3 in #121
- More careful calculation of inclusive range limits (fixes #105) by @mattsep in #111
- Exaustive test by @ConduitDan in #126
- Examples/catenoid by @joshichaitanya3 in #127
- Reimplemented FIle class by @softmattertheory in #129
- M1 by @softmattertheory in #130
- Meshslice by @softmattertheory in #128
- Updates for 0.5.3 by @softmattertheory in #134
Full Changelog: v0.5.2...v0.5.3