All Projects → acharal → wam

acharal / wam

Licence: GPL-2.0 license
A simple compiler from Prolog to WAM (Warren Abstract Machine) and a runtime for WAM.

Programming Languages

haskell
3896 projects
prolog
421 projects

Projects that are alternatives of or similar to wam

vscode-gcode-syntax
G Code Language Extension for Visual Studio Code. Turn VSCode into a fully capable G-Code editor, including language support & more.
Stars: ✭ 59 (+227.78%)
Mutual labels:  machine
MSDS696-Masters-Final-Project
Earthquake Prediction Challenge with LightGBM and XGBoost
Stars: ✭ 58 (+222.22%)
Mutual labels:  machine
IndyMill
Open Source DIY Metal CNC Machine
Stars: ✭ 85 (+372.22%)
Mutual labels:  machine
ciao
Ciao is a modern Prolog implementation that builds up from a logic-based simple kernel designed to be portable, extensible, and modular.
Stars: ✭ 190 (+955.56%)
Mutual labels:  prolog-compiler
freebird
No description or website provided.
Stars: ✭ 21 (+16.67%)
Mutual labels:  machine
parallel-corpora-tools
Tools for filtering and cleaning parallel and monolingual corpora for machine translation and other natural language processing tasks.
Stars: ✭ 35 (+94.44%)
Mutual labels:  machine
LibreTranslate
Free and Open Source Machine Translation API. Self-hosted, offline capable and easy to setup.
Stars: ✭ 3,932 (+21744.44%)
Mutual labels:  machine
machine learning examples
machine_learning_examples
Stars: ✭ 68 (+277.78%)
Mutual labels:  machine
wamcompiler
Prolog implementation based on Warren's abstract machine
Stars: ✭ 39 (+116.67%)
Mutual labels:  wam
FiniteStateMachine
This project is a finite state machine designed to be used in games.
Stars: ✭ 45 (+150%)
Mutual labels:  machine
mlearn
Benchmark Suite for Machine Learning Interatomic Potentials for Materials
Stars: ✭ 89 (+394.44%)
Mutual labels:  machine
neptune-client
📒 Experiment tracking tool and model registry
Stars: ✭ 348 (+1833.33%)
Mutual labels:  machine
knime-r
KNIME Interactive R Statistics Integration
Stars: ✭ 18 (+0%)
Mutual labels:  machine
build-inspector
Inspect your builds to look for changes in filesystem, network traffic and running processes.
Stars: ✭ 12 (-33.33%)
Mutual labels:  machine
l1vm
L1VM - a tiny virtual machine with a 64 bit core
Stars: ✭ 112 (+522.22%)
Mutual labels:  machine
Neural-Tile
A better tiling script for Neural-Style
Stars: ✭ 35 (+94.44%)
Mutual labels:  machine
algorithmia
No description or website provided.
Stars: ✭ 15 (-16.67%)
Mutual labels:  machine
thesaurus
TT Hackathon 2018 - Autocomplete for Visual Programming Nodes
Stars: ✭ 23 (+27.78%)
Mutual labels:  machine
zAnalysis
zAnalysis是基于Pascal语言编写的大型统计学开源库
Stars: ✭ 52 (+188.89%)
Mutual labels:  machine
EmptyLicensesLicx
Easy continuous integration of apps using third-party controls that rely on licenses.licx files
Stars: ✭ 57 (+216.67%)
Mutual labels:  machine

A Simple PROLOG Compiler to WAM

GitHub license Build Status

WAM (Warren Abstract Machine) is an efficient popular abstract machine to compile Prolog logic programs and is implemented in almost all industrial-strength PROLOG compilers such as SWI-Prolog and YAP.

This interpreter contains the compilation and runtime of WAM instructions based on the definition in Russinoff 1992. The interpreter is developed in Haskell and the purpose of the project is to be used as testbed for various extensions in WAM.

Getting Started

Building

To build the WAM compiler you should have a system with GHC and cabal. The following sequence of commands will build the compiler after installing any dependencies needed.

$ cabal update
$ cabal install --only-dependencies
$ cabal configure && cabal build

Compile an example to WAM

After a successfull build the compiler will reside by default in ./dist/build/wam/wam. You can add the directory to your current path, i.e.

$ export PATH=`pwd`/dist/build/wam:$PATH

To compile a PROLOG program to WAM you should issue:

$ wam -c -i prog.pl -o output.wam

where prog.pl is your initial PROLOG source file, output.wam is the name of the output file that will contain WAM bytecode. The switch -c will only compile the program but not run. On the other hand if you omit -c, namely

$ wam -i prog.pl -o output.wam

the program will also be executed after the compilation.

Features and Limitations

Compilations supports some basic optimizations such as

  • tail execution optimization
  • unsafe variables

Limitations

There are also some features of WAM that are not yet supported such as:

  • There are no special instructions for lists (get_list, put_list).
  • No environment trimming.
  • No indexing at the switch-operators
  • No cut functionality
  • No garbage collection has been implemented.
  • A subset of the ISO-Prolog is supported and compiled. No build-in predicates are supported, neither user-defined operators.
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].