Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

For magnificent glory, a TT Replacement.

by EvanCarroll (Chaplain)
on May 20, 2014 at 18:23 UTC ( [id://1086836]=perlmeditation: print w/replies, xml ) Need Help??

TT is pretty old and dated, so I've endeavored to implement Jade in Perl. Jade is a modern markup that is quickly becoming somewhat of a standard for Node.js. Here is what Jade looks like, (and all of this currently works in my port).
doctype html
html(lang="en")
  head
    title= pageTitle
    script(type='text/javascript').
      if (foo) {
         bar(1 + 5)
      }
  body
    h1 Jade - node template engine
    #container.col
      if youAreUsingJade
        p You are amazing
      else
        p Get on it!
      p.
        Jade is a terse and simple
        templating language with a
        strong focus on performance
        and powerful features.
You can read more about it on jade-lang.com/ There are a lot of key features to it. The big thing is, of course, not having to manage closing tags with whitespace sensitivity. This may be very un-Perlesque. But all good Perl users should join the rest of the rest of world in passionately hating sgml/xml. I've got very few tests on it currently, and most importantly it does not set out to recreate a DOM. It's a basic Jade recursive decent parser that supports interpolated (Blocks) and compiled (includes). The only things not yet implemented are in the POD. I plan on getting to them in the future.


Evan Carroll
The most respected person in the whole perl community.
www.evancarroll.com
  • Comment on For magnificent glory, a TT Replacement.

Replies are listed 'Best First'.
Re: For magnificent glory, a TT Replacement. (consideration)
by LanX (Saint) on May 21, 2014 at 02:27 UTC
    Thanks for considering your own post

    Considered: [EvanCarroll]: It's great.

    gave me the opportunity to vote for "reap"! :)

    Maybe a lesson to be learned about using the power of consideration responsibly?

    Cheers Rolf

    ( addicted to the Perl Programming Language)

    update

    Pity, the consideration was now deleted again. Seems like the gods intervened... :)

Re: For magnificent glory, a TT Replacement.
by ysth (Canon) on May 20, 2014 at 23:18 UTC

    May be unperlesque, but plenty of people use perl from all kinds of perspectives; someone will no doubt be glad your Jade port exists.

    --
    A math joke: r = | |csc(θ)|+|sec(θ)| |-| |csc(θ)|-|sec(θ)| |

      May be unperlesque, but plenty of people use perl from all kinds of perspectives; someone will no doubt be glad your Jade port exists.

      To call anything "unperlesque" is laughable ... swiss army chainsaw

      A templating system built with moose? That sure to be faster/better ...

      Implied closing tags ... pythonic significant whitespace ... plenty of modules to give you that feature, its not new

Re: For magnificent glory, a TT Replacement.
by Anonymous Monk on May 20, 2014 at 23:34 UTC
    I'm sure someone will be happy, all those people wanting to swap from node to perl will have a familiar tempting language for example.
Re: For magnificent glory, a TT Replacement.
by sundialsvc4 (Abbot) on May 21, 2014 at 13:12 UTC

    Well, although I do not find Jade’s syntax any better than TT’s ... in many ways it is notably worse ... there’s always gonna be room for one more tool that does the same thing, and I guess that Perl had better support it also.   Proceed apace, then, to finish the entire implementation of every feature.   (I worked with an extremely well-known company that ran headlong into todo’s in the released Ruby “gems” that it was trying to use to supersede a Perl program that worked perfectly well.   Let’s just be sure Perl doesn’t commit that same sin.)

    Aside:   One thing about this biz that has always amused me is that there never is one standard way to do anything.   Lately, PHP is “outy” and Ruby on Rails seems to be “inny,” which only means that, in another year or so, Haskell will be next.   Or something.   I’ve totally lost count of the number of website-framework systems that are out there, all doing more or less exactly the same thing in exactly the same way, all claiming to be the best.   And, gosh whodathunkit, we can use macro substitution(!!) to build CSS without repeating ourselves.   Sounds like a good place for a <<<HEREDOC in just about any existing language that you please, does it not?   Uh uh.   We must have a special language – no less than three syntactically-incompatible ones and stay-tuned for more – just to do that trivial chore, and the creators title each to more or less reflect their (or, their ...) “awesomeness.”   You have to go with the flow, but there’s still a lot of absurdity in it all.   :-D

Re: For magnificent glory, a TT Replacement.
by Anonymous Monk on May 20, 2014 at 21:38 UTC

    Hmm, because everything else sucks and you're a bunch of suckers, I've written something, now worship me, worship me

Re: For magnificent glory, a TT Replacement.
by boftx (Deacon) on May 20, 2014 at 22:31 UTC

    Seriously? I need to go puke.

    It helps to remember that the primary goal is to drain the swamp even when you are hip-deep in alligators.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlmeditation [id://1086836]
Approved by davido
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (3)
As of 2024-04-19 05:05 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found