HackerTrans
TopNewTrendsCommentsPastAskShowJobs

shilangyu

no profile record

Submissions

Solving balanced parentheses problem using Dart's type system

shilangyu.dev
5 points·by shilangyu·3 anni fa·2 comments

comments

shilangyu
·12 mesi fa·discuss
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
·12 mesi fa·discuss
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
·3 anni fa·discuss
> 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
·3 anni fa·discuss
The world record average is 4.48s and it's held by... a 9 year old.
shilangyu
·3 anni fa·discuss
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
·3 anni fa·discuss
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
·3 anni fa·discuss
Except it's made by the same person
shilangyu
·3 anni fa·discuss
Nice example! Indeed, this language has a few interesting equivalent problem statements.
shilangyu
·3 anni fa·discuss
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
·3 anni fa·discuss
> 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
·3 anni fa·discuss
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
·3 anni fa·discuss
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?