Live data from Hacker News

Erg: a statically typed language that is Python compatible

github.com

11–20 of 194 posts

Re: Erg: a statically typed language that is Python compatible

#12

It 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.

why not use the built in typing? https://docs.python.org/3/library/typing.html

Re: Erg: a statically typed language that is Python compatible

#14

It 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.

why not use the built in typing? https://docs.python.org/3/library/typing.html

it doesnt enforce the types in any way

Re: Erg: a statically typed language that is Python compatible

#15
post #8

I have so much trouble when trying to refactor projects bigger than a few hundred lines in python. If I could integrate this into Jupyter easily I'd be excited to try it out.

Type hinting combined with PyCharm’s refactor commands work well for me. I assume the other IDEs work just as well.

Are you using an IDE?

Re: Erg: a statically typed language that is Python compatible

#16
post #4

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.

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.

Re: Erg: a statically typed language that is Python compatible

#17

Earlier 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

You can run, for example, pre-commit checks such as mypy to enforce some semblance of sanity.

Re: Erg: a statically typed language that is Python compatible

#18
post #4

Earlier 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.

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, with high probability Python will be better in something unless it is about performance.

What I don't like: no type hints in many libraries, some libraries are not type-hint friendly, lot of unnecessary dynmamic features (like being able to patch modules in runtime) and absolutely no caring about performance and being able to compile into machine code.

> trying to figure out what some dynamically typed code is doing

There should be type hints.

Re: Erg: a statically typed language that is Python compatible

#19
post #4

Earlier 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 believe dynamically typed languages are easier to use than old-style statically typed langages (Java, C, etc).

More modern statically typed languages can be quite easy to use (I am thinking of Scala) but none provides an ecosystem as rich as python's.

Plus, recent static languages (Scala, Rust, Haskell or even Elm) are more oriented toward "Software Engineers" or CS academics. Python appeals to a lot of "programmers" who's main job is actually data science, mechanical engineering, biologist...

Re: Erg: a statically typed language that is Python compatible

#20

Nice.

https://github.com/erg-lang/erg/blob/726b7b80fcf06c6c4099b62... Using a 69 as your language's logo? I actually don't think it has been done in a serious-seeming project before.

it is actually "Erg", not 69
Post reply on HN