Giter Club home page Giter Club logo

emlang's Introduction

EmLang

What is EmLang?

EmLang stands for β€œEmoji Language”. It is a proof of concept. It proves that programming languages are formal. And the symbols themselves don't matter. We can use any symbol (Emoji included) to code.

EmLang is implemented in Haskell. It is a project I made for UIUC CS421 Programming Languages and Compilers. It is based heavily on the Forth language, which you can check out here https://www.forth.com/forth/. EmLang borrowed the framework and starter code from one of the MPs we did for this class. The original MP source code is confidential.

How to Run?

Setting up is very easy if you use Docker.

  • Pulled the latest Haskell image: docker pull haskell
  • Start the container based on that image
  • Clone this repository inside of a directory in the container
  • Run stack repl to start the Haskell repl
  • Enter main and hit enter to start the EmLang compiler
  • Viola! image

How to Test?

Instead of running stack repl, run stack test which will run all of the test cases.

Sample programs

How to Print

Printing is easy in EmLang! Just do πŸ–¨οΈ to print and pop the top of the stack, or πŸ–¨οΈπŸŽ‰ to print the entire stack!

For example, to print the current stack:

image

To print and pop the top element of the stack:

image

And now the stack looks like this:

image

Define a "max" function

The following block of code defines a "max" function which returns the biggest of the two give integers.

βœοΈπŸ“– max πŸͺž β˜€οΈ πŸͺž β˜€οΈ πŸ˜€βš–οΈ πŸ€” πŸ™ƒ πŸ€– πŸ’¦ πŸ“•

Running the max function:

image

Of course, since this is EmLang, it is recommended that you define functions in Emojis too! We should define the above max function with the 🐢 emoji:

βœοΈπŸ“– 🐢 πŸͺž β˜€οΈ πŸͺž β˜€οΈ πŸ˜€βš–οΈ πŸ€” πŸ™ƒ πŸ€– πŸ’¦ πŸ“•

And the results of calling our new 🐢 function is:

image

Happy coding in EmLang!

emlang's People

Contributors

tonymuu avatar mutony-ms avatar

Stargazers

Roman avatar

Watchers

 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.