Threads for quasilyte

  1. 4

    Isn’t this how Facebook’s Hack started out as well, before moving on to a JIT? Interesting how Facebook’s Russian competitor is doing the same years later.

    1. 2

      According to https://github.com/vk-com/kphp-kdb, they did this in 2009.

      1. 1

        You never know for sure, but the plan is that it’s always going to be AOT compiled and it’ll not become a completely different language like Hack.

        KPHP is a compiled (and quite strict) subset of PHP with some features like tuples that are easily emulated with kphp-polyfills in normal PHP.

        Developers use normal PHP during the development phase, so no KPHP VM is needed. When the code is deployed, it’s being compiled. It’s tempting to create your own language, but sometimes you need to limit your desires to stay practical. :)

        1. 1

          Yep! Though according to the disclosure it has been used in production for a while. It is interesting to see a different take on this approach; personally I think JIT is the winner here but nonetheless it’s intriguing.

          1. 1

            Am I right in thinking that with PHP8 it will begin compiling hot areas of code to native in order to get the best performance? I remember there being an option with PHP7 to do something like that but it had to be switched on and configured.

        1. 4

          BTW, for the such and similar situations go-critic has checks rangeValCopy and rangeExprCopy

          See docs: https://go-critic.github.io/overview

          Repo: https://github.com/go-critic/go-critic

          1. 1

            Thanks, I integrated it into my codebase. The default sizeLimit of 512 seems rather large, I would expect to see something like 64.

            https://github.com/contribsys/faktory/blob/master/.golangci.yml

            1. 2

              go-critic has a support for config per checker, look for @rangeExprCopy.sizeThreshold on the overview page :)

              And from what I see there is no mention of go-critic config param (oops), we’ll update docs soon.

              1. 2

                Yeah, I dug thru it and config’d golangci-lint. See link above.

              2. 2

                Just in case if you didn’t know: you can change the default size with -@rangeExprCopy.sizeThreshold parameter.

                To get a list of checkers, run: gocritic doc.

                To get info about a checker, run: gocritic doc <checkerName>.

                So, in case of the rangeExprCopy you do “gocritic doc rangeExprCopy” and it tells what parameters are available.

            1. 3

              When you’re doing a pull request, some random guru-senior-architect might occasionally check your code and suggest few changes. Sounds unlikely but any additional eyes might uncover bugs or architecture mistakes.

              Is this true? I would love to have someone review my code but I cant see it ever happening. Do I just open a PR and hope someone comes along to review it? How would they even know I am waiting for public review. It feels quite rude to jump in to someone elses project and start reviewing their changes.

              1. 4

                “Watchers” of the repo will get notifications, so they can get involved pretty easily if they want to. Also, you can add a label like “needs review” or something like that to attract more attention.

              1. 2

                The range check comments are reversed I think.

                1. 1

                  Oh, that’s right. Thank you! I think the issue is in the README only though. Warnings are given in a proper format.

                1. 1

                  Note that there is also RU version available, in case you’re more comfortable with it: https://habr.com/post/416903/ It also includes a bonus gopher image. :3