MorseLang

MorseLang is a programming language whose _ Source Code _ is _ Morse Code _. For this project, I developed the MorseLang language and then I built an interpreter for it. Come test it out and write your own MorseLang programs.

The following file

    program.morse
.. -. - / -- .- .. -. () {
    .. -. - / -..-;
    .. -. - / -.--;
    -..- = .---- -----;
    -.-- = -----;
    .-- .... .. .-.. . (-.-- < -..-) {
        .. ..-. (-..- == ..---*-.--) {
            .--. .-. .. -. -(-.--);
        }
        -.-- = -.-- + .----;
    }
 }

Has the equivalent in a normal looking language:

int main() {
    int x;
    int y;
    x = 10;
    y = 0;
    while (y < x) {
        if (x == 2*y) {
            print(x);
        }
        y = y + 1;
    }
}

and produces output

 5

when run in MorseLang

Language Features

  • Static Typing
  • Imperative
  • Interpreted
  • .morse files
  • execute programs with morseLang <filename>

How I built it

With OCaml.

Challenges I ran into

Parsing a file of morse code involves some rather complex regular expressions. That was challenging. I also didn't realize until pretty late on that the literal minus sign would be interpreted as a morse symbol the way I was doing things. Had to make some adjustments to debug this. I also had some weird issues with regular expression matching newlines.

What's next for MorseLang

MorseLang is the future of software engineering. It is highly flexible, easy to use, saves a lot of developer time :)

Built With

Share this project:

Updates