A Python-compatible statically typed language erg-lang/erg

This page summarizes the projects mentioned and recommended in the original post on news.ycombinator.com

SaaSHub - Software Alternatives and Reviews
SaaSHub helps you find the best software and product alternatives
www.saashub.com
featured
  1. erg

    A statically typed language compatible with Python

    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.

  2. SaaSHub

    SaaSHub - Software Alternatives and Reviews. SaaSHub helps you find the best software and product alternatives

    SaaSHub logo
  3. mypy

    Optional static typing for Python

    Mypy can work really well in many cases, but we seem to get bitten by bugs on a daily/weekly basis. There are >1,000 currently open on Github [0], so it doesn't take much effort to hit one. And having the type-checker tell you that something's not valid when it actually is is a real turn-off...means that we end up with code that's riddled with "# type: ignore", which kind of defeats the point.

    Pylance (the VSCode built-in linter, based on Pyright I believe) tends to do a better job than Mypy, but not as easy to integrate into CI. It's a real shame that the Python ecosystem doesn't have anything nearly as robust as TypeScript.

    [0] https://github.com/python/mypy/issues?q=is%3Aopen+is%3Aissue...

  4. py2many

    Transpiler of Python to many other languages

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

  5. hissp

    It's Python with a Lissp.

    No shortage of options, e.g. Dg, Mochi, Coconut, and Hebigo (based on Hissp[1]).

    [1]: https://github.com/gilch/hissp

  6. pyright

    Static Type Checker for Python

    These aren't just some third-party 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. Maybe some day 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

  7. pytype

    A static type analyzer for Python code

  8. nimporter

    Compile Nim Extensions for Python On Import!

    Erg looks fun for small programs. Though Erg's syntax choices seem less Pythonic than I'd expected. Interesting though, some of the idioms seem handy.

    Though Nim definitely can be described as a statically typed Python-compatible language! I haven't used them but https://github.com/Pebaz/nimporter https://github.com/yglukhov/nimpy both seem great. Nimporter in particular looks fantastic for writing fast python libraries.

    Actually come to think of it that might be the easiest way to write fast KiCad 6 plugins.. I really want to try making a native KiCad autorouter. But I don't want to figure out the C++ plugin setup and since KiCad 6 the Python APIs seem better documented and supported anyways. Problem is that Python would likely be too slow. Nimporter could be perfect. It looks really simple to setup.

  9. nimpy

    Nim - Python bridge

    Erg looks fun for small programs. Though Erg's syntax choices seem less Pythonic than I'd expected. Interesting though, some of the idioms seem handy.

    Though Nim definitely can be described as a statically typed Python-compatible language! I haven't used them but https://github.com/Pebaz/nimporter https://github.com/yglukhov/nimpy both seem great. Nimporter in particular looks fantastic for writing fast python libraries.

    Actually come to think of it that might be the easiest way to write fast KiCad 6 plugins.. I really want to try making a native KiCad autorouter. But I don't want to figure out the C++ plugin setup and since KiCad 6 the Python APIs seem better documented and supported anyways. Problem is that Python would likely be too slow. Nimporter could be perfect. It looks really simple to setup.

  10. typedload

    Python library to load dynamically typed data into statically typed data structures (by davidatsurge)

    I read more about your repo, and it looks like typedload only does Python lists/dicts -> typed python objects(like named tuples, data classes, attrs classes, etc). Ie, the benchmarks don't include the time required to parse the JSON.

    So I modified the benchmarking code to include loading JSON[0], and your library still came out on top!

    But, it turns out I was wrong about pydantic using serde under the hood. Pydantic version 2 will. And the maintainer aims for it to be about 10x faster [1] than version 1.

    Nonetheless, this was definitely a surprise for me, and if I ever go back to using Python, I'll definitely check your library out!

    I'm curious, why do you think pydantic took off and your library didn't? It looks like your library is both faster and easier to use to me.

    [0] https://github.com/davidatsurge/typedload/pull/1/files?diff=...

  11. pydantic-core

    Core validation logic for pydantic written in rust

  12. libpython-clj

    Python bindings for Clojure

  13. Flask

    The Python micro framework for building web applications.

    > If you see code without empty lines separating different steps, that's pretty badly written Python.

    You're describing literally all of the Python I've ever seen. Look at Flask, for example[1].

    Furthermore, without brackets, adding newlines in a code block forces me to then add more newlines between blocks (which Flask also does!)

    I would rather just have easy-to-scan, clear characters that demarcate a code block.

    1. https://github.com/pallets/flask/blob/main/src/flask/templat...

  14. ZIO

    ZIO — A type-safe, composable library for async and concurrent programming in Scala

  15. Scala.js

    Scala.js, the Scala to JavaScript compiler

  16. chisel

    Chisel: A Modern Hardware Design Language (by chipsalliance)

  17. cats-effect

    The pure asynchronous runtime for Scala

  18. cats

    Lightweight, modular, and extensible library for functional programming.

  19. Metals

    Scala language server with rich IDE features 🚀

  20. scala-cli

    Scala CLI is a command-line tool to interact with the Scala language. It lets you compile, run, test, and package your Scala code (and more!)

  21. Laminar

    Simple, expressive, and safe UI library for Scala.js (by raquo)

  22. Ammonite-Ops

    Scala Scripting

  23. Jupyter Scala

    A Scala kernel for Jupyter

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts

Did you know that Scala is
the 38th most popular programming language
based on number of references?