Live data from Hacker News

Erg: a statically typed language that is Python compatible

github.com

21–30 of 194 posts

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

#21

Earlier quoted context omitted.

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

As much as I enjoy the tongue-in-cheek logotyping, "Erg" is certainly not the first thing that my mind reads when looking at it.

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

#22

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.

It'd not fully solve your issue, but have you ever seen https://github.com/py2many/py2many ?

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

#23

Earlier quoted context omitted.

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

Lol. I guess I made the same mistake. /me wonders if there’s some double entendres going on here.

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

#24

Earlier quoted context omitted.

it is actually "Erg", not 69

As much as I enjoy the tongue-in-cheek logotyping, "Erg" is certainly not the first thing that my mind reads when looking at it.

I couldn’t bring myself to use the phrase “tongue in cheek” here. I was going to, but couldn’t.

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

#25

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.

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

#26

Not 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 give this new language a chance.

It's also looks like the type inference of erg will be better than the current Python checkers.

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

#27

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

As someone coming from FP and having to use Python at work, I have the opposite perspective: I am constantly frustrated at how bad the type hinting is, and how few "guardrails" there are generally. :(

I don't know if this is what I'm looking for, but I think there's a ton of room for innovation and improvement in the python world. I welcome this language and I think it's quite interesting!

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

#28

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.

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 "programmer…

I think the latter point hits the nail right on the head: the preference for python is probably more of a social issue than a technical one at this particular point in History.

I think when FP languages and paradigms become the norm (you can quote me on this, I predict that it's only a matter of time), preferences will change. People tend to prefer what they know, and it will take some time for culture to change.

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

#29

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.

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 attempt would indeed be very interesting because it would allow for more aggressive exploration of ergonomic typing constructs while maintaining that any valid Python would be valid in that new language as well (just like TS).

Post reply on HN