Engineering blog of Square, covering its Ruby tooling, API design, accounting systems, and engineering practices.
HN cites it for Square's work on Ruby typing with RBS and Steep, its Racket-based OpenAPI DSL, and Caviar's word2vec menu recommendations.
Very interesting idea, I'd love to see where it goes! This reminds me of Square's Racket DSL [1] for making OpenAPI tolerable, but perhaps a more pragmatic approach.
The team I worked with in my previous job built a lot of tooling around OpenAPI (CLI, GitHub integration etc.) to try and improve the developer UX around creating, maintaining, and collaborating on large definitions. The OAS definition for the company's core product amassed ~60k lines of YAML. Some of the features you listed happen to solve some of the biggest challenges we ran into:
> Type checks and autocomplete.
The CLI tool we developed was able to parse an OAS (expressed in a single file or over multiple ones using $refs) into a tree structure. This allowed the tool itself to reason about the state of the OAS, but it was difficult to expose the same information to the user via an editor extension or language server.
Utilising an existing language and all of its editor features to write the OAS to begin with would alleviate some of the pain points we saw when managing very large collections of OAS files.
> Easy CICD integration.
We built a whole GitHub integration that listens for webhook events (like PR opened, commit merged into master etc.) which then downloaded the OAS files from the affected repo, ran checks and validations, compiled them into a single monolithic file, uploaded the file to S3, and generated Markdown docs. I can imagine this process being much simpler if existing language tooling…
from Soutarowho who did the type system for Ruby 3:
We defined a new language called RBS for type signatures for Ruby 3. The signatures are written in .rbs files which is different from Ruby code. You can consider the .rbs files are similar to .d.ts files in TypeScript or .h files in C/C++/ObjC. The benefit of having different files is it doesn't require changing Ruby code to start type checking. You can opt-in type checking safely without changing any part of your workflow.[1]
So UX-wise I don't know. While it's nice to have them separated, you are just faster if you have types in the code in front of your face when the IDE warns. Otherwise you will context-switch on any warning/error. This could get significant since you code just based on the LSP's output sometimes for hours. The IDE could help here with showing the definition when warning but still, if you want to change the definition or want to see more than just a snippet you will constantly jump between files.
Also .d.ts files were introduced to type old code and as an fallback and as a secondary option, At some point, Matz and Soutaro need to integrate types into the language itself to get the same level of productivity other typed languages offer, eg. Rust/Go/TS.
The next thing is IDE support, anyone knows more?
[1] https://developer.squareup.com/blog/the-state-of-ruby-3-typing/
Square | Mobile Engineers (Mid/Sr levels) | ONSITE VISA San Francisco, CA
-- Mission --
We believe everyone should be able to participate and thrive in the economy. So we’re building tools that make commerce easier and more accessible to all. We started with a little white credit card reader but haven’t stopped there!
-- About the team --
Current team size: 4 iOS, 2 Android, 1 PM, 1 EM
Languages: Objective-C/Swift; Java/Kotlin
I'm one of the many hiring managers here at Square. My team, CDX (Connected Devices Experience), is searching for an Android engineer interested in platform, product, and/or low-level work (e.g. drivers, bluetooth, hardware). If you enjoy platform work that is consumer visible, I'd love to chat with you!
-- Links --
We're always open to new talent here at Square. If this role isn't a fit, there are several others I'd be happy to refer you to other teams.
Our philosophy on growth as an engineer is available here: https://developer.squareup.com/blog/squares-growth-framework-for-engineers-and-engineering-managers/
-- Apply --
These are roles for my team and sister teams (mention CDX if you're specifically interested):
• Mid-level Android Engineers: https://smrtr.io/3zKmj
• Senior Android Engineers: https://smrtr.io/3zKmq
• DM for other roles: https://squareup.com/us/en/careers/jobs
Use them to measure how well people will perform in the tasks that you need them to do. For coding interviews, Square's is really good. [1] I am not sure if they have sample questions written anywhere in the linked blog posts, but very simple things with added complexity.
Example - Write a rate limiter that takes in a timestamp (integer) and returns true if it hasn't hit a rate limit. Ok, now what if we make the rate limiter per user. Just simple things to see how you represent data, store it, create interfaces to it, and how you refactor to deal with change.
Most likely, you want to be having someone write tests for some code and review some code. Then speak to them about their experience. Depends on your organization though, maybe you are small and people need to produce a lot more than the large tech companies.
1. https://developer.squareup.com/blog/ace-the-square-pairing-interview/
The problem is that the Cocoa framework, even after the advent of Swift, has always been created with MVC in mind. We're now at a point in iOS where trends have rolled around and now people are saying to pick MVC because that was Apple's intention, other architectures were created because people were doing it wrong:
https://medium.com/flawless-app-stories/the-only-viable-ios-architecture-c42f7b4c845d
Obviously most significant production apps are using variant architectures such as at the bare minimum having view models, and the introduction of SwiftUI and popular earlier frameworks such as RxSwift also complicates things. Most apps aren't using pure MVC, sure, but it doesn't mean that the architecture isn't scalable. The alternatives might also be pretty gnarly:
https://developer.squareup.com/blog/ziggurat-ios-app-architecture/
Well, I was trying to avoid the entire rant about using API Keys for security in the first place.
https://zapier.com/engineering/apikey-oauth-jwt/
https://cloud.google.com/endpoints/docs/openapi/when-why-api-key
We all have done it at one point or another. But if I am ever in the middle of a technical presentation and mention “API Keys”, I get all types of dirty looks from security.
Notice that Square for instance strongly discourages API Keys for production.
https://developer.squareup.com/docs/build-basics/access-tokens
On the AWS side (where I work) we always discourage long term use of access key/secret keys for accessing resources even though I realize it’s necessary for some integrations. Even then, most organizations also put a condition that you can only use it from known IP addresses.