Philosophy

From Rebertia

Jump to: navigation, search

Iguana...

  • has OCaml's inferred typing and pattern matching without unusual syntax and difficult monads
  • has Python's clean syntax but with anonymous code blocks and better object-orientation
  • has Ruby's anonymous blocks and dynamism without Perlisms or clutter
  • has Erlang's concurrency but with proper strings and a more normal syntax
  • has Eiffel's design by contract without the unnecessary B&D
  • has Smalltalk's object-oriented purity but manages to play nice with *nix
  • is like a modern Lisp with a more straightforward macro facility
  • is like Perl6 without the baggage, and it might actually get implemented
  • makes interfacing with external programs not that hard, like bash
  • JavaScript
  • is NOT Java, though it is implemented in it
  • is an admitted example of Greenspun's Tenth Rule in action

Contents

Lessons learned from other languages

A review of the Pros and Cons of those who came before us.

General

C++

Java

Pros
  • Cross-platform
  • No "hard", opaque crashes; you always get a nice exception traceback
  • Package system relatively nice
Cons
  • Very verbose (need I say more than: public static void main and System.out.println)
    • Also demonstrates how manifest typing sucks: Map<String,String> mapping = new HashMap<String,String>()
    • Limited dynamism
  • No operator overloading
    • Makes custom numerics painful.
    • Yet Sun gets to override + operations involving strings. WTF.
    • I can't tell you how many times == has bitten me.
      • If Iguana even has an operator for pointer equality, it shall be a purposefully ugly and obscure one.
  • No first-class functions or closures
  • Primitive types (incomplete OO)
  • Ab(use) of classes as general-purpose namespaces
  • One-class-per-file leads to explosion in the number of files and overhead in managing them
  • Several of the "general points" apply
  • No default argument values. True, there is overloading, but many of these are trivial.
  • Checked exceptions
  • Hard to integrate with native platform and external programs

Python

Pros
  • Clean & elegant syntax & semantics
  • Numerous others; when in doubt, follow Python's choice
Cons

Yes, there are some; otherwise I wouldn't be designing Iguana.

  • Object-orientation has a few warts (explicit self; len() as function)
  • No anonymous code blocks
  • Indentation-based syntax turns some people off (albeit for irrational reasons)
  • No static typing. Static typing is actually useful in many cases if used right; obviates documentation in some cases.
  • No concept of interfaces, beyond duck typing; sometimes it's nice to be more rigorous about these things. Case in point: "file-like object"

Ruby

Pros
  • Anonymous blocks makes pseudo-DSLs a snap
  • Semicolon and braces-free syntax
Cons
  • Copied a bit too liberally from Perl in some cases
  • Pervasive culture of unsafe monkeypatching
  • APIs could definitely be cleaner
  • Exact semantics of anonymous blocks could be tweaked for the better
  • Everything as an expression; it just feels strange.

Eiffel

Pros
  • Design by contract
Cons
  • Confusing assertions with exceptions
  • Extremely B&D
  • Shares many of Java's Cons

Smalltalk

Pros
  • Fully object-oriented
  • Dynamic
  • Meta-object protocol
Cons
  • Hard to integrate with outside world
    • Image-based nature
    • Takes being its own platform to the Nth degree; clearly all PLs are their own platforms somewhat, but it goes a tad too far.
  • Takes OOP/orthogonality arguably too far (with if-else and while being magic methods)

Lisp

Pros
  • Macros
Cons
  • Macros - they're too powerful for their own good and inhibit collaboration
  • Lack of syntax removes visual cues and leads to verbosity

Perl 6

Pros
  • Has actually discovered and brought together several good ideas
    • Traits
    • Subtypes
Cons
  • See any Pythonista critique of Perl; particularly, TIMTOWTDI

Haskell

Pros
  • Demonstrates beauty/elegance/usefulness of FP and virtues of immutability
  • Inferred typing; it's quite sexy
Cons
  • Default lazy evaluation can be very non-intuitive. As OCaml has shown, we can do FP while retaining eager evaluation.
  • Monads - they tend to complicate things
  • Odd syntax in some cases, particularly the whole (f x y) / f x y rather than f(x, y) thing
  • No way to escape purity; it would be rather handy sometimes
  • No object-orientation
Personal tools