-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[WIP] Ruby Implementation #44
base: main
Are you sure you want to change the base?
[WIP] Ruby Implementation #44
Conversation
Hello Rob, welcome!!
Start with just the source code and a README with pointers for installing Sorbet. We'll test the instructions before merging to see if it makes sense to add more code.
Class methods are fine, go for it! |
Yep. Though, another option might be to not have row schemas but check somehow that the result table (after adding a row) is correct. Pyret rows come with schemas (link). |
Media/Ruby/basics_spec.rb
Outdated
require './table' | ||
require './table_api' | ||
|
||
RSpec.describe Basics do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These tests are, for the most part, literally testing the ruby core std lib methods themselves... not super practical, more so in the spirit of completeness.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Especially helpful as I re-org the files/classes to more closely adhere to the table api spec; helps with a test driven development approach.
Sure, Ruby is dynamic... but come on, no Boolean class :(
Thus, we cannot really enforce sort on StackOverFlow pointed out this can be solved by monkey patching in
I added this because it irked me. This may begin toeing the line between "implementing B2T2 for Ruby" and "getting Ruby to work with B2T2". |
It was fairly straight forward to add tests for
|
We are interested in using a dynamic language like Ruby to implement B2T2. I am personally interested in also briefly exploring the Sorbet static type checker as I go here. I think it might help me reason about the Table API by allowing me to decorate with types.
Please note: until this is no longer a draft, consider this a work in progress that is messy, unorganized, and likely not a proper or correct representation of the final pull request.
Live List of Unknowns
what do you actually check-in when using Sorbet? (i.e. how do I reduce the 64k diffs 🤦)no Sorbet for nowfor all r in rs, schema(r) is equal to schema(t1) --> this seems to imply you can call schema on a row and a table?consider adding a schema to each row, or having some link between row and schemais a module a more accurate representation of the Table API? Or can I just create class methods?mostly classes with possible a TableAPI module, we'll see how this pans out