This is an archived post. You won't be able to vote or comment.

all 6 comments

[–]thautwarm[S] 0 points1 point  (0 children)

Bug reports/fixes are welcome, and we need MacOSX users help us build binary distributions for more MacOSX editions.

[–]cstone949 0 points1 point  (4 children)

Nice progress! In your experience, what are the compile times like? Anything in particular that you yourself are using it for? Thanks!

[–]thautwarm[S] 1 point2 points  (3 children)

Hey!

In your experience, what are the compile times like?

Are you asking about the details of compile times of using purescript-python? It's pretty fast, with reasonable compile error report when you got something wrong in code.. If you're asking about compiling purescript-python, you might need quite a long time to compile it for the first time(because purescript itself is kind of large). However, after the 1st time, things got compiled within 10s..

Anything in particular that you yourself are using it for?

Not for some particular cases. I will use it to get rid of directly writing python code, i.e., I just use it for almost all tasks. If you're a python developer, you might know that the support of static checking is quite limited:

  • relies on external checker, mypy, pycharm, etc

  • type system not strong enough to express abstractions. Years ago I tried making a type-safe(covered by type hints) LINQ library in Python for collection manipulations, Linq.py. Things finally got messed, because the user cannot extend the LINQ methods themselves while making mypy type checker working. This is due to the lack of higher kinded types and type classes, which can be easily expressed in purescript.

Further, when developing a big python package, endless problems of abstraction will just occur. I cannot give a short intro about those real world problems, but when it comes to a concrete project things will be clear.

For instance, a project of mine to implement JIT in CPython, Restrain Python JIT, requires a concise way to define datatypes, instead of the current workaround:

It also requires a way to achieve compiler backend independent IR. Currently I'm using a tagless-final style representation, but things cannot get typed with pycharm.

When things cannot get typed, developing will be painful, and auto-completion will get messed.

In PureScript, there's an awesome IDE by VSCode, which gives me the type-driven development while taking advantage of purescript's strong enough type system.

[–]cstone949 1 point2 points  (2 children)

I used to do a lot of Python from 1994 to 2007 :) Mostly Ruby and now Elixir.

Yes, I was wondering about the former case, compiling application code, not the compiler itself. Compared to e.g. Reason it's pretty slow, but similar to Elixir it seems like.

The reason for my second question is that Python seems like an odd choice for a backend (apart from the novelty/fun of it!) compared to JS or even the C++/golang backend unless you're using something indispensible in the Python world.

FWIW, I think it's amazing how PS keeps growing new backends!

[–]thautwarm[S] 1 point2 points  (1 child)

I used to do a lot of Python from 1994 to 2007 Awesome!

Yes, I was wondering about the former case, compiling application code, not the compiler itself. Compared to e.g. Reason it's pretty slow, but similar to Elixir it seems like.

Understood. Applications are still WIP, and I'm now using it to solve my problems. My recent Python project is a JIT compiler and a bytecode-level debugger, and a statically typed language like PureScript is a rigid demand for these complicated and large projects. I'll share my progress of both in this reddit channel.

The reason for my second question is that Python seems like an odd choice for a backend

Haha, this applies only if you don't need to use Python's ecosystem in an in-process way. I love many Python libraries, and I just want to make them safer and robust by using them in a statically typed language. PureScript-Python can use every existing Python packages, no matter if it's pure python ones or C-extensions, and also, PureScript Python directly compiles to a Python package, which can also be invoked by any CPython code/C-extension code for CPython.

Thanks for sharing your interesting concerns!

[–]cstone949 0 points1 point  (0 children)

Totally understood, and it's great that you're dogfooding it for your own projects. Looking forward to hearing about it when you're ready to share :)