Skip to content

Latest commit

 

History

History
84 lines (66 loc) · 2.04 KB

limitation.md

File metadata and controls

84 lines (66 loc) · 2.04 KB

Limitation

Since UniScript uses SlowSharp as a backend, there're some differences compared to original C#.

await

UniScript is designed for creating game flows not a core logic computation, Threading is not a major consideration at this moment.
Current implementation of await keyword just Waits until task ends and may blocks the execution thread.

Here's a code from SlowSharp.

private HybInstance RunAwait(AwaitExpressionSyntax node) {
  var task = RunExpression(node.Expression);
  
  if (task.isCompiledType &&
      task.Unwrap() is Task t) {
      t.Wait();
      return HybInstance.Null();
  }
  /* ... And goes on */
}

goto

goto is very unstable for the moment.

For example, every execution of goto creates a frame. this may lead program to StackOverflowException or memory leaks.

label:
Console.WriteLine("Hello World");
goto label;

Strongly not recommended to use.

generic

generics are one of hardest part to implement.

Instantiating generic classes from script is working, declaring generic classes or method is not supported yet.

// This is OK
var list = new List<int>();

// Oops, Not implemented yet
class Foo<T> { }

partial

SlowSharp is an interpreter and does not have linking phase during compliation. partial keyword won't be supported by design.

partial class Foo {
  public void A() { }
}
partial class Foo {
  public void B() { }
}

Operator overloading

Currently, main purpose of UniScript is writing a game flow using external texts not creating a datastructure.
However, I'm totally agree with this is necessary.

Will be implemented in near future.

Lambda

Will be implemented with high priority.
Now supports with partially implementation.
pjc0247/SlowSharp#1

And more...

  • Latest language features such as pattern matching and named tuple.
  • Special keywords: unsafe, stackalloc, volatile and so on.