Skip to content

Instantly share code, notes, and snippets.

@rmartinho
Last active October 10, 2015 14:58
Show Gist options
  • Save rmartinho/3707974 to your computer and use it in GitHub Desktop.
Save rmartinho/3707974 to your computer and use it in GitHub Desktop.
Halcyon

This document is an informal collection of design ideas for the Halcyon programming language. This document in in permanent draft status; do not take anything you read here as final. There are no plans to ever actually implement the ideas here; they're listed only for future reference.

Wants

  • Static, strong typing

    Type errors at runtime are stupid.

  • Type inference

    Having to type types that the compiler knows is stupid.

  • First-class monadish things

    Something along the lines of F# computation expressions. I think I'll call them "environments".

  • Compile-time metaprogramming/code generation

    Syntactic and semantic manipulations are cool. I'm thinking of stuff along the lines of boo's syntactic macros, AST attributes and metafunctions; not along the lines of Ruby-style metaprogramming or C++ template metaprogramming.

  • Proper Unicode support

    "Are Halcyon strings UTF-8 or UTF-16?" is a question that makes no sense. Halcyon strings are sequences of codepoints, not code units. By that I don't mean they're UTF-32; saying they're UTF-32 makes as much sense as the question above: zero.

  • Proper iteration

    Only three loops are needed: while, do-while, and Python-like for-in. C#-like iterators or Python-like generators or any other yield-like construct does wonders with for-in.

  • Fundamental types in all shapes and sizes

    Integers can be signed or unsigned, and can have 8, 16, 32, 64, or 128 bits. Floating point numbers can be binary 16-, 32-, 64-, 80-, or 128-bit; or decimal 32-, 64-, or 128-bit. Machine word sized integers also exist in signed and unsigned variants. And hardware sized floats as well.

  • Bigints and multiple-precision floats

    The last option on the zero-one-infinity rule.

  • Unit type

    Everything has a value, even if a meaningless one.

  • Modules

    A nice module system is nice.

  • Purity

    Maybe D-like, in that only observable purity is required.

  • Number theory concepts

    Rings, groups, etc, can be defined by types. This is the basis for things like operator +.

  • Proper resource handling

    As in C++ style scope based resource management.

Don't wants

  • Octal or binary literals

    Octal is only ever useful for chmod. Binary is hardly useful for anything over 8 bits. Hexadecimal should cover everyone's needs. Write a syntactic extension if you desperately want binary or octal literals.

  • Support for anything other than x86 and ARM

    If it forces me to make the language any more complex than I want, I don't care about your platform.

  • void

    A function that returns nothing? Sorry, but no. Return unit, it's implicit.

  • Global namespace

    Namespace all the things

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment