Giter VIP home page Giter VIP logo

moonwalk's Introduction

๐ŸŒ• MoonWalk Compiler ๐ŸŒ•

My first attempt at creating my own programming language.

Description ๐Ÿ“

Moonwalk is designed to be a simple, safe, statically typed, compiled language fully compatible with the .NET platform. It is designed to be a simple language that is easy to learn and use, while still being powerful enough to write complex programs in.

Goals ๐ŸŽฏ

  • Simple impertaive language
  • Full compatibility with .NET
  • Safe, statically typed, compiled language
  • Modular and eas y to write and create POC
  • Inline testing

Code Examples ๐Ÿ“

For now the syntax is still in flux, but here is a simple example of what I am aiming for:

import Terminal.Gui;

module Main {
	pub func Main(args: string[]): void {
		Application.Init();

		let label: Label = create_label("Hello, World!");

		Application.Top.Add(label)
		Application.Run();
		Application.Shutdown();
	}

	prv func CreateLabel(text: string): Label {
		let label = new Label(text) {
			X = Pos.Center(),
			Y = Pos.Center(),
			Height = 1
		};
		return label;
	}

	prv func ImportExample(): void {
		Utils.Print("Hello, World");
	}
}

module Utils {

	pub struct Person() {

		Name: string;
		Age: int;

		init (name: string, age: int): Person {
			this.Name = name;
			if (age < 18) {
				Console.WriteLine("Younger person");
			}
			this.Age = age;
		}
	}

	pub func Print(text: string): void {
		Console.WriteLine(string);
	}
}

module Main.Tests {

	import NUnit;

	[Test]
	pub func ShoudlAddTwoNumbers(): void {
		let result = 1 + 1;
		Assert.AreEqual(2, result);
	}
}

References ๐Ÿ“’

moonwalk's People

Contributors

maciekwin3 avatar dependabot[bot] avatar

Stargazers

BlueSharkPartners avatar  avatar Andrew Johnson avatar Piotr Kiedrowski avatar Norbert avatar  avatar

Watchers

 avatar  avatar

moonwalk's Issues

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.