-
I see the point to make a parallel with HipHop, but here YJIT is directly integrated in CRuby, the main implementation of the language, and it’s just a matter of command line flag whether you enable or disable it — at least from what I remember that I red.
From what I remember, HipHop was distributed in a different toolchain than the vanilla PHP interpreter. Ruby also have other interpreters available by the way: https://github.com/codicoscepticos/ruby-implementations
-
CodeRabbit
CodeRabbit: AI Code Reviews for Developers. Revolutionize your code reviews with AI. CodeRabbit offers PR summaries, code walkthroughs, 1-click suggestions, and AST-based analysis. Boost productivity and code quality across all major languages with each PR.
-
Ruby does have optional type annotations, if you want them:
https://github.com/ruby/rbs
-
Python now has an optional type system and if you add one of them such as mypy or pyre to your CI process and you can configure GitHub to refuse the pull request until types are added you can make it somewhat strongly typed.
If you have a preexisting codebase I believe the way you can convert it is to add the types that you know on commits and eventually you will have enough types that adding the missing ones should be easy. For the missing ones Any is a good choice.
https://pyre-check.org and https://github.com/python/mypy are popular.
-
Python now has an optional type system and if you add one of them such as mypy or pyre to your CI process and you can configure GitHub to refuse the pull request until types are added you can make it somewhat strongly typed.
If you have a preexisting codebase I believe the way you can convert it is to add the types that you know on commits and eventually you will have enough types that adding the missing ones should be easy. For the missing ones Any is a good choice.
https://pyre-check.org and https://github.com/python/mypy are popular.
-
There might be a number of reasons why YJIT isn't effective in your application.
The best way to know it to enable YJIT runtime statistics [0] to see whether YJIT is doing a lot of side exits and if so why. But it requires a bit of YJIT knowledge to interpret them.
It's also entirely possible that your application isn't CPU bound in the first place, or that it's bottlenecked by things YJIT can't do anything about (e.g. GVL).
That's close to impossible to guess what it might be without being able to instrument the application.
[0] https://github.com/ruby/ruby/blob/df6b72b8ff7af16a56fa48f3b4...
-
Python's type hints are definitely an improvement and they're getting better all the time, but they're still frustrating to use at anything approaching the edge. I long for something as elegant and functional as TypeScript.
One hurdle I've stumbled over recently is the question "what is a type?", the answer can be surprising. Unions, for example, are types but not `Type`s. A function that takes an argument of type `Type` will not accept a Union. So if you want to write a function that effectively "casts" a parameter to a specified type, you can't. The best you can do is have an overload that accepts `Type` and does an actual cast, and then another that just turns it into `Any`. This is, in fact, how the standard library types its `cast` function [1]. The argument I've seen for the current behavior is that `Type` describes anything that can be passed to isinstance, but that's not a satisfying answer. Even then, `Union` can be passed to isinstance and still does not work with `Type`. Talk currently is to introduce a new kind of type called `TypeForm` or something to address this, which is certainly an improvement over nothing, but still feels like technical debt.
[1]: https://github.com/python/typeshed/blob/main/stdlib/typing.p...
-
Looks like it’s still a WIP
https://github.com/oracle/truffleruby/commits?author=eregon
-
SaaSHub
SaaSHub - Software Alternatives and Reviews. SaaSHub helps you find the best software and product alternatives
-
Are you referencing https://github.com/hpyproject/hpy?
I do hope it takes off.
Related posts
-
What's the point of using `Any` in Union, such as `str | Any`
-
Importing python libraries "Cannot find implementation or library stub for module named ..."
-
Offer to Type Hint API's, or Start a Statically Typed Python?
-
Wrapping my head around type hinting
-
Is there any other mainstream language (especially strongly typed compiled) whose type system is as powerful (or at least close) as Typescript? It's difficult to like other languages type system after using Typescript.