News for hackers. Stuff that matters.
Re:Why Type Systems Matter by mamcx on Friday August 18, 2017 @08:06PM (#15050719)
My dream is a static-first (like with inmutable-first) language with a way to do dynamic.

The thing is not available (as far I know) is to build a dynamic object and "close it" for further modification so the compiler can optimize well. Other, that requiere good metaprograming, is to build a dynamic object AT COMPILE TIME (macro?) and close it, then the type-system work after that (F# type provider is almost this)

A use case is reflect a database/data storage like JSON or relational table. I wish, like with python, to do:

    class Customer = @build(table("Customer"))
and after this line :

    c = Customer()
    print c.name
to 'c' be a static type. If at compile time, it check the type, let say the field change to c.fullname, to mark as a type error.

If in runtime, like a interpreter, to "close" Customer and be certain that it never will mutate.

AKA: Inmutable types/clases, but the posibility to mutate it in some discret places.

Make sense?

Re:Why Type Systems Matter by 62747478182 on Friday August 18, 2017 @10:28PM (#15051297)
You may be interested in Crystal.

https://crystal-lang.org/

Re:Why Type Systems Matter by h_r on Friday August 18, 2017 @09:59PM (#15051203)
This sounds similar to F# type providers.