Live data from Hacker News

Show HN: Mys – an attempt to create a statically typed Python-like language

github.com

41–50 of 57 posts

Re: Show HN: Mys – an attempt to create a statically typed Python-like language

#41

Strongly typed? You mean statically typed? See "What to know before debating type systems" : http://blogs.perl.org/users/ovid/2010/08/what-to-know-before...

> Type inference is generally a big win. I see this claimed a lot, but haven’t seen any evidence.

I think the claims might be the evidence you're looking for.

Re: Show HN: Mys – an attempt to create a statically typed Python-like language

#42
post #37

Earlier quoted context omitted.

I can import this with no errors, so Python is untyped: def foo(): return 1 + "2" Another example showing Python is untyped: x = 1 x = "2" x clearly has no type. No variables in python have types.

>>> 1 + "2" Traceback (most recent call last): File " ", line 1, in TypeError: unsupported operand type(s) for +: 'int' and 'str' https://dev.to/jiangh/type-systems-dynamic-versus-static-str...

What that article calls "dynamically typed" is commonly referred to as "untyped" in PL research.

The program '1 + "2"' is a perfectly valid python program with well defined behavior (it signals a TypeError). This demonstrates that you can in fact add integers to strings in python. Of course whether or not you can add integers to strings is completely orthogonal to whether or not a language is typed. Both typed and untyped languages may overload the addition operator.

Re: Show HN: Mys – an attempt to create a statically typed Python-like language

#43
post #5

Given that the OP is the github project owner, are you aware of https://chocopy.org/ ? You might want to also look at Shedskin, https://github.com/shedskin/shedskin which converts implicitly typed Python programs to C++

For the sake of completeness, might as well mention Nuitka [1] (another Python -> C compiler), Cython (Python-like language that compiles to C), and Numba (LLVM-based JIT compiler for a limited subset of Python).

[1]: http://nuitka.net/

[2]: https://cython.org/

[3]: https://numba.pydata.org/

Re: Show HN: Mys – an attempt to create a statically typed Python-like language

#44
post #12
post #5

Given that the OP is the github project owner, are you aware of https://chocopy.org/ ? You might want to also look at Shedskin, https://github.com/shedskin/shedskin which converts implicitly typed Python programs to C++

No, I am not aware of ChocoPy. Thanks for letting me know. Shedskin uses the Python interpreter if I remember correctly. I aim not to.

It can make both standalone executables as well as extension modules that can be loaded into cpython2.7

Re: Show HN: Mys – an attempt to create a statically typed Python-like language

#48
post #42

Earlier quoted context omitted.

>>> 1 + "2" Traceback (most recent call last): File " ", line 1, in TypeError: unsupported operand type(s) for +: 'int' and 'str' https://dev.to/jiangh/type-systems-dynamic-versus-static-str...

What that article calls "dynamically typed" is commonly referred to as "untyped" in PL research. The program '1 + "2"' is a perfectly valid python program with well defined behavior (it signals a TypeError). This demonstrates that you can in fact add integers to strings in python. Of course whether or not you can add integers to strings is completely orthogonal to whether or not a language is typed. Both typed and un…

For those downvoting aidenn0's comments, I was surprised to find that "untyped" is indeed a common term that includes what many people (myself included) call dynamically typed. See the three top-voted answers to this Stack Overflow question, one of which includes a citation from TaPL, a standard text (emphasis added):

"A type system is a tractable syntactic method ... Terms like 'dynamically typed' are arguably misnomers."

https://stackoverflow.com/questions/9154388/does-untyped-als...

I still prefer the term dynamically typed, because there are useful distinctions about value types to be made among such languages, such as those described in striking's link.

Re: Show HN: Mys – an attempt to create a statically typed Python-like language

#49

I was once toying with the idea to create a statically-typed Python-like language, and I had the perfect name for it: Typhoon... ;)

Alternate idea: a language called Typon in which the compiler paves over typos of keywords and symbol names.

Like a whole language built on the fuckit principle.

Re: Show HN: Mys – an attempt to create a statically typed Python-like language

#50
post #42

Earlier quoted context omitted.

>>> 1 + "2" Traceback (most recent call last): File " ", line 1, in TypeError: unsupported operand type(s) for +: 'int' and 'str' https://dev.to/jiangh/type-systems-dynamic-versus-static-str...

What that article calls "dynamically typed" is commonly referred to as "untyped" in PL research. The program '1 + "2"' is a perfectly valid python program with well defined behavior (it signals a TypeError). This demonstrates that you can in fact add integers to strings in python. Of course whether or not you can add integers to strings is completely orthogonal to whether or not a language is typed. Both typed and un…

I think this discussion is frustrating because your explanation seems to be based on well-defined terms of art, as opposed to the colloquial terms like "weak" and "dynamic".

It's like the discussion is untyped, and the downvotes are runtime errors that would have been caught if terms were agreed upon ahead of time.

Post reply on HN