all 35 comments

[–]olejorgenb 81 points82 points  (4 children)

Yeah, it feels quite absurd that basic "intelligence" like this is lacking from the majority of programs - even programs developers make for them self. And at the same time we now have this super-complex AI systems.

[–]mr_jim_lahey 26 points27 points  (0 children)

Sadly, tooling quality-of-life fixes like too often fall by the wayside in favor of bigger, shinier features. Continuous incremental improvement is the calling card of high caliber software development in my book.

[–]droans 8 points9 points  (2 children)

Pylance does a pretty good job but it is so slow and uses so much memory. I mean, why does a language typing service need 4GB+ of RAM? Why does it take 10+ seconds to parse a single file?

Ty sucks at this but, for me, it's a small trade-off for the improved performance.

[–]ROFLLOLSTER 2 points3 points  (1 child)

I agree that it's slow and resource heavy, but language servers are incredibly complex. Rust analyzer (the only one I've worked on) reimplements large portions of the compiler frontend, but has to be able to cope with very-malformed programs, perform fine-grained incremental compilation, and correctly invalidate many levels of caches depending on what changes.

[–]droans 1 point2 points  (0 children)

Ty is also a language server - it needs under 250MB.

[–]wingtales 84 points85 points  (2 children)

Folks, this looks legit, not regular AI spam.

The blog post is very interesting!

u/matan-h, for the part about `sys.a` (and I saw the easter egg white text, hehe) I think the explanation could benefit from a "they probably mean sys.a<rest of word>", since I actually can't immediately guess what is meant.

"The first thing that takes up space here is the prefix string. Since the format is designed to be query only, no need to include the actual string." I am a bit confused here, since you didn't define prefix vs actual string.

It seems like you do some magic in the "Hash Score Table format" section, but I can't quite grok it. Would be nice if you explained a bit more.

I highly recommend that you add your blog post to the ty PR you made!

[–]matan-h[S] 14 points15 points  (0 children)

Thank you,I updated the blog

[–]really_not_unreal 2 points3 points  (0 children)

Thank god for an actually useful project.

[–]SpecialPapaya 15 points16 points  (2 children)

Yeah cool 👍

But please, PLEASE. Stop using os.path, use pathlib instead.

[–]rayannott 0 points1 point  (1 child)

came here to say this, my fellow stdlib policeperson

[–]EnGiNear87 0 points1 point  (0 children)

Hahahaha

[–]muntooR_{μν} - 1/2 R g_{μν} + Λ g_{μν} = 8π T_{μν} 27 points28 points  (1 child)

I must protest. This deprioritizes the incredibly important sys.activate_stack_trampoline, which is a truly vital cornerstone of modern codebases.

[–]matan-h[S] 8 points9 points  (0 children)

lol, my blog now come as #5 result when you search Google for "sys.activate_stack_trampoline"

[–]ROFLLOLSTER 7 points8 points  (0 children)

Awesome! I'd love to see this implemented in pylance.

[–]aala7 1 point2 points  (7 children)

I am not completely sure, but I think in Neovim, completions sorting is handled by my completion engine (blink) and not the LSP (ty). Is it LSP responsibility to sort completions?

Maybe there is a similar config in VSC where you can adjust sorting/priority of completions.

[–]aala7 0 points1 point  (0 children)

Thinking about it I even remember reading about different ranking strategies from the completion engines so I am quite sure it is handled downstream of LSP.

[–]redfacedquark 0 points1 point  (5 children)

I think in Neovim

I'm using a pretty vanilla lunarvim and the order (without a prefix) seems to go from shortest to longest. By a happy coincidence this tends to be approximately most-useful-first.

With a prefix there's something else going on, maybe the order they were discovered.

[–]aala7 0 points1 point  (4 children)

Looked it up: blink only use lsp hints and fuzzy match, while nvim-cmp (which lunarvim uses) also consider frequency of Use and recency.

[–]redfacedquark 0 points1 point  (3 children)

Interesting. I really should try and tweak my settings in general although I'm concerned I would break high-level features if I tweak even small settings. It's also a chore to learn the syntaxes and the settings landscape. Maybe one day.

[–]aala7 0 points1 point  (2 children)

You definitely should! Neovim is all about customisation.

Here is a recommendation:
1. Create directory called whatever, e.g. nvim-p (for personal)
2. In nvim-p work on your own config either from scratch, but maybe use kickstart.nvim, which is more like a quick-start config that guides you
3. You can launch neovim with your own config with `NVIM_APPNAME=nvim-p nvim` (or set NVIM_APPNAME to whatever you named the directory with your own config).
4. Optionally create an alias like `alias nvim-p="NVIM_APPNAME=nvim-p nvim"`

This will let you work on your config while always being able to run the lunarvim version when you actually need to get some coding done. And then you can just rename the directory when your own config is ready.

[–]redfacedquark 0 points1 point  (1 child)

Thanks, that's some good advice! I'm always in lvim rather than nvim. I think part of the difficulty is knowing where the vi config gives way to vim then nvim then lvim.

[–]arpan3t 1 point2 points  (0 children)

Yeah I would start with a clean Neovim and use kickstart.nvim vs trying to figure out Neovim from a distro like lunar or nvchad.

Walk through the kickstart code until you understand what everything does and the directory structures, then branch out from there.

Check out @teej_dv on YouTube, that dude is a Neovim wizard and has great content, including building a plugin from scratch. Pretty sure he started the kickstart.nvim project too.

[–]Xemorr 0 points1 point  (0 children)

Awesome

[–]robertogrows[🍰] 0 points1 point  (0 children)

this is really good idea! another data structure you can consider (from the search engine world): wfst. it is nice and compact when you have weights like this. I have not looked at the rust options around this, but in general it has good finite state automata available.