Top
Best
New

Posted by adamnemecek 13 hours ago

Type Server Protocol(github.com)
232 points | 153 comments
nikolatt 12 hours ago|
DetachHead (maintainer of basedpyright) has criticized the TSP before:

- https://docs.basedpyright.com/v1.40.2/type-server/

- https://github.com/microsoft/pylance-release/discussions/718...

Ty (the type checker maintained by astral) however will apparently support the TSP: https://github.com/astral-sh/ruff/discussions/23432

ghm2180 11 hours ago|
I think the only way MS knows how to make money is lock someone into an ecosystem. I think their next attempt should be a closed source lean checker that has will have proprietary code for NL -> lean formalization checker.
pjmlp 11 hours ago||
Applies to all big tech contributing to FOSS, they don't do it out of charity.
salynchnew 4 hours ago|||
Definitely not true. Historically, it's been one of the ways they attract (and scout) top talent.
IshKebab 10 hours ago||||
I don't think that's true. Many big companies contribute to FOSS in ways that aren't just to attempt to lock people in. Often it's because they use the software and don't want to maintain patches forever - everyone wins if things actually get fixed. Or even because they just want to be known as a good place to work.
__s 10 hours ago|||
That describes how hands off MS was with Postgres committers ime a few years ago. Useful to house them to for helpful office hours too. We'll see how that holds up post HorizonDB
simonjgreen 10 hours ago||||
So… not out of charity then?
pixlmint 55 minutes ago|||
You're mixing motivation and end goal. Just because their motivations aren't purely charitable doesn't mean the end goal must be nefarious.
lukan 10 hours ago||||
No, mostly not, but that does not mean they engage with locking customers in.
IshKebab 10 hours ago||||
Not purely, but "charity" and "only doing it to lock people in" are not the only options.
wtetzner 9 hours ago|||
Of course not? I don't think anyone claimed it was out of charity.
pjmlp 10 hours ago|||
Name one big tech company in the same monetary level, that doesn't contribute to FOSS without second intentions.
wtetzner 9 hours ago|||
They definitely have other intentions, but it's often the same as people contributing in their free time: they use the software, want to make it better for their purposes, but don't want to be the ones to maintain it.
galaxyLogic 9 hours ago||||
Don't we all have "second intentions"?

Altruism happens usually among members of a tightly knit group, like family members or soldiers of a given unit. Teachers sacrificinng their life to save children. FOSS-developers, are they really producing software out of altruism? Maybe some of them are but it is hard for us to know whether that is so or not.

awesome_dude 6 hours ago|||
If a FAANG releases Kafka, REACT, Kubernetes, or any number of projects that they found helpful, and released into open source - there will always be a claim that they do it with some second intention, such as "be seen to be a positive contributor to the community"

But the truth is - so do I - as a humble contributor to a document, test, bug fix, or feature add to a FOSS project - where's the beef?

endofreach 10 hours ago|||
No. Microsoft and facebook are the try-hardest by far.
1287h 10 hours ago|||
Yes, Microsoft fired the Faster CPython team and Facebook/Instagram tries to buy its way into Python core in order to get their buggy free threading in.

Totally altruistic!

pjmlp 10 hours ago|||
NVIDIA, AWS, Google, Intel, AMD,...
anonymous908213 12 hours ago||
This should be called Python Type Server Protocol, no? Seems weird to mine the generic protocol namespace for a protocol that only supports Python. Especially coming from the company behind LSP, which actually is generic.
rzzzt 12 hours ago||
Type Server Subsystem for Python
cobolexpert 11 hours ago|||
Copilot+ Type Server Subsystem for Python Series S
Waterluvian 11 hours ago||
Copilot+ Type Server Subsystem for Python Series S .NET
kstrauser 10 hours ago|||
…Server 2027.
nazgulsenpai 10 hours ago||
...Subscription Edition
keitmo 9 hours ago||
...365
wseqyrku 5 hours ago||
.PYTHON
MoltenMonster 2 hours ago||
For Teams
duckqlz 26 minutes ago||
… Home Edition
zemo 10 hours ago||||
Language Server Protocol Server Subsystem for Type Server Protocol Servers for Python
warkdarrior 7 hours ago||
... for Workgroups
awesome_dude 6 hours ago|||
Python Server Subsytem Typing - PSST
wolttam 12 hours ago|||
It is namespaced under the pylance project. I also don't see any announcement here, just a markdown file.

Perhaps the post title could use a tweak

adamnemecek 12 hours ago||
This was the announcement https://devblogs.microsoft.com/python/announcing-tsp/
roarcher 11 hours ago|||
This is the company that named its web framework "MVC". At least this time they're not eternally polluting search results for an industry standard term.
ameliaquining 9 hours ago||
I've usually heard it called "ASP.NET MVC" except when the former part was clear from context.
Blackarea 12 hours ago|||
100% - it would make more sense if they also supported elixir or other dynamic languages
pantsforbirds 12 hours ago|||
I do wonder if it generalizes outside of python similar to how LSPs do.
fnord123 9 hours ago||
So now I need a TSP AND an LSP eating loads of memory?
impoppy 4 hours ago||
It’s really good that folks over at Astral decided to implement it. It was difficult for me to understand what does this protocol provide that couldn’t be implemented with a new LSP capability, the linked document doesn’t really explain that, but what did become clear to me is that seemingly Microsoft are trying to invent new features for their proprietary LSP server that only works in VS Code so people will have harder times switching to other editors. This way, no matter what Microsoft comes up with, will be matched with very high quality open source tools.
benatkin 47 minutes ago|
Indeed, this seemed not to happen to the same degree: https://ghuntley.com/fracture/

vscode forks were shown to be viable.

tobz1000 11 hours ago||
As someone with minimal knowledge of LSP specifics, I'm a bit confused about why this exists. Is it the case that LSP alone does not provide adequate functionality for Python type queries?
nextaccountic 8 hours ago||
> why this exists

https://docs.basedpyright.com/v1.40.2/type-server/

> The "type server protocol" is a desperate attempt from microsoft to prevent pylance from becoming obsolete by outsourcing its type checking to other language servers like basedpyright, ty or pyrefly -- while continuing to keep certain language server features exclusive to pylance.

> This protocol benefits nobody except microsoft. It adds needless complexity to any language server that chooses to support it. Basedpyright does not support it and strongly advises other language servers to avoid supporting it as well.

> For more info see here https://github.com/microsoft/pylance-release/discussions/718... and here https://github.com/astral-sh/ty/issues/1190#issuecomment-337...

Wilfred 11 hours ago||
It seems to be a more structured representation of the type. Normally in LSP you'd have a plain string or markdown that you render in the IDE, but nothing that you can analyse structurally.

It's a shame it's not just an LSP extension though, or a feature in a newer LSP version. LSP is maintained by Microsoft engineers.

zamalek 11 hours ago||
workspace/symbol will do it (and the output may need some massaging), but it's optional.
ocamoss 10 hours ago||
I thought workspace/symbol returns an unstructured payload wrapped w/ some metadata.

Since the format is unspecified I imagine many language servers would just return a string representation of the type, which in Python is a PITA to parse because not every type has a closed-form representation (overloaded callable types, for example, have to be declared as a protocol).

zamalek 10 hours ago||
Fair enough, I had no idea it was unstructured.
Tarean 12 hours ago||
So basically adding machine readable type-at-point queries as an lsp extension so Pylance and Pywright can be separated?

The 'result types'format is super python specific, like not having a for all binder. I don't think this specific schema will be used for any non-python languages.

pipes 12 hours ago||
Can someone explain what this is to someone like me that doesn't know python very well, but programs a lot in c#?
jesuslop 11 hours ago|
Language server protocol is the interface of a software piece that sits between an IDE and a language toolchain so you don't need to change code in the IDE to add support of new languages (you add support on the LSP server). Then server provides things such as completions/intelli-sense, navigation to definitions and some correction checking. From the anouncement TSP extends LSP for better python type awarness.
PufPufPuf 9 hours ago||
I just use the Pyrefly extension in VSCode/Zed, run Pyrefly in the CI, and everything works well. The fragmentation around pyright/pylance/basedpyright/cursor-pyright etc. makes it pretty much unusable, you can't get consistent results across IDEs.
asunny 6 hours ago|
[flagged]
0cf8612b2e1e 12 hours ago||
It kept with UTF-16. New protocol is a chance to correct that poor decision.
marshray 9 hours ago||
It's just an .md file and a few hundred lines of json schema defining some extension messages, not a bottom-up protocol revision.
ivanjermakov 7 hours ago||
What's wrong with UTF-16 for transport?
hmry 5 minutes ago||
In LSP, UTF-16 is not just for transport. Source locations are also referred to by their UTF-16 offset. That means applications are required to store a persistent mapping from UTF-16 offsets to whatever they use internally, keep that mapping updated as the document is edited, and map back and forth constantly.

Oh well. It was primarily designed to be a good protocol for VSCode, not for any other users

ashkankiani 6 hours ago||
When I wrote the initial version of the neovim LSP client, I got intimately familiar with LSP, and how much I hate it. Microsoft protocols have a habit of being extremely specialized to their application despite being recommended for broader use. I will never, ever, ever adapt another microsoft language protocol.
_heimdall 6 hours ago|
Reading the main README, I'm not sure why I'd reach for this over ant other typed JSON RPC, tRPC or similar. What are the benefits I'm missing here?
More comments...