4 ms·
Berp: An implementation of Python 3, that compiles to Haskell
- TimothyFitz 16y agoAt 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/features/ http://github.com/bjpop/berp/tree/master/test/regression/fea... Especially cool is the fact that you can use callCC!
- dons 16y ago> 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://en.wikipedia.org/wiki/QuickCheck * http://projects.unsafeperformio.com/hpc/ http://projects.unsafeperformio.com/hpc/
- viraptor 16y agoIt'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 16y agoYou'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.
- omaranto 16y ago"the Haskell community which is notoriously anti-automated-tests" What? That surprises me. I thought all Haskellers loved QuickCheck.
- pjscott 16y agoIf you're not familiar with QuickCheck, it's easy to get the impression that Haskellers aren't big fans of test suites because the type system catches so many bugs for which you would otherwise need a bunch of regression tests to find.
- rwmj 16y agoDon 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.
- deleted 16y ago[deleted]
- frou_dh 16y agoFor one, you were bashing Don Syme (the F# guy) before you edited your comment.
- sjs 16y agoModded 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.
- dons 16y agoWow. Gee. Let's see. /r/coding (where the maintainer asked me to submit articles!) http://www.reddit.com/r/coding http://www.reddit.com/r/coding 3 articles in 3 weeks, all of which above 75% positive.
- johkra 16y agoI 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?
- kingkilr 16y agoDoes it (and will it) support either of the following: frame introspection, proper tracebacks.
- devinj 16y agoAs 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.
- alec 16y agoA short tutorial, more interesting than the link's list of dependencies: http://wiki.github.com/bjpop/berp/using-berp http://wiki.github.com/bjpop/berp/using-berp
- mwerty 16y agoCould not find a 'motivations for berp' doc. Why/how is this useful?
- stcredzero 16y agoAllows a Pythonista to implement something that compiles into fast code, while retaining a lot of the compiler-unfriendly capabilities of Python.
- Confusion 16y agoI imagine a future version will allow for easy Haskell-Python integration? Good for Python shops wishing to move on or expand their abilities?
- sanxiyn 16y agoDue 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 http://hackage.haskell.org/trac/ghc/ticket/3972 GHC developers are on it. Please wait.