ojacot-descombes / dsharp Goto Github PK
View Code? Open in Web Editor NEWOpen-source .NET compiler for D# (d-sharp), a "C#" with simplified syntax.
License: MIT License
Open-source .NET compiler for D# (d-sharp), a "C#" with simplified syntax.
License: MIT License
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?
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:
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 ]
;
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.