News for hackers. Stuff that matters.
Re:PyPy.js: A fast, compliant Python implementation for the web by vog on Wednesday May 06, 2015 @03:20AM (#9497042)
> python can't be directly included in Firefox or other browsers

So Python is a bad candidate, but there are better candidates out there. For example, jsofocaml (using OCaml in the browser) looks quite promising.

In the end, we need a lightweight yet properly defined and highlevel language, and the ML languages as well as the LISP languages are great candidates for that.

Re:PyPy.js: A fast, compliant Python implementation for the web by Macha on Wednesday May 06, 2015 @07:36AM (#9497848)
I believe the issue is politics. I.e. browser vendor A (any vendor) can't unilaterally introduce a programming language and expect others to follow. (MS tried with VBScript, Google gave up on doing so with Dart, for example)

This applies equally to any language.

Re:PyPy.js: A fast, compliant Python implementation for the web by maximilian on Wednesday May 06, 2015 @04:41AM (#9497276)
Purescript is a Haskell-like language that is designed to output to javascript. It looks quite nice and has seen a lot of attention lately. It's even in GSoC.
Re:PyPy.js: A fast, compliant Python implementation for the web by dheera on Wednesday May 06, 2015 @10:39AM (#9498933)
The problem I have with "output to Javascript" languages is that debugging becomes hell. Line numbers no longer correspond to each other, for example.

A slightly less-hellish but still annoying problem is that I often poke at things directly from the console when bugs happen, and this helps me a lot in debugging. However poking at the console requires using JavaScript, which is fine, but it would drive me nuts to have to code in one language (e.g. CoffeeScript, TypeScript, Python) and debug in another (JavaScript) and switch my brain back and forth every few minutes. So I've ended up largely sticking with writing code directly in JavaScript.

Any good solutions to this? Are there replacements to the Chrome JavaScript console that supports those other languages?

Re:PyPy.js: A fast, compliant Python implementation for the web by Psyonic on Wednesday May 06, 2015 @11:22AM (#9499323)
Are you using source maps? If so, you can actually put breakpoints in your other source and Chrome will still break on it. I've even done this with Scalajs.
Re:PyPy.js: A fast, compliant Python implementation for the web by akst on Wednesday May 06, 2015 @07:48AM (#9497916)
Purescript is interesting, I've been trying to build a project in it over the last few months. Since it's still pre 1.0, it has proven difficult but understandably so. It's mostly due to arcane/vague error messages (which they're in the process of dealing with), painfully long compile times, (imo) a few missing features, and incomplete young libraries.

On the flip side, with the state of libraries and all, it's provided me with a real incentive to get involved in open source, by having to contribute patches to said libraries and getting actively involved in general discussion.

Edit:

Just so I don't come off as mostly negative, I do enjoy having purescript as another statically typed option on the client side with close semantics to javascript. It's also been nice having a some kind of parsec like library on the client side (purescript-parsing), which was the main reason I chose purescript for this project in the first place.

Re:PyPy.js: A fast, compliant Python implementation for the web by arianvanp on Wednesday May 06, 2015 @05:48AM (#9497515)
plus its semantics lie pretty close to javascript. Most importantly because it's strict instead of lazy. Eventhough its strict it has a very haskelly feel. Both in syntax and type system. Also I think strict semantics is the way to go for efficient Functional Reactive Programming.

Furthermore, Purescript's FFI is really nice to use and it's really easy to bind to existing javascript libraries.

PureScript is community is nice and active. They are also discussing a lot with the `virtual-dom` guys to bring react/om/mercury-like functionality to purescript [0] and it's quite freakin awesome.

Seriously I'd take purescript for javascript any day. I think it's great that we FP folks can finally do frontend dev :-)

[0] - https://github.com/slamdata/purescript-halogen

Re:PyPy.js: A fast, compliant Python implementation for the web by magmadiver on Wednesday May 06, 2015 @05:07AM (#9497364)
Also, ClojureScript.
Re:PyPy.js: A fast, compliant Python implementation for the web by stock_toaster on Wednesday May 06, 2015 @05:58AM (#9497548)
> In the end, we need a lightweight yet properly defined and highlevel language....

Even lua would be a joy!

Re:PyPy.js: A fast, compliant Python implementation for the web by espadrine on Wednesday May 06, 2015 @07:41AM (#9497874)
Out of curiosity, what would make Lua valuable to add in browsers by default? It is similarly prototype-based, has the same closure design, is dynamically typed, has an object system fairly similar to JS (with the type of arrays and hashtables both mixed), and its number system is also based on floating-point numbers…

I honestly don't see how we can justify the cost of adding Lua to browsers. I see the merit of Lua-to-JS compilers (existing codebases or sheer love of the syntax), but built-in?

Re:PyPy.js: A fast, compliant Python implementation for the web by trynumber9 on Wednesday May 06, 2015 @10:56AM (#9499078)
Lua 5.1 (2006) has lexical scoping, tail calls, multiple return vales with assignment lists, semicolons are actually optional & most importantly: coroutines. ES6 adds some of these features.

Lua 5.3 has both integer and floating-point types.

Re:PyPy.js: A fast, compliant Python implementation for the web by vog on Wednesday May 06, 2015 @11:59AM (#9499600)
Not sure why this was downvoted. Does anyone care to elaborate?
Re:PyPy.js: A fast, compliant Python implementation for the web by toyg on Wednesday May 06, 2015 @12:05PM (#9499655)
I didn't downvote, but I don't think the problem has anything to do with specific language features. It's purely a political issue: you have to get at least two or three main vendors to adopt the new language at the same time, and none of them must perceive it as a threat to its own agenda. For that to happen, all of them must release compatible implementations that put everyone on an equal level at the exact same time, which is really hard to accomplish. It was very hard even to get javascript where it is now (remember the browser wars and all the incompatible extensions it spawned... ?), starting again from scratch with any new language would be extremely difficult, regardless of how "nice" the actual language is.