Coder Social home page Coder Social logo

die's Introduction

Die

A Language For the Aggressive Programmer

Die is a language you can use to tell other programmers what you think of them, as well as make them confused and angry as they try and parse out your code. It's a simple language, based on the ideas of Brainfuck.

I don't personally recommend using this language. But you're certainly welcome to do so!

Building

This interpreter is written from scratch in C. Any standard compiler should do the job without any issue. I use build scripts in the form of build.sh and build.bat myself.

Specification

Below is the language specification, as I've designed it. Some features in this specification have not been implemented yet. They're merely guidelines for what I want to have the language do. Just be aware!

Cells

Programs in Die are made up of an array of Cells and a Pointer to those cells. Each cell starts out with a value of 0 and can be incremented and decremented. The pointer can be moved left and right, and values can be printed. That's all!

Comments

Comments are written like you're talking under your breath.

... This is a comment

Line comments are the only ones that are supported right now. For funsies, how about just don't use comments?

Increments & Decrements

The central command of the language is die, which is used to increment the current cell value. Various forms of die increment the currently pointed value in certain different ways.

die => +1
Die => +10
DIE => +100

Optionally, increasing the number of E's multiplies the incrementing value. dieeee => +4

To decrement, the same principals are used but the word is please

please => -1
Please => -10
PLEASE => -100

and it can be multipled again with the number of E's pleeeease => -4

The Pointer

You can move the pointer left and right by using . and go.

go die. => Move to cell 1 and increment by 1, then go back to cell 0.

Loops

Not yet implemented

While loops are done by using ok and stop. Whiles are terminated when the current cell is 0. Be aware, this makes it really easy to make infinite loops, by accident.

ok
please
die die die
stop

For loops are done using ok so and stop. The number of o's in so are how many times it loops.

... loop 4 times
ok soooo
die die die die die
stop

Printing

Printing can be done in two ways:

sorry prints the ascii char of the currently pointed-to variable, Sorry (capitalized) prints the integer value.

Debug Mode

Running die and passing in --debug activates debug mode. This will show the read-in source and each operation that is run, in order, as they are done. Excellent for seeing what's really going on! (thanks to darkfire000 for adding this).

Example Program

See "basic.die"

die's People

Contributors

fhoeddinghaus avatar

Watchers

James Cloos 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.