HNHacker News
TopNewBestAskShowJobs

shilangyu

16 karma · joined December 26, 2022

Computer science, math, and everything in between. Exploring programming languages. https://github.com/shilangyu
submissionscomments
shilangyu··on Adding lookbehinds to rust-lang/regex
PCRE2 supports only bounded length lookbehinds. It is true, it is not a big improvement to have unbounded ones in rust-lang/regex, but it still feels like something.
shilangyu··on Adding lookbehinds to rust-lang/regex
As others have pointed out, the regex engine is the same so the benefits would trickle downstream. For example, VSCode also uses ripgrep and therefore the rust-lang/regex engine.
shilangyu··on Formatting text in C++: Old and new ways
> I am tired of writing my own print functions for random objects when debugging because the API developers did not bother to override the <<operator.

Won't you face the same problem in Rust? If the library developer did not derive the Debug trait, you're out of luck.

shilangyu··on My speed cubing page
The world record average is 4.48s and it's held by... a 9 year old.
shilangyu··on My speed cubing page
Roux while still very much an underdog is gaining popularity as the method for one handed (OH) solves. The 2023 world champion of OH used roux to gain this title. I even heard of cases where people that use CFOP are now learning roux to use it exclusively for OH solves. The main advantages of roux for OH are that it requires fewer moves, requires no cube rotations (which are awkward to do with one hand) and you can use the table to act as a second hand when performing middle layer slices.
shilangyu··on NotebookLM: An AI Notebook
Originally when teased at Google IO this product was called project tailwind but the URL was thoughtful.sandbox.google.com (it seems to now redirect to the notebooklm URL). "Thoughtful sandbox" feels like a much more fitting name.
shilangyu··on Node.js built-ins on Deno Deploy
Except it's made by the same person
shilangyu··on Solving balanced parentheses problem using Dart's type system
Nice example! Indeed, this language has a few interesting equivalent problem statements.
shilangyu··on Defining interfaces in C++ with ‘concepts’ (C++20)
I don't know why I thought Go generics also do monomorphization, must've misremembered or it was an earlier proposal? Thanks for the correction!
shilangyu··on Defining interfaces in C++ with ‘concepts’ (C++20)
> In Go, I found that using an interface was not free: it can make the code slower.

The Go version that was presented isn't equivalent though. In Go you are accepting an interface directly which will hide the value under some fat pointer for dynamic dispatch, in c++ you are using generics to monomorphise the function to specific types. If you want to compare the implementations fairly you should've used Go generics:

  func Count[T IntIterable](i T) (count int) {
shilangyu··on Rust-sitter: Define your entire tree-sitter grammar in Rust code
I would like to delve into the compatibility with tree-sitter, since in other features tree-sitter being under the hood is mostly an implementation detail:

If I were to write my parser using rust-sitter, would I be able to still generate the final standalone tree-sitter parser as a `.so`? That way I could integrate with tools supporting tree-sitter parsers (for instance https://github.com/nvim-treesitter/nvim-treesitter#language-...) without having to write the `.js` grammar?

shilangyu··on Rust-sitter: Define your entire tree-sitter grammar in Rust code
Are there any benefits for users that tree-sitter is used under the hood? Can we benefit from the killer features of tree-sitter? Namely incremental parsing, fallible parsing, lossless syntax tree, or being embeddable into editors supporting tree-sitter syntax highlighting?