All Projects → weinholt → Erlscp

weinholt / Erlscp

Licence: other
Erlang Supercompiler

Programming Languages

erlang
1774 projects

Projects that are alternatives of or similar to Erlscp

Osqp
The Operator Splitting QP Solver
Stars: ✭ 689 (+2895.65%)
Mutual labels:  optimization
Pyswarms
A research toolkit for particle swarm optimization in Python
Stars: ✭ 742 (+3126.09%)
Mutual labels:  optimization
Shift Scheduling
Shift Scheduling for workforce
Stars: ✭ 22 (-4.35%)
Mutual labels:  optimization
Casadi
CasADi is a symbolic framework for numeric optimization implementing automatic differentiation in forward and reverse modes on sparse matrix-valued computational graphs. It supports self-contained C-code generation and interfaces state-of-the-art codes such as SUNDIALS, IPOPT etc. It can be used from C++, Python or Matlab/Octave.
Stars: ✭ 714 (+3004.35%)
Mutual labels:  optimization
Nuxt Optimized Images
🌅🚀 Automatically optimizes images used in Nuxt.js projects (JPEG, PNG, SVG, WebP and GIF).
Stars: ✭ 717 (+3017.39%)
Mutual labels:  optimization
React Ssr Optimization
React.js server-side rendering optimization with component memoization and templatization
Stars: ✭ 806 (+3404.35%)
Mutual labels:  optimization
Optim.jl
Optimization functions for Julia
Stars: ✭ 679 (+2852.17%)
Mutual labels:  optimization
Mobius Assignment
Staffjoy Suite (V1) Microservice - Shift Assignment Subject To Constraints
Stars: ✭ 23 (+0%)
Mutual labels:  optimization
Su2
SU2: An Open-Source Suite for Multiphysics Simulation and Design
Stars: ✭ 731 (+3078.26%)
Mutual labels:  optimization
Wheels
Performance-optimized wheels for TensorFlow (SSE, AVX, FMA, XLA, MPI)
Stars: ✭ 891 (+3773.91%)
Mutual labels:  optimization
Closure Compiler
A JavaScript checker and optimizer.
Stars: ✭ 6,277 (+27191.3%)
Mutual labels:  optimization
Eaopt
🍀 Evolutionary optimization library for Go (genetic algorithm, partical swarm optimization, differential evolution)
Stars: ✭ 718 (+3021.74%)
Mutual labels:  optimization
D912pxy
DirectX9 to DirectX12 API proxy for Guild Wars 2
Stars: ✭ 833 (+3521.74%)
Mutual labels:  optimization
Gradient Free Optimizers
Simple and reliable optimization with local, global, population-based and sequential techniques in numerical discrete search spaces.
Stars: ✭ 711 (+2991.3%)
Mutual labels:  optimization
Vs Net
Variable splitting network for accelerated parallel MRI reconstruction
Stars: ✭ 22 (-4.35%)
Mutual labels:  optimization
Tiramisu
A polyhedral compiler for expressing fast and portable data parallel algorithms
Stars: ✭ 685 (+2878.26%)
Mutual labels:  optimization
Pennylane
PennyLane is a cross-platform Python library for differentiable programming of quantum computers. Train a quantum computer the same way as a neural network.
Stars: ✭ 800 (+3378.26%)
Mutual labels:  optimization
Chama
Python package for sensor placement optimization
Stars: ✭ 23 (+0%)
Mutual labels:  optimization
Owl
Owl - OCaml Scientific and Engineering Computing @ http://ocaml.xyz
Stars: ✭ 919 (+3895.65%)
Mutual labels:  optimization
Liblaml
A stand-alone pure C++ library for linear algebra and machine learning
Stars: ✭ 7 (-69.57%)
Mutual labels:  optimization

-- coding: utf-8-with-signature; mode: outline --

Copyright (C) 2013 Göran Weinholt [email protected]

  • What erlscp is and what it is used for

The Erlang Supercompiler (erlscp for short) is a parse transform that is capable of removing many redundancies in Erlang code. It can optimise code but it also has many other metacomputational uses that have not been fully explored in the context of this project.

Those interested in the algorithm may peruse these publications:

Peter A. Jonsson and Johan Nordlander. Positive supercompilation for a higher order call-by-value language. In /Proceedings of the 36th annual ACM SIGPLAN-SIGACT symposium on Principles of programming languages/, POPL '09, pages 277--288, New York, NY, USA, 2009. ACM.

Peter A. Jonsson and Johan Nordlander. Strengthening supercompilation for call-by-value languages. In Andrei P. Nemytykh, editor, /Proceedings of the second International Valentin Turchin Memorial Workshop on Metacomputation in Russia/, pages 64--81. Ailamazyan University of Pereslavl, July 2010.

Peter A. Jonsson and Johan Nordlander. Taming code explosion in supercompilation. In /Proceedings of the 20th ACM SIGPLAN workshop on Partial evaluation and program manipulation/, PEPM '11, pages 33--42, New York, NY, USA, 2011. ACM.

Peter A. Jonsson. /Time- and Size-Efficient Supercompilation/. PhD thesis, Luleå University of Technology, Luleå Sweden, 2011.

Göran Weinholt. /Supercompiling Erlang/. Master's thesis, Chalmers University of Technology, Gothenburg, 2013.

  • Before you use erlscp

Before using erlscp you will need to have Erlang installed. The only version that has been tested is Erlang R15B01. Another requirement is erlang-syntax-tools.

Currently erlscp does not support the full Erlang language. The treatment of patterns is simplistic and support for some expression types is missing. You may need to read the supercompiler output to determine if the code got better.

Something will happen if the supercompiled module contains side-effects such as message passing, and it will probably not be something good.

  • How to use erlscp

(There is probably some nice way of packaging Erlang modules so that this stuff is easier, but that is for the future.)

Obtain a copy of erlscp from this website:

http://weinholt.se/gitweb/?p=erlscp.git

A tarball can be obtained from this URL:

http://weinholt.se/gitweb/?p=erlscp.git;a=snapshot;h=HEAD;sf=tgz

The source code repository can be cloned with this command:

git clone http://weinholt.se/git/erlscp.git/

Compile erlscp using make (which might need to be GNU make). This will produce a few .beam files in the ebin directory. This is the directory that you need to add to Erlang's path.

Add this line to the Erlang module that you want to supercompile:

-compile({parse_transform, erlang_supercompiler}).

Then you can invoke the Erlang compiler as per usual, but make sure that you have added the ebin directory to its path (e.g. by invoking erlc with the flags -pa path/to/erlscp/ebin).

tl;dr: git clone http://weinholt.se/git/erlscp.git/ cd erlscp make cat > foo.erl << EOF -module(foo). -export([append/3]). -compile({parse_transform, erlang_supercompiler}). append(Xs, Ys, Zs) -> (Xs ++ Ys) ++ Zs. EOF erlc -pa ebin foo.erl erlc -P -pa ebin foo.erl less foo.P

  • Possible side-effects

Due to incomplete handling of pattern matching it is currently possible for the supercompiler to introduce allocations of tuples.

The supercompiler has not been tamed and code explosion is possible.

If the second or higher Futamura projections are used then the supercompiler output is a derivative of erlscp. This means that the license in LICENSE.txt is applicable to the supercompiled program. This only applies to when the supercompiler is applied to itself (as in the Futamura projections mentioned). Merely using erlscp for optimisations does not make the output a derivative of erlscp.

Not that the Futamura projections can be used with erlscp yet, but, you know, just in case that day ever comes. A man can dream.

  • How to properly store erlscp

Store on a digital medium and outside the reach of children. Dispose of in the bitbucket. Patches are submitted to the author by email.

  • Other information

This README was modelled after an informational paper slip that came in a package of medicine. I've left out the parts about pregnancy and heavy machinery.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].