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

科技回声

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

GitHubTwitter

首页

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

资源链接

HackerNews API原版 HackerNewsNext.js

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

Scala.js - Write in Scala for the browser

75 点作者 bertzzie将近 12 年前

13 条评论

benjaminjackman将近 12 年前
First of all, if you watched the slides, you just ran the first `hello world` Scala-js app in your browser. The slides use the scala-js runtime. Developer tools have scalajs-runtime.js at 1.7MB compressed and about 4s to download&#x2F;execute, then about 1.5s on subsequent refreshes.<p>Now, having seen the talk at Scala days here are a few notes&#x2F;thoughts:<p>This is currently the result of 4 months worth of work, and Sébastien Doeraene, the author of the slides and the code there-in, is going to be working on it at EPFL for the next 4 years or so for his doctorate.<p>This is being done by replacing the backend portions of the Scala compiler that emit java bytecode with ones that emit javascript.<p>When the slide showing that it is 16MB came up everyone laughed and the author acknowledged how large a number this is. It is the result of having to bring in the entire the Scala standard lib. He is planning to work on ways of cutting this number down.<p>At the end of talk Martin Odersky commented from the audience that this is an attempt by the EPFL at making Scala useable for large webapp development. If it proves successful more resources will put towards supporting it.<p>I plan to try this out for internal sites used by my company. Currently we split and then have to duplicate a lot of our code between Scala &#x2F; Javascript. Scala for the server software, Javascript for frontends which are webapps. I haven&#x27;t had time since I got back to do much more than clone the git repo.
beefman将近 12 年前
16MB minified. Ok; for what?<p>&quot;How to scale to Rich Internet Applications?&quot;<p>Good question. They didn&#x27;t answer it. Is the Scala code going to be much more compact? And what problems scaling JS to rich applications were they thinking of, exactly? They don&#x27;t say.
评论 #5889052 未加载
评论 #5884507 未加载
评论 #5885036 未加载
octo_t将近 12 年前
16MB runtime is really painful. Having to pack a huge amount of the standard library (List is backed by a lot of other traits for example) into the js is going to be very difficult to reduce.
评论 #5883671 未加载
评论 #5884732 未加载
rubyn00bie将近 12 年前
While in principal, I love this... Because JS is not my favorite language... I just don&#x27;t see the real world benefit. It&#x27;s going to:<p>1.) increase difficulty debugging (compiled js -&gt; scala) 2.) decrease productivity, see #1<p>Why not just write javascript? Though that&#x27;s my argument against any of these compile to js kits (coffee script being the big one). So maybe I&#x27;m just trolling (sorry).<p>Again, super cool. The author is waaay smarter than I for implementing this, but... The real world.
评论 #5883712 未加载
评论 #5885290 未加载
评论 #5883757 未加载
评论 #5883672 未加载
lostnet将近 12 年前
I enjoy both javascript and scala.<p>For work and anything I would want to put on a web site it is more practical to write javascript and when I&#x27;ve had time for my own projects I&#x27;ve enjoyed scala.<p>For me this is a great direction. The idea that I&#x27;d suddenly replace my javascript is silly. But being able to pull in things I&#x27;m familiar with from both into the same prototype (and at the same layer) of something and debug it all in the debugger I&#x27;m most familiar with (and with correct code line references!) is awesome.<p>Similarly, for someone who is learning scala and doesn&#x27;t have&#x2F;want java+IDE experience, this could lead to learning scala as a language with much less overhead and&#x2F;or while learning a more useful combination of debugger and editor.<p>I think the overly negative comments come from those who view javascript as the &quot;problem&quot; that every new way to integrate languages with it must have been designed to tackle. Since every language has trade-offs, there is always ample criticism available from that vantage point...
srameshc将近 12 年前
I hoped for something like clojurescript with Scala. Its finally happening which is great step. But for now , I am happy with Dart.
wiradikusuma将近 12 年前
Interesting! Maybe it can learn from Scala on Android:<p>For Android development, install Scala runtime into rooted phone, so you don&#x27;t need to &quot;minify&quot; your code (faster roundtrip). For Scala.js, maybe use Chrome Extension?<p>For production, ProGuard (removes unused code in Scala) and Closure Compiler (optimizes JS).
altrego99将近 12 年前
I have not used Scala before. What&#x27;s the motivation for this? I can think of two reasons - a) to make native Scala programmers feel home with Javascript and b) Scala is a superior language than Javascript, will therefor make many things easier.<p>How much of this is (b)?
评论 #5884010 未加载
评论 #5893239 未加载
auggierose将近 12 年前
I think that this is a great project, and would be exactly what I need for ProofPeer (<a href="http:&#x2F;&#x2F;www.proofpeer.net" rel="nofollow">http:&#x2F;&#x2F;www.proofpeer.net</a>) because I have lot&#x27;s of code that needs to run both on the server and in the browser. I am using Clojure&#x2F;Clojurescript currently and am pretty happy with it. But I am missing the possibility of defining abstract datatypes in Clojure, so my first choice would have been Scala if Scala.js would already be mature and reasonably production ready.
chii将近 12 年前
It&#x27;d be interesting to integrate this into the GWT toolchain, so you can write both java and scala for the browser!
评论 #5884661 未加载
_progger_将近 12 年前
I hope it covers &quot;Debug with breakpoints in Scala for the browser&quot;.
评论 #5884780 未加载
sjrd将近 12 年前
The video recording is now available! <a href="http://www.parleys.com/play/51c380bfe4b0ed8770356866" rel="nofollow">http:&#x2F;&#x2F;www.parleys.com&#x2F;play&#x2F;51c380bfe4b0ed8770356866</a>
umren将近 12 年前
good job on making this, but.. it&#x27;s useless