by Kilimanjaro · 14y ago · 0 comments
{%
name = request.get('name','world')
list = ['this','language','rocks']
%}
<h1>Hello {{ name.upper }}</h1>
<ul>
{% for item in list %}
<li>{{ item }}</li>
{% endfor %}
</ul>
Save it as 'index.nxt' and run it in any future language you are going to design.Create a mod_next and try it on any web server like apache, nginx, etc. It should work without any extra fiddling with config files or installing frameworks or template engines.
It should just work!
That's the kind of platform that would leave php behind once and for all.
Of course once you master it, you separate the code from the html and call it from the view like this:
hello.nxt
name = request.get('name','world')
list = ['this','language','rocks']
response.render('hello.html',name,list)
hello.html <h1>Hello {{ name.upper }}</h1>
<ul>
{% for item in list %}
<li>{{ item }}</li>
{% endfor %}
</ul>
But what do I know about language design or human behavior?My point is, the language has to be designed as a web framework from the get go, routers, templates, models, everything should be right there so noobs feel confident from day one. That's the only way to conquer the world.