Giter Site home page Giter Site logo

chili's Introduction

🌶 The Chili Programming Language

Chili is a general-purpose, compiled programming language, focused on productivity, expressiveness and joy of programming™.

At this stage, Chili brings the syntax and fun of a modern, high-level programming language, a robust type system and the performance characteristics of a low-level language.

Hello, World

fn main() = println("Hello, World!")

For more information about up-to-date syntax and language features, check out the demo file.

Getting Started

For Windows

There are a couple of prerequisites here. First, make sure you have Rust's toolchain installed. Second, make sure you have Visual Studio Build Tools installed. You can also initialize Visual Studio's environment by running vcvarsall.bat x64, which should be under ...\VC\Auxiliary\Build.

You have to compile Chili from source and set up a working directory, to do that, navigate to Chili's directory and run:

./build.bat release

This will create a directory called dist/release under Chili's directory. To build Chili for debug, run ./build.bat debug.

For *Nix systems

First, make sure you have Rust's toolchain installed.

For Linux, make sure you have llvm-12 and clang installed through your package manager.

MacOS is currently not supported, but will be in the future.

Navigate to Chili's directory and run:

sh build.sh release

This will create a directory called dist/release under Chili's directory. To build Chili for debug, run sh build.sh.

Trying it out

For ease of use, I recommend adding dist/release to your PATH environment variable.

In your terminal, run chili .\examples\playground\build.chl

chili examples/playground/build.chl

You should see "Hello, World!" in printed to your terminal.

To run a compile and run a file directly, without using Chili's build API, use the --run flag. Test this out by running the hello world example:

chili examples/hello_world.chl --run

For some examples of what you can do with Chili, check out the examples folder.

Tooling

  • VSCode plugin is available here (currently includes syntax highlighting)

Tasks

Compiler

  • Functions
  • Variables
  • Static Typing
    • Global type inference
    • Scalar types
    • Pointers & Arrays & Slices
    • Structs & Tuples
  • Modules & Imports
  • Binding patterns: Struct/Module unpack, Tuple unpack and Wildcard
  • Compile time execution with FFI support
    • FFI support
    • Build configuration based on compile-time execution
  • Dynamically sized types
  • Static variables
  • Attributes
  • Default function arguments
  • Panic function
  • Varargs
  • Printing
  • Memory management model (The design is still in progress)
    • Ownership (Move & Copy semantics)
    • Safe references ("Borrowing")
    • Regions
  • Parametric polymorphism - supporting both types and constant values
  • Associated functions / Methods
  • Enums & Pattern matching
    • Option & Result types
    • Try operator: ?
  • Traits / Typeclasses
  • format function
  • Closures
  • Built-in code testing

Standard library

  • OS Abstractions for Windows
    • Filesystem API
    • Networking and HTTP
    • Date/Time
  • OS Abstractions for Linux
    • Filesystem API
    • Networking and HTTP
    • Date/Time
  • OS Abstractions for MacOS
    • Filesystem API
    • Networking and HTTP
    • Date/Time
  • Formatting/Printing
  • Basic data structures
    • Box
    • List/Vec/Seq (Haven't settled on a name yet)
    • String
    • HashMap
    • HashSet

Contributing

As the language is in its very early stages, every contribution will help in shaping Chili into what it will become. The best way to contribute right now, is opening issues/bugs and suggesting features/changes. This project is open source, and always will be.

Our Discord Server

chili's People

Contributors

c-bj avatar r0nsha 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.