Hacker News new | past | comments | ask | show | jobs | submit login
Show HN: Moya, a web framework and integrated language (moyaproject.com)
26 points by billowycoat on March 7, 2015 | hide | past | favorite | 15 comments

Hi HN,

This is something I've been working on since 2011. It's a hard project to sell to people. People have tended to associate it with things like coldfusion, but it's origins are more from MVC Python frameworks.

The use of XML has discouraged some developers. One commenter said it would be like 'a free colonoscopy'.

Be gentle.

I know the feeling, unfortunately there is not much open mindedness amongst developers when it comes to new ideas on building web applications :)

I built HiveMind (www.crudzilla.com), let's just say it is a different take on how to build web apps :)

I am going to be digging into your stuff! It looks very interest.

It feels a lot like web2py to me, but with less Python and more XML. I really love web2py, in particular for 'one man band' style projects. That live debugger is pretty cool. How do you think Moya compares to web2py?

I really don't get all that XML hatred! How is JSON any better?

I kinda liked XML the way it is presented on the home page. But I'm not sure about when and where would I use Moya.

I'll dig into it more later, probably.

Hopefully you would use it anywhere you needed a db driven website... Let me know if you have any questions about it.

Hey man this is actually pretty cool.

Congrats for having built a fairly complete tool with a unique approach to it, that I kinda dig. Also, good work on putting together the example apps, they're extremely useful to understand how the platform works.

I was a big fan of XSLT myself and I know how much shit talking people do about XML.

And I think that's the big shortcoming of this platform, people wouldn't even consider it for a split of a second after seeing the first <tag />. To be honest, while this looks very promising, I think it's a few years late.

I'll give it a serious try when I get the chance!

OK. I'm sure I'm not alone in thinking "XML based syntax? Get out of here..."

Given the widespread distaste for "XML overreach" (XLST, SOAP and other 'enterprise-isms') can someone sell this to me?

You're not alone.

XML can be a huge syntactical burden, I'll grant you. I read an article about an IBM standard for representing JSON in XML. Madness.

What XML does excel at is representing complex hierarchical data. The way Moya does forms (https://github.com/moyaproject/sociallinks/blob/master/socia...) and models (https://github.com/moyaproject/sociallinks/blob/master/socia...) is actually quite terse, IMO. Especially if you consider the amount of encapsulation in those declarations. Forms for instance, know how to render, validate, and apply themselves.

Slightly more contentious is Moya Code which is a high level language expressed in XML. But it does mean that code and data can be mixed in a fairly effortless way. As a language, Moya Code is actually quite similar to Python. Not surprising since I'm a Python guy.

Here is a loop to print the numbers 1 to 10 in Python and Moya Code:

    for i in range(1,11):

    <for src="1...10" dst="i">
More characters to type in XML, but it is quite familiar.

The extra characters are offset somewhat by the fact that moya tags are very high-level. Imagine if your code to render a page was factored out so that at the top level was barely a dozen function calls and conditions. That's what views in Moya Code tend towards.

Moya's expressions also cut down on lines of code. The following gets the current price of Bitcoin from a web service:

    <let btc="(fromjson:get:'https://www.bitstamp.net/api/ticker/')['ask']"/>
Less contentious is the template language, which straightforward to use, and uses the same expressions as Moya Code. There's no need to use a different syntax there. The most complex template for the Moya builtins is probably the threaded comments (https://github.com/moyaproject/moya/blob/master/moya/libs/co...). I don't think that's too bad.

I could go on, at great length. I've only waited 4 years to talk about it.

Whoa. I don't understand it, but it seems powerful.

Can I use that on the testimonials page?

Of course! Please, use it.

This is awesome. I need to build a simple web-application. If I were into Python I sure as hell use your project to do it.

Looks heavily influenced by rails, which is a good thing! Keep up the good work.

Thanks! You might want to give it a try. There's no Python used for https://www.moyaproject.com or http://notes.moyaproject.com

One thing you could do is to essentially hide the XML with a UI, the corresponding XML would be generated behind the scene.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact