Giter Site home page Giter Site logo

niyongaboarsene / arsenegithubwithrmaxwell Goto Github PK

View Code? Open in Web Editor NEW

This project forked from fabianschuiki/maxwell

0.0 0.0 0.0 9.8 MB

Modern, statically typed, duck typed, generic, imperative programming language, inspired by C++, Go, and Scala.

License: GNU General Public License v2.0

Shell 0.42% JavaScript 0.03% C++ 77.78% C 2.12% PHP 0.12% TeX 4.21% Makefile 0.04% HTML 7.06% CMake 1.81% LLVM 1.11% Yacc 5.31%

arsenegithubwithrmaxwell's Introduction

Maxwell Programming Language

Build Status Coverage Status

Maxwell is a modern, high-level programming language that aims to combine the comfort and expressiveness of scripting languages with the power and efficiency of a compiled language. It aims to achieve the following goals:

  • embrace refactoring as a natural part of programming
  • keep repetition to a minimum (DRY)
  • everything is an expression, i.e. no statements
  • focus on generic programming
  • imperative
  • strict duck typing
  • functions, strings, arrays, sets and maps are first class citizens
  • implicit interfaces
  • operator overloading
  • type inference

Maxwell uses Semantic Versioning.

Design Guidelines

  • code is written in C++11
  • source files have suffix .cpp
  • header files have suffix .hpp
  • sources and headers live in the /maxwell directory
  • everything lives in the maxwell namespace
  • files may be grouped into directories for better readability and structure
  • files containing subnamespaces of maxwell must be placed in directories with the same name as the corresponding namespace (e.g. maxwell::repository::interface classes are to reside in the maxwell/repository/interface directory)
  • directory names are lowercase
  • includes are sorted by
    • origin (Maxwell first, then third party, then standard headers)
    • alphabet
  • using ... and using namespace ... only in sources, absolutely not in headers (except for rare cases where the directive is to apply to the entire code base)
  • type names are capitalized (e.g. SourceRepository)
  • function names are camel-cased and start with a verb (e.g. addFileToRepository)
  • variable names are camel-cased (e.g. pendingFiles)
  • accessor functions are named set... and get...
  • no underscores in type, function, or member names
  • nullptr instead of 0 or NULL for pointers
  • tests live in the /test directory (not interleaved with the source code)
  • no std::endl, use the UNIX line feed \n
  • write good commit messages

How To Dive In

To get things up and running create a build directory, ask cmake to generate a build system for you, and build the compiler as follows:

$ mkdir build
$ cd build
$ cmake ..
$ make
$ ln -s ../maxwell/runc.sh runc

The last command symlinks the ../maxwell/runc.sh script into your build directory so you can build things easily. This file calls the low-level plumbing commands that parse and process Maxwell source files, generate C code, and package the generated code into C source files. It then feeds this files to gcc to generate an executable.

Take a look at the tests directory for some sample snippets of Maxwell code; or write your own if you feel like it. To compile your source run ./runc yourfile.mw, which will compile your code to a.out. You might also be interested in the *.{c|h} files generated next to your source file, as they show you how the Maxwell compiler transforms your input to C code.

For the curious: The document language/Ideas.html contains random snippets of code and ideas.

arsenegithubwithrmaxwell's People

Contributors

fabianschuiki 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.