Hacker Newsnew | past | comments | ask | show | jobs | submit | ptarjan's commentslogin

https://www.vimgolf.com/ is what taught me to VIM


I like the idea of vimgolf, but almost every "good solution" is a regexp replacement. Which is a problem since outside of vimgolf, I've very rarely used i. The usecase of vim regexp is quite narrow, basically only used in converting files between formats (a task I'd rather use other tools for)


The metric system seems like a similar analog to geometric algebra vs vector calculus. You are saying the same thing but the language you are using is much more internally consistent.

Adoption has been bumpy given the US resistance but I think in the long run it (or something even more consistent) will win out. Similarly I think geometric algebra will be adopted. Maybe not in our lifetimes but eventually.


> As for detecting gravitational waves, except for violent events like black hole mergers, we don't detect any; what few such gravitational waves there are are far too weak for us to detect.

I thought LIGO and VIRGO had been detecting gravitational waves for the last 4 years pretty regularly (i.e. once a week).


Yes, from mergers.


My favorite time I had to do this was for a real-life situation. I wanted a script that was both a bash script (for speed) and a ruby script (if you installed it the default way).

I came up with: https://github.com/sorbet/sorbet/blob/master/gems/sorbet/bin...


The parser for Sorbet was actually entirely given to us by GitHub. They were fabulous partners early on in the project and we're grateful for their contributions.


Understated, but awesome! Thanks for the insight!


We believe that the main goal of a typechecker is to give you nice error messages. We've found giving names to things makes it easier for folks to reason about their errors, and introducing names for interfaces isn't that onerous at Stripe or with our beta testers.

We aren't opposed to eventually support it, but we'd like to see how it goes with the current form first.


Thank you! Ruby has been kind to us, we'd like to be kind back.


Thanks for the idea.

We used `params` because Method#parameters was what they called it in the standard library. I actually had it as `args` originally until someone pointed this out. https://ruby-doc.org/core-2.6.3/Method.html#method-i-paramet...

As for the syntax change, we are actually on our 8th iteration of the syntax. We really wanted this to NOT be a fork of Ruby so finding something compatible was very important. For example that's why it has the weird `sig {` syntax too, we didn't want to have to cause load-time and cyclic dependencies from adding type signatures.


> We used `params` because Method#parameters was what they called it in the standard library

Super interesting. We should probably have being consistent for naming parameters vs. arguments in stdlib. It's too late though!


On a super pedantic level, "parameters" are the names that you write in the function definition, and "arguments" are the values you pass as parameters.

  def name_length(person)

  steve = Person.new
  name_length(steve)
Here, 'person' is a parameter, and 'steve' is an argument.

Most programmers use them interchangeably.


We called those 2 terms "formal parameters", and "actual parameters" if I remember my programming language concepts class from college correctly.


I've never been to programming college but in 10 years I have always heard them as def(parameters) and call(arguments). Probably a lot of that was when reading about how VMs and compilers work, though.


Thanks for pointing that out. It can be called all of those. We liked sigil from its connotation:

> Google defines sigil as, “an inscribed or painted symbol considered to have magical power,” and we like to think of types as pretty magical

https://sorbet.org/docs/static#fn1


That's a pretty unintuitive use, since "sigil" is more commonly used (in programming languages) as a single symbol, as in a non-alphanumeric character that's used as some kind of syntax.

https://en.wikipedia.org/wiki/Sigil_(computer_programming)


Right so the $ in PHP or @ in Perl would be a sigil, (and even the $ and % in QBasic, am I dating myself?) and the # in this example and all C code and some Swift code would be a pragma. Seems pretty cut and dry.


And the $ and @ in ruby...


I remember there was this CEO once who was new to the software industry and was looking for a word to describe non-small-business customers. When people suggested "Enterprise", he instantly dismissed it, and when they insisted this is already the word we all use to mean this, he actually opened the dictionary to prove that it wasn't quite accurate. What I took from this is that, when cultures or conventions already have momentum, sometimes you just have to go with it. This is the same reason I don't like Go.


How does this relate to Go? That flew over my head.


They throw every convention out the window and act like they have a true greenfield audience. They don't even allow [variable, Class, CONSTANT] convention, they don't follow the convention of letting devs choose their own project location, and a lot more.


Could be a reference to Go choosing to use different words for similar concepts that exist in other languages like C++? I'm not familiar enough to think of examples though.


Bummer. That kind of name overloading has the potential to be needlessly confusing down the line. "Sigils, I mean well, they're like pragmas but in Sorbet we call them sigils." [x a billion]

Now's the time to fix that stuff.

(In any case, I'm quite keen to start playing with sorbet, looks great!)


  test/test_corpus.cc
  364:        auto checkPragma = [&](string ext) {
  368:                    << "Missing `# typed:` pragma. Sources with ." << ext << ".exp files must specify # typed:";
  377:            checkPragma("cfg");
A quick look at the source shows that it may have been called pragma at one point.

EDIT: I'm guessing "sigil" was chosen because it's closely matching the "signatures" or Sigil.sig method name?


Nice spelunking! Yeah, this word means nothing really. Sigil, pragma, directive, typed comment, whatever. Feel free to call it "dohicky" if you'd like.


Ruby has perl-like sigils, eg: @i_am_instance_var, $i_am_global. Additionally, one might consider array literals sigil-like (like %w[a b c d e f g]).

https://ruby-doc.org/docs/ruby-doc-bundle/UsersGuide/rg/vari...


Great find! Fixing now, thanks.


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: