Coder Social home page Coder Social logo

ldpl-rs's Introduction

LDPL + Rust

LDPL in Rust

crate

LDPL is a powerful compiled programming language designed from the ground up to be excessively expressive, readable, fast and easy to learn. It mimics plain English, in the likeness of the good parts of older programming languages like COBOL, with the desire that it can be understood by anybody. LDPL was designed to run on Unix systems, including AMD-64 Linux, macOS, ARMv8 Linux, Android Termux and both Intel and PowerPC OS X (tested from Tiger 10.4 onwards). It even supports UTF-8 out of the box.

โ€” The Official LDPL Repository


This is an experimental LDPL 4.4 compiler written in Rust. Like the official compiler, LDPL code is translated to C++ code and then compiled into a standalone binary. Generated code should be 100% compatible with the official compiler, meaning LDPL-RS should work just fine with regular LDPL extensions.

Installation

LDPL-RS requires cargo to install and a C++ compiler to use.

Once you've got them both, installation is a breeze:

cargo install ldpl

You should now have an ldpl-rs binary in your $PATH that you can use to compile simple LDPL 4.4 programs, like any of the official examples:

git clone -b 4.4 git://github.com/lartu/ldpl
ldpl-rs ldpl/examples/99bottles.ldpl

Note the difference between the Crate name and binary. This is to avoid collision with the official LDPL compiler.

Building It

Building from source requires make and cargo. LDPL-RS also requires a C++ compiler to build LDPL programs, so you'll need one installed even after building the ldpl-rs binary.

Once you've got all that, clone and compile the project:

git clone git://github.com/xvxx/ldpl-rs
cd ldpl-rs
make

If that works, you've successfully built an ldpl-rs binary that you can use to compile any of the official LDPL examples:

git clone -b 4.4 git://github.com/lartu/ldpl
./ldpl-rs ldpl/examples/99bottles.ldpl

You can also use the "run" command to build and run a file in one go:

./ldpl-rs run ldpl/examples/99bottles.ldpl
99 bottles of beer on the wall...

To take it with you, just copy ldpl-rs to /usr/local/bin or something else in your $PATH.

Status

This project is in its infancy, but can compile simple LDPL programs. It supports all LDPL 4.4 statements, including C++ extensions, and can compile and run all the examples that shipped with LDPL 4.4. It can also compile Gild and ldpl-todo.

It passes 11 of 12 of the official LDPL tests.

However, these features are currently unsupported (but coming soon):

  • nested collections (NUMBER LIST LIST LIST)
  • OF syntax (LIST OF NUMBERS)

To run the tests, clone this project (instructions above) and run:

make test

LDPLTest Pass/Fail Status

Test Status Failure Reason
basicar โœ…
basictx โœ…
conflow โœ…
exec โœ…
explode โœ…
fibo โœ…
file โœ…
list โœ…
of โŒ OF syntax
quine โœ…
sqrt โœ…
vector โœ…

LDPL Examples Pass/Fail Status

Example Status Failure Reason
99bottles.ldpl โœ…
absolutevalue.ldpl โœ…
arguments.ldpl โœ…
bellman-ford.ldpl โœ…
brainfuck.ldpl โœ…
disancount.ldpl โœ…
euler.ldpl โœ…
explode.ldpl โœ…
factorial.ldpl โœ…
fibonacci.ldpl โœ…
floyd-warshall.ldpl โœ…
helloworld.ldpl โœ…
leapyear.ldpl โœ…
loop_counter.ldpl โœ…
oddornot.ldpl โœ…
quine.ldpl โœ…
sqrt.ldpl โœ…
strcmp-demo.ldpl โœ…

License

The LDPL-RS Compiler is distributed under the Apache 2.0 License, same as the official LDPL compiler. All LDPL Dinosaur logos where created by Lartu and are released under a Creative Commons Attribution 4.0 International (CC BY 4.0) license.

Portions of LDPL-RS are copied directly from LDPL. Thank you to the LDPL community for all their contributions!

ldpl-rs's People

Contributors

xvxx avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  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.