

Berp: An implementation of Python 3, that compiles to Haskell - dons
http://hackage.haskell.org/package/berp-0.0.1

======
TimothyFitz
At first I thought: Like every other "static Python to compiled language X
translator" this one will only translate some static-enough subset of the
language, at which point it's not Python. Interesting as usual, but mostly
academic.

But then I started reading the source code, and the amount of python features
supported with regression tests is impressive! (Especially for something
coming from the Haskell community which is notoriously anti-automated-tests).

[http://github.com/bjpop/berp/tree/master/test/regression/fea...](http://github.com/bjpop/berp/tree/master/test/regression/features/)

Especially cool is the fact that you can use callCC!

~~~
dons
> anti-automated-tests

Ummm... the Haskell community invented QuickCheck and HPC, the limit case of
automated testing tools...

* <http://en.wikipedia.org/wiki/QuickCheck> * <http://projects.unsafeperformio.com/hpc/>

~~~
viraptor
It's true - Haskell people use a lot of testing, since it's pretty simple to
do in that environment. However, compilers in my experience are extremely easy
to test. You can start building your input at whatever stage of compiling you
need, run a specific transformation phase on it and check the output. I'd risk
the opinion that compiler is the easiest to test "advanced" piece of software.
Because of that, I'd be more surprised by a compiler project without
regression tests.

~~~
doty
You're right that it's pretty easy to write the individual tests.

But on the whole, I disagree: in my experience, compilers for non-trivial
languages have an extremely large surface area, especially when optimization
is involved. Language features have the habit of interacting with each other
in non-trivial ways, and the combinatorics can quickly get overwhelming.

------
mwerty
Could not find a 'motivations for berp' doc. Why/how is this useful?

~~~
stcredzero
Allows a Pythonista to implement something that compiles into fast code, while
retaining a lot of the compiler-unfriendly capabilities of Python.

------
alec
A short tutorial, more interesting than the link's list of dependencies:
<http://wiki.github.com/bjpop/berp/using-berp>

------
johkra
I was looking forward to trying it, but then I had a problem installing it.
(That's on Linux 32bit)

    
    
      $ cabal -V
      cabal-install version 0.8.2
      using version 1.8.0.2 of the Cabal library 
      $ ghc -V
      The Glorious Glasgow Haskell Compilation System, version 6.12.1
      $ cabal install berp
      Resolving dependencies...
      cabal: cannot configure berp-0.0.1. It requires integer -any
      There is no available version of integer that satisfies -any
    

Does it work for anybody? Does anyone know how to solve this?

~~~
tumult
Edit the .cabal file and rename it to integer-gmp or try removing it (haven't
tried it myself yet)

~~~
johkra
Thanks, this solved that problem. Unfortunately it fails to build
array-0.2.0.0 and I'll just wait until it's compatible with more recent
versions of the Haskell Platform.

------
kingkilr
Does it (and will it) support either of the following: frame introspection,
proper tracebacks.

~~~
devinj
As an goal in and of itself, it seems like one would go "did it get rid of
frame introspection?!" in a happy voice, rather than "does it support frame
introspection?"

Maybe you wanted to ask, "does it run Twisted and/or Zope", which use frame
introspection (sadly, so very sadly), but otherwise, yuck.

------
sanxiyn
Due to a bug in GHC 6.12.x, compilation will consume more than 2 GB of memory.
Details here:

<http://hackage.haskell.org/trac/ghc/ticket/3972>

GHC developers are on it. Please wait.

------
rwmj
Don Stewart is now spamming Hacker News and reddit.com/r/coding, as well as
/r/programming ...

Edit: modded down for what? The truth is he spams all these fora with
irrelevant articles.

~~~
sjs
Modded down because it's not spam. He posts a metric fuck-tonne of Haskell
links but only the ones that the community is interested in get voted up.
That's how these sites work, so obviously some of us like some of the stuff he
posts. If you don't like it mod it down or ignore it and move on. Go to the
new posts and vote for things you are interested in.

If you must complain, you're unlikely to find much agreement here since people
reading these comments are probably interested in the article.

