Live data from Hacker News

HTTP/3 is everywhere but nowhere

httptoolkit.com

501–504 of 504 posts

Re: HTTP/3 is everywhere but nowhere

#501

Earlier quoted context omitted.

TS does not have macro facilities. Proper macros operate on AST, which it to say, it is exactly like the Expression stuff in C#, except it can represent the entirety of the language instead of some subset of it (C# doesn't even fully support the entirety of System.Linq.Expressions - e.g. if you want LoopExpression, you have to spell the tree out explicitly itself).

> TS does not have macro facilities That I'm aware; I'm curious how this works on Go or Rust.

For details, take a look at the examples here: https://doc.rust-lang.org/book/ch20-06-macros.html

For procedural macros, what you get is not even the syntax tree but rather the token tree: https://doc.rust-lang.org/proc_macro/struct.TokenStream.html. You can then use stdlib to parse that into a Rust syntax tree (which is roughly the equivalent of Expression): https://docs.rs/syn/latest/syn/enum.Expr.html

Or you can do your own parsing, meaning that you can handle pretty much any syntax that can be lexed as Rust tokens. Which means that e.g. the C# LINQ syntactic sugar (from ... select ... where etc) can also be implemented as a macro. Or you could handle raw SQL and do typechecking on it.

Re: HTTP/3 is everywhere but nowhere

#502
post #230
post #63

Earlier quoted context omitted.

This is an interesting point I hadn't thought of when I saw the announcement of the new TypeScript compiler. It might be overstating the case to say that C# is indeed a minor language, but it's thought-provoking that it wasn't Microsoft's automatic choice here, the way it is for some all-Microsoft in-house IT shops.

It's not thought-provoking if you care to spend 5 minutes and read/listen to the reasons they provided.

I am not at all surprised to find that there are people in whom it does not provoke thought, but I am mildly amused that one of them would admit to it.

Re: HTTP/3 is everywhere but nowhere

#503
post #491

Earlier quoted context omitted.

C# supports top-level functions as well, that's not the issue. But, just to give a simple example, in TS you can do things like: var foo: { bar: { baz: string } } which have no equivalent in C#, because it doesn't have anonymous struct types, and its typing system is almost entirely nominal. Go, on the other hand, can translate this directly pretty much mechanically: var foo struct { bar struct { baz string } } And k…

I would love if in mapping the typescript types to go they ended up building a "compiler plugin" to enhance go's type system.

TypeGo by Microsoft (TM).

Considering how fast the TypeScript compiler is, the TypeGo -> Go transpilation might as well be similar (up to a constant factor) in speed to Go compilation itself.

I'd give it a try. As a highly enthusiastic Go programmer, a powerful TypeScript-like type system is something I'd welcome in Go with open arms.

Re: HTTP/3 is everywhere but nowhere

#504
post #469

Earlier quoted context omitted.

Just because .NET is what you know best, doesn't necessarily mean it's the best in all use cases. You're seeming like the node developers trying to push js everywhere because it's all they know. It's not a very rational approach I think.

I don't think I've ever said it was good for all use cases and probably said to the contrary. I write it very explicitly here[0]: > Should you use C# for web front-ends? > > We're only considering backends here; I do not think that .NET-based front-ends (e.g. Blazor) are competitive in all use cases. We are in a thread about...backend application servers. Most of my side projects are TS/JS and run serverless Node.js…

node is the wrong tool for any job.
Post reply on HN