News for hackers. Stuff that matters.
Re:Python 3 implementation in Haskell by sp332 on Tuesday November 08, 2011 @09:20AM (#3210787)
Some discussion of implementation on github: https://github.com/bjpop/berp/wiki/Developing-Berp
Re:Python 3 implementation in Haskell by DasIch on Tuesday November 08, 2011 @04:02PM (#3212789)
Which shows that this implementation doesn't support imports, keyword arguments, metaclasses, eval and variable scope annotations.

This might have been a nice exercise but it is completely unusable as a serious implementation.

Re:Python 3 implementation in Haskell by egonschiele on Wednesday November 09, 2011 @03:03AM (#3214735)
> Please note that Berp is currently in a very early stage of development. Many aspects of Python 3 are not yet implemented, and there are lots of rough edges to the code.
Re:Python 3 implementation in Haskell by judofyr on Tuesday November 08, 2011 @08:10AM (#3210566)
Re:Python 3 implementation in Haskell by mulander on Tuesday November 08, 2011 @12:44PM (#3211799)

  CLPython (http://common-lisp.net/project/clpython/) is 
  an open-source implementation of Python written in 
  Common Lisp. 
  It bridges the Python and Lisp worlds, so you can:
   * access Python libraries from Lisp;
   * access Lisp libraries from Python.
Runs on 6 different CL implementations. Like Berp it can interpret and compile if the underlying CL implementation supports compilation.
Re:Python 3 implementation in Haskell by marcf on Tuesday November 08, 2011 @08:45AM (#3210674)
How fast is it?
Re:Python 3 implementation in Haskell by wbhart on Tuesday November 08, 2011 @05:18PM (#3213098)
Mostly it doesn't actually work.

But the one trivial example I tried the berp interpreter was something like 1000 times slower than Python.

Re:Python 3 implementation in Haskell by tresta on Tuesday November 08, 2011 @08:35AM (#3210642)
Hmmm... won't install with ghc 7.0.4:

  $ cabal install berp
  Resolving dependencies...
  cabal: dependencies conflict: ghc-7.0.4 requires containers ==0.4.0.0 however
  containers-0.4.0.0 was excluded because berp-0.0.2 requires containers <0.4
Re:Python 3 implementation in Haskell by exDM69 on Tuesday November 08, 2011 @10:34AM (#3211087)
This is pretty usual when it comes to major revision changes in the compiler or standard library with many languages.

This is what you should do:

1. checkout berp from GitHub

2. try to build using cabal in the checked out source tree

3. if there are failing dependencies, hack Cabal build files. this case is probably trivial and berp developers have left containers < 0.4 without a good reason (I may be wrong here, see what's changed in the "containers" package).

4. go to step 2, repeat until software is built

5. submit the change to github, file pull request

Re:Python 3 implementation in Haskell by wbhart on Tuesday November 08, 2011 @01:44PM (#3212133)
After three hours of trying to install this with GHC 6.12.1 and GHC 7.0.3 I have given up.

The problem isn't with berp .cabal files but with dependencies of berp.

ghc-7.0.3 requires containers ==0.4.0.0 language-python requires containers ==0.3.0.0

ghc-6.12.1 requires directory ==1.0.1.0 language-python requires directory ==1.0.1.2

Fetching and unpacking language-python and changing the dependencies manually doesn't appear to fix the problem, for reasons I do not understand.

Re:Python 3 implementation in Haskell by wbhart on Tuesday November 08, 2011 @04:17PM (#3212854)
There is a workaround for the issues with language-python. One can do:

cabal fetch language-python cabal unpack language-python edit the language-python.cabal file updating the containers dependency to 0.4.0.0 then change the version number of language-python itself to 0.3.3 cabal configure cabal install

However, this will not fix the more obtuse problem:

Warning: This package indirectly depends on multiple versions of the same package. This is highly likely to cause a compile failure. package haskell98-1.1.0.1 requires process-1.0.1.5 package ghc-7.0.3 requires process-1.0.1.5 package Cabal-1.10.1.0 requires process-1.0.1.5 package berpinterpreter-0.0.3 requires process-1.0.1.5

I believe the only solution for this problem is to rebuild the entire Haskell platform from source, and if that fails, to format and reload the entire machine.

But you know, keep voting this thread up because Hackhell is awesome.

Re:Python 3 implementation in Haskell by wbhart on Tuesday November 08, 2011 @05:17PM (#3213095)
I finally got it to build, after rebuilding most of Haskell.

It crashes on just about everything. Even a simple "for" loop defeats it. So one has to replace all of those with while blocks.

Every single one of the Python benchmarks I have previously written fails with a not implemented error.

On the one trivial example I timed which worked it was about 1000 times slower than Python.

Re:Python 3 implementation in Haskell by Symmetry on Tuesday November 08, 2011 @03:00PM (#3212513)
This sounds sadly like my experiences trying to get the Yi editor to install. I love Haskell in theory, but the build system is so painful if you aren't an expert!
Re:Python 3 implementation in Haskell by exDM69 on Wednesday November 09, 2011 @02:56AM (#3214714)
The same can be said about Ruby, except that my experiences with Ruby are worse than with Haskell. With Haskell, you can get a pretty nice "batteries included" setup by installing the latest Haskell platform package.

With Ruby, you have to learn to use rvm, bundler and whatnot just to get a recent version of Ruby installed. Many distributions ship with quite old versions of Ruby and the Ruby official release tarballs have been unreliable (version number doesn't change, tarball contents does, etc).

Lots of languages seem to suffer from similar problems.

Re:Python 3 implementation in Haskell by Peaker on Tuesday November 08, 2011 @04:10PM (#3212820)
When you "cabal unpack language-python" and fix the dependencies, make sure you boost its minor version number (e.g: from: 1.0.3 to 1.0.3.1), otherwise cabal-install will ignore your custom install of the package and will revert to the one from the repositories.

cabal-install is a big hurdle -- must be improved for faster Haskell adoption.

Re:Python 3 implementation in Haskell by yoklov on Tuesday November 08, 2011 @03:37PM (#3212682)
Welcome to the dll hell-style package management system of hackage.
Re:Python 3 implementation in Haskell by treeform on Tuesday November 08, 2011 @03:51PM (#3212747)
I wander if it adds any of Haskell's lazy and thread features?
Re:Python 3 implementation in Haskell by treeform on Tuesday November 08, 2011 @03:54PM (#3212754)
To answer my own question it looks like it supports call/cc https://github.com/bjpop/berp/blob/master/test/regression/fe...

tail calls https://github.com/bjpop/berp/blob/master/test/regression/fe...

So those features are cool at-least...

Re:Python 3 implementation in Haskell by chbrosso on Tuesday November 08, 2011 @08:48AM (#3210684)
Last update was in May 2010...
Re:Python 3 implementation in Haskell by treo on Tuesday November 08, 2011 @09:13AM (#3210759)
Last commit on August 04, 2011. https://github.com/bjpop/berp
Re:Python 3 implementation in Haskell by wbhart on Tuesday November 08, 2011 @01:40PM (#3212111)
There is a commit to the new-identity branch on Oct 19th 2011.
Re:Python 3 implementation in Haskell by flazzarino on Tuesday November 08, 2011 @08:13AM (#3210577)
but will it blend?