Giter Club home page Giter Club logo

ritchie's Introduction

Ritchie Language

Ritchie is an expressive and efficient language for the C ecosystem. Ritchie uses C libraries natively and generates easy to understand C code. It is named after the great computer scientist Dennis Ritchie, if not for whom we would all be programming in Visual Basic.

There are five core principles behind Ritchie:

  1. Ease of programming, inspired by Python
  2. Fast, like C code
  3. Type safety, like Scala
  4. Ability to go lower level and write C code
  5. No reserved keywords, everything is redefinable

We ran the prime counting benchmark for Ritchie, C and Python. Here's what we got:

Ritchie C Python
Runtime (ms) 457 424 7836
Characters of code 423 542 474

The best way to introduce yourself to this language is to take a look at some of the examples and try running them. Ritchie is still in early development; many features have not yet been fully implemented or described. A list of major development tasks remaining can be found in the wiki.

Features

  • Ritchie uses type inferencing, so the boilerplate Java statement:
Point point = new Point (x,y)

becomes a short Ritchie statement:

point = Point x, y

Identifiers have their type inferred when they are first used and their type cannot be changed after that. In the above example, point gets type Point.

  • Ritchie tries to follow English linguistic constructs, so, most of Ritchie language expressions take the form:

    Subject Verb Object

    The following phrase:

hello = "Hello"

parses as:

Subject Verb Object
hello = "Hello"
  • Ritchie has no keywords. There are many symbols with predefined meanings, but the intention of Ritchie is to have all those symbols redefineable. Currently Ritchie has been developed with a standard dialect of Ritchie in mind, and to that effect many symbols work as keywords might otherwise have in other languages. For example to define a class in Ritchie, you would type
SomeClass :: SomeBaseClass

The :: is simply a verb that reads "become a subclass of".

  • We call verbs what the constructs called functions, methods or subroutines in other languages. For example:
Integer : factorial Integer n
	result = 1
	i for 1,n+1
		result = result * i
	-> result

print factorial 5

There's no assignment operator in Ritchie, but = is defined as an assignment verb for Identifier.

  • A special type of verb is a control flow verb.

if, while and for in Ritchie are all such verbs. They are not keywords, as you can redefine them, although this is probably not a good idea.

  • Ritchie is whitespace sensitive

Get started

  1. Build the ritchie compiler make clean;make
  2. Write your ritchie program in your favourite text editor (let's call it program.rit)
  3. Set RITCHIE_HOME export RITCHIE_HOME=/path/to/ritchie
  4. Run ${RITCHIE_HOME}/ritchie.sh program.rit and ritchie will build, execute and run the program

Team

Ritchie Language is being developed by a group of efficiency obsessed programmers for demanding programmers who want both the conciseness of Python and the efficiency of C.

Concept: Rohana Rezel (Riolet Corporation)

Design and implementation: Joe Pelz, Phillip Hood and Dimitry Rakhlei (final year students at BCIT, Burnaby, BC, Canada)

ritchie's People

Contributors

chris1221 avatar dimitryrakhlei avatar joepelz avatar kissaki avatar phillhood avatar rrezel avatar vijaykiran 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.