News for hackers. Stuff that matters.
Re:Stripe is building a Ruby typechecker by iamleppert on Sunday June 03, 2018 @06:04PM (#17222543)
People created dynamic languages for the exact reason of not having to define types.

Now the trend is to bolt on type checking to dynamic languages because people don’t want dynamic behavior. Most developers I’ve encountered who seek to add types to dynamic languages will never truly understand dynamic languages, closures, concurrency passing or functional programming for that matter.

If you want a statically typed language, use one. Use one that was designed for deterministic behavior and static correctness.

If you have a huge codebase in Ruby that is full of bugs and is unpredictable, don’t blame the language or lack of types.

There are plenty of ruby codebases that are bug free and work well without static typing. How do they exist?

Re:Stripe is building a Ruby typechecker by Tehnix on Sunday June 03, 2018 @06:12PM (#17222600)
> Most developers I’ve encountered who seek to add types to dynamic languages will never truly understand dynamic languages, closures, concurrency passing or functional programming for that matter.

I don't see how seeking to add types precludes also understanding "closures, concurrency passing or functional programming", especially since these are in no way foreign concepts in statically typed languages.

> If you want a statically typed language, use one. Use one that was designed for deterministic behavior and static correctness.

I definitely see what you're trying to say, but as I understand it, these projects to "add types" often come on later, when the project is so big, that it is simply less time consuming to just develop a type checker, than it is to rewrite your entire codebase in a new language.

Re:Stripe is building a Ruby typechecker by iamleppert on Monday June 04, 2018 @11:58PM (#17234875)
My argument is that you can always implement your own breed of type checking either via convention (with appropriate enforcement via static analysis or linting tools if so desired without having to run the code), or you can do type checking at run time -- most dynamic languages have a facility to interrogate a variable to determine its contents and you can implement any number of tests on it as you see fit to validate it.
Re:Stripe is building a Ruby typechecker by hderms on Tuesday June 05, 2018 @10:18AM (#17237796)
In practice the difference in guarantees between a static type checking system and a runtime one are so vast that I think they're mostly incomparable. Runtime checking is like doing most of the work of modelling a program with static types but achieving a fraction of the benefit.
Re:Stripe is building a Ruby typechecker by Kiro on Sunday June 03, 2018 @06:14PM (#17222609)
But let's say you have a function that takes an integer and goes completely bonkers when you pass in a string. Why would you not want to prevent that?
Re:Stripe is building a Ruby typechecker by zxcvhjkl on Monday June 04, 2018 @03:44AM (#17225434)
> People created dynamic languages for the exact reason of not having to define types.

Not having to define types is not the biggest merit of dynamic languages.

The biggest benefit is to be able to do things that you couldn’t do if you had a type system. You can do some crazy stuff with Ruby’s meta programming.

Re:Stripe is building a Ruby typechecker by hderms on Tuesday June 05, 2018 @10:19AM (#17237808)
How many problems out there are really apropriately solved by runtime metaprogramming?
Re:Stripe is building a Ruby typechecker by freedomben on Sunday June 03, 2018 @11:48PM (#17224446)
I'm not sure how well you understand functional programming either if you think it needs dynamic typing. The king of functional programming languages (Haskell) is statically typed.
Re:Stripe is building a Ruby typechecker by iamleppert on Monday June 04, 2018 @11:52PM (#17234854)
The king of functional languages is not Haskell but Lisp in my opinion, and Lisp is dynamically typed. With Common Lisp, there is no difference between runtime and compile time: it's one in the same.
Re:Stripe is building a Ruby typechecker by adamnemecek on Sunday June 03, 2018 @06:06PM (#17222565)
> There are plenty of ruby codebases that are bug free and work well without static typing. How do they exist?

This is a bad question. Refactoring Rails is AFAIK a nightmare. Given enough devs it can probably be done, however it might be painful.