Type Server Protocol
Posted by adamnemecek 13 hours ago
Comments
Comment by nikolatt 11 hours ago
- 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
Comment by ghm2180 11 hours ago
Comment by pjmlp 11 hours ago
Comment by salynchnew 4 hours ago
Comment by IshKebab 10 hours ago
Comment by __s 10 hours ago
Comment by simonjgreen 10 hours ago
Comment by pixlmint 28 minutes ago
Comment by lukan 10 hours ago
Comment by IshKebab 10 hours ago
Comment by wtetzner 9 hours ago
Comment by pjmlp 9 hours ago
Comment by wtetzner 8 hours ago
Comment by galaxyLogic 8 hours ago
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.
Comment by awesome_dude 6 hours ago
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?
Comment by endofreach 10 hours ago
Comment by anonymous908213 12 hours ago
Comment by rzzzt 11 hours ago
Comment by cobolexpert 11 hours ago
Comment by Waterluvian 10 hours ago
Comment by kstrauser 10 hours ago
Comment by zemo 10 hours ago
Comment by warkdarrior 7 hours ago
Comment by awesome_dude 6 hours ago
Comment by wolttam 12 hours ago
Perhaps the post title could use a tweak
Comment by adamnemecek 12 hours ago
Comment by roarcher 10 hours ago
Comment by ameliaquining 9 hours ago
Comment by Blackarea 12 hours ago
Comment by pantsforbirds 12 hours ago
Comment by fnord123 8 hours ago
Comment by tobz1000 11 hours ago
Comment by nextaccountic 7 hours ago
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...
Comment by Wilfred 10 hours ago
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.
Comment by zamalek 10 hours ago
Comment by ocamoss 10 hours ago
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).
Comment by zamalek 9 hours ago
Comment by impoppy 4 hours ago
Comment by benatkin 20 minutes ago
vscode forks were shown to be viable.
Comment by Tarean 12 hours ago
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.
Comment by pipes 11 hours ago
Comment by jesuslop 10 hours ago
Comment by PufPufPuf 8 hours ago
Comment by asunny 5 hours ago
Comment by wolvesechoes 2 minutes ago
Comment by 0cf8612b2e1e 12 hours ago
Comment by marshray 9 hours ago
Comment by ivanjermakov 7 hours ago
Comment by ashkankiani 6 hours ago
Comment by _heimdall 5 hours ago
Comment by rmzs0711 12 hours ago
Comment by ocamoss 10 hours ago
PHP, Erlang, Ruby, etc.
Comment by dev_l1x_be 10 hours ago
Comment by rjbwork 11 hours ago
Comment by YuechenLi 11 hours ago
Comment by 0gs 10 hours ago
Comment by YuechenLi 9 hours ago
Comment by 0gs 5 hours ago
Comment by YuechenLi 4 hours ago
https://github.com/yuechen-li-dev/GenerativeCompressionProto...
Comment by chuckadams 11 hours ago
Comment by kenhwang 11 hours ago
There has been so much programming language innovation in the past decade that I'm surprised someone hasn't built a better Python. I'd like to see something like Rhai or Roto take off which has a natural upgrade path to Rust.
Maybe it's because interpreted languages just aren't in vogue anymore and probably won't be for a long time if humans aren't even coding anymore.
Comment by zamalek 9 hours ago
I believe Mojo is an attempt at that. Python is probably too entrenched by my estimation.
Comment by jacquesm 11 hours ago
Comment by rspeele 11 hours ago
Perl 6?
Comment by giancarlostoro 11 hours ago
Comment by collabs 11 hours ago
I can't imagine how anyone can complain about this. The community revolted. The team listened. What else do we want?
Comment by dist-epoch 10 hours ago
Comment by jacquesm 9 hours ago
Yes, that's the attitude I was talking about.
See, when you are a maintainer of a popular language with a community at some point the bickering becomes the job. And when you are a creative person managing a horde of egos who all participate to put their stamp on something the only reasonable thing to do is to leave them to their own devices, which he did. I really don't blame him. Guido is one of the nicest people and to see how the Python community did not have a single second's consideration for how their incessant infighting must have made him feel is one of the worst stories of the FOSS movement.
Comment by dist-epoch 8 hours ago
If you don't want bickering create a closed project, make it open but don't accept contributions, etc.
You can't have it both ways "I want a big diverse community, but they should all agree with me"
Comment by deathanatos 11 hours ago
You don't have to activate a venv to use it; `$VENV_PATH/bin/python3` just works.
(It also softlinks/symlinks the binaries.)
Comment by benrutter 11 hours ago
What languages are you thinking of specifically when you mention better thought out ones?
Comment by rjbwork 10 hours ago
Frankly, I just really prefer statically and strongly typed compiled languages.
I did my last company's first Demo and MVP in Python after running through the Koans at my co-founder's behest and ultimately we decided that the production system would not be done in Python. There are some cool things about it - specifically I do like that annotations are real AOP seams, but the numerous footguns and lack of types and a compiler just make it a very annoying ecosystem to work in for me.
Comment by pphysch 11 hours ago
Comment by jelloroll42 8 hours ago
Comment by pphysch 7 hours ago
Comment by stackghost 11 hours ago
C# is strongly/statically typed, compiled, and quite fast (after the vm has started), whereas python is weakly/dynamically typed, interpreted, and generally slow as fuck. Those are two fundamentally different languages, how could it possibly be a coke/pepsi situation?
I think python is fantastic for certain use cases: gluing other tools together (like LAPACK or other ancient libraries), system automation, prototyping, exploitation (I think pretty much all of us were working on stealmybitcoin in python), and exploratory data analysis.
The problems arise when people try to write, say, gigantic GUI applications in python, or really anything with CPU-bound workloads. Part of being an engineer is using the right tool for the right job. Python is the wrong tool for lots of jobs. That shouldn't be a controversial statement.
Comment by Jtsummers 9 hours ago
It's strongly/dynamically typed, not weakly typed. Why do people keep getting this wrong? Has any version of Python been weakly typed? I know Python 2 and 3 aren't, perhaps the first version or ABC, its predecessor language.
Comment by wtetzner 8 hours ago
It's kinda funny to say people are getting it "wrong" when strong/weak typing isn't really defined anywhere or universally agreed upon.
In fact, even "dynamic typing" can be considered to be an oxymoron, since types are formally defined to be a static property of a language. A more correct term would be "uni-typed".
I'm not saying that the meanings you're using for static/dynamic and weak/strong are bad, just that chastising someone for getting them "wrong l" doesn't make sense for terms that are not widely agreed upon.
Comment by pphysch 10 hours ago
Comment by stackghost 10 hours ago
What I don't do is cultivate a "favorite language" and make it my whole identity, and then take criticism of that language as some sort of personal affront. Python objectively has some serious flaws. That shouldn't make anyone emotional, and I don't know why people get their backs up like this.
Comment by pphysch 9 hours ago
Problem with any popular language is an outsider sees one or two statistically-likely codebases that are total turds, and then gets one-shot by the Goomba fallacy.
Comment by stackghost 6 hours ago
I don’t know, but deflecting legitimate criticism of a language by calling it “language purism” seems pretty emotional to me.
Comment by FacelessJim 11 hours ago
Comment by loeg 11 hours ago
Comment by lijok 11 hours ago
What do you attribute Python's success to, in spite of being a disaster of a language and ecosystem?
Comment by rjbwork 13 minutes ago
We've known for a very long time that shitty things can become very successful in this field and why.
Comment by TomBombadildoze 9 hours ago
First, it's easy to learn and reasonably powerful. You can make a lot of useful things really quickly, which was true even 15 years ago. It's only gotten easier since, and the ecosystem has continued to grow.
Second, ML latched onto it. That gave Python a lot of credibility for people coming through CS programs and into industry, especially as AI use cases were picking up momentum. Think Tensorflow starting 10-ish years ago, then Pytorch, and so on.
[opinion time] Unfortunately, ML has contributed to disaster. The quality of software engineering in ML applications lags badly behind that in other segments, and there's where most Python development is happening now. The feedback loop of training Bad Python into LLMs is only making it worse. The skill floor was dropping, and now it's practically zero.
It also wasn't helped much by language design decisions. Gradual typing was a huge mistake. It would have been much better to go the Typescript route and define a superset of the language that compiles to native Python. The grafted-in typing features that rely on runtime behavior and never got an actual spec for a type system haven't helped.
Comment by johnfn 11 hours ago
Comment by dude250711 11 hours ago
Comment by theplumber 11 hours ago
Comment by konart 11 hours ago
Apparently you can't be a senior dev unless you "just here to deliver"
Comment by dijit 11 hours ago
It can do everything, it's a nightmare to write correctly and is so full of warts that really only a mother could love it.
Go is "elegant" and properly designed, which leads to fundamental unassailable limitations; like its GUI story or writing a backend for other languages (cgo is so slow and -build-mode=c-shared is a hog).
No operator overloading makes it difficult for numerical/scientific work - Python is stronger here.
"just get stuff done" is your crappy dump truck which is welded together out of spare bits and is barely hanging on, this is how I feel about C++.
Go is a lot more elegant and well designed, but it requires "smooth roads" (An OS and Runtime) and goes fast... it's more like a Dodge Hellcat..
EDIT: if we consider speed a function of development time rather than runtime, of course at runtime C++ can be as fast as it gets.
Comment by stackghost 11 hours ago
To me it seems more like C++ is the metal shop's old school 3-axis mill: effective and dangerous. Can do almost anything, including easily maim you unless you're continually vigilant.
Go seems like a CNC machine: just as effective, much less dangerous because it relies on digital safeguards and embedded controllers. You need to go to extreme lengths to make it do something it wasn't designed to do.
Python seems like lego. Shit simple to build things with, lets you start building immediately, fantastic for prototypes, but finished product is still just press-fit plastic bricks
Comment by dijit 10 hours ago
Comment by bheadmaster 11 hours ago
Comment by dijit 11 hours ago
Comment by kingstnap 11 hours ago
Cross platform interpreter.
NumPy and SciPy really set the stage.
Comment by chuckadams 11 hours ago
Comment by timschmidt 9 hours ago
Comment by jacquesm 11 hours ago
I'll give Python one thing though, it is by far the most elegant way to glue together a large number of otherwise incompatible C libraries.
Comment by thinkyfish 9 hours ago
Comment by stronglikedan 11 hours ago
Comment by rsalus 11 hours ago
Comment by Pxtl 11 hours ago
But Python peaked like 20 years ago. The later features were too ugly, and it was too slow to fill the obvious gaps in the language.
Comment by aaabbbbb 11 hours ago
The language is a disaster since it deviated from its original purpose. The community is ruled by insane, mediocre narcissists who drove away all reasonable people.
Comment by avaer 11 hours ago
- Reasonable ergonomics for describing data flows, as long as you never run the code, which you often don't care about if you're a mathematician
- Adoption by people who optimize pumping citations, not reproducible results -- non-working code is a feature when you're trying to BS
Comment by wiseowise 10 hours ago
Comment by svachalek 11 hours ago
Comment by joshheitzman 10 hours ago
Comment by hocuspocus 9 hours ago
If you set a bar, any bar, there's really not much offered by Python that you cannot find in a more reasonable language. Especially if you're gluing together C++ and Rust libraries for data processing or ML workloads. Python is still disproportionately popular there but I'm also convinced its days are counted. C++ will be tremendously harder to get rid of, in comparison, if that's even possible.
Comment by kenhwang 10 hours ago
Comment by gostsamo 10 hours ago
I work in python. It's only real and big issue is the slow interpreter. Everything else is resolvable one way or another. The only other big issue it has is the envy of people who imagine that if not for python, their beloved language would be as used as python is now. Most of their beloved languages are older than python or when they were created, they had much bigger ticket backing than python and those languages are still not where python is. The reason? Python is made to solve the issue one has now, not the issue one might have in the future. Local optimum at its best and worst. And honestly, most people have the current issue to solve and rarely reach the imaginary issue to be. If python didn't exist, it would have been invented.
Comment by FridgeSeal 7 hours ago
- performance is awful.
- gradual typing is sort of ok, but relies too much on runtime behaviour.
- async support is a bit all over the place.
- uv has made the packaging experience sort of liveable, but collectively it’s still very limited: feature support, conditional dependencies, rudimentary tree shaking, cargo-style workspaces, etc.
In an era where your options of tech stack are freer than ever, unless you explicitly need PyTorch, I’m not really sure why you’d choose Python over literally everything else.
Comment by trojans1290 9 minutes ago
Comment by risyachka 11 hours ago
Comment by mi_lk 11 hours ago
Comment by Toutouxc 11 hours ago
Comment by Pxtl 11 hours ago
Comment by Toutouxc 10 hours ago
Comment by brcmthrowaway 11 hours ago
Venvs, activate, deactivate, shitty scripts hacking on $PATH. How did this ever ship? Then there was poetry, `uv`, and maybe something in else in $CURRENT_YEAR.
Try to set it up on a new macOS, go on. Install a package from pip, and there's a bunch of garbage that won't let you do it.
It's horrible. Python packaging engineer is now an FTE, maybe that's what they wanted.
Comment by Pxtl 11 hours ago
Comment by globular-toast 10 hours ago
Comment by westurner 11 hours ago
Comment by esafak 11 hours ago
Comment by quotemstr 11 hours ago
Comment by okanat 11 hours ago
It lacks decent packaging and by design cannot handle multiple versions of dependencies or perform metadata-only/declarative resolution. To resolve the dependencies of a Python package you need to install it. Many Python packages resolve their dependencies imperatively depending on the current system state. When you need binary dependencies like numpy it gets even worse since libpython doesn't have a stable ABI.
It is one of the most underdesigned languages but it holds a dear place due to being easier to translate from pseudocode to actual implementation. This resulted many academics to pick it up and write advanced math libraries in it.
Comment by Quitschquat 11 hours ago
Comment by theplumber 11 hours ago
Comment by mathisfun123 11 hours ago
"unhinged" take
Comment by paaloeye 12 hours ago
Comment by intrasight 12 hours ago
Comment by paaloeye 9 hours ago
Trisodium phosphate was at one time extensively used in formulations for a variety of consumer-grade soaps and detergents, and the most common use for trisodium phosphate has been in cleaning agents.
Comment by paaloeye 9 hours ago
Comment by madelgi 9 hours ago
Comment by ChrisArchitect 11 hours ago
Pylance + Pyrefly: bring your preferred type checker to Visual Studio Code
https://devblogs.microsoft.com/python/announcing-tsp/
Pyrefly + Pylance Integration in VS Code
Comment by ahgrta 12 hours ago
Why don't you spend your resources on F# instead of this nonsense?
Comment by SwamyM 11 hours ago
Absolutely!
F# is criminally under-invested in.
Comment by rednb 11 hours ago
Comment by beaconflint 12 hours ago
Comment by sick_of_slop 7 hours ago
Comment by wetpaws 12 hours ago
Comment by arionmiles 9 hours ago
Maybe just make a Python 4 with better types built in at this point...
Comment by pacman1337 10 hours ago
Comment by wargames 9 hours ago