Java-Gaming.org Hi !
Featured games (90)
games approved by the League of Dukes
Games in Showcase (774)
Games in Android Showcase (230)
games submitted by our members
Games in WIP (856)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  Really a Markup Language (RML)  (Read 15052 times)
0 Members and 1 Guest are viewing this topic.
Offline kingroka123
« Posted 2014-10-19 21:26:58 »

Hey JGO,

I've been working on this xml-ish scripting language and interpreter library thing.

GitHub Link Here


Purpose:
RML is a language that kinda looks like XML and it doesn't have any immediate purpose for the general programmer but I don't care because this project was really just for fun.

A simple script:


Features:
- functions
- doubles, booleans, and strings
- conditional statements
- printing to the console
- lists

To be Added:
- parameters for functions
- loops

FAQ:
1. Is this project Gluten free?
    A: no
2. Can I has recursive functions?
    A: yes
3. Can i create my own tags and commands with this library?
    A: yes
4. Download?
    A. no, I'll release a download when I get around to it.
Offline Ecumene

JGO Kernel


Medals: 197
Projects: 4
Exp: 8 years


I did not hit her! I did not!


« Reply #1 - Posted 2014-10-19 21:31:37 »

This has allot of potential... Seeing as its a universal data-driven language, with the simplicity of a mark-up language, it could fit anywhere...

Nice job OP!

Offline BurntPizza

« JGO Bitwise Duke »


Medals: 486
Exp: 7 years



« Reply #2 - Posted 2014-10-19 21:33:48 »

Not trying to bash (heh) but I'm not sure the particular brand of "readability of XML" is a desirable property for most.

Question: if functions don't yet take parameters, then what is print?
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Riven
Administrator

« JGO Overlord »


Medals: 1356
Projects: 4
Exp: 16 years


Hand over your head.


« Reply #3 - Posted 2014-10-19 21:45:11 »

Scripting is about convenience, when Java is too verbose or imposes too many rules. You went in the opposite direction.

Hi, appreciate more people! Σ ♥ = ¾
Learn how to award medals... and work your way up the social rankings!
Offline BurntPizza

« JGO Bitwise Duke »


Medals: 486
Exp: 7 years



« Reply #4 - Posted 2014-10-19 21:50:13 »

You should see if you can make it homoiconic, as a scripting language written in a markup language is the perfect opportunity for such.

Another question, as I am always curious about langs and their implementations, are recursive functions possible? Because that's an easy way to have loops.
Offline kingroka123
« Reply #5 - Posted 2014-10-19 22:07:00 »

Not trying to bash (heh) but I'm not sure the particular brand of "readability of XML" is a desirable property for most.

Question: if functions don't yet take parameters, then what is print?

Yeah I didn't really think so, this is more for me and my future projects. I just thought to share this in case anyone else was interested.

As for your question, the print tag is its own separate command not a parameter.

Scripting is about convenience, when Java is too verbose or imposes too many rules. You went in the opposite direction.

Yep. That's the point. RML is not about convenience at all, but readability. 
Offline Riven
Administrator

« JGO Overlord »


Medals: 1356
Projects: 4
Exp: 16 years


Hand over your head.


« Reply #6 - Posted 2014-10-19 22:09:06 »

I don't see how:
1  
<double name="index" value="500"/>

is more readable than:
1  
double index = 500;

Hi, appreciate more people! Σ ♥ = ¾
Learn how to award medals... and work your way up the social rankings!
Offline ags1

JGO Kernel


Medals: 367
Projects: 7


Make code not war!


« Reply #7 - Posted 2014-10-19 22:13:39 »

I've used a language like this before, but only because I was paid to :-)

Offline CopyableCougar4
« Reply #8 - Posted 2014-10-19 22:24:13 »

The below example would be more of what I would want in a scripting language if I used one Smiley

1  
2  
3  
4  
5  
6  
7  
8  
func main(args[]):
    index = 500
    line = "Condition is true"
    bool = false
    func test():
        if [bool] print line
    done
done


CopyableCougar4

Either wandering the forum or programming. Most likely the latter Smiley

Github: http://github.com/CopyableCougar4
Offline BurntPizza

« JGO Bitwise Duke »


Medals: 486
Exp: 7 years



« Reply #9 - Posted 2014-10-19 22:25:55 »

So... julia?
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline kingroka123
« Reply #10 - Posted 2014-10-20 00:21:02 »

I don't see how:
1  
<double name="index" value="500"/>

is more readable than:
1  
double index = 500;


I see, I didn't really think about it like that.

My Thought Process:
1. Java can be cluttered and confusing to read sometimes
    - I should fix that
2. What language is not cluttered and confusing most of the time?
    - Html-> XML
3. Make something that looks like xml yet functions like java
    - RML was born

 Maybe "readable" is the wrong word, would "clear" (or "overly clear") be a better word?

Also, recursion is possible with the latest commit.
Offline CopyableCougar4
« Reply #11 - Posted 2014-10-20 00:24:55 »

It's cool that you made this parser, but...

My honest thoughts:
It's cool to use as a fun thing for your own projects. However, there are so many languages out there that, while not being perfectly what people want, are close enough and abundant enough that creating a language that others will use (especially scripting) would be quite difficult (but not impossible).

CopyableCougar4

Either wandering the forum or programming. Most likely the latter Smiley

Github: http://github.com/CopyableCougar4
Offline basil_

« JGO Bitwise Duke »


Medals: 418
Exp: 13 years



« Reply #12 - Posted 2014-10-20 00:30:28 »

a markup language is not a programming language. they just share the word "language".
Offline BurntPizza

« JGO Bitwise Duke »


Medals: 486
Exp: 7 years



« Reply #13 - Posted 2014-10-20 00:31:04 »

2. What language is not cluttered and confusing most of the time?
    - Html-> XML

I think what we're trying to get at here is that most consider XML to be extremely cluttered.


creating a language that others will use (especially scripting) would be quite difficult (but not impossible).

Of course, but it seems this is another instance of the "I'm not re-inventing the wheel, I'm doing this for fun," which is a perfectly valid purpose for a project.
Offline CopyableCougar4
« Reply #14 - Posted 2014-10-20 00:32:43 »

Quote
Of course, but it seems this is another instance of the "I'm not re-inventing the wheel, I'm doing this for fun" which is a perfectly valid purpose for a project.

I know, and I think that's cool. My only point was that, due to the sheer abundance of languages that come close enough to satisfying the needs, this wouldn't be something that would be used by a large collection of people (no offense meant to the OP).

CopyableCougar4

Either wandering the forum or programming. Most likely the latter Smiley

Github: http://github.com/CopyableCougar4
Offline kingroka123
« Reply #15 - Posted 2014-10-20 00:47:34 »

2. What language is not cluttered and confusing most of the time?
    - Html-> XML
I think what we're trying to get at here is that most consider XML to be extremely cluttered.

And that's where the problem stems because I find xml to be the least cluttered out of all the languages I know and I guess I'm in the minority.
Offline EgonOlsen
« Reply #16 - Posted 2014-10-20 06:12:23 »

Wrapping actual code in XML isn't better to read and/or understand. If you think that, try to work with ColdFusion (http://en.wikipedia.org/wiki/Adobe_ColdFusion) for one day.

Offline cylab

JGO Kernel


Medals: 188



« Reply #17 - Posted 2014-10-20 06:22:14 »

Don't use @ in tag names since it would be impossible to use with XSLT.

Mathias - I Know What [you] Did Last Summer!
Offline princec

« JGO Spiffy Duke »


Medals: 1059
Projects: 3
Exp: 20 years


Eh? Who? What? ... Me?


« Reply #18 - Posted 2014-10-20 07:33:31 »

The only reason to describe code in XML is if you're going to transform it in some way (because XML is data, not code).

Cas Smiley

Offline ags1

JGO Kernel


Medals: 367
Projects: 7


Make code not war!


« Reply #19 - Posted 2014-10-20 10:22:14 »

Don't use @ in tag names since it would be impossible to use with XSLT.

Actually, it is not even well-formed XML... so it can't even be parsed. :-(

Offline kingroka123
« Reply #20 - Posted 2014-10-20 10:40:39 »

Okay how about this:
RML is a language that kinda looks like XML and it doesn't have any immediate purpose for the general programmer but I don't care because this project was really just for fun.
Offline kevglass

« JGO Spiffy Duke »


Medals: 319
Projects: 25
Exp: 22 years


Coder, Trainee Pixel Artist, Game Reviewer


« Reply #21 - Posted 2014-10-20 10:45:42 »

PERFECT!

Cheers,

Kev

Offline kingroka123
« Reply #22 - Posted 2014-11-03 03:07:10 »

Thinking about making a syntax change:
1  
2  
3  
4  
5  
6  
7  
8  
9  
rml(class:Main){
   func(name:$main){
      double(name:hello, value:10);
      @var(name:hello, set:30);
      print(){
         Hello World
      }
   }
}


Any suggestions?
Offline CopyableCougar4
« Reply #23 - Posted 2014-11-03 03:10:03 »

I like a syntax more like:

1  
2  
3  
4  
5  
6  
7  
class Main {
  $hello = 10;
  function main() {
    $hello = 30;
    print "Hello World";
  }
}


For example, I personally like PHP syntax Smiley

CopyableCougar4

Either wandering the forum or programming. Most likely the latter Smiley

Github: http://github.com/CopyableCougar4
Offline BurntPizza

« JGO Bitwise Duke »


Medals: 486
Exp: 7 years



« Reply #24 - Posted 2014-11-03 03:36:47 »

Thinking about making a syntax change:
...

Any suggestions?

The parts I can decipher I cannot understand why the syntax would be like it is, and the rest I simply cannot comprehend how the types, semantics, etc. interact.

E.g.

1  
2  
double(name:v, action:v)
@var(name:v, action:v)


What is the difference between these? Obviously "double" seems to construct a floating point value, but then "@var" seems to construct/declare a variable. So then does "double" not declare a variable?!
Offline kingroka123
« Reply #25 - Posted 2014-11-03 03:50:08 »

double would be defining the variable while @var would be used to manipulate it. This is one of the parts I would like to change along with the syntax but I figured I would focus on changing the syntax before working on functionality.
Offline CopyableCougar4
« Reply #26 - Posted 2014-11-03 03:56:11 »

The syntax I mentioned above is much more readable in my opinion.

It has the things I like in a scripting language.
  • Types determined by program
  • No unneeded characters
  • Easy to read

CopyableCougar4

Either wandering the forum or programming. Most likely the latter Smiley

Github: http://github.com/CopyableCougar4
Offline saucymeatman
« Reply #27 - Posted 2014-11-03 18:11:02 »

Thinking about making a syntax change:
1  
2  
3  
4  
5  
6  
7  
8  
9  
rml(class:Main){
   func(name:$main){
      double(name:hello, value:10);
      @var(name:hello, set:30);
      print(){
         Hello World
      }
   }
}


Any suggestions?

This seems almost intentionally confusing haha
I would go with a traditional approach :
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
SomeClass {

name = "Saucy"
value = 10

main {
print "Hello World"
}

}
Offline BurntPizza

« JGO Bitwise Duke »


Medals: 486
Exp: 7 years



« Reply #28 - Posted 2014-11-29 06:30:36 »

If you're still working on this, I found a nice blog post about a particular part of programming language design that you (and others!) might enjoy reading: http://www.defmacro.org/ramblings/lisp.html

It's about the power of homoiconicity in LISP, but the first half is an introduction via XML that you might find particularly relevant.

This project also reminds me of Greenspun's Tenth RulePointing
Pages: [1]
  ignore  |  Print  
 
 

 
EgonOlsen (1865 views)
2018-06-10 19:43:48

EgonOlsen (1887 views)
2018-06-10 19:43:44

EgonOlsen (1256 views)
2018-06-10 19:43:20

DesertCoockie (1688 views)
2018-05-13 18:23:11

nelsongames (1357 views)
2018-04-24 18:15:36

nelsongames (1975 views)
2018-04-24 18:14:32

ivj94 (2743 views)
2018-03-24 14:47:39

ivj94 (1945 views)
2018-03-24 14:46:31

ivj94 (3036 views)
2018-03-24 14:43:53

Solater (1088 views)
2018-03-17 05:04:08
Deployment and Packaging
by mudlee
2018-08-22 18:09:50

Java Gaming Resources
by gouessej
2018-08-22 08:19:41

Deployment and Packaging
by gouessej
2018-08-22 08:04:08

Deployment and Packaging
by gouessej
2018-08-22 08:03:45

Deployment and Packaging
by philfrei
2018-08-20 02:33:38

Deployment and Packaging
by philfrei
2018-08-20 02:29:55

Deployment and Packaging
by philfrei
2018-08-19 23:56:20

Deployment and Packaging
by philfrei
2018-08-19 23:54:46
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!