News for hackers. Stuff that matters.
Re:Open-sourcing Sorbet: a fast, powerful type checker for Ruby by tptacek on Thursday June 20, 2019 @06:24PM (#20238013)
Yes, and, just to keep this clear: that debugging (or unit-testing-for-typos) time is coming out of your prototyping budget. Your Ruby program will fail to run for stupid reasons the first time you run it, which is not the experience Java and Go and Rust programmers have. I just remember when I first picked up Go, after about 5 years writing Ruby exclusively, how amazing it was that all my Go programs "worked" the first time I ran them. Obviously, they had bugs. But they didn't blow up for stupid reasons.

I'd been a C/C++ programmer for about 10 years! I guess I just forgot that compilers can catch typos if you let them.

Re:Open-sourcing Sorbet: a fast, powerful type checker for Ruby by losvedir on Thursday June 20, 2019 @07:53PM (#20238644)
> Your Ruby program will fail to run for stupid reasons the first time you run it, which is not the experience Java and Go and Rust programmers have.

I know exactly the feeling, but I don't think it's just the types that give it but that it's compiled. I similarly moved on from ruby after 5 years but to Elixir and was similarly surprised to (re-) learn that a simple compile step catches so many braindead typos, misnamed variables, not imported function calls, and the like.

Types go above and beyond this, but I think there's a huge step up just going from interpreted to compiled.

Re:Open-sourcing Sorbet: a fast, powerful type checker for Ruby by smw on Thursday June 20, 2019 @07:37PM (#20238541)
I know a lot of people in the Ruby community tend to believe in using text editors with limited (or no) semantic understanding of the code. I've found that using, for instance, JetBrains Rubymine tends to make typos and related bugs apparent as they happen. Not to mention providing autocomplete that usually feels like using a statically typed language.
Re:Open-sourcing Sorbet: a fast, powerful type checker for Ruby by cbetti on Thursday June 20, 2019 @11:00PM (#20239519)
New to Ruby, veteran Java/C++, while I'm liking what RubyMine adds, it's nowhere near what I get from a simple language with a simple type system like Java.
Re:Open-sourcing Sorbet: a fast, powerful type checker for Ruby by MaxBarraclough on Friday June 21, 2019 @05:06PM (#20246301)
The ability to refactor, for one.
Re:Open-sourcing Sorbet: a fast, powerful type checker for Ruby by jacobolus on Friday June 21, 2019 @06:08PM (#20246667)
I think this is a Ruby thing more than a dynamic languages thing. (Not exclusively a Ruby thing mind; Javascript code is also always full of weird edge cases and gotchas.)

I wouldn’t necessarily recommend it, but I have written 500-line Python programs without executing/testing any functions along the way, that “just worked” the first time I ran them with no serious bugs. And not because I am especially clever or have an amazing memory or unusual attention to detail, but just because the code is easy to make clear and straightforward.

(But this was just with basic data types and a few standard library modules; dealing with other people’s poorly documented / confusing APIs makes this gets a lot harder.)

Re:Open-sourcing Sorbet: a fast, powerful type checker for Ruby by go_ruby on Thursday June 20, 2019 @09:38PM (#20239147)
You never had a go program fail to compile, only to fix the problem then try to compile again? Replace 'run' with 'compile' and you could still type a bunch of go code and have to make changes before you deploy or no?
Re:Open-sourcing Sorbet: a fast, powerful type checker for Ruby by ncphillips on Thursday June 20, 2019 @11:33PM (#20239671)
Tooling makes this argument moot. I use Ruby and TypeScript, both with VSCode. The experiences are vastly different. Ruby is slow and difficult to work with, and TypeScript is a breeze. I don’t have to wait for my TypeScript to compile before it tells me about the typo I have, the editor tells me immediately after typing the word.
Re:Open-sourcing Sorbet: a fast, powerful type checker for Ruby by nitrogen on Thursday June 20, 2019 @08:03PM (#20238697)
It's odd to complain about the first run not working, when the first run is significantly earlier. I'd also say the interactivity of Pry and binding.pry more than compensates for anything lost by not having a compilation step.
Re:Open-sourcing Sorbet: a fast, powerful type checker for Ruby by koolba on Thursday June 20, 2019 @08:09PM (#20238732)
I’d argue that type checking combined with editor auto completion leads to faster development.

The feedback loop is within your editor, that’s a step before the app console!

Re:Open-sourcing Sorbet: a fast, powerful type checker for Ruby by ncphillips on Thursday June 20, 2019 @11:38PM (#20239697)
100% going from Java+IntelliJ to Ruby+VSCode was shocking. In regards to tooling, the developer experience is way behind with Ruby. Sure there’s a lot more boilerplate to look at, but with tolls you don’t actually end up writing much. And then you get refactoring tools that are actually super useful and robust.
Re:Open-sourcing Sorbet: a fast, powerful type checker for Ruby by cbetti on Thursday June 20, 2019 @11:04PM (#20239536)
Prototyping in Java is as fast as prototyping in Ruby once you understand how to use the tools equivalent to Pry in Java, and standard types instead of rolling your own types. JIT isso fast today the 20ms required to JIT what you type is immaterial.
Re:Open-sourcing Sorbet: a fast, powerful type checker for Ruby by pjmlp on Friday June 21, 2019 @01:57AM (#20240204)
More so now with better type inference and repl integration.
Re:Open-sourcing Sorbet: a fast, powerful type checker for Ruby by nitrogen on Friday June 21, 2019 @03:27AM (#20240625)
What REPL do you use on the JVM? I've added JRuby to Java projects in the past just to get a REPL.
Re:Open-sourcing Sorbet: a fast, powerful type checker for Ruby by pjmlp on Friday June 21, 2019 @03:42AM (#20240679)
The one that comes with it, starting with Java 9, jshell.

Before that, there was the Rhino and Nashorn ones, which although JavaScript based, did the job.

Re:Open-sourcing Sorbet: a fast, powerful type checker for Ruby by signal11 on Friday June 21, 2019 @02:53AM (#20240462)
Not strictly Java, but Groovy is a great environment to prototype on the JVM. Prototyping was lightning fast and turning it into Java code was pretty quick too. There’s great IDE support for it too (IntelliJ’s Groovy scratches).

These days Kotlin is also pretty good. Perhaps not quite as fast to prototype but there’s little need for converting afterwards.

Re:Open-sourcing Sorbet: a fast, powerful type checker for Ruby by zmmmmm on Friday June 21, 2019 @05:52PM (#20246581)
Yes, add an environment like BeakerX [1] (essentially, Jupyter notebooks) and it's quite amazingly good to figure out your approach even if you intend to write Java.

[1] http://beakerx.com/