cx

module
v0.7.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 28, 2021 License: BSD-1-Clause

README

cx logo

CX Programming Language

Build Status Build status

CX is a general purpose, interpreted and compiled programming language, with a very strict type system and a syntax similar to Golang's. CX provides a new programming paradigm based on the concept of affordances.

Table of Contents

CX Programming Language

[Back to the Table of Contents] ↑

CX is a general purpose, interpreted and compiled programming language, with a very strict type system and a syntax similar to Golang's. CX provides a new programming paradigm based on the concept of affordances, where the user can ask the programming language at runtime what can be done with a CX object (functions, expressions, packages, etc.), and interactively or automatically choose one of the affordances to be applied. This paradigm has the main objective of providing an additional security layer for decentralized, blockchain-based applications, but can also be used for general purpose programming.

Installation

CX requires a Golang version of 1.15 or higher.

Binary Releases

You can find binary releases for most major systems on the release page.

Compiling on Linux

If you are using a apt compatible system, install the dependencies with"

sudo apt-get update -qq

sudo apt-get install -y glade xvfb libxinerama-dev libxcursor-dev libxrandr-dev libgl1-mesa-dev libxi-dev libperl-dev libcairo2-dev libpango1.0-dev libglib2.0-dev libopenal-dev libxxf86vm-dev --no-install-recommends

Download CX's repository using Go:

go get github.com/skycoin/cx

Get required Go dependencies with:

go get -u golang.org/x/mobile/cmd/gomobile
go get -u modernc.org/goyacc
go get golang.org/x/mobile/gl 

Navigate to CX's repository via:

cd $GOPATH/src/github.com/skycoin/cx

Build CX's binary and install by running:

make install

make install builds a CX binary and installs it into $HOME/cx/bin. Add the CX binary path to your operating system's $PATH. For example, in Linux:

export PATH=$PATH:$HOME/cx/bin

You should test your installation by running:

make test

If you intend to develop games with CX, then run:

make test-full
Compiling on MacOS

Download CX's repository using Go:

go get github.com/skycoin/cx

Navigate to CX's repository via:

cd $GOPATH/src/github.com/skycoin/cx

Build CX's binary and install by running:

make install

make install builds a CX binary and installs it into $HOME/cx/bin. Add the CX binary path to your operating system's $PATH. For example, in Linux:

export PATH=$PATH:$HOME/cx/bin

You should test your installation by running:

make test

If you intend to develop games with CX, then run:

make test-full
Compiling CX on Windows

Compiling CX on Windows requires a recent version of Git to be installed.

Before compiling CX, install dependencies with pacman:

pacman -Sy

pacman -S mingw-w64-x86_64-openal

if [ ! -a /mingw64/lib/libOpenAL32.a ]; then ln -s /mingw64/lib/libopenal.a /mingw64/lib/libOpenAL32.a; fi

if [ ! -a /mingw64/lib/libOpenAL32.dll.a ]; then ln -s /mingw64/lib/libopenal.dll.a /mingw64/lib/libOpenAL32.dll.a; fi

You can compile CX by running:

cx-setup.bat

Test your installation by running:

cx lib/args.cx tests/main.cx ++wdir=tests ++disable-tests=issue

Updating CX

You can update your CX installation by running:

make install

Or on Windows:

cx-setup.bat

Resources and libraries

If you are interested in learning more about CX, please refer to the resources documentation.

If you want to get started with some basic example programs and tutorials check out the tutorials section.

The docs also provide a high level overview over the language.

Directories

Path Synopsis
cmd
cx
api
development
Goyacc is a version of yacc generating Go parsers.
Goyacc is a version of yacc generating Go parsers.
biggfft
Package bigfft implements multiplication of big.Int using FFT.
Package bigfft implements multiplication of big.Int using FFT.
fileutil
Package fileutil collects some file utility functions.
Package fileutil collects some file utility functions.
fileutil/falloc
WIP: Package falloc provides allocation/deallocation of space within a file/store (WIP, unstable API).
WIP: Package falloc provides allocation/deallocation of space within a file/store (WIP, unstable API).
fileutil/hdb
WIP: Package hdb provides a "handle"/value DB like store, but actually it's closer to the model of a process's virtual memory and its alloc, free and move methods.
WIP: Package hdb provides a "handle"/value DB like store, but actually it's closer to the model of a process's virtual memory and its alloc, free and move methods.
fileutil/storage
WIP: Package storage defines and implements storage providers and store accessors.
WIP: Package storage defines and implements storage providers and store accessors.
golex
Golex is a lex/flex like (not fully POSIX lex compatible) utility.
Golex is a lex/flex like (not fully POSIX lex compatible) utility.
golex/lex
Package lex is a Unicode-friendly run time library for golex[0] generated lexical analyzers[1].
Package lex is a Unicode-friendly run time library for golex[0] generated lexical analyzers[1].
lex
Package lex provides support for a *nix (f)lex like tool on .l sources.
Package lex provides support for a *nix (f)lex like tool on .l sources.
lexer
Package lexer provides generating actionless scanners (lexeme recognizers) at run time.
Package lexer provides generating actionless scanners (lexeme recognizers) at run time.
mathutil
Package mathutil provides utilities supplementing the standard 'math' and 'math/rand' packages.
Package mathutil provides utilities supplementing the standard 'math' and 'math/rand' packages.
mathutil/mersenne
Package mersenne collects utilities related to Mersenne numbers[1] and/or some of their properties.
Package mersenne collects utilities related to Mersenne numbers[1] and/or some of their properties.
parser/nquads
Package parser implements a parser for N-Quads[0] source text.
Package parser implements a parser for N-Quads[0] source text.
parser/yacc
Package parser implements a parser for yacc source files.
Package parser implements a parser for yacc source files.
scanner/nquads
Package scanner implements a scanner for N-Quads[0] source text.
Package scanner implements a scanner for N-Quads[0] source text.
scanner/yacc
Package scanner implements a scanner for yacc[0] source text with actions written in Go.
Package scanner implements a scanner for yacc[0] source text with actions written in Go.
sortutil
Package sortutil provides utilities supplementing the standard 'sort' package.
Package sortutil provides utilities supplementing the standard 'sort' package.
y
Package y converts .y (yacc[2]) source files to data suitable for a parser generator.
Package y converts .y (yacc[2]) source files to data suitable for a parser generator.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL