News for hackers. Stuff that matters.
Re:Python 1.0.0 is out (1994) by e12e on Saturday January 27, 2018 @09:37AM (#16246350)
I think the closest thing to "python with types" is probably Julia: https://julialang.org/

I think the efforts of adding type/type hints to python are interesting - but there's a tension between "weee! Look at me ducktyping, metaprogramming all the prototypes!!"-design and leveraging types as part of your design. Haskell/f#/ml are great languages, but they feel very different from python (ml maybe less so,but afaik there are no full featured implementations with areasonable standard lib...).

If Python is the starting point, I think there's probably four approaches that makes sense if python ends up being limited (in part due to lack of typing): move to a language like Julia, proto-type in python; re-employment in go, prototype in python; reimplement parts in cython and/or rust, add type hints on top of python.

[ed: almost forgot, secret option number five: use restricted-python and the pypy framework to implement a language suited to the problem domain..]

Re:Python 1.0.0 is out (1994) by benji-york on Saturday January 27, 2018 @10:15AM (#16246472)
Every time I look at Julia, I like it a lot, right up to the point where I remember that indexing is 1-based and I loose the will to go on.
Re:Python 1.0.0 is out (1994) by e12e on Saturday January 27, 2018 @01:50PM (#16247444)
I am in the odd situation that from habit collection[0] feels natural - but I actually think "first element" makes a lot more sense than "item at zero offset".

Except maybe for things that are actually pointer+offset (which I think very rarely makes sense in high level languages/most ADTs).

In fact, I think for situations where 0-based indexing makes sense, I'd prefer "memory_area+offset" rather than "pretend_collection_type[offset]".

I also usually talk about "the first character" of a string, or first word of a sentence; not "word at zero offset from start".

So yeah, I think Dijkstra's wrong on this one (or rather he has some very strong opinions on greater-/less-/-and-equal-to, and which are natural - for which I have little sympathy outside of abstract discrete math papers).

http://www.cs.utexas.edu/users/EWD/transcriptions/EWD08xx/EW...

Re:Python 1.0.0 is out (1994) by KenoFischer on Saturday January 27, 2018 @03:23PM (#16247918)
One nice thing about Julia is that you basically never have to think about the indices. One of the primary reasons for this is that people using julia like array types with all types of strange and wonderful index sets (e.g. skew lattices to slice through a higher-dimensional array which people in medical imaging like apparently). As such, there are easy and convenient abstractions that are independent of the index space and all of the standard libraries and most external packages use these (to be able to deal with non-standard arrays).
Re:Python 1.0.0 is out (1994) by newen on Saturday January 27, 2018 @01:10PM (#16247216)
Rolls eyes. 0 or 1 based indexing is one of the smallest thing to worry about in a programming language.
Re:Python 1.0.0 is out (1994) by renox on Sunday January 28, 2018 @07:16AM (#16250962)
I disagree when you're used to 0based array languages and you use a 1based array language (or vice versa of course), you have a high risk of 'off by one' errors.
Re:Python 1.0.0 is out (1994) by toyg on Saturday January 27, 2018 @01:21PM (#16247289)
A user will worry about what a user will worry about. Otherwise, we would all be using LISP.
Re:Python 1.0.0 is out (1994) by scrollaway on Saturday January 27, 2018 @11:46AM (#16246855)
I think the closest to "python with types" really is typescript. I hope Python can one day get there. Typescript really gets how strong typing can be accessible yet optional.

It's also my understanding that the TS community wants to replicate the mypy model where typechecking and compilation are separate steps; by adding a typescript compiler with no type checking to Babel.

Re:Python 1.0.0 is out (1994) by e12e on Saturday January 27, 2018 @01:59PM (#16247499)
@granitosaurus you're dead, but you make a valid point:

> granitosaurus 3 hours ago [dead] [-]

> There's also nim, which is rather new and not yet v1 worthy but I'd say it's still a worthy contender to the "closes thing to python with types"

I think nim looks nice, and have some very python like qualities. But while it's statically typed, I think it's more "python with native compilation", than "python with types" - in the sense of how the typesystem help with program design.