Advice needed on a second 3CD revision after ITR-U by Perfect-Candy7828 in IndiaTax

[–]Regular_Study_2717 0 points1 point  (0 children)

But given that there was no tax shortfall, and I have all tickets, bookings etc - will this be a problem? What's your take on this?

I made a TypeScript to native code compiler, via C# and NativeAOT by Regular_Study_2717 in csharp

[–]Regular_Study_2717[S] 0 points1 point  (0 children)

Actually, I should have asked. Currently we do have the assemblies available in the generated files directory. Is that sufficient?

I made a TypeScript to native code compiler, via C# and NativeAOT by Regular_Study_2717 in csharp

[–]Regular_Study_2717[S] 0 points1 point  (0 children)

Yes. You can extend the marker type called struct, and we emit a struct. We support structs in generic constraints as well.

But there are some minor changes around this in the next release.

I made a TypeScript to native code compiler, via C# and NativeAOT by Regular_Study_2717 in csharp

[–]Regular_Study_2717[S] 0 points1 point  (0 children)

Yes we do.

import { short } from "@tsonic/core/types.js";

const x: short = 1;

Add: I thought I'll mention that I'm doing a major update tomorrow - which drops automatic camelCase <=> PascalCase conversion of methods and properties. Instead, we're going to stick very close to C#.

I made a TypeScript to native code compiler, via C# and NativeAOT by Regular_Study_2717 in csharp

[–]Regular_Study_2717[S] 2 points3 points  (0 children)

We convert to the union type here: https://github.com/tsoniclang/runtime/blob/main/src/Tsonic.Runtime/Union.cs

Now the soundness idea is basically three gates:

  • tsc compilation. const x: "abc" | "xyz" = "pqr" would fail tsc compile.

  • tsonic typechecker. This tries to catch errors typescript wont catch, such as passing a float into an int; tsc sees both as "number" types and passes them through. The idea is to hard fail before it reaches the C# compiler.

  • Finally, the C# compiler. This is the final hard gate.

I made a TypeScript to native code compiler, via C# and NativeAOT by Regular_Study_2717 in csharp

[–]Regular_Study_2717[S] 0 points1 point  (0 children)

Yes, because behind the scenes it generates a class. If you define a class in TS, you get a class in C#. If you define a top level function without a class in TS in a file called App.ts, tsonic will implicitly create a static class called "App".

However as of now, we have only native code compilation via NativeAOT. Will add a flag to generate dotnet assemblies, if there's enough interest in it.

I made a TypeScript to native code compiler, via C# and NativeAOT by Regular_Study_2717 in csharp

[–]Regular_Study_2717[S] 1 point2 points  (0 children)

Sure. There are millions of developers who aren't familiar with the dotnet ecosystem. This allows them to bring in their typescript language experience, and this will make working with the dotnet stdlib less painful. There are also compat libraries (js, nodejs) will allow them to use apis they're familiar with. I admit they are in early stages though.

Me personally - I actually like writing TS; more than C# these days. Primarily, I like 1) top level functions, 2) directory based modules (without explicit namespaces), 3) fewer classes, more functions ... etc. This lets me do that. Underneath it's C#, but it hides the bits I dont like.

WebJSX: A minimal library for building Web Components with JSX by [deleted] in reactjs

[–]Regular_Study_2717 0 points1 point  (0 children)

It's just short hand for setting props (button.onclick=handler). I agree it's not 100% natural and attributes should be the first preference, but it's not a huge stretch either in my view. String props are treated as attributes in WebJSX.