Coder Social home page Coder Social logo

cecile's Introduction

Group 1 (2)

The Cecile Programming Language

โญ Introduction

The Cecile, a little programming language designed for simplicity and flexibility.

๐ŸŽ Overview

Welcome to the Cecile programming language.

This language is part of my journey into learning compiler and interpreted languages. It's inspired by ajeetdsouza/loxcraft, a great Rust project that implemented the Lox language.

The syntax of Cecile is influenced by traditional programming languages like JavaScript, Go, and Rust, with a strong emphasis on developer experience, readability and ease-of-use.

Cecile is written in Rust. Some of performance matter part is written in Unsafe Rust that makes fast enough to compete with traditional interpreted languages like Javascript, Python.

Important note: This project is built for learning purposes. The code quality of this project is definitely not production ready.

๐Ÿ“• Features

Language features

  • Interpreted
  • Bytecode compiler
  • Garbage collected in runtime
  • Type Supported
  • Basic types, Array
  • Control flow statements
  • Object Oriented Programming
  • Stack tracing
  • Repl

Ongoing features

  • Online playground

For compiled version of Cecile

  • Make compiled
  • Self-hosted
  • Standart library
  • Module system

๐Ÿ”ฅ Syntax examples

Variable Declaration

// Variable Declaration
let number: int = 1;
let string: String = "string";

// Ofcource you don't need to write type everytime you declare variable
let number = 2;
let string = "hello cecile";

Function Declaration

fn say_hello() -> String {
  return "hello";
}

println say_hello() // Out: "hello"

Type Declaration

type Point {
  x: int,
  y: int,
}

impl Point {
  fn new(x: int, y: int) {
    self.x = x;
    self.y = y;
  }
}

let point: Point = Point();

Array & Builtin function

let arr = [1, 2, 3, 4];
arr.push(5);

println arr; // Out: [1, 2, 3, 4, 5]

โš™๏ธ๏ธ Build Guide

๐Ÿฆ€ Install Rust

We recommend installing Rust using rustup. You can install rustup as follows:

  • macOS or Linux:

    curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
  • Windows (64-bit):

    Download the Windows 64-bit executable and follow the on-screen instructions.

๐Ÿ™ Install Cecile

# Install 'Cecile'
$ cargo install Cecile --locked

Now to use Cecile language, in your terminal, run:

Cecile

cecile's People

Contributors

your-moon avatar

Stargazers

Munkhuu James avatar Baatar avatar invisageable avatar  avatar  avatar Andrew Johnson avatar

Watchers

Baatar avatar  avatar

cecile's Issues

Self keyword issue

when super calls, self should call superclass

type Doughnut;

type Cruller;

impl Doughnut {
    fn new() {
    }

    fn do(s: String) {
        println "Do something with doughnut";
    }
 
    fn finish(ingredient: String) {
        println "Finish with " + ingredient;
    }

    fn cook(s: String) {
        println "Dunk in the fryer.";
        self.do("fry");
    }

}


impl Cruller < Doughnut {
    fn new() {
    }
    
    fn do(s: String) {
        println "Do something with cruller";
    }

    fn finish(ingredient: String) {
        super.finish("icing");
    }
    
    fn cook(s: String) {
        super.cook("S");
    }

}

let crul = Cruller();
crul.finish("S");
crul.cook("S");

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.