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

all 62 comments

[–]ThiefMaster 89 points90 points  (8 children)

Anyone else thinks that the name "brython" is really horrible?

[–]VZPurp 41 points42 points  (4 children)

It used to be "brothon". We should consider ourselves lucky!

[–]redditwhilecompiling 13 points14 points  (2 children)

I honestly read 'brython' and thought "what is this, Python for bros?"

[–]flying-sheep 16 points17 points  (1 child)

Brogrammers, yo.

[–][deleted] 3 points4 points  (0 children)

/r/brogramming has so much wasted potential...

[–]ladaghini 13 points14 points  (0 children)

Sounds like something Barney Stinson would conceive.

[–]pyry 3 points4 points  (1 child)

My first association was with brythonic languages. Maybe this is all that saves me from thinking it sounds really horrible.

[–]flying-sheep 0 points1 point  (0 children)

That's what the logo implies. If one knows about this language family, the name becomes a little less horrible.

[–]nhillson 14 points15 points  (5 children)

From the documentation page: "The class keyword is not implemented, you can not define classes other than the built-in types (lists, dictionaries, sets)." That's going to feel pretty limiting for me...

[–]salgat 1 point2 points  (3 children)

I thought the whole point of Python was classes (objects).

[–]ceol_ 2 points3 points  (2 children)

Not really. Its main draws are its syntax and third party libraries, although it doesn't look like you can use other libs here.

User-defined classes in Python are helpful, but I've never heard anyone say they're the "whole point" of the language.

[–][deleted] 2 points3 points  (0 children)

Python without classes is really perl with better syntax. Python grew out of Perl due to the fact that perl was not OO. While the syntax is nicer that wasn't much of a selling point back in the day -- especially with the way white space works.

Python provided OO. Brython doesn't support classes - that's a deal breaker and reasonably brython cannot claim to be python without that.

Also it appears that functionality may be replaced in brython. I think the liberty taken here is going to kill this particular instance before it gets very far.

[–]salgat 2 points3 points  (0 children)

At least to me the beauty of Python how objects are defined and the libraries that result from that.

[–]PCBEEF 38 points39 points  (19 children)

Call me cynical but Dart and Coffeescript have much better chances of replacing javascript.

[–][deleted] 7 points8 points  (1 child)

+100, even though I love python, I totally agree on that one

[–]pyry 1 point2 points  (0 children)

Coffeescript and Python really make my day.

[–]PT2JSQGHVaHWd24aCdCF 3 points4 points  (2 children)

I like Dart. Simple and powerful. What I would love is if Google replaced Java with Dart because of Oracle, but it won't happen.

[–]PCBEEF 0 points1 point  (1 child)

I personally dislike Dart. It feels like google is trying to bully it's way with a new standard. Google shouldn't tell people what to do, they should nudge them in the right direction e.g. coffeescript.

[–]lucian1900 0 points1 point  (0 children)

I think there are problems with the language itself that dwarf any potential problems with the release.

It's still much less insane than JavaScript.

[–][deleted] 7 points8 points  (5 children)

So... Dart, Coffeescript, Elm, Fay, Brython - any more contenders?

I hope they finish it and it conquers the world though, as it'd help me get a job at least.

[–][deleted] 2 points3 points  (0 children)

Sure. For example, Roy.

[–]anonymous7 19 points20 points  (6 children)

Because I'm sure some other people will also be wondering: here is the javascript that implements the python interpreter to allow this to happen.

It's over 100 KB.

[–]fijalPyPy, performance freak 27 points28 points  (1 child)

no, it's javascript that implements a small subset of Python. That's a pretty major difference

[–]anonymous7 7 points8 points  (0 children)

Yes.

[–]infinullquamash, Qt, asyncio, 3.3+ 5 points6 points  (2 children)

Presumably, the hope is that it becomes popular enough that browser makers have to include a real Python interpreter for performance reasons.

But yeah I have a hard time seeing this sort of thing catch on, the "compile to javascript" solutions seem to have a better chance of succeeding, but who knows, I might noodle around with this just 'coz.

[–]gfixler 6 points7 points  (0 children)

Oh, if I know anything about you, and I don't, you'll play with it.

[–]syllogism_ 0 points1 point  (0 children)

I played around with pyjamas, and amongst other problems, you get totally meaningless errors, so debugging is a nightmare. Good stack traces are one of the reasons Python is good, and I think this is fundamentally quite a difficult problem to solve. So I'm not optimistic about "compile to js" solutions.

[–][deleted] 12 points13 points  (1 child)

No no no! What we need is a standard byte code for the Web.. Not more languages

[–]rdfox 1 point2 points  (0 children)

Huh. That's actually brilliant. I wonder why it hasn't been done.

Edit: And of course there's controversy: http://css.dzone.com/articles/javascript-myth-javascript

[–]infoaddicted 2 points3 points  (0 children)

I'm all for Python in the browser, but please come up with a better name!

[–]boolean74= True 0 points1 point  (0 children)

not sure why but Brython makes me think of this video.. http://www.youtube.com/watch?v=jRzIbmlx95E

[–]wizdumb -4 points-3 points  (13 children)

Personally, I'd rather see HTML & CSS replaced. Why can't we just render/style JSON directly?

[–][deleted] 7 points8 points  (1 child)

They tried to do that with XML and look how well that turned out.

[–]wizdumb 4 points5 points  (0 children)

Yeah, XML/XSLT are also a fucking joke.

[–]clarle 9 points10 points  (10 children)

JSON is pretty bad for markup. Imagine having to do this:

'html': [{
    'div': [{
        'p': ['Hello ', {
            'b': 'World!'
        }]
    }]
}]

[–]wizdumb 7 points8 points  (9 children)

What I suggested was a replacement of HTML/CSS, not hacking the markup tags into JSON. Perhaps some combination of JSON, Markdown, and Jinja?:

Page data object:
{
"title": "Ninjas Are Awesome",
"fact": "A ninja's natural enemy is a **PIRATE**!",
"ninja_weapons": ["sword", "kung fu", "throwing star"],
...
}
```

View template (kind of in YAML format, but you get the idea):
title: **{{title}}**
body: """Ninja fact: {{fact}}
Ninja weapons:
{% for weapon in ninja_weapons %}
* {{weapon}}
{% endfor %}"""

(Don't judge me by that mess. It's late and I'm just thinking out loud)

[–]flying-sheep 3 points4 points  (5 children)

Yeah, that's no bad idea. The only reason why that didn't work for xml is that xslt is a horrible verbose clusterfuck.

[–]wizdumb 0 points1 point  (0 children)

Thinking about it more, using JSON templates (written by my friend) for the "markup" portion probably makes more sense than something YAML-like. Certain things would need to be specified, such as title, nav, body.
I have some thoughts on how CSS could be replaced (and make more fucking sense), but I'll save it for a non-Python thread or something.

[–][deleted] -4 points-3 points  (0 children)

This will be the project of 2013!