merd    hoch http://merd.sf.net
 
  Beschreibung: From merd's homepage:
merd is a language inspired (mainly) by Caml, O'Haskell and Ruby. It also has many features of Dylan.

Features:

  • function/method calling
    • parametric and ad'hoc polymorphism (overloading/refining/specializing)
    • late binding
    • default parameters
  • types
    • strongly typed
    • static typing (keeping expressivity!)
    • type inference (see ML, and more precise O'Haskell)
    • subtyping (extendable structs, extendable datatype, subranges...)
    • abstract-types (mix-in's, aka type-classes)
    • types as first-class citizen
  • functional programming
    • functions as first-class citizen (even overloaded one)
    • anonymous functions
    • partial application (currying)
  • sugaring
    • user definable operators (infix, prefix, suffix, multi-op, around-op)
    • OO-like syntax (purely syntactic)
    • indentation based grouping (see Haskell&Python), also called layout
    • horizontal layout: 1+2 * 3 is (1+2) * 3 (merd innovation!)
    • pattern-matching (see ML)
    • macros (?)
  • extensible powerful library


All in all, sounds like a really interesting languge, even if not yet an interpreter is available.


  Fakultät   Pixel
# Drei Fakultäts Funktionen

fact :=
    0 -> 1
    n -> n * fact(n-1)

fact'(n) := if n == 0 then 1 else n * fact'(n-1)

fact''(n) :=
    fact = 1
    while n >= 0 do
        fact *= n
        n--
    fact
Berechnet die Fakultät. Ergibt 720.


 Hello World   Pixel
# Hello World in merd

"Hello World!".println
Gibt "Hello World" auf dem Bildschirm aus.


 Squares (1)   Pixel
println(
    1..10.map(n -> "{n ** 2}").join(" ")
)
Gibt die Quadrate von 1 bis 10 aus.


 Squares (2)   Pixel
1..10.map(** 2 ~ to_string).join(" ").println
Gibt die Quadrate von 1 bis 10 aus.