Earlier quoted context omitted.
Slightly related question: why do people love Python so much? Or, any dynamically typed language? There's almost nothing that has frustrated me more in a professional setting than trying to figure out what some dynamically typed code is doing and ensuring I don't break anything by making changes.
- Huge ecosystem. - Common stuff (opening files, dealing with databases, string processing, math, regexps) is very easy. Sane defaults. - Works well with the existing C ecosystem. It's not a "rewrite everything in X" language. - It's everywhere, most machines run Python just fine. - It doesn't treat Windows like a second-class citizen. - It doesn't force upon you a programming model that you might or might not care a…
Erg: a statically typed language that is Python compatible
81–90 of 194 posts
Re: Erg: a statically typed language that is Python compatible
#82Earlier quoted context omitted.
Why so averse to direct Python?
Slightly related question: why do people love Python so much? Or, any dynamically typed language? There's almost nothing that has frustrated me more in a professional setting than trying to figure out what some dynamically typed code is doing and ensuring I don't break anything by making changes.
I agree that working with Python code from an undisciplined/sloppy/inexperienced developer can be a pain (although in those situations I've found code from those same developers in others languages to be a problem too, but maybe worse in Python? I dunno), but in the hands of a solid dev, Python code is so readable and easy to follow, that to me code in other languages often feels much noisier. YMMV of course.
Re: Erg: a statically typed language that is Python compatible
#83At this point I'm open to try anything that will give me access to the python ecosystem without having to code in Python. From the FAQ it looks like Erg code gets transpiled to python bytecode.
Oh, man, have I got a treat for you: go checkout hylang.org - Hy is a lisp that (ab)uses the python AST to give you access to the entirety of python, but gives you a pretty lisp syntax.
Re: Erg: a statically typed language that is Python compatible
#84Earlier quoted context omitted.
Slightly related question: why do people love Python so much? Or, any dynamically typed language? There's almost nothing that has frustrated me more in a professional setting than trying to figure out what some dynamically typed code is doing and ensuring I don't break anything by making changes.
Because you can do a lot with little typing and there are lots of great libraries. Python is probably the best choice when you need to get something done quick or calculate something when performance is not important. It is also not an exotic functional language without loops and filled with linked lists. Also, in Python integers do not overflow, unlike in Rust, C and other buggy languages. If you name a language, wi…
There is no such thing as a buggy language. Software can be buggy (or language implementation), but not the language. And the reason you do not have integer overflow is because integers are implemented as integer objects of arbitrary size, which is great if you're doing something quick and dirty, but could be disastrous for a serious work.
Re: Erg: a statically typed language that is Python compatible
#85Not sure why I'd want to use this, presuming I was already happy with python. Especially now that python's type hinting is more mature. Looking through the feature set the main thing it seems to provide is a type system, but with a syntax I don't like as much as python's type hinting.
This is sort of speculation on my part: The fact that static typing PEPs can't easily introduce syntactic changes to the language (I don't think there has been a syntactic change introduced because of static typing ever since Python 3.5) will really hold back Python's static typing from being ergonomic at least, and "fully capable" at the worst. I think that limitation of statically typed Python alone is enough to gi…
https://peps.python.org/pep-0646/#grammar-changes
The other case that I remember off the top of my head is Python 3.6 adding annotations for variables that aren't created via function definitions:
Re: Erg: a statically typed language that is Python compatible
#86But not really a pythonic syntax. Reminds me more of ruby? i.e.: > 2.times! do!:
This is what is putting me off the most of this, the syntax feels very unreadable for something that is meant for python, which has a very readable and open syntax, even typescript's sometimes messy typing is for the most part more readable than this
Re: Erg: a statically typed language that is Python compatible
#87Why is the logo 69
Re: Erg: a statically typed language that is Python compatible
#88Re: Erg: a statically typed language that is Python compatible
#89Earlier quoted context omitted.
Slightly related question: why do people love Python so much? Or, any dynamically typed language? There's almost nothing that has frustrated me more in a professional setting than trying to figure out what some dynamically typed code is doing and ensuring I don't break anything by making changes.
Anecdote, but I like the Python community's emphasis on "readability counts". I did not get that from e.g. Ruby. Python's internals are also relatively accessible and easy to work with, so it's smooth sailing once you have that need. The language starts out easy, and grows with you. Of the languages I've tried (and there are many), only Smalltalk and the Lisp family were comparable in expressiveness. The language mos…
And then there's the fact that Python has significant characters that are literally unreadable because they're invisible (semantic whitespace).
Re: Erg: a statically typed language that is Python compatible
#90Earlier quoted context omitted.
>There should be type hints. "Hey, this variable is probably of this type. Now go on, run the code and launch a debugger the same way you would if there was no hint just to make sure it's correct. Oh, and don't forget to check all the possible code paths that lead to this to make sure you've exhausted all possibilities." Don't get me wrong, type hints are cool but they're just a toy compared to proper static typing.
> Oh, and don't forget to check all the possible code paths that lead to this to make sure you've exhausted all possibilities." This is literally what mypy does. There's no difference between a mypy-enabled codebase and a java codebase in terms of static typing (other than that mypy actually supports a generally richer type system). Like yes if you aren't validating the type hints you aren't getting the value, but if…
Type hints in python are _just that_, they're hints. The whole "typed" python ecosystem relies on packages and the language using them, using them correctly, and using them consistently. In my experience so far, I've seen little widespread use, and nothing from core python, which is a huge hole IMO.