Code Monkey home page Code Monkey logo

agora's Introduction

The agora programming language

Agora is a dynamically typed, garbage collected, embeddable programming language. It is built with the Go programming language, and is meant to provide a syntactically similar, loose and dynamic companion to the statically typed, machine compiled Go language - somewhat like Lua is to C.

Installation

go get -t github.com/PuerkitoBio/agora/...

This will install the agora packages as well as the agora command-line tool. See agora -h for help, provided the $GOPATH/bin path is in your exported path. The -t flag installs the test dependencies, it works only on Go 1.2 and later, omit it otherwise.

Example

Much more examples are available in the wiki and the source code under /testdata/src, but to give a taste of the syntax, here is the mandatory hello world:

// Output: Hello, Agora !
fmt := import("fmt")
func greet(name) {
	fmt.Println("Hello,", name, "!")
}
greet("Agora")

A few things to note:

  • It looks very similar to Go, minus the types.
  • import is a built-in function, not a keyword. This is important with dynamically-loaded modules, it gives you control of where this overhead of loading and compiling the code is done. It returns the value exported by the module - in this case, an object that exposes methods like Println.
  • Obviously, since this is a dynamically-typed language, arguments have no types.
  • := introduces a new variable. Using an undefined variable is an error, so this statement could not have been =.
  • Statements are valid in the top-level (module) scope. That's because a module (the name for an agora file) is an implicit (top-level) function.
  • Semicolons are managed just like in Go, so although they are inserted in the scanning stage, they are optional (and usually omitted) in the source code.

Resources

Changelog

v0.2.0 / 2013-10-08

v0.1.0 / 2013-09-17

License

Agora is licensed under the BSD 3-Clause License, the same as the Go programming language. The full text of the license is available in the LICENSE file at the root of the repository.

agora's People

Contributors

mna avatar

Stargazers

 avatar

Watchers

 avatar  avatar  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.