I'm more and more convinced that Google Web Toolkit got things right. You get everything described in the article for free, plus more advanced stuff like code splitting which works exactly as you'd expect.
That ship has sailed.
What is your use-case? If you want a better developer environment (types, static analysis, better support for large projects) and don't mind walling yourself in (to some degree), you can try compile-to-js (GWT, Dart, etc, etc.. You can also try TypeScript if you want (optional) static typing while still having good JavaScript compatibility.)
If there is some functionality that isn't available on the browser, is there a reason you couldn't just distribute your application as a standalone executable?
Most of the frontends and a lot of the "business logic" layers are written in Java.
Also note that Google no longer uses GFS.
See GWT which is for creating web apps in Java by generating HTML/css/js from Java. It suffered a blow when Google distanced itself from it (probably due to Oracle issues) but has shown remarkable resilience since then.
AFAIK, GWT (and therefor Java) are used in Google Moderator and Adwords.
I think that most people wish that Google (or IBM?) had bought Java, but I must say that the idea that Google must own and control the languages it depends on is also distasteful. The Dart language makes a lot of sense to me, but the re-purposing of Go as a general purpose native language appears to be just a manifestation of the 'must own and control' sentiment.
Shall I cut-n-paste the first URL a google search found for it... http://www.gwtproject.org?
Or perhaps the first wikipedia page about it... https://en.wikipedia.org/wiki/Google_Web_Toolkit?
{sigh}
Use the googles, please.
The old Dev Mode plugin is dead and buried (minor 'legacy enterprise application' issues notwithstanding), except for IE, and with newer IE that takes a bit of doing since IE pretends to be a real browser. Modern FF and Chrome don't support the wiring needed for the plugin, and Opera never did to begin with.
I'm not quite sure how you've managed to start using classic dev mode with 2.7 - I didn't think it was the default any more, but instead the new 'Super Dev Mode' (aka SDM) should be used instead. In place of Java<->JS communication through the browser plugin, your app runs entirely in the browser after having been rapidly compiled/recompiled (i.e. very very draft mode, your code won't be very optimized), with sourcemaps so that you can debug in your browser debugger of choice.
The video you've linked is several years old, and predates SDM. Even some of the docs on gwtproject.org still suggest Dev Mode (e.g. http://www.gwtproject.org/doc/latest/tutorial/create.html), but patches are welcome to the doc as you get to know get better! https://github.com/gwtproject/gwt-site
So instead, here's the specifics on the gwtproject site that talks about super dev mode: http://www.gwtproject.org/articles/superdevmode.html. Note that this talks about older versions where more work is required - since you are using 2.7 (latest stable release), you can skip many of these details.
With that said, it should do more or less what you are doing now. Can you check to see what flags you are passing in your Dev Mode Run Configuration when you try to start it? Specifically, is there a -superDevMode
flag (should not be required, its the default), or is there a -nosuperDevMode
(if so, remove it)?
Your something.html should run as-is, in any browser. In certain browsers (with crappy debuggers) it will be difficult to debug easily, but the classic dev mode (what you are trying to use now) might help there if that ends up being a big issue for you.
If you don't mind a bit digression:
Here I was wondering what the hell GWT stands for (since I just read about JWT, JSON Web Tokens) and after frantically digging so much into the main pages, they only mention it somewhere deep deep down below in here and the kicker is:
> Name is spelled GWT - all capital and it stands for GWT Web Toolkit. These are collectively referred as Name in this document.
I... I now understand how programs feel about stack overflow errors.
Having developed a couple of GWT apps, the Presenter layer is probably shared while the View layer is different across devices. GWT's MVP docs cover this in more detail.
We use GWT at work for a middle sized business application and personally I think it's the right toolkit if you're developing a standalone application because as a Java guy I like to have my Fancy Java architecture with patterns and shit :p But generally speaking, If I want to know if a technology is dying or not, I checkout the release frequency. http://www.gwtproject.org/versions.html
> class TempConvertPipe {
Writing functions as classes? Cool! Welcome to the future! Are the Javadocs for Angular 2 up yet? Crossing my fingers for stuff like this.
This is great! My name is Eliisa and I am the Social Media Coordinator at Cronometer. I forwarded your comment onto our Development Team, I am sure they loved reading it! I also got the goods for you from one of them :) "So the web site is coded in Java using Google's GWT framework (http://www.gwtproject.org/). Although it isn't the newest technology it is super quick and allows us to write most of our code in Java that is then translated and deployed as Javascript."
Thanks for the comment! :)
Dart >Google is hosting a Dart developer conference in Munich this week that marks Dart’s return into the spotlight.
> Internally, Dart has also been a major success at Google. Both the AdWords and AdSense teams (which drive most of Google’s revenue), as well as the Google Fiber teams, now rely on it to write their consumer-facing web apps.
AFAIK They use https://www.polymer-project.org/1.0/.
If you’re doing application development then AFAIK they use this http://www.gwtproject.org/overview.html , they have some things in there for UI.
This question seems unrelated to libgdx, but you can use a GWT RPC to connect the GWT app to a server app. On the server you can access the mySQL server directly via JDBC then.
It's still possible to convert Java code to JavaScript even though they have nothing to do with each other. Google has a toolkit called GWT and one of its primary features is converting Java to JavaScript. I used it for a few months to make a pretty basic application but I never bothered looking into the actual conversion part.
I dunno man, this looks a lot like blogspam - lots of posts in a short amount of time, esp since these are all quite outdated or just wrong. GWT 2.4 is just over three years old now, this feature hasn't been new in a long time. Plus, the whole third paragraph is a quote (uncited) from http://www.gwtproject.org/doc/latest/DevGuideUiBinder.html, and doesnt link to it, but instead links to the old (dead) content at developers.google.com/web-toolkit.
(The others have issues too, addHandler+sinkEvents is easier to use as just addDomHandler, and iterating through panels is not too bad since any panel implements Iteratable<Widget>
, you can just do a java for-each.)
Can you at least meter them out a bit, not several in an hour, not always link to your own blog, and make sure to update this stuff a bit more before sending it out?
I would even go as far as to say that the line between compiled programs and interpreted programs is becoming more and more blurry. For example, Java is a language that is generally compiled to bytecode, then that bytecode is just-in-time compiled to native code. It can also be compiled to Javascript, which is then interpreted. But most interpreters these days actually do just-in-time compilation to native code for performance reasons. So in this case is Java compiled, just-in-time-compiled or interpreted? You could say all three! Then there are things like asm.js, which uses Javascript, an interpreted or JIT-compiled language, to emulate native code that was compiled from another language!
It's no longer as simple as just compiled languages vs scripting lanugages these days. There are often many layers of compilation, JIT-compilation, interpretation and transformation.
Comparing the source code between Google Inbox and Google News you can find a lot of similarities and according to this Gmail blog post Inbox is written using GWT.
> It is odd that Google is super open source about some frontend technologies like Angular, AngularDart, Polymer etc, and super secretive about the framework they use for things like Gmail, Google+ and News.
Not really secretive, they just promote it less than Angular or Polymer for example. GWT docs, section Real world projects lists Inbox along with Spreadsheets and WebFonts. The list is definitely not up-to-date though and take it with a grain of salt. WebFonts for example is an AngularJs 1.6.4 app probably bundled with some Google Closure Library magic, but GWT is nowhere to be found.
Also, people aren't directly writing or maintaining the "incomprehensible" html/css/JS you are looking at. It is that way because you are looking at generated code. They are using a GUI framework that builds those pages and serves them. The code that generated those pages is probably very easy to read and much more comprehensible, if you understand the framework.
They probably use something like this:
I'm not a huge fan of java so its not something I would use; but since it is google-made, I'm sure its pretty capable. Java does have wrappers for all kinds of things so if thats your forte, I don't see how it could hurt. Their docs look great though.
/u/cwmma does have a point. Your post doesn't really provide any good points to stand on other than the fact that you are trying to use JavaScript like it is C or Java. You don't have to write in JavaScript if you don't want to. Try something like GWT. Your issues with the language itself stem from it the dynamic type nature of it. If that was the only thing you hated, then try TypeScript. However, it seems to be that ignorance and incompetence are what impede your progress here. You complain that when you mash two poorly maintained libraries together and things break, then the language must be broken. By that logic, all languages are terrible because there is an uncountable number of poorly maintained projects. Your original issue was solved by /u/Cosmologicon . The issue was that you were using jQuery without understanding it. JavaScript may be different from C and Java, but it is no child's toy. The language is plenty capable and it should be treated at such.
It seems like you are still confused about GWT client-side vs server-side.
GWT cilent-side is the only place where you are limited in what you can import and use. That is the code that gets converted to JavaScript and is run in the browser.
Your server-side is completely full Java and you can use anything you want. That is where your database work will be. You will use RPC to send messages from the client to the server to perform these transactions. The server-side code will run on the server, not in the browser.
That's exactly what GWT is for: http://www.gwtproject.org/
You write things in Java, and it gets compiled into JavaScript for you. No JavaScript knowledge is required (though it can be useful). However I wouldn't recommend using GWT for iOS. Ideally you would want to use Objective-C, in which case you would use J2ObjC: https://github.com/google/j2objc
Or... you could use a layout tool like GWT and have a UiBinder to take care of matching UI elements to the UI structure, and not worry about messing up your code with random indentation.
> There is also a long-term risk. At any point in the future, google may decide that gwt is not the way to go, and you'll be left with an orphaned platform.
GWT is mostly steered by external companies now: http://www.gwtproject.org/steering.html
For a "I don't even want to use HTML" approach, all I know is GWT. It takes a Java-defined layout and compiles it to HTML/CSS/JS. It also defines compile targets for different browsers (ie different pages served to different browsers) to work around quirks.
Definitely not a lightweight framework, and some of the design patterns from Android were kinda shoehorned in. But if you've worked with Java before and want a "write once, run everywhere", it'll do.
Google Web Toolkit? 😉 http://www.gwtproject.org/ It's ancient now but back around 2010 it was a gods-sent gift to me. I was tasked with writing a website for the internal use of a company I worked in and I had to develop both the backend and the frontend. I couldn't do it without GWT.
Then there is Vaadin. I didn't follow its development but I understand it had a lot in common with GWT in its beginnings. https://vaadin.com/
The uglist wieredstster thing about GoogleWebToolkit that jnsi
- that is JNI that the native thing... is JavaScript. So you have Java code, that inside comments you have the JavAsCRiPt code. (I am not even bothering to fix this caps lock issue I had here). Here is the modern documentation: http://www.gwtproject.org/doc/latest/DevGuideCodingBasicsJSNI.html
You talk about the compile time? Lets talk about load/run time. I had this table which on the cols we had the weekdays, and the rows the hours of days (in 15 mins intervals). This means on startup there was a table that was 7 * (24*4) = 7 * 96. I tried coloring this nicely according to the hour (css) and then via some internal logic (has data, colorA, no data: colorB). As each dom event was propagated from the browser to Eclipse (ya, that old) - the load time of every page was 90 seconds on debug build. Release were OK - but we devs use debug for building.
​
(edit: formatting, I need to default to markdown code some day, as the visual editor sux salty balls).
/u/tedyoung mentioned GWT and Vaadin. Vaadin is built on top of GWT and GWT was built and maintained by Google. I believe the Vaadin team is now the primary maintainer of the GWT library as well. Both of which seem much more highly used and maintained than ZK.
If you are coming from full stack Javascript developers working with a framework like this will probably feel extremely cumbersome and slow you down quite a bit. The only way to know is to try though.
I think the idea is great, but also not new if you look at the Java world it is similar to GWT and Vaadin which are both very successful. So I definitely see potential in such an idea, but I think it would be cool if it was not Laravel dependent. Maybe in the future the project gets more abstract to use it i.e. also with Symfony/Twig instead of Laravel/Blade.
> You completely missed my point
How’d I miss you’re point? You were comparing Typescript and Java, two very different languages that have very different use cases
> you can write a damn good SPA in Java and I have more than once http://www.gwtproject.org/
What a joke. Yeah, the world has tried the whole “compile down to JS” tactic, and it sucks. Furthermore, good luck finding any dev that would deal with such a stack.
>Why can't java, for example, be used for everything instead of PHP or Python?
To add to other responses ITT, I will simply literally answer this exact question: it has been done. It's not necessarily the best way to go, however.
You could use GWT (or Vaadin) + Java web server + Prevayler (raw Java datastore).
I've actually used this combo for small prototypes, but I wouldn't recommend writing a full system that way.
"Is this what people mean when they say JavaScript is Java?"
I mean, in the case of GWT, yeah? the idea is literally "... write AJAX applications in Java and then compile the source to highly optimized JavaScript".
Nope, frameworks aren't just imported code. A good example of a java framework is GWT
I'd definitely say look into learning web technologies (html, css, javascript) because that's a very good way of making your application available to a lot of people all at once.
There's also the Google Web Toolkit (GWT), which I once built a couple of applications with. You write in Java and the front-end can then be compiled to HTML and Javascript and the application deployed using something like Apache Tomcat. They even have a browser plugin that lets you debug the front-end Java code live, allowing you to step through line by line, examine variables, view the call stack etc. I doubt many people actually use it these days, but I found it quite impressive from a technological stand-point.
Even in Java these days you have things like Prime Faces, GWT and Vaadin to handle client side web. Although I wouldn't by any means recommend them for a beginner. But for the purpose of learning you can serve basic html pages for a while.
Or mature enough that it requires no updates, https://github.com/pyjs
That project was a port of Google Web Toolkit, which is also mature enough, http://www.gwtproject.org/presentations.html
Good luck!
For web development you must eventually work in the languages of the browser, HTML, CSS and Javascript.
However there are frameworks which will allow you to work in other languages and let the framework handle how they are delivered to the browser.
One such framework for Java is GWT, though you could also use the enterprise oriented frameworks such as Spring or Struts.
Google uses closure tools -compiler, stylesheets, templates
and or Google web toolkit depending on which Google services you're looking at. Of course other Google properties probably use something totally different too haha.
You can see what Facebook does here with react in these slides react css in js by a dev on Facebook's front end infrastructure team
> Is there any way to do it relatively easily in Java or Python?
Prefer HTML/CSS/JS. If you use GWT, you're limiting yourself to GWT. If you learn HTML/CSS/JS, then you can (more or less) use anything as the server-side language(s). However, the choice is yours. If you just want something to help you get started, then GWT can be sufficient.
> GWT is used by many products at Google, including AdWords, AdSense, Flights, Hotel Finder, Offers, Wallet, Blogger.
http://www.gwtproject.org/overview.html
So yeah, being used in Adwords isn't a ringing endorsement.
It is really simple. You can find all the documentation here: http://www.gwtproject.org/doc/latest/DevGuideServerCommunication.html#DevGuideHttpRequests
and that's the code you need
import com.google.gwt.http.client.*; ...
String url = "http://www.myserver.com/getData?type=3"; RequestBuilder builder = new RequestBuilder(RequestBuilder.GET, URL.encode(url));
try { Request request = builder.sendRequest(null, new RequestCallback() { public void onError(Request request, Throwable exception) { // Couldn't connect to server (could be timeout, SOP violation, etc.) }
public void onResponseReceived(Request request, Response response) { if (200 == response.getStatusCode()) { // Process the response in response.getText() } else { // Handle the error. Can get the status text from response.getStatusText() } } }); } catch (RequestException e) { // Couldn't connect to server }
Inspecting the website I'm sure it's JavaScript no doubt but what in particular should I be learning/ learning path I should take, in order to make these on my own? All the smooth animations, etc. Does it have something to do with the Google Web Toolkit which was what it was built with?
A web application is generally made up of many layers/components. A Java applet really is only relevant to the front-end or browser side of a web app. It is by far most common for that aspect of a web app to be written using HTML, CSS and JavaScript in some combination. If you really wanted the entirety of your web application to be skewed as far towards Java as possible, there are other options such as GWT:
When it comes to the server side of a web application, Java becomes much, MUCH more common and there are many, many frameworks and libraries that are available. Like some other posters have already indicates, Spring, Play and Vaadin are all extremely popular. One suggestion I do see lacking in the comments though is that plain old Java Enterprise Edition is also very popular and viable.
You actually can develop web apps and pages in Java, for example using GWT (still compliles to JavaScript in the end). But yes, 99 out of 100 times someone mentions Java in a web context she/he's probably talking about JavaScript.
GWT has JSNI, which allows you to write plain ol' javascript. If you want a nice way to expose a javascript library to GWT in a wrapper, use JSNI. Take a look at GWTProtovis.
If he's only doing client side development, I'd be more interested in understanding REST API's and authentication.
Is it to optimize your compiled CSS?
You could take a look at this: http://dev.arcbees.com/gsss/mixins/
Where most used methods are used. If you look at the sources, you may find the answer you seek. AND This piece of documentation will explain how to use conditional logic into GSS files: http://www.gwtproject.org/doc/latest/DevGuideGssVsCss.html
Then use GWT. If being battle tested and production proven is your metric, then that's your JS framework.
A lot of people don't rewrite things just because a new framework is out--even Facebook.
It's not the best practice, but if you want to try developing a website without HTML look at something like Google Web Toolkit (GWT) http://www.gwtproject.org/
It lets you write code in Java that is compiled to Javascript. And that makes it possible to have a completely barebones HTML webpage that does nothing more than execute the javascript to build the page. However, it really is better to do the design in HTML/CSS and the functionality in GWT.
Down in the bottom right there is an email address of whoever designed the site. I'm sure if you are polite they wouldn't mind sharing what technologies they used to build the front and backend.
If it's any help their frontend appears to be done with GWT and the backend is impossible to determine as it's not something that shows up on the web site or within the HTTP requests.
I use google web toolkit which lets you write your code in java, and compiles it to javascript. It has a port of java to javascript. I never have to ever call setAttribute on an element. To set the height
style of an element, all I do is:
Element div = Document.get().createDivElement(); div.getStyle().setHeight(100, Unit.PX);
Much less chance of an error with something like that. More examples: http://www.gwtproject.org/javadoc/latest/com/google/gwt/dom/client/Style.html
Personally, I think one disadvantage to PHP is that you have to interact with your database using mysql, which is kind of ... non-modern. It's just my preference though. It basically boils down to calling:
php&mysql:
as opposed to
django:
which are both standard, but the second choice is more consistent with object oriented in my opinion. However, both are pretty standard in the industry. Also you can use a PHP framework to avoid that ugliness. Also putting django on your resume is probably as impressive as PHP. But still up to you. Facebook is guiding you towards PHP because that's what they use in house, they've also recently released HACK which is basically PHP plus some useful perks http://hacklang.org/.
Regarding java, I know that google writes a lot of their code in java and compiles it to javascript using google webkit. If you do that, you wont have to use REST and ajax I think, but I haven't personally done that. (Checkout http://www.gwtproject.org/)
What you're about to develop sounds simple enough, so as long as you break down the problem into tiny chunks I think you can totally manage it. If you want to keep in touch inbox me, I'm curious to know how your progress goes.
It is 100% a step backward - for GWT, at least today. The browsers, who are cutting us off, see it as a step forward. There have been several small posts about the notion of having to move, and requests both for testing of SDM and for ideas of how we could do better with the tools the browsers still allow us. One idea that Leif Astrand from Vaadin (https://github.com/Legioth) put forth was to make synchronous ajax calls back to the dev mode JVM - it turns out that this works, but is horrifically slow, dozens of times worse than Chrome dev mode ever was.
As long as you keep the SDM server the same, you don't need new dev mode on/off bookmarklets, you can reuse them. They will look for sdm-enabled GWT modules on the page, ask the server if it can compile them, and offer a compile button. I'm not aware of any issue with an unsafe script warning - can you give me a little more context?
Console.log definitely should work, if it doesn't, something is misconfigured. This tool should work in regular production mode, so it should for sure work in SDM. Try visiting http://www.sencha.com/examples/ with an open console (Full disclosure, I work on GXT), you should see juli formatted log messages. If you are writing your own console.log calls, don't forget $wnd, if you are using juli, ensure that the ConsoleLogHandler is enabled (which should be the default, assuming logging is turned on at all). See http://www.gwtproject.org/doc/latest/DevGuideLogging.html for more info.
And finally, expect the future to continue to improve. GWT 2.7 should dramatically improve compiler performance (and so SDM recompiles), and browsers should continue to move toward a state where they support something that looks like a modern debugger.
>mutual informationa analysis on our Flow Cytometry data.
Hmm. Sounds like my students need to talk to your group.
Back on topic. Browsers interpret javascript/html/css. So, you either have to use javascript, or something that compiles to javascript, like GWT (a java to javascript compiler) or Dart. Other folks here could probably offer better advice than I.
As zifyoip said, You can use Applets instead of an application. With the standard Java library this isn't hard to do.
On the other hand, there is also the Google Web Toolkit, for those specifically looking to publish online. It allows you to convert Java into Javascript application. The LibGDX library uses this to port to HTML5/Javascript automatically.
Honestly though it depends on what you're looking to do with your game Both options can be embedded into a page, and both are viable, but if you're don't need all of the bells and whistles of LibGDX or the GWT, it would likely be easier to go with an Applet.
This is just RC1. They typically make an announcement when the 2.6 final is cut.
UPDATE: I stand corrected. I originally just glanced at: http://www.gwtproject.org/release-notes.html but should've checked https://gwt.googlesource.com/gwt/