What's the difference between toolkits and frameworks? Do you know a good comparison?
If I had to make a distinction, then I'd say a toolkit provides specific tools to do specific jobs, whereas a framework provides you with a foundation on which to build further, higher-level structures.
Tools are useful on their own, frameworks have no innate function.
jQuery, prototype, Yahoo! User Interface, MooTools, dojo, and ExtJS will have you working with very solid code.
Other posibilities that I can't vouch for myself: QooxDoo
I believe he's looking for a comparison of the javascript libraries/toolkits(whatever they happen to call themselves).
The names say it all really, a toolkit is a set of tools that you can use however you wish. A framework is an empty frame that you can fill in to form your application. The line between them is blurry though a framework contains tools, and a toolkit sometimes forces you to perform actions in a specific sequence.
I wouldn't know of a generic comparison, i guess it depends on the toolkits and frameworks themselves.
Not Specific to AJAX though. But a have a read..
What is the difference between a framework and a library?
A toolkit provides the basic, minimum building blocks for building something. A framework already has an approach laid for your. A framework defines the application architecture for you (most of the times), where a toolkit only gives you the tools, so you define your own architecture.
For example, GWT(Google Web Tookit) is a toolkit; it does not impose a certain way of doing things, the Java JDK is also a toolkit (Java Developer's Kit), but Rails (from Ruby on Rails) is a framework. It encourages the use of their worflow and classes (MVC, share-nothing, etc).
A toolkit is like a library. You pull it into your application and you use it. A framework provides a structure to your application, so all of your code goes inside of it. The strength of a framework is that by following it's conventions and staying inside of its process it is capable of doing a lot of heavy lifting for you. A toolkit is more flexible, but there are many types of problems that are better solved by a framework. With Ajax, it is a little harder to define. For example, simple widgets and dom manipulation can be done in a toolkit style, but if all of your javascript uses special event wrappers and framework based class functionality and inheritence, all of your code becomes dependent on that framework and is really contained inside of it.
Related
I'm new at programming in Julia and I need to create a GUI.
I've been looking for information and I can't find anything useful. I tried to search information in the Julia official web page, but it seems to be down. I wonder if any of you guys knows where I can find information about it.
This is quite a generic question, but I'll try and layout the environment so that you can make an informed decision based on your needs. You might want to check out this article on 6 Julia Frameworks to Create Desktop GUI’s 🖥 and Web Apps.
If you are developing your code within an [Jupyter/IJulia] notebook, and need very simple interaction, such as a slider to change some input values, the Interact package is the easiest thing to get started with.
To develop full-fledged web UIs, take a look at Escher. Inspired by the Elm, it provides a functional library of UI components. Interactive web UIs are created in 100% Julia. There is no differentiation in code between the client and server sides. The framework handles all of that.
Another web framework worth looking at is Genie, which is based on the traditional MVC design pattern. It also includes an ORM.
Stipple is a reactive UI library for building interactive data applications in pure Julia. It uses Genie.jl (on the server-side) and Vue.js (on the client).
Dash ties modern UI elements like dropdowns, sliders, and graphs directly to your analytical Julia code.
All the above solutions are for creating web user interfaces, accessed via a browser. If you want to create cross-platform desktop apps, but want to work with web technologies (i.e. HTML/CSS/Javascript), use Blink. This is a Julia wrapper around the Electron. You could potentially write a Dash or Stipple application, and wrap it in Blink.jl to create a desktop app.
To create desktop UI applications using the Gtk library, use the Gtk.jl package in Julia. If you are familiar with the Gtk API, it is easy to get started. Note however that there are some significant known issues running GTK.jl on Windows.
If your UI framework of choice is QT, a Julia binding is available via QML.jl
If you are happy painting the buffer yourself and just want a window to render the pixels on the screen, then there is nothing simpler than MiniFB. Note however that this does not give you a widget library -- you are responsible for drawing each and every pixel yourself.
ClmGui.jl is a Julia wrapper around the immediate mode GUI toolkit known as Dear ImGui
And last, but not the least, the venerable Tk framework has a wrapper in Julia. The UI's created using TK are sometimes considered ugly compared with modern aesthetics, but sometimes this is the quickest way to get a window up.
[Edited Jan 2022]
QML.jl
https://github.com/barche/QML.jl
The QML.jl package enables using the QML markup language from the Qt library to build graphical user interfaces for Julia programs. The package follows the recommended Qt practices and promotes separation between the GUI code and application logic. All user-facing code is pure Julia and QML, no C++ knowledge is required to use the package.
There is a new package called Genie. It is a web framework comparable with Django in python. You can create web ui using Genie. Until now (Aug. 2017), the package is functional with some nice demos, the documentation is not quite complete though.
Firefox provides XPCOM API interface for writing add-on classes in C++ and allow third-party web applications to access them. I'm wondering - is there any other way of achieving these benefits (i.e. write an add-on in C++ and provide a JavaScript interface, so any JavaScript app can use this interface and eventually C++ class functionality)?
Yes, it is possible to write XPCOM components in C++ (or Javascript for that matter) and expose them to websites. You would register them in the JavaScript-global-property, JavaScript-global-constructor, etc. category or categories.
This stuff is generally not documented very well, if at all. If you'd like to know more about it, then read the code (e.g. on mxr).
But doing so is strongly discouraged for a lot of reasons:
It is very hard to ensure such things are actually secure and make it work reliable.
It is hard to control what website may actually use the new API. JavaScript-global-property and friends will be available to all websites!
Your add-on would be introducing new names into the global javascript namespace, which might clash with web site code. (Because of this, many new WebAPIs aren't introduced directly into the global namespace, but are made a property of navigator).
Due to these reasons, the addons.mozilla.org site will only accept add-ons using this mechanism as an exception to the rule and only when the author demonstrates that the use is required and without real alternatives.
MDN has a couple of articles regarding webpage-to-extension communication and vice versa you could use instead, e.g. "Interaction between privileged and non-privileged pages".
Also, it is discouraged to ship binary XPCOM components within extensions:
You'd need to re-compile your binaries against each Gecko version (every six weeks), because binary components are version tagged since Firefox 4.
Binary APIs/ABIs between (point) releases are not as stable as you would hope. Actually APIs/ABIs where inadvertently broken late in the game quite often, causing lots of unnecessary crashes for a lot of users, e.g. bug 828296.
The platform developers officially said binary components in extensions are a hassle.
Instead, you should try to use Javascript where possible, and/or create a normal binary library (.so, .dll, .dylib) with a C-API/ABI and use js-ctypes. You could implement your XPCOM components in javascript, which would then call into your library with js-ctypes.
AFAIK most add-ons switched to js-ctypes by now.
I was just thinking. C# has Winforms/WPF, Java has Swing and other frameworks, C++ has QT and so on; is it possible to create an application without using a Framework?
Putting aside the practicality of it, I'm just curious. How would one create an application that Just Works(tm) without needing external frameworks?
Two options come to mind:
Classical Win32 applications written in C. I don't know if standard Windows SDK API also counts as an "external framework" in your book, but that's as low as it gets.
DirectX/OpenGL games written from scratch with your own homebrew framework (not external, right?) There you get to do all the drawing yourself - although again, you use a pretty big library of primitive drawing functions.
If you want even less "framework", you'll have to code your own OS and drivers. :P
C# needs .NET Framework, not WinForms (which is an optional library used by some application). The same with Java.
Unmanaged (native) applications usually use some runtime library - the library of common functions. You can write a native application without any library - the compiler lets you do this, but you will need to (re)write lots of common functions, eg. for string manipulation etc..
Firstly, what is a framework?
Really a framework is just a bunch of code that is provided to you. You could, at least in theory, write the same code yourself. In that case you wouldn't be using a framework.
Your application can only do what the operating system allows it to do. Your program cannot directly manipulate the graphics card for example. So you have to use the APIs of your operating system in order to do anything.
So you are going to be calling into other code. (unless you write your own operating system). You will also being using another framework or api to get stuff done.
Yes. How: in the way that the frameworks you mentioned are implemented.
From a Windows point of view, you would register your window with Windows, then listen to window messages and react as required. Everything would be up to you - from drawing the window to building controls.
I don't see how Qt does the low level graphics work, in order to create its own custom GUI look/feel for each platform. Does it utilize each of the platforms APIs or something? I ask because I am really wondering how I could go about creating my own framework in order to make a custom GUI application with a unique graphical look.
"How does QT only use C++ to make custom GUIs for some many platforms?"
"Does it utilize each of the platforms APIs ... ?"
You answered your own question. It makes a common library for developers to write their applications with. The application developers write their application only once, not caring about platform specifics. Then, the library author puts out different versions of the library for each platform, which handles all the specific UI calls. This is called encapsulation:
http://en.wikipedia.org/wiki/Information_hiding#Encapsulation
If you were to write your own such library, you would need to figure out what is common between all of the platforms you target, or figure out what high-level concepts your application would need, and create that abstraction. Then, implement that abstraction for each of the platforms you wanted to support.
Edit:
Also see Juliano's comment. This seems like it might be closer to what you want to do, rather than the question you asked. I'd not re-do the work that Trolltech or the WxWidgets team or the Gtk guys or the Mono people did, if I could possibly avoid it.
The good people at Trolltech (now Nokia) write all the platform specific code for you. Only the interfaces to their library remains the same across platforms. You do have to make sure that you only use their classes and don't make any OS-specific calls.
If you want, you can modify the graphics and the handlers to extend the Qt library and create your own look and feel.
Your Qt application doesn't have to have the plain standard platform graphical look, but there are ways to design unique apps with Qt.
For instance, you can style your application with style sheets: http://doc.qt.io/qt-5/stylesheet.html, or even with a custom QStyle (which is not very easy): http://doc.qt.io/qt-5/qstyle.html
Qt Quick is a new technology we're introducing in the upcoming Qt 4.7 (check out the beta if you're interested). It allows you to easily define custom UI components from simple primitives, with custom animations, state transitions and other effects. See for example http://www.youtube.com/watch?v=8G4U7QWRajg.
I want to write a front-end to an application written in C/C++.
I use Solaris 10 and plan to port the application to some other architectures (Windows first).
I'd recommend taking a look at wxWidgets to provide some cross platform UI widgets that will work on Solaris and Windows.
Qt 4 is the best tool for this job. If you want to work with other languages, it also has bindings for Java and Python
On a Mac, this would be easy. The Cocoa API is great when programming in Objective C (which compiles fine with C/C++ files).
Otherwise the situation is a bit more grim. As for Rapid prototype, you might want to check the CodeGear (Borland/C++ Builder) tools. I think their VCL library is cross-platform.
Otherwise, you could interface with a scripting language like Ruby and use fantastic front end libraries like Shoes. Python also interfaces with wxWidgets to make writing cross-platform front ends easy. Keep in mind that this all requires taking time to make sure your C/C++ code can talk to the scripting language. This is not trivial, and the amount of effort required depends upon the style of your code base. (Oh my God.)
Lastly, you could just use wxWidgets itself. This might be your best bet since it requires no additional overhead than coding the UI itself. That said, C++ is not the greatest language for designing UIs.
And super lastly, consider writing a code generator that converts from say Shoes to whatever wxWidgets code is needed to generate the same Shoes app. That way you can do easier UI design but still get C++ code in the end. Likewise, you could code gen off of the Python/wxWidgets code. Then sell such a code generator. :-)
GTK-- and Glade.
Thats' the C++ bindings on GTK
GTK will work on windows ( just look at GIMP )
Works everywhere, no QT license to mess with your millions-making.
I use wxWidgets myself. It makes good use of the C++ language features and uses smart pointers, so object and memory management is not that hard. In fact, it feels like writing in a scripting language.
Coupled with a dialog editor/code generator like wxFormBuilder or wxDesigner, (links to screenshots) it becomes a good toolkit for rapid development.
Have a look at FLTK which supports X11 and Windows.
Ultimate++ is a cross platform rapid application development framework for C++. It is aimed specifically at rapid development. The Ultimate++ website provides some comparisons to other frameworks mentioned such as Qt and wxWidgets.
I have used ASP.NET Web Forms to make UI front-end to collection of command line application written in legacy language, RESTful-ish web service, and bash scripts.
Once it works on Firefox, it should work at least on Firefox on other architecture. If you haven't played around with it, you should give ASP.NET a try (ASP.NET MVC seems to be the current trend). Not quite the same as RAD, but it does give you visual design of forms etc.