User Interface Markup Language pros and cons - xul

I learnt about some declarative UI languages such as XUL for Mozilla/Gecko and HTA for Microsoft at Wikipedia.
What would be the
advantages/disadvantages of these
markup languages?
Why don't common OSes and
Applications use these techniques?
Do these languages impart flexibility
to the system?
Are there any OSes that use markup
languages for displaying their UI if
not why?...
Examples of these OSes
or Applications however ancient they may be would be welcome..

HTA isn't a markup language. It's basically a container for HTML, which is the markup.
The web is driven around markup languages, so "common" applications do use them.
This is a good place to start reading. Also this.
You might also be interested in Metaprogramming. There's similar ideas to both. You describe something using markup or metadata, and then the program executes it and turns it into something useful.
Many of your questions will be answered in-depth at those links. Except for the last one. I can't think of anything specific on the OS side.
The long and short of my personal experience is that markup is great for defining structures and organization and layout. But behavior isn't well represented. If you want your UI to do something useful, you still need to program it.

Are there any OSes that use markup languages for displaying their UI
The ISPF was a rapid application development system on IBM mainframes which used a declarative markup to define the screens, then Fortran or Cobol code behind it to provide behaviour. One previous job of mine was converting such applications to an XUL based front-end to run on a PC; it was a fairly trivial conversion.

Re #2: I don't know, but I think it's for performance reasons, you couldn't waste time parsing XML on a 486 :)
Re #4: yes, if you count Linux as an OS, GTK uses some kind of markup language for UI. Also XAML in .NET.

Related

Admin Dashboard UI Kits

I am interested in taking up a learning path which would include web application development using Dashboard Admin UI Kits such as these Link to example
What application and or languages are used when implementing such a
UI ?
What databases are to be used in the backend?
For the UI:
Languages are always the same: HTML, CSS, JavaScript. Yet, they have countless libraries.
For CSS, I would check Bootstrap (or Bulma if you want slightly less pain), which is a simpler but richer one compared to many others.
For JS, I would check some animation libraries (there are many), and probably not start with any JS framework such as React, Angular etc. They might come later once you feel comfortable with JavaScript.
For HTML, you already have dashboard kit already. Though a great idea for learning, but as far as I know using templates is not a common practice for bigger companies etc.
For the backend:
It really depends on what you want to focus more on. Programming languages have advantages and disadvantages. You can work with (almost) any language but increasingly more popular ones are Node.js, Django (Python's popular web framework) etc. For beginning, these two are nice options. Node.js is also closely related to JavaScript, so that is a big plus.
For the database:
You might want to check if you need relational data or not, because that might narrow down your options. MongoDB is easy to learn and to get the basics of backend programming, while SQL (PostgreSQL is a nice example) is a widely preferred SQL option one in the industry.

Patterns or recommendations for GUI APIs

We know things like buttons and panels are common to most languages, but are there any officially recognized and used recommendations or patterns for GUI APIs? (say, something from W3C maybe?)
I don't think there is a collection of what you are looking for. But in each of the frameworks you will probably find patterns that are applicable. Some might be specific to the runtime architecture that the API is built for but some are fairly general like MVC, Delegation or Decorator. Here are some links I know to appropriate architecture documents
Apple, Cocoa
Qt, General, Model-View Programming
Java, Swing (I don't know how old this is, haven't done anything using swing lately)
I have used a lot GUI frameworks over the last years and I still like the architecture that went into cocoa, it is one frameworks that implements guis in a very object oriented way. Most of the paradigms are applied consistently and repeatedly so that usually if you have figured out a way how to do things it will usually carry over to somewhere else.
I doesn't think there is any official and formal patterns from standard bodies. But there is a UI pattern catalog here. Yahoo also maintains a UI pattern library.
UI design is imho an art -- there's some "do this, don't do that", but not much.
Nonetheless designing-a-gui on SO
has some practical advice.
"Officially recognized": try Microsoft ?

Multiple Language IDE

I've been using Notepad++ for years and although it is comfortable I am feeling the need to move up into the IDE world for various reasons, which I'll outline below. I am looking for IDE recommendations for someone who works in multiple languages on a daily basis - I am currently looking at Eclipse and Netbeans but willing to consider any option.
The reason I have not made the switch to a full-fledged IDE yet is because they feel so bloated, they are slow to load and eat up a ton of memory. Recently, I have been working on an astronomical number of projects (5-6 at work, upwards of 10 personally) in a variety of languages (Python, PHP, Ruby, Java, Javascript, xHTML, CSS, TorqueScript to name a few). These are just the languages I am using on a daily basis - although I don't expect to find an IDE that will meet all the demands of these languages (especially the more obscure TorqueScript on the list).
So, what would you recommend for someone who needs a fast, configurable IDE that offers support for a variety of languages, syntax highlighting (preferably with various color schemes), project organization/browsing, Intellisense-ish code completion?
I forgot to mention I am primarily targetting the Windows environment here - when I'm on my Xubuntu machine (minimally) Geany works fine for what I need to accomplish.
I would recommend Eclipse as the closest match for the multi-language requirements. There are IDEs that possibly shine better for a given language (e.g. I prefer IntelliJ for Java), but none that have such a broad coverage of multiple languages.
As far as memory/bloat, it's a price you pay for the convenience that an IDE provides.
The Zeus IDE is pretty much language neutral, meaning it can be easily configured to work with almost any programming language.
It also has a lot of IDE like features (i.e project/workspace management, class browsing etc), yet still feels snappy and responsive like a light weight text editor.
Eclipse is kind of the Swiss Army knife of the programming world... With plugins, it'll handle pretty much any language you throw at it.
Well, Netbeans covers Java, Ruby and PHP which are on your list. It's definitely a bit bloated though, and I understand your pain there.
Emacs.
Seriously.
With those requirements, the closest you're going to get is Eclipse.
You might also want to check out SlickEdit. It won't offer you all of the features you are looking for, but it should be a hell of a lot faster than working through Eclipse.
Have you ever tried a web based one? Koding covers a whole pool of languages and above all that you get a free VM with root access. Definitely worth checking out.

When is it good to use embedded script language like Lua

I'm playing WoW for about 2 years and I was quite curious about Lua which is used to write addons. Since what I've read so far about Lua was "fast", "light" and "this is great", I was wondering how and when to use it.
What is the typical situation where you will need to embed a script language like Lua in a system ?
When you need end users to be able to define/change the system without requiring the system to rewritten. It's used in games to allow extensions or to allow the main game engine to remain unchanged, while allow content to be changed.
Embedded scripting languages work well for storing configuration information as well. Last I checked, the Mozilla family all use JavaScript for their config information.
Next up, they are great for developing plugins. You can create a custom API to expose to the plugin developers, and the plugin developers gain a lot of freedom from having an entire language to work with.
Another is when flat files aren't expressive enough. If you want to write data driven apps where behavior is parameterized, you'll get really tired of long strings of conditionals testing for config combinations. When this happens, you're better off writing the rules AND their evaluation into your config.
This topic gets some coverage in the book Pragramtic Programmer.
Lua is:
Lightweight
Easy to integrate, even in an asynchronized environment such as a game
Easy to learn for non-programmer staff such as integrators, designers and artists
Since games usually require all those qualities, Lua is mostly used there. Other sitation could be any application that needs some scripting functionality, but developers often opt for a little more heavy weight solution such as .Net or python.
In addition to the scripting and configurability cases mentioned, I would simply state that Lua+C (or Lua+C++) is a perfect match for any software development. It allows one to make an engine/usage interface where engine is done in C/C++ and the behaviour or customization done in Lua.
OS X Cocoa has Objective-C (C and Smalltalk amalgam, where language changes by the line). I find Lua+C similar, only the language changes by a source file, which to me is a better abstraction.
The reasons why you would not want to use Lua are also noteworthy. Because it hardly has a good debugger. Then again, people hardly seem to need one either. :)
a scripting language like Lua can also be used if you have to change code (with immediate effect) while the application is running. one may not see this in wow, because as far as i remember the code is loaded at the start (and not rechecked and reloaded while running).
but think of another example: webserver and scripting language - (thankfully) you can change your php code without having to recompile apache or restart apache.
steve yegge did that thing for his own mmorpg engine powering wyvern, using jython or rhino and javascript (can't remember). he wrote the core engine in java, but the program logic in python/javascript.
the effect of this is:
he doesn't have to restart the core engine when changing the scripts, because that would disconnect all the players
he can let others do the simpler programming like defining new items and monsters without exposing all the critical code to them
sandboxing: if an error happens inside the script, you may be able to handle it gracefully without endangering the surrounding application
Rapid development for application with real-time constraints. Computer games are one of these ;-)
It's a valid solution if you want to allow third parties to develop plug-ins or mods for your software.
You could implement an API in whatever language you are using, but a script language like LUA tends to be more simple and accessible for casual developers.
In addition to all the excellent reasons mentioned by others, Embedding Lua in C is very helpful when you need to manipulate text, work with files, or just need a higher level language. Lua has lots of nifty feature (Tables, functions are first class values, lots of other good stuff). Also, while lua isn't as fast as C or C++, it's pretty quick for an interpreted language.

Which scripting language to support in an existing codebase?

I'm looking at adding scripting functionality to an existing codebase and am weighing up the pros/cons of various packages. Lua is probably the most obvious choice, but I was wondering if people have any other suggestions based on their experience.
Scripts will be triggered upon certain events and may stay resident for a period of time. For example upon startup a script may define several options which the program presents to the user as a number of buttons. Upon selecting one of these buttons the program will notify the script where further events may occur.
These are the only real requirements;
Must be a cross-platform library that is compilable from source
Scripts must be able to call registered code-side functions
Code must be able to call script-side functions
Be used within a C/C++ codebase.
Based on my own experience:
Python. IMHO this is a good choice. We have a pretty big code base with a lot of users and they like it a lot.
Ruby. There are some really nice apps such as Google Sketchup that use this. I wrote a Sketchup plugin and thought it was pretty nice.
Tcl. This is the old-school embeddable scripting language of choice, but it doesn't have a lot of momentum these days. It's high quality though, they use it on the Hubble Space Telescope!
Lua. I've only done baby stuff with it but IIRC it only has a floating point numeric type, so make sure that's not a problem for the data you will be working with.
We're lucky to be living in the golden age of scripting, so it's hard to make a bad choice if you choose from any of the popular ones.
I have played around a little bit with Spidermonkey. It seems like it would at least be worth a look at in your situation. I have heard good things about Lua as well. The big argument for using a javascript scripting language is that a lot of developers know it already and would probably be more comfortable from the get go, whereas Lua most likely would have a bit of a learning curve.
I'm not completely positive but I think that spidermonkey your 4 requirements.
I've used Python extensively for this purpose and have never regretted it.
Lua is has the most straight-forward C API for binding into a code base that I've ever used. In fact, I usually quickly roll bindings for it by hand. Whereas, you often wouldn't consider doing so without a generator like swig for others. Also, it's typically faster and more light weight than the alternatives, and coroutines are a very useful feature that few other languages provide.
AngelScript
lets you call standard C functions and C++ methods with no need for proxy functions. The application simply registers the functions, objects, and methods that the scripts should be able to work with and nothing more has to be done with your code. The same functions used by the application internally can also be used by the scripting engine, which eliminates the need to duplicate functionality.
For the script writer the scripting language follows the widely known syntax of C/C++ (with minor changes), but without the need to worry about pointers and memory leaks.
The original question described Tcl to a "T".
Tcl was designed from the beginning to be an embedded scripting language. It has evolved to be a first class dynamic language in its own right but still is used all over the world as an embeded language. It is available under the BSD license so it is just about as free as it gets. It also compiles on pretty much any moden platform, and many not-so-modern. And not only does it work on desktop systems, there are variations available for mobile platforms.
Tcl excels as a "glue" language, where you can write performance-intensive functions in C while still benefiting from the advantages of a scripting language for less performance critical parts of the application.
Tcl also comes with a first class GUI toolkit (Tk) that is arguably one of the easiest cross platform GUI toolkits available. It also interfaces very nicely with SQLite and other databases, and has had built-in support for unicode for quite some time.
If the scripting interface will be made available to your customers (as opposed to simply enabling your own engineers to work at the scripting level), Tcl is extremely easy to learn as there are a total of only 12 rules that govern the entire language (as of tcl 8.6). In fact, Tcl shines as a way to invent domain specific languages which is often how it is used as an end-user scripting solution.
There were some excellent suggestions already, but I just wanted to mention that Perl can also be called / can call to C/C++.
You probably could use any modern scripting / bytecode language.
If you're willing to put up with the growing pains of a new product, you could use the Parrot VM. Which has support for many, if not all of the languages listed on this page. Unfortunately it's not done yet, but that hasn't stopped some people from using it in a production environment.
I think most people are probably mentioning the scripting language that they are most familiar with. From my perspective, Tcl was designed specifically to interface with C, so your problem domain is tailor-made for the language. However, I'm sure Python, Perl, or Lua would be fine. You should probably choose the language that is most familiar to your current team, since that will reduce the learning time.