Git Product home page Git Product logo

dsharp's People

Contributors

ojacot-descombes avatar

Watchers

 avatar  avatar

dsharp's Issues

Welcome

As @gafter has suggested here, I've opened a new repo for D#. You are welcome to contribute to this new language.

Does this language idea have a future? Would you like to write code with this language, with less typing as in C#, but without having to re-learn everything about methods, arrays, extension methods, assignment compatibility, operator precedence and all the rest?

Line-orientation and continuation lines and blocks

The language is line-oriented. Continuation lines are introduced with a back-tick ( ` ) and their indentation does not matter. Nested blocks have an indentation increased by 4 spaces.

Advantages: Line-orientation removes the need for semicolons and parentheses in many situations. Indentation sensitiveness allows to eliminate curly braces and block-end symbols. A line continuation character at the beginning of the line has a better visibility compared to a continuation character at a line end.

Line orientation enforces a unique style, unlike in C# where you can have a unique statement in an if-statement on the same line, indented on the next line, enclosed in braces, on the same line, first brace on the same line, braces indented, not indented etc., etc., etc...

Example:

if a < 100 && b < 100 &&
`  c < 100 && d < 100
    WriteLine("They are all less than 100")
else
    WriteLine("Some guy is too big")

Example of alignment. A back-tick indicates a continuation line:

while i < a.Length &&
`     a[i] == null
    i++

I expect that the IDE will provide visual hints like lines or indentation based background coloring:

background_coliring

Adapted EBNF as metasyntax notation

We need a syntax notation. Since D# will be line-oriented and (most likely) white-space sensitive I suggest using EBNF, but in a line-oriented and white-space sensitive manner, allowing us to express the D# grammar easily, without the need for end-of-line tokens and indentation tokens.

Example:

IfStatement =
    "if" Expression
        StatementSequence
    { "elsif" Expression
        StatementSequence }
    [ "else" Expression
        StatementSequence ]
;

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.