Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> Fancy type systems

We are taking steps to this direction. By adding optional typing to dynamic languages Python and JavaScript/TypeScript. And then type checker tools and local programming style guides are making using these maybe less optional, and more mandatory.



Sum types have definitely been making a big splash. I'd also look at how C++ has added concepts and Go has added generics. Local type inference is also commonplace too, even Java has it.


Even C23 has it.


IMO the day python types become mandatory there will be a fork.

It would be such a total betrayal of it's reason for existing that we would have to invent another untyped or duck-typed language again.


For me the primary purpose of TypeScript is to give my editor information about interfaces so I don’t have to do the menial back and forth of accidentally making a typo in a function name, object param, etc.

I find myself using less type hints in Python because the story for REPL driven development is so much better than JavaScript, and that takes most of the pain away.


Giving the editors hints in this case is very expensive.


It is, but it’s worth it in some situations.

It’s so much easier to sit down to an unfamiliar codebase, or to participate in a team of more than three or four serious contributors, when typescript is there to guide you.

I never would have guessed that that would be the benefit that won me over, but it absolutely has, all it took was a two year / six people project to completely sell me on typescript.


I find that even when type hints are made "mandatory" using Mypy's strict mode, having a dynamically typed language underneath that allows you to cheat using Any or cast() where necessary makes writing Python feel much less cumbersome than writing in actual statically typed languages.

Presumably, a Python with "mandatory" type hints would still allow you to cheat in those same ways.


I mean, your company or your project may require you to write type hints and use a type checker tool. Not that Python the language makes typing mandatory.


nagware like Typescript have turned type bolt-ons into a religion almost. It has its place but really gets in the way in others. Hence, the reason untyped languages exist in the first place.


Those would be considered basic type systems. For "fancy", you gotta dive deeper into the lambda cube (tho generics I guess in 1999 would be fancy and one step in).


The borrow-checker is pretty fancy.


The author thinks that Formal Methods are a Maybe because chipmakers while Fancy type systems are a No. I think the bar is pretty high for Type systems (in the mind of the author).




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

Search: