Comments (5)
Array[Vector] | Array[Vector] | ... should I open a different issue?
Yep, please. I have no idea why such a type is produced, so will see it later. Thanks!
from typeprof.
Is it too early for bug reports?
No, I really appreciate it!
all the methods that call Array#each_with_index crash
I could reproduce the crash. I have an idea why it fails (it reaches an inconsistent state), but I need to take time to investigate how it reaches the inconsistent state. I will check and fix it.
(Detail: It looks that an wrong-arity generic instance is created. Maybe, RBS declares a two-type-variable class like class Foo[X, Y]
, but one-type-variable class instance like Foo[X]
seems to be created for a unknown reason.)
After ~12 minutes (I have a 2013 MacbookAir
😅 ), it crashes with:
I didn't reproduce it, but I think I fixed the issue at 955df72.
Sorry for ~12 minutes
I know that the analysis performance is a serious problem of typeprof. Though it is fundamentally a slow approach, there are much room to improve the performance. But now I prioritize the not-implemented-yet features.
Thank you!
from typeprof.
After ~12 minutes (I have a 2013 MacbookAir
😅 ), it crashes with:I didn't reproduce it, but I think I fixed the issue at 955df72.
I do get an analysis now, great.
Sorry for ~12 minutes
😭 . (Good news: the crash occurs when printing RBS, so the analysis itself is already finished. It will take no more time than 12 minutes😄 )I know that the analysis performance is a serious problem of typeprof. Though it is fundamentally a slow approach, there are much room to improve the performance. But now I prioritize the not-implemented-yet features.
Yes, of course. Also, I just realized that I was out of Ram (I need a new machine), and Ruby was taking 2G and swapping, so probably much better on a good machine.
Now the results are not particularly usable...
This is what I get for `Matrix#initialize`
def initialize : ((Array[(Array[(Complex | Float | Integer | Matrix | Numeric | Rational | String | Vector)?] |
Array[(Complex | Float | Integer | Matrix | Numeric | Rational | String | Vector)?] |
Array[(Complex | Float | Integer | Numeric | Rational | String | Vector)?] |
Array[(Complex | Float | Integer | Numeric | Rational | String)?] |
Array[(Complex | Float | Integer | Rational | String)?] |
Array[(Integer | String)?] |
Array[Complex | Float | Integer | Matrix | Rational | String | Vector] |
Array[Complex | Float | Integer | Rational] |
Array[Integer] |
Array[Integer] |
Array[String?] |
Array[Vector] |
Array[untyped] |
Complex | Enumerator[(Complex | Float | Integer | Matrix | Numeric | Rational | String | Vector)?] |
Float | Integer | Matrix | Numeric | Rational | String | Vector)?] |
Array[(Array[(Complex | Float | Integer | Matrix | Numeric | Rational | String | Vector)?] |
Array[(Complex | Float | Integer | Matrix | Numeric | Rational | String | Vector)?] |
Array[(Complex | Float | Integer | Numeric | Rational | String | Vector)?] |
Array[(Complex | Float | Integer | Numeric | Rational | String)?] |
Array[(Complex | Float | Integer | Rational | String)?] |
Array[(Integer | String)?] |
Array[Complex | Float | Integer | Matrix | Rational | String | Vector] |
Array[Integer] |
Array[String?] |
Array[Vector] |
Array[untyped] |
Integer | String)?] |
Array[(Array[(Complex | Float | Integer | Matrix | Numeric | Rational | String | Vector)?] |
Array[(Complex | Float | Integer | Matrix | Numeric | Rational | String | Vector)?] |
Array[(Complex | Float | Integer | Numeric | Rational | String | Vector)?] |
Array[(Complex | Float | Integer | Numeric | Rational | String)?] |
Array[(Complex | Float | Integer | Rational | String)?] |
Array[(Integer | String)?] |
Array[Complex | Float | Integer | Matrix | Rational | String | Vector] |
Array[Integer] |
Array[String?] |
Array[untyped] |
Integer | String)?] |
Array[(Array[(Complex | Float | Integer | Matrix | Numeric | Rational | String | Vector)?] |
Array[(Complex | Float | Integer | Matrix | Numeric | Rational | String | Vector)?] |
Array[(Complex | Float | Integer | Numeric | Rational | String | Vector)?] |
Array[(Complex | Float | Integer | Numeric | Rational | String)?] |
Array[(Complex | Float | Integer | Rational | String)?] |
Array[(Integer | String)?] |
Array[Integer] |
Array[String?] |
Array[untyped] |
Integer | String)?] |
Array[(Array[(Complex | Float | Integer | Matrix | Numeric | Rational | String | Vector)?] |
Array[(Complex | Float | Integer | Matrix | Numeric | Rational | String | Vector)?] |
Array[(Complex | Float | Integer | Numeric | Rational | String | Vector)?] |
Array[(Complex | Float | Integer | Numeric | Rational | String)?] |
Array[(Complex | Float | Integer | Rational | String)?] |
Array[(Integer | String)?] |
Array[Integer] |
Array[String?] |
Integer | String)?] |
Array[(Array[(Complex | Float | Integer | Matrix | Numeric | Rational | String | Vector)?] |
Array[(Complex | Float | Integer | Numeric | Rational | String | Vector)?] |
Array[(Complex | Float | Integer | Numeric | Rational | String)?] |
Array[(Complex | Float | Integer | Rational | String)?] |
Array[(Integer | String)?] |
Array[Integer] |
Array[String?] |
Integer | String)?] |
Array[(Array[(Complex | Float | Integer | Matrix | Numeric | Rational | String | Vector)?] |
Array[Complex | Float | Integer | Matrix | Rational | String | Vector] |
Array[Vector] |
Complex | Float | Integer | Matrix | Rational | String | Vector)?] |
Array[(Array[(Complex | Float | Integer | Matrix | Numeric | Rational | String | Vector)?] |
Array[Vector] |
Array[Vector] |
Complex | Enumerator[untyped] |
Float | Integer | Matrix | Numeric | Rational | String | Vector)?] |
Array[(Array[(Complex | Float | Integer | Matrix | Numeric | Rational | String | Vector)?] |
Array[Vector] |
Complex | Enumerator[untyped] |
Float | Integer | Matrix | Numeric | Rational | String | Vector)?] |
Array[(Array[(Complex | Float | Integer | Matrix | Numeric | Rational | String | Vector)?] |
Complex | Enumerator[untyped] |
Float | Integer | Matrix | Numeric | Rational | String | Vector)?] |
Array[(Array[(Complex | Float | Integer | Matrix | Numeric | Rational | String | Vector)?] |
Complex | Float | Integer | Matrix | Numeric | Rational | String | Vector)?] |
Array[(Array[(Complex | Float | Integer | Numeric | Rational | String | Vector)?] |
Complex | Float | Integer | Numeric | Rational | String | Vector)?] |
Array[(Array[(Complex | Float | Integer | Numeric | Rational | String)?] |
Array[(Complex | Float | Integer | Rational | String)?] |
Array[(Integer | String)?] |
Array[Integer] |
Array[String?] |
Array[Vector?] |
Integer | String)?] |
Array[(Array[(Complex | Float | Integer | Numeric | Rational | String)?] |
Array[(Complex | Float | Integer | Rational | String)?] |
Array[(Integer | String)?] |
Array[Integer] |
Array[String?] |
Array[nil] |
Integer | String)?] |
Array[(Array[(Complex | Float | Integer | Numeric | Rational | String)?] |
Complex | Float | Integer | Numeric | Rational | String)?] |
Array[(Array[(Complex | Float | Integer | Rational | String)?] |
Array[(Integer | String)?] |
Array[Integer] |
Array[String?] |
Array[nil] |
Integer | String)?] |
Array[(Array[(Complex | Float | Integer | Rational | String)?] |
Array[(Integer | String)?] |
Array[Integer] |
Array[String?] |
Integer | String)?] |
Array[(Array[(Complex | Float | Integer | Rational | String)?] |
Complex | Float | Integer | Rational | String)?] |
Array[(Array[(Integer | String)?] |
Array[Integer] |
Array[String?] |
Integer | String)?] |
Array[(Array[(Integer | String)?] |
Array[Integer] |
Integer)?] |
Array[(Array[Complex | Float | Integer | Matrix | Rational | String | Vector] |
Complex | Float | Integer | Matrix | Rational | String | Vector)?] |
Array[(Array[String?] |
Integer | String)?] |
Array[(Array[String?] |
String)?] |
Array[(Array[Vector] |
Array[Vector] |
Complex | Enumerator[untyped] |
Float | Integer | Matrix | Numeric | Rational | String | Vector)?] |
Array[(Array[Vector] |
Array[Vector] |
Complex | Enumerator[untyped] |
Float | Integer | Matrix | Numeric | Rational | String | Vector)?] |
Array[(Array[Vector] |
Complex | Enumerator[untyped] |
Float | Integer | Matrix | Numeric | Rational | String | Vector)?] |
Array[(Array[Vector] |
Complex | Float | Integer | Matrix | Rational | String | Vector)?] |
Array[(Complex | Enumerator[untyped] |
Float | Integer | Matrix | Numeric | Rational | String | Vector)?] |
Array[(Complex | Float | Integer | Matrix | Numeric | Rational | String | Vector)?] |
Array[(Complex | Float | Integer | Matrix | Rational | String | Vector)?] |
Array[(Complex | Float | Integer | Numeric | Rational | String | Vector)?] |
Array[(Complex | Float | Integer | Numeric | Rational | String)?] |
Array[(Complex | Float | Integer | Rational | String)?] |
Array[Array[Integer]] |
Array[Array[untyped]?] |
Array[Array[untyped]] |
Array[Integer?] |
Array[String?] |
Array[Vector?] |
Array[nil] |
String)?, ?(Complex | Float | Integer | Matrix | Range | Rational)?) -> ((Complex | Float | Integer | Matrix | Range | Rational)?)
First thing I notice is that there are a lot of optionals, which come from a series of deductions of methods that it thinks could return nil
: convert_to_array
<= Vector#to_a
<= Vector@elements
<= ?
I will feed it some basic information and see what happens.
A clear bug is that some elements seem repeated... Array[Vector] | Array[Vector] | ...
should I open a different issue?
from typeprof.
I think I finally fixed the first issue. The fix has only three lines, but it took a day
Odd result like Array[Vector] | Array[Vector]
is not fixed yet (I'll address it in #16), but anyway, now bundle exec exe/typeprof ../ruby/lib/matrix.rb
runs in about 40 seconds on my machine without abort.
from typeprof.
runs in about 40 seconds on my machine without abort.
OMG, what a difference. Ram usage went from 2G+ to ~200MB too
from typeprof.
Related Issues (20)
- undefined method: singleton HOT 1
- A feature to ignore errors on a specified line
- Error message with rbs_collection HOT 7
- Updating a Rails app to Ruby 3.1.2 breaks typrof HOT 1
- Importing RBS::AST::Members::ClassInstanceVariable is not supported yet
- Typing of dynamic methods and variables
- Fail to start TypeProf for IDE on zsh
- Typeprof failed to start when rbs_collection.lock.yaml doesn't exist.
- tests not working for 0.21.7 on ruby 3.1 HOT 1
- test dependency sider/goodcheck is gone HOT 1
- Rail's JSON support causes issues HOT 2
- URI require issue HOT 1
- Auto-commenting of methods doesn't handle multiple lines
- Enumerator expects 2 arguments
- Type `::Range` is generic but used as a non generic type
- Methods defined in a Struct.new block end up on parent module
- `include Enumerable` causes error
- Instance variables are sometimes incorrectly added to `Object` HOT 1
- Instance variables in subclasses sometimes are defined incorrectly HOT 2
- vscode error: typeprof running on wrong ruby HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from typeprof.