Coder Social home page Coder Social logo

hello-world's Introduction

Hello, World!

Build Status

Hello, World! Is a programming language for writing hello world applications. And nothing else.

Syntax

Hello, World!

The   Hello, World! token (two spaces, followed by the string "Hello, World!") will evaluate to the string "Hello, World!". This token is represented internally as a HelloVal. Once the interpreter parses a HelloVal, it will not parse anything else.

Comments

Since everything after a HelloVal is ignored, it is possible to document your programs with comments like so:

  Hello, World! This is a comment
  Hello, World! This is another, slightly more interesting comment
  Hello, World!

The program above will output the following:

Hello, World!
Hello, World!
Hello, World!

Boolean Logic

You can implement simple boolean logic by utilising the fact that anything other than a HelloVal is an error.

  Hello, World!
False
  Hello, World! This will never be evaluated

The above program will conveniently explode on the False statement, and output the following:

Hello, World!
Parse error at "your face" (line 1, column 1):
unexpected "F"

Installation

git clone https://github.com/wildlyinaccurate/hello-world.git
cd hello-world
caban sandbox init
cabal install
make

Usage

Hello, World! can be run as a REPL

$ ./bin/hello-world
hello=>   Hello, World!
Hello, World!
hello=> Hello, World!
Parse error at "lisp" (line 1, column 1):
unexpected "H"
expecting "  Hello, World!"
hello=> what even is this
Parse error at "lisp" (line 1, column 1):
unexpected "w"
expecting "  Hello, World!"

Or it can take programs directly

$ ./bin/hello-world '  Hello, World!'
Hello, World!

Why?

Shut your face.

hello-world's People

Contributors

wildlyinaccurate avatar

Watchers

 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.