-
Notifications
You must be signed in to change notification settings - Fork 4.9k
Closed
Description
This is a continuation of my previous bug report that was placed poorly ( see: dotnet/corefx/issues/31803 ). In general this is a request about getting the old JScript .NET updated to work with more modern ECMAScript Syntax and on other platforms. In general the base ECMAScript standard has adopted some features found in C# that can be used to help with implementing a updated version of the language.
Major Implementation Problems ( Specification wise):
- The following keywords are not supported yet: interface, package, private protected, and public. These are highly useful for data management in .net. However we can use the JScript.NET syntax for now on this.
- Syntax for specifying Data types ahead of time is not set yet, but a suggestion on this has been made ( see: https://ecmascript-daily.github.io/pages/status-of-static-typing-in-ecmascript/ ). This effects the following...
- Variable data types
- function parameter data types.
- function return data type.
- Classes can only have 1 super class - This is solved by using class inheritance from expressions.
Elements helping with Implementation:
- ECMAScript 2015 (aka ECMAScript 6th edition) ( see: https://github.com/rse/es6-features or http://es6-features.org/ for examples) - This version of ECMAScript adds most of the necessary elements for .NET language Bindings. In general the major features that can be used are as follows...
- Block Scoping for variables and functions
- Lamda Opeator ( aka Arrow Functions) - This feature is symantically similar to the C# Lambda expressions.
- Lexical This for classes and arrow functions.
- Unicode Strings and regular expressions.
- Constant variables
- Default values for function paramaters.
- Template Literals - This could pose a few problems, but in general this is extremely useful for string interpolation.
- Generator functions - These behave a lot like the C# generator functions, but the syntax is different.
- import/export statements ( aka Modules) - The import statements from JScript.NET do not need any changes here, but there is still some major differences that need addressing.
- Classes - Some basic Syntax changes from JScript.NET did are required, but in general the format is a lot cleaner. The only issue is as follows...
- class constructors use the function "constructor" now.
- methods no longer require function keyword in classes.
- static member functions.
- strings support new search methods ( "startsWith", "endsWith", and "includes".
- Proxy handlers.
- Typed Arrays - This is useful for static types like signed integers, unsigned integers, single precision floating point, and double precision floating point.
- ECMAScript 2016 ( aka ECMAScript 7th edition) - This mostly cleans up implementation details for ECMAScript 2015. The new features for ECMAScript 2017 are the exponentiation operator ( ** ) and Array.prototype.includes.
- ECMAScript 2017 - This adds a lot more features.
- Shared Memory and Atomics ( see: https://github.com/tc39/ecmascript_sharedmem )
- async Functions parameters( see: https://tc39.github.io/ecmascript-asyncawait/ )
- String Padding ( see: https://github.com/tc39/proposal-string-pad-start-end )
Side References which can help with implementing the Feature:
- Jscript .NET Reference Pages (From Visual Studio 2010 ) - https://docs.microsoft.com/en-us/previous-versions/visualstudio/visual-studio-2010/x85xxsf4(v%3dvs.100)
- TypeScript ( https://www.typescriptlang.org/ ) - The syntax for typed functions and variables is a clear match to what is used in JScript.NET.
- Scala.js ( https://www.scala-js.org/ ) - This also follows some of the symantics used by JScript .NET.
- JS++ by Onux Corp ( see: https://www.onux.com/jspp/ ) - This follows a more c-like approach to defining variable types.
Metadata
Metadata
Assignees
Labels
No labels