GithubHelp home page GithubHelp logo

jlp765 / felix Goto Github PK

View Code? Open in Web Editor NEW

This project forked from felix-lang/felix

0.0 0.0 0.0 84.56 MB

The Felix Programming Language

License: Other

Shell 0.43% C++ 5.98% Python 3.96% Perl 0.06% C 52.69% Emacs Lisp 0.07% Objective-C 0.01% Java 0.01% OCaml 30.09% Haskell 0.02% Scala 0.01% Clojure 0.01% Ada 0.04% Standard ML 0.01% Elixir 0.01% MoonScript 0.02% CSS 0.02% Pascal 0.01% TeX 5.87% Gnuplot 0.71%

felix's Introduction

Felix

An advanced, statically typed, high performance scripting language with native C++ embedding.

Features

Autobuilder

This file:

// hello.flx
println$ "Hello World";

can be run directly:

flx hello.flx

It just works. No makefiles. No compiler switches. Automatic caching and dependency checking for Felix and C++. Uses a flx_pkgconfig database consisting of a directory of *.fpc files to specify and find libraries and header files based on in language abstract keys.

Hyperlight Performance

The aim is to run faster than C.

Underneath Felix generates highly optimised machine binaries which outperform most interpreters, bytecode compilers, virtual machines, and sometimes compiled languages including C and C++.

Felix is an aggressive inliner which performs whole program analysis and high level optimisations such as parallel assignment, self-tail call elimination.

Felix generates optimised C++ which is then compiled and optimised again by your system C++ compiler.

Compiler Ack Takfp
Felix/clang 3.71 6.23
Clang/C++ 3.95 6.29
Felix/gcc 2.34 6.60
Gcc/C++ 2.25 6.25
Ocaml 2.93 8.41

C and C++ embedding

Felix is a C++ code generator specifically designed so that all your favourite C and C++ libraries can be embedded with little or no glue logic:

// required header 
header vector_h = '#include <vector>';

// C++11 for smart pointers
header memory_h = '#include <memory>' 
  requires package "cplusplus_11"
;
 
// types
type vector[T] = "::std::shared_ptr<::std::vector<?1>>" 
  requires vector_h, memory_h
;

type viterator[T] = "::std::vector<?1>::iterator"
  requires vector_h
;

// constructor
ctor[T] vector[T] : unit = "::std::make_shared<::std::vector<?1>>()";

// operations
proc push_back[T] : vector[T] * T =  "$1->push_back($2);";
proc push_back[T] (v: vector[T]) (elt:T) => push_back(v,elt);

fun stl_begin[T] : vector[T] -> viterator[T] = "$1->begin()";
fun deref[T] : viterator[T] -> T = "*$1";

// example use
var v = vector[int]();
v.push_back 42;
println$ *v.stl_begin;

Getting Started

Prerequisites

  • Python 3
  • Ocaml 4.06.1 (only for source build)
  • C++ compiler: g++, clang++, or msvc

Extras (can be installed later)

  • SDL2 for graphics
  • GNU GMP, GNU GSL

Build from Source

Linux

git clone https://github.com/felix-lang/felix.git
cd felix
. buildscript/linuxsetup.sh
make  
sudo make install # optional!

OSX

git clone https://github.com/felix-lang/felix.git
cd felix
. buildscript/macosxsetup.sh
make  
sudo make install # optional!

Building with Nix

On platforms supporting Nix, you can set up a build and runtime environment by running:

git clone https://github.com/felix-lang/felix.git
cd felix
nix-shell shell.nix
. buildscript/linuxsetup.sh
make  

This will do an in place "install" of the Felix binaries. Note that this should work on OS X with Nix, but needs to be tested.

Windows

Follow the instructions on the Wiki.

Packages

Arch Linux

Use provided PKGBUILD to make an installable package. It is also available in the AUR repository

cd src/misc
makepkg
sudo pacman -U felix-VERSION.pkg.tar.xz

Tarballs

http://github.com/felix-lang/felix/releases

Build Status

Appveyor, Windows build: Build Status Travis, Linux build: Build Status

Links

Title URL
Documentation Master http://felix-documentation-master.readthedocs.io/en/latest/
Felix Tutorial http://felix-tutorial.readthedocs.io/en/latest/
Installation and Tools Guide http://felix-tools.readthedocs.io/en/latest/
Felix Language Reference Manual http://felix.readthedocs.io/en/latest/
Felix Library Packages http://felix-library-packages.readthedocs.io/en/latest/
Articles on Modern Computing http://modern-computing.readthedocs.io/en/latest/
Felix Home Page http://felix-lang.github.io/felix
Felix Wiki https://github.com/felix-lang/felix/wiki
Git Repository https://github.com/felix-lang/felix
Binary Download http://github.com/felix-lang/felix/releases

Mailing List

mailto:[email protected]

Licence

Felix is Free For Any Use (FFAU)/Public Domain.

felix's People

Contributors

0xflotus avatar alexkross avatar atilde avatar bbarker avatar dobesv avatar erickt avatar freylax avatar gbluma avatar jlp765 avatar kirbyfan64 avatar mariadeanton avatar martindemello avatar mationai avatar mmaul avatar ngeiswei avatar nuald avatar pvgoran avatar refi64 avatar rfistman avatar shayne-fletcher avatar skaller avatar steshaw avatar user202729 avatar wiml 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.