Giter Club home page Giter Club logo

nishi's Introduction

Nishi

An easy, clean language that transpiles to C#.

What is Nishi?

Nishi is a new, clean coding language that transpiles to C# code. It is inspired by languages such as Red, Python and Kotlin.

Why is Nishi?

The name "Nishi" is a slice of the name of a type of Koi, called "Nishikigoi".

Nishi is intended to be an easier language for those getting into mid-tier programming.

Using the Nishi transpiler

The Nishi transpiler is the program that turns Nishi code into C# code. You can download it from the releases page, or get the latest version by building from the source.

Once you have the transpiler program, simply open a terminal and type: nishi.exe --help. The program will then tell you the accepted arguments and what they do.

If you would like to transpile a file, you give it the file argument and then the file you want, by entering: nishi.exe --file=file.nishi or nishi.exe -f=file.nishi, where "file.nishi" is your Nishi script.

Building from source

To build the transpiler from source, you will need:

  • Python 3.6
  • ANTLR4
  • PyInstaller

After installing those, you just need to run nishi.bat to generate the ANTLR lexer and parser, and then run build.bat to build the binary with PyInstaller.

File Extensions:

  • .nishi
  • .nish
  • .goi
  • .lel

Inspired By:

  • C#
  • C++
  • Java
  • Python
  • Kotlin
  • Red
  • Go

nishi's People

Contributors

deflatedpickle avatar

Stargazers

 avatar

Watchers

James Cloos avatar

nishi's Issues

Enums

enum MyEnum {
    One: 1
    Two: 2
    Three: 3
}

Code outside of classes

Code should not have to just be in classes, functions and variables should be able to be defined outside of them.

Try/catch statements

try {
    this.my_empty: "This causes an error!"
}
catch TypeError {
    this.my_empty: 5
}

Undeclared variables

Variables should not have to be declared to be used. Variable creation should be dynamic.

Statically typed variables

The type of variables can be grabbed from how they are used, so they don't need to be set.

my_int = 0;

For loops

for num in numbers {
    print("Hello, World!")
}

Classes

class MyClass {
    fun MyClass() {
    }
}

Access modifier blocks

Access blocks would allow you to define the access modifier of multiple variables when defining them.

public {
    string my_var;
    int my_number = 0;
}

private {
    float my_float = 0.0f;
}

Functions

fun hello() -> Void {
    print("Hello, World!")
}

Logical operators

The language needs logical operators such as "and", "not" and "or".

HereDocs

It might be nice to have Ruby-like HereDocs as an alternative to multi-line strings.

# Where "END" is what stops the HereDoc
string <<END
This is a
  multiline,
as is String!
END

Import blocks

The language should have import blocks, like in Go.

import {
    System
}

Docstrings

The language should have simple and easy docstrings, such as:

doc {
    The description of what the docstring is for.
}

Switch/case statements

number: 5
switch number {
    case 1 { print("It's one!") }
    case 2 { print("It's two!") }
    case "Hello" { print("I don't know how this happened!") }
    case 3 + 1 { print("It's four!") }
    case 5 { print("It's five!") }

    else { print("I don't know what it is!") }
}

Broken variable contexts for functions

The variable contexts for other types of functions don't exist, so variables in functions that return a type, just get registered in the last function with a context.

Python-like classes

The classes in Carp should be able to be adapted and changed like Python classes.

If statements

if one = two {
	print("I don't know how that happened.")
}
elf one != two {
	print("That's more like it.")
}
else {
	print("This also shouldn't happen.")
}

Can't use class access

When using class access syntax, values cannot be used since it is not supported by the grammar.

print(MyClass()@myfunc()) # Not supported by the grammar!

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.