Giter Club home page Giter Club logo

chaos's Introduction

Chaos

Logo

Turn chaos into magic!

GitHub Last Commit GitHub Commit Activity GitHub License GitHub Workflow Linter Checks Status GitHub Workflow Automated Tests Status GitHub Workflow Memory Leak Checks GitHub Workflow Memory Sanitizer GitHub Workflow Address Sanitizer GitHub Workflow Undefined Behavior Sanitizer GitHub Workflow Chaos C Extension Feature Tests Status Code Coverage (Codecov)

Chaos is a strongly typed, dynamic yet compilable, test-oriented procedural programming language that achieves zero cyclomatic complexity.

Influenced by

  • TypeScript's type safety
  • Python's syntax, modules and extensibility
  • JavaScript's cross-platform support
  • Ruby's loops and blocks, Rexx's FOREVER keyword
  • PHP's dedication to server-side
  • Haskell's pure functions
  • C's speed and interoperability
  • Go's standalone executables

Featured Aspects

  • There are no control structures. (no if..else, no switch..case) Decision making only possible on function returns:
     num def add(num x, num y)
         num z = x + y
     end {
         z == 8  : f1(),
         z > 10  : f2(),
         default : f3()
     }
  • A single unit test is enough to have 100% coverage on functions, always.
  • Warns you about untested functions in the executed program.
  • Detects possible runtime errors in compile-time.
  • Unique function call system that combines procedures with some aspects of functional programming paradigm.
  • No while or when keywords. Loops are mostly predetermined. Infinite loops can only be achievable through the INFINITE keyword.
  • There are break and continue statements but breaking a multiline loop inside a function is forbidden.
  • Single source of errors and unique exit codes for each one of them. So the errors are catchable by other programs.
  • Language's itself forces you to write less error-prone code.
  • Say goodbye to dependency conflicts with Occultist dependency manager.
  • Eliminated segmentation fault possibility using strict memory management and predictions.
  • Simplest C extension development framework so far.

Installation

Install the requirements:

make requirements

Compile the Chaos source:

make

Install the chaos binary system-wide:

make install

Interpreter

Interactive Shell

$ chaos
    Chaos Language 0.2.0 (Jan 20 2021 02:39:23)
    GCC version: 9.3.0 on linux
    Turn chaos into magic!

kaos> print "hello world"
hello world
kaos> exit
    Bye bye!

Program File as Command-line Argument

hello.kaos:

print "hello world"
$ chaos hello.kaos
hello world

Compiler

$ chaos -c hello.kaos -o hello
Starting compiling...
Compiling Chaos code into build/hello.c
Compiling the C code into machine code...
Cleaning up the temporary files...

Finished compiling.

Binary is ready on: build/hello
$ build/hello
hello world

Run chaos --help to see more options.

Uninstallation

You can uninstall the chaos binary and its C headers with:

make uninstall

Useful Links

Language Reference

Developing Chaos C Extensions

API Reference

Template for Chaos C Extension Developers

Documentation Repository

Bug Tracker

Occultist Dependency Manager

Contribution Guide

Code of Conduct

chaos's People

Contributors

melihs avatar mertyildiran avatar naltun avatar

Stargazers

 avatar

Watchers

 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.