TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Why-didnt-we-use-python-in-the-browser

9 点作者 kracekumar大约 13 年前

8 条评论

smoyer大约 13 年前
I'm not sure I agree with the premise of the article ... Part of Python's attraction is it's vast ecosystem of libraries and many of them wouldn't work in a browser. How many of those command-line applications would actually work?<p>If you're looking for a clean syntax, try Coffescript, limit yourself to javascript's "good parts" and be very careful with your style.
gioele大约 13 年前
From <a href="http://www.w3.org/TR/html4/interact/scripts.html" rel="nofollow">http://www.w3.org/TR/html4/interact/scripts.html</a><p><pre><code> &#60;INPUT name="edit1" size="50"&#62; &#60;SCRIPT type="text/tcl"&#62; proc edit1_changed {} { if {[edit value] == abc} { button1 enable 1 } else { button1 enable 0 } } edit1 onChange edit1_changed &#60;/SCRIPT&#62; </code></pre> We could have had a future where you could choose which language to use in client-side code. The "removal" of @type from HTML 5 strongly suggests that not everybody believes in that future.<p>Maybe initiatives like Dart and NaCL will create an humus that will make the use of other languages acceptable in HTML pages.
firlefans大约 13 年前
Check out Skulpt and Pyjamas. Wouldn't recommend either for production use but Coffeescript gets you a similar, even cleaner syntax and there is a js lib for everything these days.
jeffehobbs大约 13 年前
I don't see why we couldn't, at some point down the line.
Hovertruck大约 13 年前
I'd hate to see how IE would've butchered that.
gcp大约 13 年前
Someone should make a FAQ for this. It comes up every 2 months.<p>One important point I remember is that it would have been Python without the standard library. Which isn't anything special, really. We call it CoffeeScript nowadays.
评论 #3816842 未加载
willvarfar大约 13 年前
Sad this got flagged
rsanchez1大约 13 年前
Imagine if it had been Perl instead?<p>Well, there was an attempt to get PerlScript to run in the browser, but the hoops you had to go through to get it made it unattractive compared with JS that got native browser support.