Skip to content

EfficiencySimplicity/GML

Repository files navigation

GML

GML is a better-designed Web language suite, designed for efficiency, simplicity, elegance, and flexibility.

it's designed with the current state of the Web as a priority, instead of trying to make a text markup language function as a layout engine, along with being backwards compatible for over 20 years.

HTML is a mess

See here if it's unclear why. This is just the natural result of forcing an XML-based text markup language to be a whole layout engine along with being backwards compatible for over 20 years; not to mention having to be the sole backbone of a Web page. HTML is still very useful, and nowhere near as bad as it could be! But something designed with the current state of the Web (and also system application UI, too) in mind will naturally be more tuned to the needs of developers, users, and readers.

CSS is ugly

Not what you can make with it, there are a lot of things you can make with it! (Check out CSS Zen Garden if you wanna see some fantastic creations)

It's the syntax that's ugly, confusing to beginners, and again, forced to be backwards-compatible over 20 years.

You have flexboxes and grids, justify- and align- self-, content- and items- (what's the difference between content and items?). You have parents changing the child's size and children changing the parent's size; even so much that the simple act of centering a div has become a famous roadblock. Plus, different browsers support different feature sets, so sites do not work the same across various browsers.

JavaScript

No explanation necessary.

Introducing GML

What we need is a clean, efficient, well-designed layout / language suite for the Web

We like hide this messiness behind framework after framework, but a system is only as reliable as its foundation, and a simple, solid base would make everything built atop it much more manageable.

Plus, it's just plain fun to write languages!

GML is more a suite than a language, encompassing GML, GATTR, and GMLOAD, along with an unspecified-as-of-yet scripting language, to be decided upon later (but it's probably Rust)

The entire design, logic, and implementation of GML is entirely written by human hands, or generated by hard-coded template systems designed with intent. No probabilistic generative black-box AI used here, just obsessive human nerdiness. The Web was made for humans (though it sure doesn't seem like it, JavaScript could be used as a type of torture)

Features include:

  • a built in component system
  • an incredibly simple syntax
  • a simple but immensely powerful attribute system
  • extensive control over asset loading

GML is focused on extensive features, modularity, abstraction, funny comments, writing itself in itself, and above all, simplicity.

GML syntax is straightforward:

page {

    // This is a comment, in case you weren't sure
    navigation-menu (border-color(red)) {
        menu-option (link("https://example.com/home)) {"Home"}
        menu-option (link("https://www.purelyhuman.xyz/artists/JoshuaWard)) {"Art"}
        menu-option (link("https://example.com/store)) {"Store"}
        menu-option (link("https://example.com/games)) {"Games"}
        menu-option (link("https://example.com/about)) {"About"}
    }

    /*
        This is the comment that never ends,
        yes it goes on and on my friends,
        you poor fool started reading it,
        not knowing what it was,
        and you will keep on reading it
        forever just because
    */

    content {

        canvas-title {"Draw on the canvas!"}
        canvas (main-canvas) {}
        subtitle {"Copyright 1995 BananaHead Systems, Ltd.}

    }

}

(spec page for GML)

The loading of assets is handled by GMLOAD, with extensive control over order and priority:

// We load a loading page first
https://example.com/loading-page

// This block loads second
{
    // We here load some basic assets
    https://example.com/page-source
    style: https://example.com/basic-style
    font: https://example.com/basic-font
}

// Third, we load whatever localized profile image is faster
profile-image: (
    https://example.com.uk/profile-image
    https://example.com.us/profile-image
    https://example.com.ch/profile-image
)

// Finally, we load a better font and style
[
    // These fields replace the old font and style fields
    font: https://example.com/better-font
    style: https://example.com/better-style
]

(spec page for GMLOAD)

The styling, scripting, component design, and practically everything else is managed by the (elegantly designed!) (self-referential!) (modular!) (immensely powerful!) GATTR language:

(menu-option) {
    border-color("red");
    color("blue");
}

canvas-title {
    title();
    color("red");
}

(spec page for GATTR)

And that's all there is to it!

... In case you were wondering, centering a div in GML is done in this way:

box (rows([; ; ;])) {
    inner-box {}
}

Or alternatively:

box (center) {
    inner-box {}
}

What is this all for?

Fun! This project is there to fulfill the human desire to make things clean, simple, and efficient, and who knows? Maybe find some sort of practical application someday, if it ever ends up with enough features to be useful.

Can I help out?

  • Do you wanna obsess over the little details? Do you have some problems with Web design?
  • Do you know a lot about Web design that would fill in the knowledge gaps of the current contributors to this spec and make the GML suite much more relevant to people like you?
  • Do you like Markdown somewhat?

The answer may be yes!

Click on this link to check out our presentation for newcomers.

Then check out CONTRIBUTING.md to get started!

Do keep in mind that some things may be a bit vague, as GML is a developing language, and many thanks.

About

Spec for a better-designed Web language suite; for fun and obsession

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors