News for hackers. Stuff that matters.
Re:Just-In-Time Static Type Checking for Dynamic Languages by IshKebab on Tuesday April 19, 2016 @03:03PM (#11529311)
Doesn't sound like it solves my main objections to dynamic typing:

1. No compile-time type checking.

2. No autocomplete / intellisense in IDEs (you can try but it's never very good).

Re:Just-In-Time Static Type Checking for Dynamic Languages by riyadparvez on Tuesday April 19, 2016 @04:00PM (#11529776)
My main objection is always readability. Sure, it is nice when I am writing code and on top of my head I know the type of each variable, but when I am reading code, this becomes nightmare for lack of type information.
Re:Just-In-Time Static Type Checking for Dynamic Languages by B1FF_PSUVM on Tuesday April 19, 2016 @04:10PM (#11529879)
> My main objection is always readability.

Strange, that's my objection to type declarations.

Re:Just-In-Time Static Type Checking for Dynamic Languages by ufo on Tuesday April 19, 2016 @08:28PM (#11531535)
I'm nor sure I would use the word "readability" there. I'd prefer saying that types aid in documentation.
Re:Just-In-Time Static Type Checking for Dynamic Languages by tigershark on Tuesday April 19, 2016 @04:24PM (#11530022)
Factory<MarketDataService<Stock>> marketDataService = new Factory<MarketDataService<Stock>>()

Is objectively less readable than

def marketDataService = new Factory<MarketDataService<Stock>>()

And even the latter is not the best.

def MyClass(marketDataService){

    this.marketDataService = marketDataService
}

It's imho the most readable. If the name is self describing and there are unit tests that prove that I'm receiving the correct type I cannot care less about the type itself.

Re:Just-In-Time Static Type Checking for Dynamic Languages by ubertaco on Tuesday April 19, 2016 @05:11PM (#11530461)
Alternatively, in MLs (this sample specifically is OCaml) :

    type expression =
    | Number of float
    | Add of expression * expression
    | Subtract of expression * expression
    | Multiply of expression * expression
    | Divide of expression * expression

    let rec eval expr = 
        match expr with
        | Number n -> n
        | Add (expr1, expr2) -> (eval expr1) +. (eval expr2)
        | Subtract (expr1, expr2) -> (eval expr1) -. (eval expr2)
        | Multiply (expr1, expr2) -> (eval expr1) *. (eval expr2)
        | Divide (expr1, expr2) -> (eval expr1) /. (eval expr2)
Hey look, I just built a calculator DSL. And everything is statically typed and typechecked (and if I left off the "Divide" case in my "eval" method, it would warn me).
Re:Just-In-Time Static Type Checking for Dynamic Languages by ufo on Tuesday April 19, 2016 @08:26PM (#11531531)
Point #1 would be very very hard to do for Ruby, since its such a highly dynamic language. The University of Maryland team thats behind this paper already tried doing that with Diamondback Ruby but it didn't really work out in the end.

janvitek.github.io/events/PBD13/slides/JeffFoster.pdf

They apparently changed their focus to gathering type information at runtime and using it to do interesting stuff, like this recent Hummingbird research.

By the way, I think it might be possible to implement autocompletion based on that runtime information they collect.

Re:Just-In-Time Static Type Checking for Dynamic Languages by sillysaurus3 on Tuesday April 19, 2016 @03:21PM (#11529449)
#2 isn't really true. ETags/GTags provide you with a TAGS file consisting of function definitions. Your intellisense can use those however it wants. Autocompletion and "goto definition" are features of certain emacs packages, for example. (See emacs company-mode for some pretty nice autocompletion on various dynamic languages.)
Re:Just-In-Time Static Type Checking for Dynamic Languages by veidr on Wednesday April 20, 2016 @04:48AM (#11533067)
I think #2 is true. It's never any good.

There are a lot of rudimentary "caveman completion" packages available for Ruby coding, but nobody has ever written a good "intellisense" feature for Ruby, where "good" means something on the level of, say, Xcode's "CodeSense" auto-completion for Objective-C or Swift, or JetBrains IDEA's support for Java.

I work in Xcode a lot, but I also maintain a couple Rails apps at work. A few times a year, I get so aggravated I spend an afternoon googling the state of the art in code completion for Ruby, and trying out various editors and IDEs.

JetBrains RubyMine is consistently the best, but it is far, far inferior to Xcode in this regard. It suggests methods but not the one I am looking for, or it suggests inappropriate methods that would cause an error, etc. It can't always jump to the definition of something, or tell me all the places the method I am currently editing is called from.

Xcode has a lot of things I could complain about, but the code completion, finding caller/callees, jump to definition/counterpart... all that stuff is incomparably better than it is for Ruby in any editor I have ever seen.

And of course it is — it is incredibly hard and complicated to do a complete or even mostly-complete job of it with Ruby code. There are just too many ways to metaprogram and too little information available to the editor to make it a straightforward task.