LUA/MO/DL Browser Project


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 5 of 5

Thread: LUA/MO/DL Browser Project

  1. #1
    Join Date
    Feb 2005
    Posts
    4

    Post LUA/MO/DL Browser Project

    Before I tell you anything at all, I have to mention that I'm not a coder, but a designer. I currently study IT and I'm trying to learn C/C++, and java is even more interesting, but the fact remains that I'm a designer, it can be quite difficult for me to code, I'm the person who comes up with good ideas, develops them and then searches for people to help.

    Well then, with that out of my way, I'll go straight to the core. When I create web site, I use a not so usual style, I ONLY use <div> and CSS. The web site that I'm working on right now is the last site of mine that uses <div>, <img>, <a>, and CSS. This whole idea of a LUA/MO/DL browser (I'll tell you what that means a bit later ^-^) came from this unusual style of creating web sites. Since I only used <div>, <img>, <a>, and CSS, I became interested in creating a new markup language, one with only those four elements in it, and I called it MO, Minimal Objective. I asked around in forums how difficult it would be to create a markup language and an interpreter/browser for it. To my disappointment, it was far more complex and time consuming than I had expected, and noone was interested in helping me with the language either, so I gave up on the idea of MO.

    Only 3 weeks ago I came up with an idea that I found really good, I would use PHP to create my language. I had read that you could practically create your own language using XNL, but I've never like XML and it all seemed so messy and unpractical that I gave up on the idea, but PHP really made me interested. So, using a lot of functions I soon had a small language where I could write:

    image(image,40,40,$__images_dir.'image.png');
    -->image(id,width,height,url)

    which would then be translated to HTML. I like this very much, it made the source code cleaner and smaller, and it was simply cool to have your own language, even if not a true language but only heavy use of functions in PHP (^-^).

    Well, as I mentioned earlier, I soon dropped <img>, and later also <a>, so I was left with only <div>, which gave me my next idea, DL, Dynamic Layer. I still used <div>, <img>, <a>, and CSS for my web sites, but I had been working on MO, and now I started working on DL, so that I could later move over to using it for my web sites. DL also used PHP, but this time I used PHP only, I didn't even use css, everything was written in PHP, which would then be translated to HTML and CSS. This was even more interesting, and a whole lot more fun (^-^)! I have wanted to know programming for quite many years, but I've never really managed to learn anything, just simple stuff, so it was really fun to work with both MO and DL, it wasn't real coding, but it was still fun (^-^), it felt like real coding (^O^).

    Well, the next step was when I started wondering wether it would work with LUA. PHP is nice, but it's server side, and not as small and fast as LUA, so I started looking into this. Using LUA to create HTML/CSS web sites turned out to be just as simple as using PHP, but with one problem, LUA wasn't supported by any browser as a client-side scripting language. So, as I use Firefox, I tried to make an extension for FF so that it would be able to use LUA as a client-side scripting language, but that proved to be diffidult for me. A few people helped me a bit over at irc.mozilla.org/#mozilla but I still didn't manage to create the extension. This made a bit sad, but I didn't stop working with LUA.

    What happend next was the simple result of wanting to create my own language and being upset with how complex FF was (as if it wasn't enough that XML & XUL really was a mess, the FF API was also complex).

    The idea originated from my use of only the <div> element to create web sites. My idea was to create a browser in Java that would use LUA as its markup language instead of HTML & CSS, and that it would be customisable like FF, but in a different way. The idea was that when you start the browser you would only see a white screen, completely empty, not even a titlebar, only an initialised Java window, and a small linux like console window. The main idea was that the user should be able to create her/his own browser, using MO and DL. MO&DL weren't the same languages anymore, but MO had become the language to control and create the browser, and DL became the very core of the browser, the language that you used to give the browser a interface, and also the markup language for the web sites. The empty Java screen was not actually empty, it just had nothing to show, this Java screen was like the window in any browser that displays the HTML content. Are you starting to get the point (^-^)? In Mozilla you can use XUL to control the behaviour and look of the browser, in my java browser, the webpage and the look of the browser are the same things. However, it's far from as detailed and advanced as the use of XUL in Mozilla, but I still think MO/DL is far better, because of it's simplicity, you really don't need much to create extremely nice a webpage/gui.

    Of course, by default the browser would have a nice and clean gui, but the best and most entertaining thing would be to create a new profile and start from scratch. So, by using a lot of global commands & functions, MO, and DL, you would be able to shape every part of the browser's gui. One of the first things you would do could be to create a dl layer to use a titlebar by writing this into the console:

    cmd: make dl(titlebar)
    *syntax: make element(id)

    this would create an empty dl layer, and next you'd need to place it in the top of the screen and add some other properties.

    cmd: add(1)>> titlebar{position=top width=100% height=20px background=0,0,0 layer=0}
    *syntax: add(x/id)>> - add to line x, or into specified dl layer

    DL uses something very similar to CSS.

    This would place the dl layer, in the top of the screen, and it would be 100% in width and 20px in height, and it would have a black background (DL uses only rgb for colours), and layer is the same as z-inde, and 0 means the topmost layer. If adding to an element, "add" adds the code to the end of the element, to delete any previously entered code you would simply use "add(id)!>".

    Next you could add a dl layer that displays the title of the document, and three other dl layers that function as minimize, maximize, and close buttons. Since both MO&DL are basically just LUA, all variables are global, so to display the title you wouldn't need to write anything else but "print(document.title)", and to make the buttons work you would use the global functions: __minimize(), __maximize(), and __exit(), and add this to the style for the dl layers: onClick{__minimize()} and the other functions for respective dl layer.

    All that these commands have done is to write code to the default page the browser opens on startup, "default.lua" and updating the java screen to display the changes.

    The user can create any gui s/he likes by simply editing the default web page. Either through the console, or by opening the document in notepad or any other text editor.

    All MO&DL documents can contain info on what the browser should look like, so to prevent that the gui changes every time the user visits a new web site (the sites don't need to have though), s/he can simply make a dl layer:

    make dl(container)
    add(2)>> container{width=100% height=100% scrollbars=true url=hompage)}
    add(container)>> homepage='http://www.google.com/'

    and to be able to type the address we need an addressbar:

    make dl(addressbar)
    add(3)>> addressbar{width=100% height=24px}
    add(addressbar)>> dl(input_url)
    add(4)>> input_url{height=22px input=normal,url onSend(homepage,url)}
    add(5)>> preserve_gui = true
    add(6)>> //always add an empty line to the end of the document

    By giving the dl layer an input property it automatically becomes an input text field, and onSend is when you press enter. The screen is always updated on send, and now the homepage variable is set to the url entered in the addressbar, and thus displayed instead of the default web page which was google. The preserve_gui set to true simply ignores any code that would change the gui, and it also prompts the user if s/he wants to visit the current web page every time it notices gui code in the web page.

    That's should give the basic idea of what this browser would be like (^-^), and I'm just as sure that there by now are a lot of people that think I'm completely insane (^.^). Well, as I mention earlier, I'm a designer, and although I'd love to be able to code all this myself, what I enjoy the most is to get to design the browser and the languages. As I mentioned earlier, the language used in the web pages is LUA, and the browser uses the LUA bins to translate into java or send necessary code to the program. So the code dl(layer1) would send the appropriate command to the java program to display an empty dl layer and give it the id "layer1". LUA is available to linux/mac/win, so this wouldn't be a problem.

    Anyway, what I want to ask you after telling you this, is how difficult do you think it would be to create this? The dl layer basically behaves like the div layer (especially in position and dimension) so at one point I thought of using parts of the XBrowser code to create this. The java program would simply just need to be able to display the web page, communicate with lua, and have that small console...to put it very simply (^-^).

    If you have any comments or question, just ask. I'm also looking for someone who would be willing to try to create something like this, as I only do the design part (^-^). This really isn't an attempt to create a new standard or anything, just a personal hobby, sort of, so I can't promise you any money or fame (^-^), just the pleasure of working on this project. I know this is very ambitious, so my expectations aren't very high, but it would be so fun to have this made (^-^)

  2. #2
    Join Date
    Feb 2005
    Posts
    4
    I should also mention that this project is in a VEEEERY early stage, I'm far from finnished with the reference, and I could also use some help with that (^-^)

  3. #3
    Join Date
    Feb 2005
    Posts
    4
    **** it! lot's of mistakes in that post, well, this is what the code would look like:

    homepage = 'http://www.google.com/'
    preserve_gui = 'true'

    titlebar = {position='top',width='100pc',height='20px',background=000,layer=0}
    addrssbar = {width='100pc',height='24px'}
    input_url = {width='100pc',height='22px',input='normal',send='url',onSend=set(homepage,url)}
    container = {width='100pc',height='100pc',scrollbars='true',url=homepage}

    dl(titlebar)
    endl(titlebar)

    dl(addressbar)
    dl(input_url)
    endl(input_url)
    endl(addressbar)

    dl(container)
    endl(container)

  4. #4
    Join Date
    Feb 2005
    Posts
    4
    crap !! it's way too much, forget it...I'm just goig to use HTML and make the browser myself, I have Netbeans and JBuildre so I should manage.

  5. #5
    Join Date
    Nov 2004
    Location
    Norway
    Posts
    1,560
    May the Force be with you
    eschew obfuscation

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center