Giter Club home page Giter Club logo

language's Introduction

Ideas to Include in a new Programming Language

Focus is on programmer ergonomics. Should be as easy to use as python and as fast as Java.

  1. Heavy type inference; type inference of variables, and also of function parameters and return type; interfaces are made for every individual method, and also for every method combination that is inferred. Classes don't inherit from other classes, instead they inherit from interfaces, and the implementation is copied over.
  2. Python syntax
  3. Compile-time errors are reported but only stop execution if they're on a potential runtime path.
  4. Error-reporting can be turned on and off again at will
  5. Casts are inserted whenever necessary, but emit a warning.
  6. Class meta-types
  7. Match statements; supports match on class of object
  8. Generators, coroutines, asyncio, all supported
  9. implicit return of None
  10. Shadowing is not allowed, except accross function boundaries
  11. Variables are implicitly initialized to None
  12. If, Else, etc. do not produce a new scope.
  13. No recursive imports; statically checked.
  14. Types cannot be reassigned.

Examples

def function():
  pass

print("Hello, world!")

class A()<In, Out>:
  pass

Should translate to the following java code:

public class Script {
  public class Function0 {
    public Object call() {
      return null;
    }
  }

  public class A<In, Out> {}

  public static Function0 function;
  public static Class<? extends Object> classA;

  public static void main() {
    function = new Function0();

    System.out.println("Hello, world!");

    classA = A.class;
  }
}

language's People

Contributors

a1liu avatar

Watchers

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