Skip to content
This repository has been archived by the owner on Feb 6, 2022. It is now read-only.
/ scopion Public archive

a statically-typed programming language with powerful syntax

License

Notifications You must be signed in to change notification settings

coord-e/scopion

Repository files navigation

scopion

Travis Docker Automated buil Docker Build Statu license GitHub release C++ Standard

a statically-typed programming language with powerful objective syntax

(stopped its development)

Example:
(argc, argv){
  io = @import#c:stdio.h; // Import C header directly!

  v1#mut = v2 = [
    real: 10,
    add: (val, self){
      newv = self;
      newv.real = self.real + val;
      |> newv;
    },
    +: (rhs, self){ // Operator overload
      |> self.:add(rhs.real);
    },
  ];

  v1.=add(1); // Object-oriented call
  io.printf("v1.real => %d\n", v1.real);

  io.printf("(v1+v2).real => %d\n", (v1+v2).real);
}
Output:
v1.real => 11
(v1+v2).real => 21

This project is heavily under development.

scopion has a serious problem around typesystem and currently impractical very much. This will be fixed in v0.0.4

Why scopion?

  • Intuitive
    • Removal of 'global'
    • Just right fusion of Functional and Object-oriented programming
    • Referentially transparent function
    • Powerful objective syntax
  • Concise
    • No reserved words
    • Powerful type suggestion
  • Fast
    • Statically typed compiler
    • Optimization and native code generation by LLVM
  • C-friendly
    • Directly use of C function

All features are listed in docs/Feature.md

Getting started

Prerequirements

  • llvm, clang (v5.0.0~)
  • libgc
  • ctags

Supported Platforms

  • macOS
  • GNU/Linux

Only 64bit system is currently supported.

Installation

If you are in Ubuntu 17.04~, Debian stretch~, or macOS Sierra~, just paste this at a terminal prompt:

curl -fsSL https://scopion.coord-e.com/get | bash

Binary downloads

Docker Image

docker pull coorde/scopion
docker run -it coorde/scopion /bin/bash

Enjoy

Now you can compile your scopion source

scopc prog.scc -o prog

Usage

usage: scopc [options] ... filename ...

      -h, --help                        Print this help
      -t[type], --type=[type]           Specify the type of output
                                        One of: asm, ast, ir, obj
      -o[path], --output=[path]         Specify the output path
                                        Default: ./a.out
      -a[triple], --arch=[triple]       Specify the target triple
                                        Default: native
      -O[level], --optimize=[level]     Set optimization level (0-3)
                                        Default: 3
      -V, --version                     Print version
      filename                          File to compile

Build from source

if there is no suitable prebuilt binary for your environment, you can build scopion from source.

Prerequirements

  • (Installation prerequirements)
  • Boost (v1.62~)
  • cmake (v3.7~)
git clone https://github.com/coord-e/scopion
cd scopion
git submodule update --init --recursive
mkdir build && cd $_
cmake .. -DCONFIG=RELEASE -DFORMAT_BEFORE_BUILD=OFF
make # build
sudo make install # install

License

This program is licensed by GPL v3. See COPYING.