Are there any HTML5 Canvas implementations for embedding in c++ [closed] - javascript

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 5 years ago.
Improve this question
I'm working on a browser based game atm and already looking into options porting it to other platforms such as consoles or devices where playing in a web browser may not be suitable.
The game is pretty much all JavaScript with rendering done via a 2d canvas context.
What i was hoping for is that there is already a c++ library/api that will work in conjunction with maybe google's v8 engine to handle the canvas calls in JavaScript and render them with opengl or something similar
Does anyone know of a project out there that may be providing this functionality?
Otherwise how would you suppose I go about embedding my javascript in c++ with as little changes required to the javascript as possible as I don't really want to have to maintain too many differences between platforms?

Qt is a very nice C++ library compatible with LGPL licensing that among other things includes a webkit based widget with javascript support. Also as scripting language Qt uses javascript with a tight integration with C++ (it's easy to write a C++ class and and make it visible at the javascript level).
Qt is multi platform and comes with an highly sophisticated IDE.
Qt is not currently using V8 but the porting is in progress and they aim at providing a 100% backward compatible solution.
The only "problems" of Qt are IMO that:
It's huge
It's a framework, not a library. You cannot just "use" Qt easily, you should embrace the view (the documentation is however of excellent quality).
The long term prospects are a bit fuzzy (not as bad as a few months ago, tho)

I guess I'm a bit late here, but I'm searching for a similar solution. I found node-canvas and I do not know if it is feasible to hook that so it renders into something like an SDL or SFML-managed window or not.
But for my own purposes, I will port my code over to C++ and use Cairo directly with SFML and OpenGL.

Interesting idea - another possibility is using Adobe Air, and rendering the game via StageWebView and Flex 4. Here's some example code for using the thing if you're interested:
https://github.com/JustinBeckwith/frink/blob/master/frink-flex/src/controls/WebBrowser.as

An interesting Project that I have uses id FireBreath(firebreath.org). This is not exactly what you are looking for, but in some ways it would get you close. Firebreath allows the creation of browser plugins in C++. One of the features of Firebreath is it allows you to access and modify the DOM from the C++ in you browser plugin as well as create methods and properties in C++ that can be accessed from JavaScript on your page.

Related

How useful is JavaScript without its third-party libraries i.e. JQuery etc? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 7 years ago.
Improve this question
I'm new to JavaScript, and just started learning about Document Object Model.
I came to an understanding that DOM is actually not a "core/default" library of JavaScript rather developed by W3.org as a programmatic model to work with HTML.
I have also learnt that JQuery is also a library built ON TOP of JavaScript just like AngularJS NodeJSN etc.
So my question is:
Does Javascript have a core library?
And is JavaScript actually useful without relying on third-party libraries in 2015?
Are there examples of programs/products that just use Javascript without any third-party libraries?
There is a set of core JavaScript functions, and a specification to detail these functions and their behaviors. This is sometimes known as ECMAScript and common support is for version 5 (aka es-5).
There are a great number of functions available to you in here, from DOM manipulation, creating/modifying arrays and even HTTP requests. Essentially every library that you see, is just a wrapper on top of the core JavaScript functionality to make your life easier.
A great example of this is http://youmightnotneedjquery.com/ which gives examples of how to do things in vanilla JavaScript. Here's a simple comparison from their site:
has class in jQuery
$(el).hasClass(className);
has class in pure JavaScript
if (el.classList)
el.classList.contains(className);
else
new RegExp('(^| )' + className + '( |$)', 'gi').test(el.className);
This quite clearly shows how jQuery can make things easier, but you can also achieve what you want in pure JavaScript.
Does Javascript have a core library?
The language itself doesn't have any means of interacting with anything. It relies on being run in an environment where it can interface with something useful, for example running in a browser and interfacing with the DOM objects.
JavaScript is also used in environments completely different from a browser, like in the web server platform Node.js where the environment allows JavaScript to respond to web requests and access system resources.
Is JavaScript actually useful without relying on third-party libraries
in 2015?
Yes. You can do anything without a third party library that you can do with one, you just need to write more code yourself. Third party libraries are only used for convenience.

Where can I find an R-to-JavaScript compiler? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 7 years ago.
Improve this question
After learning about dplyr and ggplot2, I've decided to start coding exclusively in R. Where can I find an R-to-JavaScript compiler, so I can build extensions for Google Chrome?
I am willing to write one myself, but it would have to be in R.
R works well as a special purpose math oriented language purely because the R interpreter/JIT and runtime is highly optimized.
Not unlike MATLAB or Mathematica or even using numpy with python
If you were to transpile R code to JS, it would be quite poor in comparision and would be unable to efficiently perform all the complicated computations you would typically do in an R program (if your R code is really doing non-trivial computations)
There doesn't seem to be any project that does R to JS compilation - seems like it is not really something people would really require.
I think the ecosystem of Javascript only Chrome extensions is a poor fit for running R code in.
If you were running FireFox or IE, you could call DLLs from within extensions - using COM on IE and the FF native bridge API. Chrome doesn't support such a thing directly.
The answer is to write an NPAPI plugin - this is a bit of native code implemented as a DLL that can be accessed from JS, via an OBJECT tag. I have used this to write an extension that replaces Flash video controls with a windowless VLC player on Chrome, FF and IE.
This is the best way to do it. Write your R code, make it a DLL, expose the interface via an NPAPI plugin. In your extension, inject an OBJECT tag into the HTML, which will instantiate your native code instance - after which you can call methods on it directly as if it were a JS object.
The next best thing I can think of is - Translate R to MATLAB, convert MATLAB to C++ (which is possible) and then run the C++ as native client code in the browser.

Pure JavaScript Programming [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 8 years ago.
Improve this question
I'm diving into web development again (first time was an utter failure), and I have some pretty spectacular resources for learning both HTML5 and CSS3. What I want to begin studying next is JavaScript so I can have absolute control over my pages. But before I begin integrating JavaScript into my work, I'd like to use JavaScript solely as a programming language (with console I/O and basic programs) to familiarize myself first. What are the best tools for accomplishing this? Because thus far, I haven't found any browser/tool that approaches the simplicity of writing a source file, and clicking run like you might with a C++ program. Thanks.
Node.js is your best shot.
Node is used for:
Server-side applications (Sails, Express, Socket.io)
Various frontend-related scripting (Grunt, LESS)
You can try Node.js, that allows you to run Javascript programs from commandline. Other than that, Javascript runs in a browser.
I think JetBrains makes the best IDEs in the world. Their support of JavaScript, HTML5, and CSS3 is first-rate. I'd recommend looking at WebStorm as your IDE.
I would recommend jsfiddle.net which allows you to type and run code. I might also suggest codecademy.com which has a very good program to teach you javascript and many other languages as well. There is also a really simple part of there website called "codebits" where you can compile js, html, and css and play around. W3schools.com is also very helpful for reference.
If you are running windows, the Windows Scripting Host (WSH) can run both Visual Basic Scripting and JavaScript... with the JavaScript having full access to things.
Because Microsoft supprorted VB Script over JScript (their version of EMCAScript), it is difficult to find documentation, though it does exist. I have a fair number of admin tools written in JScript.
Because that's not how Javascript works. You can't read user input from console.
You can use any browser's development tools and write Javascript code line by line.

RIA liblaries/framework in day-to-day development [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 3 years ago.
Improve this question
I need to develop quite simple web application with some Ajax functionality and GUI components with Java as a server-side language. The main purpose for me is to learn sth about designing web app that I can make use of when I start looking for a job ... .I ran into lots of framework (RAP, Nice JSF implementations etc.) and there are also GWT and JQuery . I started reading about GWT and it seems to be great at the beginning, but there are limited number of visual components. When You missed one it seems to be much harder to write it with GWT than in JavaScript/JQuery (e.g sortable components).
Also:
If JavaScript is is easy why to learn API to just make translation?
The main argument seems to be that GWT is for developers who don't
know Java Script very well, but is JS harder than GWT API and
configuration to work with?
GWT offers also very nice Remote Procedure Call and translating
objects to JS, but there are lots of libraries like DWR.
You need also to use standard servlet to e.g send file stream to a
user, so You need also to save it to a Database or as a hidden XHTML files to make them available to servlet.
So should I start to learn GWT? It is really wide spread? Or maybe JSF implementations with Ajax support outperforms GWT in usability? The biggest problem I have that I cannot imagine how to solve simple problems in GWT while they are almost complete solutions with JQuery. Mixing JavaScript native code with GWT don't seems to be a good option also.
When working with GWT, its always better to now whats going on behind. So you have to learn HTML, CSS and JavaScript as anyway. Maybe you can start with less knowledge on browser frontend technologies. But you will come to the point where you need to know whats going on.
So ask yourself. Is your app large enough that its worth to start with complex GWT app. Also if you're on a large team and familiar with JAVA, Maven and Junit it makes senses.
On the other hand there are a bunch of small (backbone.js with jquery), middle (mootools) or large (extjs) JavaScript frameworks to build RIA.
I've never work with JSF, but all people a meet that used it, wasn't really satisfied.
After all I dont think its a good idea to select a framework by the current feature set of your app. As this can change of the time, you will have to implement it later with a technologie you not familiar with.
Note there is a table sort library for GWT as well: http://code.google.com/p/gwt-advanced-table/
GWT contains several unique features which make it difficult to be compared with other frameworks. The key point is that GWT isn't just a framework or library -- it's a toolkit. Consider:
Ability to use Java IDE's and debugger during development
Automatic generation of compiled scripts optimized for different browsers
Benefits of java for organization of code-base: OOP, package system, checked exceptions, compile-time type-checking etc.
These features make GWT suitable for big projects built by large teams that should be enhanced and maintained over a large time-frame. Off course, many projects do not have such requirements and therefore developers should give more weight to other consideration like widget library and learning curve.

WYSIWYG GUI builder (IDE) for JQuery or other JavaScript framework? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 7 years ago.
Improve this question
Are there any IDE's that allow building of web pages / user interface using javascript frameworks such as JQuery in a WYSIWYG manner?
For example, similar to how Dreamweaver allows you to build HTML pages or NetBeans allows you to graphically design Java applications, Flash Builder can graphically design flash applications.
I would think by now there is something that would let you plug in a javascript framework such as JQuery/JQueryUI or YUI or Prototype, etc. and for example drag in a JQueryUI styled button and position it and size it. Throw on some JQuery fields or a datagrid?
Update:
I have found a couple, so I am sure there must be more:
Sencha Ext Designer (commercial) -- supports the ext js framework, JQuery/Prototype and others.
Maquetta (open source) -- supports Dojo, some Jquery/YUI
Wakanda (open source) -- very interesting, looks like their own JS framework. May require the use of their back-end server for db, etc.?
For jQuery UI
IxEdit is a JavaScript-based interaction design tool
This works with jQuery Mobile only: RIB
Dreamweaver 5.5 allows you to access to all jQuery library features.
There is Alpha Five as well, but this is only applicable if you are building a database application. Wicked product.
Wakanda v1 is out (beta phase is over).
Codiqa (https://codiqa.com/) a SAAS GUI builder, HTML5/jQuery UI.
To create a GUI with jQuery UI widgets you can take a look here: http://umyproto.com.
Widgets are placed in the page by drag and drop, also you can write JavaScript for events, and finally you will have a bunch of HTML files which you can use in your code of an application.
it's really exciting, try it - you'll find a lot more for you.
There's Google's GWT Designer (for GWT) and Atlas (for Cappuccino). Simpler, more Web-centric UI frameworks don't really lend themselves to a GUI designer, in my opinion, but some apps probably try to do it anyway.
Hey have you listen about linb visualjs. it works great with all server side languages with over 40 components with drag and drop and it is open source also with a good example book.
but you must know how to use JSON because it is totally based on JSON.
But good news is JSON is nothing but Javascript Array.

Categories