At 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.
Erg: a statically typed language that is Python compatible
41–50 of 194 posts
Re: Erg: a statically typed language that is Python compatible
#42Earlier 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.
>ensuring I don't break anything by making changes I think this is a problem in both static and dynamic languages and is pretty much solved in the same way: you test your code.
Re: Erg: a statically typed language that is Python compatible
#43Earlier 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.
These aren't just some third-party tools bolted on. The type annotation syntax is built into the language[5] and standard library[6][7].
I personally find static typing to be more trouble than it's worth most of the time. Industry typing metalanguages are not expressive enough to deal with even fairly basic real-world programs and force you to write bad code to work around the type checker's stupidity. And, of course, you still have to write tests. Maybe someday they'll catch up to Idris. Python's static typing is no better, but at least it allows you to turn it off when it's not worth it.
[1]: https://github.com/microsoft/pyright
[2]: https://github.com/python/mypy
[3]: https://github.com/google/pytype
[4]: https://github.com/facebook/pyre-check
[5]: https://peps.python.org/pep-3107/
[6]: https://peps.python.org/pep-0484/
[7]: https://docs.python.org/3/library/typing.html#module-typing
Re: Erg: a statically typed language that is Python compatible
#44Earlier 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…
"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.
Re: Erg: a statically typed language that is Python compatible
#45It would be nice if someone created a typescript for python. Something that allows us to wrangle control and sanity over reams of legacy untyped python madness.
I think both `erg` and statically typed Python are both attempts at doing exactly that. May be what you mean is a static typing solution for Python whose syntax is a superset of Python syntax (which I don't think `erg` is), but isn't identical to Python's syntax( ie, it is a strict superset, which statically typed Python's syntax isn't). Typescript is exactly that for JS. In that case, I agree with you that such an a…
Re: Erg: a statically typed language that is Python compatible
#46Why is the logo 69
Re: Erg: a statically typed language that is Python compatible
#47Earlier quoted context omitted.
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 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.
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 you are, you don't need to run the code! I get most of my python errors at compile time, and you can too. I promise.
Re: Erg: a statically typed language that is Python compatible
#48Is there documentation in English? The japanese[1], however wonderful a language, would be a major barrier to entry for me. [1] http://mtshiba.me/TheErgBook/
Re: Erg: a statically typed language that is Python compatible
#49Earlier 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 should be type hints.
So, is it one or the other?
Re: Erg: a statically typed language that is Python compatible
#50Earlier quoted context omitted.
why not use the built in typing? https://docs.python.org/3/library/typing.html
it doesnt enforce the types in any way