Online view of what the Scala.js compiler generates - scala.js

Is there a page somewhere that allows me to write short snippets in Scala and to check the corresponding (possibly optimised) JavaScript spit out by the Scala.js compiler?
Would be great for short demos to friends and colleagues.

ScalaFiddle supports this feature, although it's hidden. Write your code on the left, then hit Ctrl+J. The optimized generated code appears on the right. Note that it's the code for the entire app, so there's a lot there. Usually a good starting point is to Ctrl+F for function $c_LScalaFiddle$().

Related

navigate to the implementation of a data-type or a function

I was wondering if there was the equivalent of "Ctrl+left-click" in eclipse for java, that takes me to the implementation of a method or a data-type in Rascal. I'm finding it a little hard to sort through a list of references brought up by doing a "Ctrl+H" search everytime.
Thanks,
The short answer is: not yet.
The longer answer is: we are working hard on a type checker and compiler for Rascal and those will provide the basic information for jumping to definitions, uses, and the like. As soon as that information is available we will integrate it in Eclipse.

Coffeescript JS version?

If I am going to develop using Coffeescript I will need to know what browsers are supported by the coffeescript JS code - I'm sure there will be a webpage somewhere on the subject :)
CoffeeScript's motto is "It's Just JavaScript." That means that if you write CoffeeScript code that invokes a feature that only exists in newer browsers, the JavaScript output will depend on that feature. CoffeeScript's own syntactic features, such as class inheritance and array comprehensions, generate code that's compatible with all major browsers going back to IE6.
Update: I now realize you were specifically asking for browsers which support the Coffeescript compiler. I have no detailed information about that, but considering the wide usage of Coffeescript my answer would be most of them.
No browsers support Coffeescript directly, although there may be some magic javascript snippets available that could compile Coffeescript to Javascript on the fly when a browser loads the page.
The usual workflow however is to compile Coffeescript to Javascript, and then only feed the browsers the resulting Javascript files. "Compile" may not be the proper word either, as it is more or less translating one set of source code (Coffescript) to another set of source code (Javascript), which is then parsed and sometimes JIT-compiled to execute in the browser (Spidermonkey, V8 etc).

Scala Help needed - Code completion

I am working on writing an IDE for Scala and need some help. I would like to implement coding assistance so that I could present a list of options when a user presses a period (".") or a space (" "). e.g. if projects is a List, as soon as user types "projects." or "projects ", I would like to show all methods of scala.List that he could use (regular IDE stuff). I know that scala.tools.nsc.interactive package provides this capability, but I am unable to figure out how to do it. Besides, it seems that the interactive package would use REPL and would be slow for this purpose. Is that a fair assumption, and if yes, are there any alternatives?
Also, is there a way I could get a call reference tree for a literal/ method (where all is the method referred to in a code base) ?
Thanks and Best regards
Aishwarya
Well, your best bet is going through the same set of links I provided in answer to this question, even though the questions are different.
Yes, the presentation compiler under scala.tools.nsc.interactive is where the reusable functionality would be.
The presentation compiler is used by Eclipse and ENSIME. May be ENSIME itself which in addition to providing emacs support also provides a server as a backend for an editor would be a good avenue.
The presentation compiler is not slow. It was designed from the ground up to provide good performance for Eclipse and it has largely delivered on this goal.
For some of the presentation compiler capabilities, see scala.tools.nsc.interactive.CompilerControl.
For another project using ENSIME, look at Daniel Spiewak's plugin for jEdit.

i want my popup window to appear in center

i had created my popup window which is appearing on a click of link but it is coming at the top corner of window and want it to appear it in at center and also want to resize it. i had created it in scala and calling it with html file.so everybody please give your suggetions as fast as possible.
This question is just so wrong, web pages aren't written in Scala; they're written in HTML, JavaScript and CSS.
Please, please stop taking some very fundamental questions about basic web design / jQuery concepts and tagging them as Scala. You do not have a Scala problem.
My advice to you is to forget Scala, at least for now. Concentrate on just writing static web pages using JavaScript/jQuery. Once you have a level of understanding there, start looking at Scala, but not for web pages, just get a feel for the language by writing command-line tools.
Then, and only then, you can start learning the Lift framework, and tie it all together.
Alternatively, you could always try Ruby on Rails, it's supposed to be easier to learn than Lift.
Also, you really should post samples of any code you're struggling with, it makes it far easier for others to spot the problem if they can see the code.

How to run additional statements in eclipse(pdt for PHP)?

Like firebug's console,I can type in the scripts directly.
Is there a similar place in eclipse out there?
Or do I install some plugin to have the feature?
You can use the Display window to type in code snippets, set variable values and evaluate whilst debugging.
http://help.eclipse.org/help32/index.jsp?topic=/org.eclipse.jdt.doc.user/reference/views/display/ref-display_view.htm
The "watch" view can be used to execute simple snippets of code.
In some circumstances, I use the groovy shell (in a separate window) to check how a code snippet will behave. It isn't practical when complex data structures or library classes are involved, but for a respectable number of cases it works very well.
You can use the Expression and Display views. There's a set of excellent free video tutorials on the Eclipse debugger that you can see here. The aforementioned views are talked about in lesson 3.