GithubHelp home page GithubHelp logo

happy-ferret / hummingbird Goto Github PK

View Code? Open in Web Editor NEW

This project forked from dirk/hummingbird

0.0 1.0 0.0 791 KB

Typed language compiling to JavaScript & LLVM

Home Page: http://hummingbird-lang.org/

License: Other

JavaScript 26.56% C 0.70% Harbour 0.23% Shell 0.02% TypeScript 67.77% Yacc 4.71%

hummingbird's Introduction

Build Status Coverage Status

Hummingbird

Hummingbird is a language inspired by JavaScript, ML, and Swift. It features/will feature a usable type system with ML-inspired type inference, JavaScript code generation, and a concise syntax designed for readability.

Example

An obligatory hello world:

let welcome: String = "Hello "
func sayHello () -> Boolean {
  console.log(welcome + "world")
  return true
}
sayHello()

For more examples see the specification and manual.

Getting started

The quickest way to get started is to clone the repository and use that directly. This language is actively being built out, so many features you would expect may be missing.

git clone [email protected]:dirk/hummingbird.git
cd hummingbird
# Install the dependencies
npm install
# We're actively transitioning to TypeScript, so right now you'll need to
# call the `compile` or `watch` tasks to compile the sources to JavaScript.
# nb. We use a custom invocation script for Jake that exposes the V8
#     garbage collector.
./jake # Default task, calls ts:compile
# Run the command-line tool with no arguments to see the options
bin/hb
# To see the parsed and type-checked AST of a file
bin/hb inspect examples/simple.js
# To compile and run a file
bin/hb run examples/simple.js

Contributing

To contribute just fork the repository, commit your changes on a branch on your fork, and create a pull request!

If you're planning to introduce significant changes/features, then we highly suggest creating an issue with the "Proposal" label ahead-of-time so that everyone can contribute to a discussion before starting to commit development time. We really don't want to have to needlessly turn down pull requests!

Specification

The Hummingbird specification is designed to be both human- and machine-readable. It is organized into sections for each syntactical and semantic feature of the language.

Each feature has a <spec name="..."></spec> block containing the Hummingbird example source and the expected JavaScript output. These can then be parsed and a full suite of unit tests generated in test/spec/.

# Generating the spec tests
npm run gen-spec
# Running those tests
npm run test-spec

Native compilation (via LLVM)

The LLVM-based native compiler is still in its pre-alpha stages and should be considered very unstable. Getting started with it requires a few more steps on top of the basic setup:

# The BDW garbage collector is required for building and running, so
# make sure you have it installed. On a Mac with Homebrew you will
# want to do:
brew install bdw-gc
# Call the Jake default task if you haven't already to build the
# standard library "extension" objects
./jake
# Then call the native compiler with a source file
bin/hbn examples/simple.hb
# And run the compiled binary
./a.out

License

Released under the Modified BSD License. See LICENSE for details.

hummingbird's People

Contributors

dirk avatar horak avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.