Posted in Uncategorized | Comments Off

## Protected: Map-like functions in Ur/Web

Posted in Uncategorized | Comments Off

## Some mathematics

Using the latex plugin to wordpress, one can write formulae into a blog post!

$\alpha+\beta\geq\gamma$

Cool.

Posted in Uncategorized | Comments Off

## On Standard ML

What does SML offer for customers?

Safety, speed, expressiveness and platform independence.

SML is a typed functional language so every operation is applied to arguments whose type are as expected. This is in contrast to weakly typed languages like C where using pointers one can really make bogus mistakes which cannot be found easily. In so-called dynamic languages one have one type Everything, and it contains really anything, making it easier to write code but making it harder to understand it. And, as the old software engineering dictum says a formal notation should be easy to read rather than easy to write.

This property, that functions are always applied to proper arguments is summarised in the sentence "Well-typed programs cannot go wrong". If there is a mismatch in the program, it turns out at compile time. It is a common experience for functional programmers that once a simple program compiles it runs flawlessly. This might not be true for large programs but the absence of core dumping helps testing.

As SML is used in many verification systems based in mathematical logic, the question arose: is the language safe? The answer is positive. There is a machine-checked proof that Standard ML fulfill safety properties. This was done using the formal definition of the language.

That was safety. Let us turn towards speed. SML is fast, concerning both development and execution.

As the type system catches errors early, bugs can be fixed in time. It is said that significant time can be saved on development using a functional language. SML has a whole-program optimising compiler, called Mlton. The code it produces is comparable to compiled C code in speed.

On expressiveness: ML's powerful type system allow to express important properties about functions. It can serve as a documentation. The module system continue this on the large scale: a signature, which is akin to an interface in Java, conveys much information about the code without having to read it. Functors are similar to C++ templates, in a typed way.

Data types can express difficult properties, even a programming language. One notable application of SML is to write interpreters and compilers. Abstract syntax trees are easy to write using algebraic data types. The necessary functions are easy to write using pattern matching. It is customary to create Domain Specific Languages using ML.

Last but not least: platform independence.

Mlton runs on ARM, Alpha, AMD64, HPPA, IA64, PowerPC, PowerPC64, S390, Sparc and X86 architectures. Concerning operating systems, it is run on Linux, Cygwin/Windows, Mac OS X, MinGW/Windows, HP-UX, Solaris, FreeBSD, NetBSD, OpenBSD and AIX.

The ML Basis Library collects basic datatypes and interfaces to the underlying operating system in a generic manner.

Summarising this: Standard ML is a proper vehicle for systems programming. Do you have such a task to solve?

Posted in Uncategorized | Comments Off