HNHacker News
TopNewBestAskShowJobs

jez

4,090 karma · joined February 23, 2014

- http://blog.jez.io

- https://github.com/jez

- https://jez.io

[ my public key: https://keybase.io/jez_; my proof: https://keybase.io/jez_/sigs/s9uEJ_STwo02blZ-iSkntb4jURsdxhKkc8rg5Y_9im8 ]

submissionscomments
jez··on Bug squash: An underrated interview question
The point of the interview is not to answer "Can this candidate find and fix this bug?" but rather "what is the candidate's approach to fixing unknown problems?"

A good performance looks like making a hypothesis for where the bug is, testing that hypothesis, and repeatedly narrowing in closer and closer. Finding and fixing the bug is irrelevant!

A bad performance might look like

- running out of hypotheses for what might be causing the bug

- making hypotheses, but never testing them

- failing to interpret the result of their test of the hypotheses (thinking it confirms one thing, when it doesn't actually confirm that, or it confirms the opposite)

jez··on Bug squash: An underrated interview question
I think there's the chance to do both!

Some candidates will not have problems installing dependencies and want to use their own tools.

Other candidates will want to not have to think about their environment.

Providing an online code sandbox doesn't preclude allowing candidates to do it on their own laptop!

jez··on Import and Export Markdown in Google Docs
How does it handle images in the imports and exports?
jez··on An Overview of the Starlark Language
The biggest feature I want out of Starlark the language (not Bazel the build system) is to allow optional type annotations. They don’t have to do anything, they don’t have to specified, it just needs to be syntactically valid to put type annotations somewhere. If there were syntax for type annotations that tools like Bazel ignored, it would be possible for some enterprising soul who’s forced to use Bazel at work to throw up an initial prototype of a type checker and a language server for Starlark in Bazel. The language is not that complicated that a type checker couldn’t be written by a hobbiest.

My biggest frustration when using Bazel is not even Bazel—it’s the fact that when I’m looking at code like this[1], everything comes from a single, unannotated `rctx` variable that has no type annotation. So when I’m trying to read the code, it’s a matter of constantly grepping the repo, grepping the bazel docs, and grepping the bazel source code to get any new code written.

Why can’t I just hover and see the docs? Why can’t I press `rctx.` and see all the attributes available?

I frequently hear “why do you need types? the language is Turing complete just run it and see if it fails” but that misses the point that I have want to use types to guide what code to write in the first place.

[1] https://github.com/bazel-contrib/toolchains_llvm/blob/master...

jez··on Superfile – A fancy, pretty terminal file manager
This is my biggest complaint with keybindings on Linux/Windows, that Ctrl means “escape codes” in terminal emulator applications and “window/UI operations” in every other application.

By contrast, in macOS all the window/UI keybindings are typically Cmd (Cmd-W) which means that GUI applications attempting to layer on vi keybindings don’t have to also audit all the Ctrl keybindings that might be doing something wildly different compared to what vi users expect.

Cmd for UI and Ctrl for terminal just makes for such a nice default convention.

jez··on GPL all the things?
The article the first post in the thread links to was discussed a few days ago.

https://news.ycombinator.com/item?id=40160331

jez··on Readme.txt vs. README.txt (2015)
"Historically it wasn't possible to make lowercase `readme` files" doesn't explain why, after transitioning to systems which allowed separate case in file names, `README` files remained uppercase while most other text files now have lowercase names.
jez··on Embed Crystal code directly in Ruby
Sorbet is not feature complete, we are working on it every day!

I hear you on the verbosity of generic type declarations. It's something that I pushed hard for us to improve in the early phases of the project, but I was outvoted by other members of my team. But... at this point those members have all left the team and in the meantime we've heart actual users complain about the verbosity (not our own hypothetical "what if" complaints in the design phase) so I'm optimistic we'll be able to reduce generic type verbosity in the future. For example, a while back I did a prototype/experiment to drastically drop the verbosity of generic type annotations[1]. It's definitely on our radar.

Happy to chat more either on Sorbet's issue tracker or Slack group.

[1] https://github.com/sorbet/sorbet/pull/7322

jez··on Embed Crystal code directly in Ruby
> The main thing I struggle with regarding generics is the scenario where you must have separate type_template and type_member for class methods vs instance methods, and there are many use cases where these values are equal.

Makes sense, this is a big one for us too. For example, we'd like to do a better job of typing the T::Enum `serialize` and `deserialize` methods, but that's blocked on having a better mechanism for type_members that are equivalent to type_templates. I have done some prototypes to build this feature (you can find them in my draft PRs) but none of the solutions I arrived at were particularly satisfying. It's on our list to fix for sure.

> Adding more polish to the ergonomics [...] would lead to better "just-works" type support

People mean a lot of different things by this—I'd love to hear more about what kinds of ergonomic improvements would help. For example, some people say ergonomics to mean only tooling improvements, while others mean something else (e.g. type system improvements).

jez··on Embed Crystal code directly in Ruby
Do you have some examples of programs using generics in Sorbet you would prefer worked better or differently?
jez··on Difftastic, a structural diff tool that understands syntax
Unfortunately it doesn't appear to allow customizing colors yet.

I chimed in on this issue[1] to express support for that. You may wish to also chime in on that one, or open a new issue if you think that the feature you're looking for is sufficiently different from the one discussed in that thread.

[1]: https://github.com/Wilfred/difftastic/issues/611

jez··on Abandoned villages of Hong Kong
https://lite.cnn.com/2024/02/13/style/hong-kong-abandoned-vi...
jez··on DNS over HTTPS is not what I thought
In this case how is dns.google or cloudflare-dns.com resolved?

Maybe in this case, because the author of the post only cares to check whether certain domains resolve or not, having the DNS server be resolved by normal DNS not DNS over HTTPS is fine, and that in other cases you’d hardcode an IP like with normal DNS resolution?

jez··on Protesters hurl soup at the Mona Lisa painting in Paris
https://lite.cnn.com/2024/01/28/europe/soup-thrown-mona-lisa...
jez··on Welcome to the end of college football as we know it
https://lite.cnn.com/2024/01/06/opinions/college-football-pl...
jez··on Carta to exit secondary trading business
When a company says something like:

“Fast forward to today, our business is broken down as follows: the captable business is about $250M/year, fund administration is about $100M, private equity is about $20M, and the secondary trading business is about $3M.”

Is that assumed to be yearly revenue? Earnings? Something else?

jez··on Moving Git commits between repos (2017)
If the goal is to move all the commits of one repo into another repo, Git provides subtree merges:

https://docs.github.com/en/get-started/using-git/about-git-s...

For companies that started out making lots of small repositories that want to moev incrementally to a monorepo, this strategy can be useful because it sets up the smaller repo as a self-contained unit of the larger repo, preserving things like git commit history and git blames. After a subtree merge, further steps can more tightly integrate the code into the larger repository (i.e., so that it is no longer wholly contained in the subtree).

jez··on Posts, profiles, and user search are now available without login
After reading this post, I can't see the new Bluesky logo any other way:

https://news.ycombinator.com/item?id=14460013

jez··on ArXiv now offers papers in HTML format
Ah, thanks for clarifying!

I looked up the submission formats, and it looks like if you authored the paper in TeX/LaTeX, they do not accept pre-rendered versions of the document.

https://info.arxiv.org/help/submit/index.html#formats-for-te...

But if you did not author it in TeX/LaTeX (e.g., Word, Google Docs, etc.) it appears you can upload a PDF or HTML yourself.

jez··on ArXiv now offers papers in HTML format
I think this is an argument in favor of doing automatic PDF -> HTML conversion for the authors that don't want to touch it, but I don't think it's an argument against letting those who are fine with HTML provide their own.
jez··on ArXiv now offers papers in HTML format
It would be neat if they offered submitters the chance to upload their own HTML version alongside the PDF version, instead of always relying on an automatic conversion process.

- I can imagine authors feeling frustrated if someone reaches out about a problem in the HTML version of their paper, but they have no way to correct it except by hoping that a change to the PDF fixes a change to the generated HTML. Easier to just fix the formatting problem in the PDF outright.

- It would be neat to allow people to experiment with alternative formatting for their papers. For example, imagine a paper about a programming language that embeds a sandbox you can use to play around with the language under discussion. Or a paper about multivariable calculus and you can interact with a three dimensional plot of some function.

jez··on I Love Ruby
Not saying it’s the optimal choice in the languages design spectrum, but it is a little defensible:

If you’re prototyping a new interpreted language and don’t want to have to build a JIT that can optimize code, but still want some semblance of good performance, the block approach Ruby picks can be pretty useful.

Ruby doesn’t haven to allocate a full-on, garbage-collected, closure object every time a function accepts a block: it only has to do this if the block gets stored to a variable. If the block is only ever yield’d to, the allocation can be skipped.

And when your language’s primary looping mechanism is done with blocks, the difference adds up:

    xs.each do |ys|
      # with normal closures and no fancy JIT,
      # the VM has to allocate a closure once per loop:
      ys.each do |y|
      end
    end
Ruby was able to get away with its closure-heavy standard library APIs without a JIT for almost 3 decades because of the affordances that blocks provide over procs/lambdas.
jez··on Ruby's private keyword is weird
Fascinating, thank you for sharing!

More about this Python feature in the docs:

https://docs.python.org/3/tutorial/classes.html#private-vari...

jez··on Ruby's private keyword is weird
Yep, another bad copy paste from the previous section. Thanks! Will fix in a bit.
jez··on Ruby's private keyword is weird
Thank you for sharing!

It looks like the Scala project found allowing protected[this] fields as an escape hatch for variance to be unsound:

https://github.com/scala/bug/issues/7093

Going to have to chew on that and what it means for the same feature in Sorbet…

Thanks again for bringing this up!

jez··on Ruby's private keyword is weird
That’s cool! Thanks for sharing, I had never considered that aspect of private[this].

Mentioned in the article, but it also powers covariant classes. In a language like C# only interfaces can have covariant type parameters, because it wouldn’t be sound to store a value in a (C#) private field if it had a covariant type. This influences a lot of the API design in C# where basically every container a covariant/immutable interface alongside the invariant/mutable implementation.

(Java gets around this with use site variance annotations which are more flexible but have their own drawbacks).

jez··on Ruby's private keyword is weird
The difference between private and protected is a bit subtle so I’ll defer to the Ruby FAQ:

https://www.ruby-lang.org/en/documentation/faq/7/

(On this page there’s a section called “What’s the difference between private and protected?” which explains it.)

It’s interesting in its own right, and it’s in my backlog to blog about because I don’t like any of the existing resources contrasting the two.

jez··on Ruby's private keyword is weird
I don't think this has to be the case! I think you could build a different language with the same message passing semantics as Ruby, but with the limitations that classes are not allowed to be re-opened and method definitions must appear syntactically at the top-level of a class (and maybe a few other limitations), and then build something more similar to how `private` works in a traditional, statically-typed language.

You definitely don't arrive at a language that has all the same feeling of Ruby, but you could still have the "everything is an object, and everything is message passing" character to the language.

jez··on Ruby's private keyword is weird
Sorry, that’s simply a typo translating from Java to Ruby. I believe the point that section is trying to make still holds after editing it to say “private :x, :x=”

> Private methods can only be invoked on an implicit receiver.

This changed in Ruby 2.7. You can now include the self keyword, which is important because it allows calling methods that share names with Ruby keywords. “begin” is a keyword but “self.begin” is a call to a method named begin. So if that method happens to be private, you can call it now in Ruby 2.7 without needing “send(:begin)”

Other than the typo (thanks! I’ll fix that when I’m back at my computer), I think that the rest of the post underscores what you’ve already pointed out about how private works, modulo the misunderstanding about the changes in Ruby 2.7

jez··on The state of merging technology
The biggest day-to-day merge conflict annoyance I have is situations like this. As far as I know, there’s no solution:

    commit aaaaaaaa
    diff --git a/README.md b/README.md
    --- a/README.md
    +++ b/README.md
    @@ -1,4 +1,4 @@
    -<p align="center">
    +<p align="left">
       <img width="200" src="logo.svg">
     </p>


    commit bbbbbbbb
    diff --git a/README.md b/README.md
    --- a/README.md
    +++ b/README.md
    @@ -1,5 +1,5 @@
     <p align="center">
    -  <img width="200" src="logo.svg">
    +  <img width="345" src="logo.svg">
     </p>

     # Project
Commit aaaaaaaa changes some text on line 1.

Commit bbbbbbbb changes some unrelated text on line 2.

I don’t want to have to manually resolve this—just merge the lines. If there’s a semantic conflict I’ll let the tests sort it out. When I’ve looked in the past there wasn’t a merge strategy that fixes this.

← PreviousPage 3 of 10Next →