Creating a Web Language

Started by
15 comments, last by MortusMaximus 12 years, 11 months ago
I would like to make my own version of HTML.

I know this wont get popular nor is it a way to make money but I would like to do it for experience.
I would really like to learn more about Network programming, languages and interpreters.

Basically I want to be able to have a page like the following on a server and it display correctly in a Browser.

//Set the variables
// in this case a string called name to Waldo
-Var
str Name = "Waldo"
//Display Test "Where's Waldo"
-Text
"Where's" & Name
//Draw an image
-Image
picture.png


This is a project I seriously want to take on.
I can create this code in a LANG file and FTP it to a server.
(LANG being an extension I just made up)

All I need is to write a Firefox plugin to display the page.
Does anyone have any information about how to make such a plugin? Tutorials? Examples?

I do not want it to interface HTML at all. Basically get my page off the internet and my plugin (or program) draw it.

Any info would be helpful!

Thanks in advance!
If this post was helpful please +1 or like it !

Webstrand
Advertisement
Looks like Javascript to me. Where in your example are the variables/tags/keywords for the layout. Layout = HTML.

Beginner in Game Development?  Read here. And read here.

 


I would like to make my own version of HTML.


You don't need HTML at all. You want a configuration file served by a web server? That's done all the time. Some existing key/value data formats you may want to look at:

- JSON
- XML
- YAML

If none of those formats suit you, you can also define your own configuration file format. There's nothing stopping you from doing that.

My question is: What is your problem? Make a file, put it on a server, download it from clients -- are you having any problems with any of those parts?
enum Bool { True, False, FileNotFound };

My question is: What is your problem? Make a file, put it on a server, download it from clients -- are you having any problems with any of those parts?
[/quote]


//Set the variables
// in this case a string called name to Waldo
-Var
str Name = "Waldo"
//Display Test "Where's Waldo"
-Text
"Where's" & Name
//Draw an image
-Image
picture.png


Maby I didn't explain well.

I want to write a plugin that will be able to receive the data above, and instead of outputtin it do the following:
Create a string
Write the text on the webpage
Draw an image.

All without any already existing language.
If this post was helpful please +1 or like it !

Webstrand
Would you like to view that in an existing browser, or would you make your own client for viewing?

I would like to make my own version of HTML.

I know this wont get popular nor is it a way to make money but I would like to do it for experience.
I would really like to learn more about Network programming, languages and interpreters.

Basically I want to be able to have a page like the following on a server and it display correctly in a Browser.

//Set the variables
// in this case a string called name to Waldo
-Var
str Name = "Waldo"
//Display Test "Where's Waldo"
-Text
"Where's" & Name
//Draw an image
-Image
picture.png



Just going to point out that what you are trying to do has nothing to do with Network Programming. And everything to do with languages and interpreters. HTML is just a markup language that allows you to configure how you display data. Its no different than having a doc file or pdf file (except for the javascript part). You may be asking for help in the wrong forum.

If you want to build an actual Firefox plugin Google can help you with that. Here is a tutorial i found via simple google search.
http://colonelpanic....lugin-part-one/
http://colonelpanic....lugin-part-two/
http://colonelpanic....gin-part-three/
(a firefox extension might be easier, instead of converting your language to pixels you'll be converting it to HTML)

I hope you realize that building the plugin (or extension) is the trivial part. The hard part is actually building the interpreter (depending on which libraries you use).

Overall this exercise will not make you a better network programmer. All you are going to learn is how to create a language and interpret it. If that is what you want to learn, then thats fine.
Would you like to view that in an existing browser, or would you make your own client for viewing? [/quote]
I know making my own would be alot easier but I would like it to be viewable in an existing client, like firefox.


[quote name='coderWalker' timestamp='1305307770' post='4810326']
I would like to make my own version of HTML.

I know this wont get popular nor is it a way to make money but I would like to do it for experience.
I would really like to learn more about Network programming, languages and interpreters.

Basically I want to be able to have a page like the following on a server and it display correctly in a Browser.

//Set the variables
// in this case a string called name to Waldo
-Var
str Name = "Waldo"
//Display Test "Where's Waldo"
-Text
"Where's" & Name
//Draw an image
-Image
picture.png



Just going to point out that what you are trying to do has nothing to do with Network Programming. And everything to do with languages and interpreters. HTML is just a markup language that allows you to configure how you display data. Its no different than having a doc file or pdf file (except for the javascript part). You may be asking for help in the wrong forum.

If you want to build an actual Firefox plugin Google can help you with that. Here is a tutorial i found via simple google search.
http://colonelpanic....lugin-part-one/
http://colonelpanic....lugin-part-two/
http://colonelpanic....gin-part-three/
(a firefox extension might be easier, instead of converting your language to pixels you'll be converting it to HTML)

I hope you realize that building the plugin (or extension) is the trivial part. The hard part is actually building the interpreter (depending on which libraries you use).

Overall this exercise will not make you a better network programmer. All you are going to learn is how to create a language and interpret it. If that is what you want to learn, then thats fine.
[/quote]

Yes, Creating a language and interpreter is the main part I want to learn about.
I guess this would be more like flash than HTML, because I do not want it to convert down to HTML.

Would the plugin need to do everything, or would I need a plugin that runs my "flash" program and returns an image?
How does this work?
If this post was helpful please +1 or like it !

Webstrand
Now, you might be anxious to get things running in Firefox, but sit down with your favourite language, and either use an existing scanner to retreive the source file or make your own.
(I figure you could just use http when the time comes). The important thing now is to parse the lines and create an immediate representation; a hierarchical OO-version of the stuff that was just parsed.

Make some sort of output function that shows the IR structure.

When your language and the parser is done, worrying about making a firefox plugin will be the next step. :)

But for starters, you can actually enjoy planning the syntactical rules and programming a parser. - neat, huh? ;)
Hello codeWalker!

Most of what I'm going to say has already been mentioned, but maybe my own explaination might still help you.
So, what you're talking about are actually three separate problems:

- Networking (Transfer of the file from the server to the client)
- Language Parsing (Reading and interpreting the content of the file, loading it into an appropriate data structure)
- Layout Rendering (Bringing the content of the file onto the screen in the way that you devised)

These parts all work together to create what the web is about, but from the technical point of view, they have nothing to do with each other.

If you want to learn how it all works, I suggest that you begin with the last part, the layout rendering. IMHO this is the most interesting (but also the most difficult) task. It is the field where the most improvements are achieved these days in web technology (Well, that's not really true. Currently, the hot thing is inventing a new 60% faster JavaScript interpreter every three weeks or so, but rendering improvements have dominated the browser dev world for many years before and - if you ask me - are much more important than creating even faster and faster JS engines). The other two aspects are pretty much settled: For networking, there's HTTP (and all the underlying protocols), and for parsing, there's XML. These are standards, and all browsers do them in the same way (That's another lie: HTML and how it is parsed by browsers is, in most cases, *not* based on XML, but it's similar and the difference doesn't really matter here). If you don't know about XML yet: It's a "meta-language" that defines a syntax similar to HTML, but allows you to invent your own tags and attributes. The big advantage of XML is that you can use existing parser libraries to read it, but still have the freedom to create your own language.

Having said that, I recommend you to pick up some library that does HTTP networking, another one that does XML parsing, and finally one for graphics output (like SDL). Then, invent a XML-based language and try to write your own browser for it. For the beginning, you could as well leave out the HTTP networking part and simply load the file from local hard disk.

Would the plugin need to do everything, or would I need a plugin that runs my "flash" program and returns an image?
How does this work?


I don't know, since I've never written a browser plugin. This is why I pointed you to tutorials that can help you figure that out. My best guess is that the browser provides you some sort of rendering context into which you can render.

This topic is closed to new replies.

Advertisement