My Google Summer of Code ideas

classic Classic list List threaded Threaded
18 messages Options
Reply | Threaded
Open this post in threaded view
|

My Google Summer of Code ideas

Valentín
Hi!

I will apply to try to become a GSoC student this year, and I think that Haxe would be a nice project to apply for. I've been playing with the languaje for the last months and I have plans to use it in web development in the future, and I think that this could be a great opportunity to become part of the community.

I have two ideas of things that would be nice to implement, and I'd like to hear your opinion about them.

The first idea is to write a complete template system for Haxe, based on the functionalities of the Smarty template system for PHP, which I've been using for last years -- http://www.smarty.net/docs/en/

You can read the documentation of Smarty to get an idea, but the main capabilities would be:

- Template programming syntax --if-else, for, while...

- Output modifiers --easy to use built-in functions to modify variable outputs to the template... things like escaping HTML code, applying different formats to string and numeric values, etc.

- Caching --the templates would be parsed by the Haxe application using them to produce target executable code, but that result could be cached, just the way Smarty does it.

- And lots of more possible features (template inheritance, pluggable system, etc), only limited by the time of the GSoC.

This template system would be written in Haxe so it could be used with PHP, C++ and Neko targets, and it would include the mayor part of functionalities that Smarty has.

I know that Haxe has haxe.Template, but it is too simple.

I also know (I think) that Nicolas Cannasse is developing another template system, Templo ( http://lib.haxe.org/p/templo ), but I don't know it's status of madurity nor if the author would continue developing and promoting it --but if Nicolas considerate that it would be better to continue it's development rather than starting a new one, I will not have any problem. I've chosen writing a new system because I know Haxe (but not NekoML --yet) and I think that this could be accomplished in the time of GSoC.

I don't know where this project should be placed... maybe in Haxe API or only in haxelib. :S I'm not really sure, but maybe the best thing would be to create an entire website and made this system available from it, with documentation, bug taking system, and news about it, just like http://www.smarty.net/ . But of course this would be a decision of the organization, and if the website is chosen, I could do it and manage it in my free time, just when GSoC ends --and I could do the appropriate things to make it available from the haxelib, because it is a more comfortable system for developers.

My second idea is more simple to explain... it would be a port (or a system based on the functionalities of) PHP PDO ( http://es2.php.net/manual/en/intro.pdo.php ) to have a data-access abstraction layer in Haxe/PHP and Haxe/C++ (and maybe Haxe/Neko).

I would have to deep into the idea to calculate times, but I think that in the time of this GSoC I could have implemented PDO to Haxe/PHP with the drivers to connect to MySQL and PosgreSQL.

So... What do you think about those ideas?

--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: My Google Summer of Code ideas

Andy Li
Hi Valentin,

Glad to hear your idea. 1st of all, Google has not announced the accepted mentoring organizations (see gsoc timeline). 
Haxe may or may not be accepted. But anyway, we encourage you to work on the project :)

About templating, I used a few time the haxe template(haxe.Template), htemplate, and read a little bit templo and smarty.
Smarty is definitely one of the most popular template engine in PHP. It is good to have a haxe one that comparable to it.
In my opinion, a template system in haxe should be also usable in client side(JS), as it is actually pretty useful.
You should have a look at jQuery template. One thing to consider is the syntax, it would be perfect(but optional) if the unprocessed HTML template
is still valid HTML/XML, eg. <a href="::link::">::name::</a> is not valid, but <a href="${link}">${name}</a> is.
It would be extremely fun if it is also valid haxe syntax, so you can create a macro that expend templated code. Let's think of having literal class template ;)

For PDO, I'm not familiar with it, maybe others can give you some comment (Franco?). But you should have read about SPOD(or dbtool), or have you?

You can host your project on github or google code, and then put it on haxelib once it is stable. I encourage you to use github, as one can easily fork your code,
and you can easily merge it. Having a dedicated project website is good, but it is better done after the project is stable, put more time on coding first.

Cheers,
Andy

2011/3/16 Valentín <[hidden email]>
Hi!

I will apply to try to become a GSoC student this year, and I think that Haxe would be a nice project to apply for. I've been playing with the languaje for the last months and I have plans to use it in web development in the future, and I think that this could be a great opportunity to become part of the community.

I have two ideas of things that would be nice to implement, and I'd like to hear your opinion about them.

The first idea is to write a complete template system for Haxe, based on the functionalities of the Smarty template system for PHP, which I've been using for last years -- http://www.smarty.net/docs/en/

You can read the documentation of Smarty to get an idea, but the main capabilities would be:

- Template programming syntax --if-else, for, while...

- Output modifiers --easy to use built-in functions to modify variable outputs to the template... things like escaping HTML code, applying different formats to string and numeric values, etc.

- Caching --the templates would be parsed by the Haxe application using them to produce target executable code, but that result could be cached, just the way Smarty does it.

- And lots of more possible features (template inheritance, pluggable system, etc), only limited by the time of the GSoC.

This template system would be written in Haxe so it could be used with PHP, C++ and Neko targets, and it would include the mayor part of functionalities that Smarty has.

I know that Haxe has haxe.Template, but it is too simple.

I also know (I think) that Nicolas Cannasse is developing another template system, Templo ( http://lib.haxe.org/p/templo ), but I don't know it's status of madurity nor if the author would continue developing and promoting it --but if Nicolas considerate that it would be better to continue it's development rather than starting a new one, I will not have any problem. I've chosen writing a new system because I know Haxe (but not NekoML --yet) and I think that this could be accomplished in the time of GSoC.

I don't know where this project should be placed... maybe in Haxe API or only in haxelib. :S I'm not really sure, but maybe the best thing would be to create an entire website and made this system available from it, with documentation, bug taking system, and news about it, just like http://www.smarty.net/ . But of course this would be a decision of the organization, and if the website is chosen, I could do it and manage it in my free time, just when GSoC ends --and I could do the appropriate things to make it available from the haxelib, because it is a more comfortable system for developers.

My second idea is more simple to explain... it would be a port (or a system based on the functionalities of) PHP PDO ( http://es2.php.net/manual/en/intro.pdo.php ) to have a data-access abstraction layer in Haxe/PHP and Haxe/C++ (and maybe Haxe/Neko).

I would have to deep into the idea to calculate times, but I think that in the time of this GSoC I could have implemented PDO to Haxe/PHP with the drivers to connect to MySQL and PosgreSQL.

So... What do you think about those ideas?

--
haXe - an open source web programming language
http://haxe.org


--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: My Google Summer of Code ideas

clemos
Hi

Speaking of template systems, I really like the approach of this project :
https://github.com/hij1nx/weld
I haven't really used it yet, but I really like the idea of avoiding
special markup like <?, <%, ${ or whatever.
This makes it very powerful in client-side Javascript, with native CSS
selector support, but also, I think, from a multi-platform point of
view, since standard XML processing may be faster than raw string
parsing + interpretation on most platforms.

+++++
Clément

On Wed, Mar 16, 2011 at 4:19 PM, Andy Li <[hidden email]> wrote:

> Hi Valentin,
> Glad to hear your idea. 1st of all, Google has not announced the accepted
> mentoring organizations (see gsoc timeline).
> Haxe may or may not be accepted. But anyway, we encourage you to work on the
> project :)
> About templating, I used a few time the haxe template(haxe.Template),
> htemplate, and read a little bit templo and smarty.
> Smarty is definitely one of the most popular template engine in PHP. It is
> good to have a haxe one that comparable to it.
> In my opinion, a template system in haxe should be also usable in client
> side(JS), as it is actually pretty useful.
> You should have a look at jQuery template. One thing to consider is the
> syntax, it would be perfect(but optional) if the unprocessed HTML template
> is still valid HTML/XML, eg. <a href="::link::">::name::</a> is not valid,
> but <a href="${link}">${name}</a> is.
> It would be extremely fun if it is also valid haxe syntax, so you can create
> a macro that expend templated code. Let's think of having literal class
> template ;)
> For PDO, I'm not familiar with it, maybe others can give you some comment
> (Franco?). But you should have read about SPOD(or dbtool), or have you?
> You can host your project on github or google code, and then put it on
> haxelib once it is stable. I encourage you to use github, as one can easily
> fork your code,
> and you can easily merge it. Having a dedicated project website is good, but
> it is better done after the project is stable, put more time on coding
> first.
> Cheers,
> Andy
> 2011/3/16 Valentín <[hidden email]>
>>
>> Hi!
>>
>> I will apply to try to become a GSoC student this year, and I think that
>> Haxe would be a nice project to apply for. I've been playing with the
>> languaje for the last months and I have plans to use it in web development
>> in the future, and I think that this could be a great opportunity to become
>> part of the community.
>>
>> I have two ideas of things that would be nice to implement, and I'd like
>> to hear your opinion about them.
>>
>> The first idea is to write a complete template system for Haxe, based on
>> the functionalities of the Smarty template system for PHP, which I've been
>> using for last years -- http://www.smarty.net/docs/en/
>>
>> You can read the documentation of Smarty to get an idea, but the main
>> capabilities would be:
>>
>> - Template programming syntax --if-else, for, while...
>>
>> - Output modifiers --easy to use built-in functions to modify variable
>> outputs to the template... things like escaping HTML code, applying
>> different formats to string and numeric values, etc.
>>
>> - Caching --the templates would be parsed by the Haxe application using
>> them to produce target executable code, but that result could be cached,
>> just the way Smarty does it.
>>
>> - And lots of more possible features (template inheritance, pluggable
>> system, etc), only limited by the time of the GSoC.
>>
>> This template system would be written in Haxe so it could be used with
>> PHP, C++ and Neko targets, and it would include the mayor part of
>> functionalities that Smarty has.
>>
>> I know that Haxe has haxe.Template, but it is too simple.
>>
>> I also know (I think) that Nicolas Cannasse is developing another template
>> system, Templo ( http://lib.haxe.org/p/templo ), but I don't know it's
>> status of madurity nor if the author would continue developing and promoting
>> it --but if Nicolas considerate that it would be better to continue it's
>> development rather than starting a new one, I will not have any problem.
>> I've chosen writing a new system because I know Haxe (but not NekoML --yet)
>> and I think that this could be accomplished in the time of GSoC.
>>
>> I don't know where this project should be placed... maybe in Haxe API or
>> only in haxelib. :S I'm not really sure, but maybe the best thing would be
>> to create an entire website and made this system available from it, with
>> documentation, bug taking system, and news about it, just like
>> http://www.smarty.net/ . But of course this would be a decision of the
>> organization, and if the website is chosen, I could do it and manage it in
>> my free time, just when GSoC ends --and I could do the appropriate things to
>> make it available from the haxelib, because it is a more comfortable system
>> for developers.
>>
>> My second idea is more simple to explain... it would be a port (or a
>> system based on the functionalities of) PHP PDO (
>> http://es2.php.net/manual/en/intro.pdo.php ) to have a data-access
>> abstraction layer in Haxe/PHP and Haxe/C++ (and maybe Haxe/Neko).
>>
>> I would have to deep into the idea to calculate times, but I think that in
>> the time of this GSoC I could have implemented PDO to Haxe/PHP with the
>> drivers to connect to MySQL and PosgreSQL.
>>
>> So... What do you think about those ideas?
>>
>> --
>> haXe - an open source web programming language
>> http://haxe.org
>
>
> --
> haXe - an open source web programming language
> http://haxe.org
>

--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: My Google Summer of Code ideas

Franco Ponticelli
About the template system I also suggest erazor (https://github.com/ciscoheat/erazor). It is the evolution (in term of syntax) of htemplate and it is very much like the Razor template system for .Net. It has been primarily developed by Andreas and I plan to keep maintaining it. I am actively using it and in my opinion is the best template syntax I've ever worked with.

Franco

On Wed, Mar 16, 2011 at 4:54 PM, clemos <[hidden email]> wrote:
Hi

Speaking of template systems, I really like the approach of this project :
https://github.com/hij1nx/weld
I haven't really used it yet, but I really like the idea of avoiding
special markup like <?, <%, ${ or whatever.
This makes it very powerful in client-side Javascript, with native CSS
selector support, but also, I think, from a multi-platform point of
view, since standard XML processing may be faster than raw string
parsing + interpretation on most platforms.

+++++
Clément

On Wed, Mar 16, 2011 at 4:19 PM, Andy Li <[hidden email]> wrote:
> Hi Valentin,
> Glad to hear your idea. 1st of all, Google has not announced the accepted
> mentoring organizations (see gsoc timeline).
> Haxe may or may not be accepted. But anyway, we encourage you to work on the
> project :)
> About templating, I used a few time the haxe template(haxe.Template),
> htemplate, and read a little bit templo and smarty.
> Smarty is definitely one of the most popular template engine in PHP. It is
> good to have a haxe one that comparable to it.
> In my opinion, a template system in haxe should be also usable in client
> side(JS), as it is actually pretty useful.
> You should have a look at jQuery template. One thing to consider is the
> syntax, it would be perfect(but optional) if the unprocessed HTML template
> is still valid HTML/XML, eg. <a href="::link::">::name::</a> is not valid,
> but <a href="${link}">${name}</a> is.
> It would be extremely fun if it is also valid haxe syntax, so you can create
> a macro that expend templated code. Let's think of having literal class
> template ;)
> For PDO, I'm not familiar with it, maybe others can give you some comment
> (Franco?). But you should have read about SPOD(or dbtool), or have you?
> You can host your project on github or google code, and then put it on
> haxelib once it is stable. I encourage you to use github, as one can easily
> fork your code,
> and you can easily merge it. Having a dedicated project website is good, but
> it is better done after the project is stable, put more time on coding
> first.
> Cheers,
> Andy
> 2011/3/16 Valentín <[hidden email]>
>>
>> Hi!
>>
>> I will apply to try to become a GSoC student this year, and I think that
>> Haxe would be a nice project to apply for. I've been playing with the
>> languaje for the last months and I have plans to use it in web development
>> in the future, and I think that this could be a great opportunity to become
>> part of the community.
>>
>> I have two ideas of things that would be nice to implement, and I'd like
>> to hear your opinion about them.
>>
>> The first idea is to write a complete template system for Haxe, based on
>> the functionalities of the Smarty template system for PHP, which I've been
>> using for last years -- http://www.smarty.net/docs/en/
>>
>> You can read the documentation of Smarty to get an idea, but the main
>> capabilities would be:
>>
>> - Template programming syntax --if-else, for, while...
>>
>> - Output modifiers --easy to use built-in functions to modify variable
>> outputs to the template... things like escaping HTML code, applying
>> different formats to string and numeric values, etc.
>>
>> - Caching --the templates would be parsed by the Haxe application using
>> them to produce target executable code, but that result could be cached,
>> just the way Smarty does it.
>>
>> - And lots of more possible features (template inheritance, pluggable
>> system, etc), only limited by the time of the GSoC.
>>
>> This template system would be written in Haxe so it could be used with
>> PHP, C++ and Neko targets, and it would include the mayor part of
>> functionalities that Smarty has.
>>
>> I know that Haxe has haxe.Template, but it is too simple.
>>
>> I also know (I think) that Nicolas Cannasse is developing another template
>> system, Templo ( http://lib.haxe.org/p/templo ), but I don't know it's
>> status of madurity nor if the author would continue developing and promoting
>> it --but if Nicolas considerate that it would be better to continue it's
>> development rather than starting a new one, I will not have any problem.
>> I've chosen writing a new system because I know Haxe (but not NekoML --yet)
>> and I think that this could be accomplished in the time of GSoC.
>>
>> I don't know where this project should be placed... maybe in Haxe API or
>> only in haxelib. :S I'm not really sure, but maybe the best thing would be
>> to create an entire website and made this system available from it, with
>> documentation, bug taking system, and news about it, just like
>> http://www.smarty.net/ . But of course this would be a decision of the
>> organization, and if the website is chosen, I could do it and manage it in
>> my free time, just when GSoC ends --and I could do the appropriate things to
>> make it available from the haxelib, because it is a more comfortable system
>> for developers.
>>
>> My second idea is more simple to explain... it would be a port (or a
>> system based on the functionalities of) PHP PDO (
>> http://es2.php.net/manual/en/intro.pdo.php ) to have a data-access
>> abstraction layer in Haxe/PHP and Haxe/C++ (and maybe Haxe/Neko).
>>
>> I would have to deep into the idea to calculate times, but I think that in
>> the time of this GSoC I could have implemented PDO to Haxe/PHP with the
>> drivers to connect to MySQL and PosgreSQL.
>>
>> So... What do you think about those ideas?
>>
>> --
>> haXe - an open source web programming language
>> http://haxe.org
>
>
> --
> haXe - an open source web programming language
> http://haxe.org
>

--
haXe - an open source web programming language
http://haxe.org


--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: My Google Summer of Code ideas

Tarwin Stroh-Spijer
In reply to this post by clemos
@Valentin: I'm happy to see you're interested in doing the haxe GSOC (if it happens). I am a little unsure why you'd want to create another templating language though.

This may be a philosophical difference, but I've generally found Smarty templates more annoying than helpful. This is because they define a whole new syntax, mostly for doing things that are already available to you in PHP; PHP is already a templating language itself (yeah I know it has OOP but really that doesn't change the fact that it's roots are templating). Things like {$var|capitalize} are strange to me because you could directly write this in PHP with <?=ucwords($var)?>. It's no more complex and gives you full control, without you having to learn a whole other "language" for no benefit.

On the templo site, I agree there are some things which would be nice to add, but things such as caching are already done (at least for PHP target) and work really well! There are some things that could be learned from Smarty though that would be awesome to add to Templo I'm sure. This includes access to some kind of "counter" in iterators, maybe even some kind of "is first", "is last", exposed by default instead of having to write a bunch of code.

I also feel that the syntax for "foreach item list" is a little broken, at least when you're coming from haxe. I know it's smaller (than "for item in list") in a way but would be best to be consistent I think.

@clemos: I'm not convinced that this would be very fast, either to display OR create. It would generally mean input a whole lot of <span id="VAR">THIS IS WHERE VAR WILL BE</span> text rather than simply writing something like ::var:: to do the same thing. I could see it as being useful, and is still valid XHTML, editable by designers etc. I'm also confused, they say "no foreign..." but then have conditionals like "<% if(person.description) { %>"

My 2 cents ...


Tarwin Stroh-Spijer
_______________________

Touch My Pixel
http://www.touchmypixel.com/
phone: +61 3 8060 5321
_______________________


On Thu, Mar 17, 2011 at 3:54 AM, clemos <[hidden email]> wrote:
Hi

Speaking of template systems, I really like the approach of this project :
https://github.com/hij1nx/weld
I haven't really used it yet, but I really like the idea of avoiding
special markup like <?, <%, ${ or whatever.
This makes it very powerful in client-side Javascript, with native CSS
selector support, but also, I think, from a multi-platform point of
view, since standard XML processing may be faster than raw string
parsing + interpretation on most platforms.

+++++
Clément

On Wed, Mar 16, 2011 at 4:19 PM, Andy Li <[hidden email]> wrote:
> Hi Valentin,
> Glad to hear your idea. 1st of all, Google has not announced the accepted
> mentoring organizations (see gsoc timeline).
> Haxe may or may not be accepted. But anyway, we encourage you to work on the
> project :)
> About templating, I used a few time the haxe template(haxe.Template),
> htemplate, and read a little bit templo and smarty.
> Smarty is definitely one of the most popular template engine in PHP. It is
> good to have a haxe one that comparable to it.
> In my opinion, a template system in haxe should be also usable in client
> side(JS), as it is actually pretty useful.
> You should have a look at jQuery template. One thing to consider is the
> syntax, it would be perfect(but optional) if the unprocessed HTML template
> is still valid HTML/XML, eg. <a href="::link::">::name::</a> is not valid,
> but <a href="${link}">${name}</a> is.
> It would be extremely fun if it is also valid haxe syntax, so you can create
> a macro that expend templated code. Let's think of having literal class
> template ;)
> For PDO, I'm not familiar with it, maybe others can give you some comment
> (Franco?). But you should have read about SPOD(or dbtool), or have you?
> You can host your project on github or google code, and then put it on
> haxelib once it is stable. I encourage you to use github, as one can easily
> fork your code,
> and you can easily merge it. Having a dedicated project website is good, but
> it is better done after the project is stable, put more time on coding
> first.
> Cheers,
> Andy
> 2011/3/16 Valentín <[hidden email]>
>>
>> Hi!
>>
>> I will apply to try to become a GSoC student this year, and I think that
>> Haxe would be a nice project to apply for. I've been playing with the
>> languaje for the last months and I have plans to use it in web development
>> in the future, and I think that this could be a great opportunity to become
>> part of the community.
>>
>> I have two ideas of things that would be nice to implement, and I'd like
>> to hear your opinion about them.
>>
>> The first idea is to write a complete template system for Haxe, based on
>> the functionalities of the Smarty template system for PHP, which I've been
>> using for last years -- http://www.smarty.net/docs/en/
>>
>> You can read the documentation of Smarty to get an idea, but the main
>> capabilities would be:
>>
>> - Template programming syntax --if-else, for, while...
>>
>> - Output modifiers --easy to use built-in functions to modify variable
>> outputs to the template... things like escaping HTML code, applying
>> different formats to string and numeric values, etc.
>>
>> - Caching --the templates would be parsed by the Haxe application using
>> them to produce target executable code, but that result could be cached,
>> just the way Smarty does it.
>>
>> - And lots of more possible features (template inheritance, pluggable
>> system, etc), only limited by the time of the GSoC.
>>
>> This template system would be written in Haxe so it could be used with
>> PHP, C++ and Neko targets, and it would include the mayor part of
>> functionalities that Smarty has.
>>
>> I know that Haxe has haxe.Template, but it is too simple.
>>
>> I also know (I think) that Nicolas Cannasse is developing another template
>> system, Templo ( http://lib.haxe.org/p/templo ), but I don't know it's
>> status of madurity nor if the author would continue developing and promoting
>> it --but if Nicolas considerate that it would be better to continue it's
>> development rather than starting a new one, I will not have any problem.
>> I've chosen writing a new system because I know Haxe (but not NekoML --yet)
>> and I think that this could be accomplished in the time of GSoC.
>>
>> I don't know where this project should be placed... maybe in Haxe API or
>> only in haxelib. :S I'm not really sure, but maybe the best thing would be
>> to create an entire website and made this system available from it, with
>> documentation, bug taking system, and news about it, just like
>> http://www.smarty.net/ . But of course this would be a decision of the
>> organization, and if the website is chosen, I could do it and manage it in
>> my free time, just when GSoC ends --and I could do the appropriate things to
>> make it available from the haxelib, because it is a more comfortable system
>> for developers.
>>
>> My second idea is more simple to explain... it would be a port (or a
>> system based on the functionalities of) PHP PDO (
>> http://es2.php.net/manual/en/intro.pdo.php ) to have a data-access
>> abstraction layer in Haxe/PHP and Haxe/C++ (and maybe Haxe/Neko).
>>
>> I would have to deep into the idea to calculate times, but I think that in
>> the time of this GSoC I could have implemented PDO to Haxe/PHP with the
>> drivers to connect to MySQL and PosgreSQL.
>>
>> So... What do you think about those ideas?
>>
>> --
>> haXe - an open source web programming language
>> http://haxe.org
>
>
> --
> haXe - an open source web programming language
> http://haxe.org
>

--
haXe - an open source web programming language
http://haxe.org


--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: My Google Summer of Code ideas

clemos
Hi Tarwin,

On Wed, Mar 16, 2011 at 6:50 PM, Tarwin Stroh-Spijer
<[hidden email]> wrote:
> @clemos: I'm not convinced that this would be very fast, either to display
> OR create. It would generally mean input a whole lot of <span id="VAR">THIS
> IS WHERE VAR WILL BE</span> text rather than simply writing something like
> ::var:: to do the same thing. I could see it as being useful, and is still

It may be a bit longer to write, but still I see it as a way to
enforce better practices, and especially cross-platform best
practices, which is rare...
In your example, <span id="var"/> and ::var:: are actually *almost* the same.
Because having an actual span around your var makes it easier to use
with JS, either to update it or to extract data from it.
So if you write <span class="var"><?= $var ?></span> more often than
just <?= $var ?>, writing only <span id="var" /> ends up being
shorter...

> valid XHTML, editable by designers etc. I'm also confused, they say "no
> foreign..." but then have conditionals like "<% if(person.description) { %>"

There are no conditionals, the snippet you're referring to is a pseudo
code example of what you can't do with weld ;)

Cheers,
Clément

> My 2 cents ...
>
> Tarwin Stroh-Spijer
> _______________________
>
> Touch My Pixel
> http://www.touchmypixel.com/
> phone: +61 3 8060 5321
> _______________________
>
>
> On Thu, Mar 17, 2011 at 3:54 AM, clemos <[hidden email]> wrote:
>>
>> Hi
>>
>> Speaking of template systems, I really like the approach of this project :
>> https://github.com/hij1nx/weld
>> I haven't really used it yet, but I really like the idea of avoiding
>> special markup like <?, <%, ${ or whatever.
>> This makes it very powerful in client-side Javascript, with native CSS
>> selector support, but also, I think, from a multi-platform point of
>> view, since standard XML processing may be faster than raw string
>> parsing + interpretation on most platforms.
>>
>> +++++
>> Clément
>>
>> On Wed, Mar 16, 2011 at 4:19 PM, Andy Li <[hidden email]> wrote:
>> > Hi Valentin,
>> > Glad to hear your idea. 1st of all, Google has not announced the
>> > accepted
>> > mentoring organizations (see gsoc timeline).
>> > Haxe may or may not be accepted. But anyway, we encourage you to work on
>> > the
>> > project :)
>> > About templating, I used a few time the haxe template(haxe.Template),
>> > htemplate, and read a little bit templo and smarty.
>> > Smarty is definitely one of the most popular template engine in PHP. It
>> > is
>> > good to have a haxe one that comparable to it.
>> > In my opinion, a template system in haxe should be also usable in client
>> > side(JS), as it is actually pretty useful.
>> > You should have a look at jQuery template. One thing to consider is the
>> > syntax, it would be perfect(but optional) if the unprocessed HTML
>> > template
>> > is still valid HTML/XML, eg. <a href="::link::">::name::</a> is not
>> > valid,
>> > but <a href="${link}">${name}</a> is.
>> > It would be extremely fun if it is also valid haxe syntax, so you can
>> > create
>> > a macro that expend templated code. Let's think of having literal class
>> > template ;)
>> > For PDO, I'm not familiar with it, maybe others can give you some
>> > comment
>> > (Franco?). But you should have read about SPOD(or dbtool), or have you?
>> > You can host your project on github or google code, and then put it on
>> > haxelib once it is stable. I encourage you to use github, as one can
>> > easily
>> > fork your code,
>> > and you can easily merge it. Having a dedicated project website is good,
>> > but
>> > it is better done after the project is stable, put more time on coding
>> > first.
>> > Cheers,
>> > Andy
>> > 2011/3/16 Valentín <[hidden email]>
>> >>
>> >> Hi!
>> >>
>> >> I will apply to try to become a GSoC student this year, and I think
>> >> that
>> >> Haxe would be a nice project to apply for. I've been playing with the
>> >> languaje for the last months and I have plans to use it in web
>> >> development
>> >> in the future, and I think that this could be a great opportunity to
>> >> become
>> >> part of the community.
>> >>
>> >> I have two ideas of things that would be nice to implement, and I'd
>> >> like
>> >> to hear your opinion about them.
>> >>
>> >> The first idea is to write a complete template system for Haxe, based
>> >> on
>> >> the functionalities of the Smarty template system for PHP, which I've
>> >> been
>> >> using for last years -- http://www.smarty.net/docs/en/
>> >>
>> >> You can read the documentation of Smarty to get an idea, but the main
>> >> capabilities would be:
>> >>
>> >> - Template programming syntax --if-else, for, while...
>> >>
>> >> - Output modifiers --easy to use built-in functions to modify variable
>> >> outputs to the template... things like escaping HTML code, applying
>> >> different formats to string and numeric values, etc.
>> >>
>> >> - Caching --the templates would be parsed by the Haxe application using
>> >> them to produce target executable code, but that result could be
>> >> cached,
>> >> just the way Smarty does it.
>> >>
>> >> - And lots of more possible features (template inheritance, pluggable
>> >> system, etc), only limited by the time of the GSoC.
>> >>
>> >> This template system would be written in Haxe so it could be used with
>> >> PHP, C++ and Neko targets, and it would include the mayor part of
>> >> functionalities that Smarty has.
>> >>
>> >> I know that Haxe has haxe.Template, but it is too simple.
>> >>
>> >> I also know (I think) that Nicolas Cannasse is developing another
>> >> template
>> >> system, Templo ( http://lib.haxe.org/p/templo ), but I don't know it's
>> >> status of madurity nor if the author would continue developing and
>> >> promoting
>> >> it --but if Nicolas considerate that it would be better to continue
>> >> it's
>> >> development rather than starting a new one, I will not have any
>> >> problem.
>> >> I've chosen writing a new system because I know Haxe (but not NekoML
>> >> --yet)
>> >> and I think that this could be accomplished in the time of GSoC.
>> >>
>> >> I don't know where this project should be placed... maybe in Haxe API
>> >> or
>> >> only in haxelib. :S I'm not really sure, but maybe the best thing would
>> >> be
>> >> to create an entire website and made this system available from it,
>> >> with
>> >> documentation, bug taking system, and news about it, just like
>> >> http://www.smarty.net/ . But of course this would be a decision of the
>> >> organization, and if the website is chosen, I could do it and manage it
>> >> in
>> >> my free time, just when GSoC ends --and I could do the appropriate
>> >> things to
>> >> make it available from the haxelib, because it is a more comfortable
>> >> system
>> >> for developers.
>> >>
>> >> My second idea is more simple to explain... it would be a port (or a
>> >> system based on the functionalities of) PHP PDO (
>> >> http://es2.php.net/manual/en/intro.pdo.php ) to have a data-access
>> >> abstraction layer in Haxe/PHP and Haxe/C++ (and maybe Haxe/Neko).
>> >>
>> >> I would have to deep into the idea to calculate times, but I think that
>> >> in
>> >> the time of this GSoC I could have implemented PDO to Haxe/PHP with the
>> >> drivers to connect to MySQL and PosgreSQL.
>> >>
>> >> So... What do you think about those ideas?
>> >>
>> >> --
>> >> haXe - an open source web programming language
>> >> http://haxe.org
>> >
>> >
>> > --
>> > haXe - an open source web programming language
>> > http://haxe.org
>> >
>>
>> --
>> haXe - an open source web programming language
>> http://haxe.org
>
>
> --
> haXe - an open source web programming language
> http://haxe.org
>

--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: My Google Summer of Code ideas

Valentín
In reply to this post by Valentín
> From: Andy Li

> Glad to hear your idea. 1st of all, Google has not announced the accepted
> mentoring organizations (see gsoc
> timeline<http://www.google-melange.com/document/show/gsoc_program/google/gsoc2011/timeline>
> ).
> Haxe may or may not be accepted.

Yes, I know that --but I hope it will be accepted ;) --, and that's the reason because I only told you some of my ideas about the templates project.

> One thing to consider is the syntax, it would be perfect(but optional) if
> the unprocessed HTML template
> is still valid HTML/XML, eg. <a href="::link::">::name::</a> is not valid,
> but <a href="${link}">${name}</a> is.
> It would be extremely fun if it is also valid haxe syntax, so you can create
> a macro that expend templated code. Let's think of having literal class
> template ;)

Here I think that the better option could be to create a set of etiquettes that would fit well with the actual HTML syntax. I think that something like

<if condition="obj1.var == true" />
    <p>Some HTML code.</p>
<elif condition="obj2.var == true && obj3.var == 3" />
    <p>Another text, with a HTML-tag-like prints: <print string="obj.var" /> and <print int="obj3.var" /> <!-- This way we can check for types -->
<else />
   <p>Attributes could be a nice way to do output formatting: <print string="obj.var" escape="html" /> and <print int="obj.timestamp" format="date" pattern="l jS \of F Y h:i:s A" /></p>
<endif />

Its only an example, if Haxe were accepted in this GSoC and if I were chosen to do this, I would have to do some research to obtain the best approach, but I think that you can get the idea.

And the template system could be enhanced to support XML syntax using namespaces to create a more rich vocabulary capable of creating real and validating XML documents that could be used to create all types of documents from Haxe. Something like:

<haxe:if haxe:condition="obj1.var == true" />
    <![CDATA[
        Some king of data here, maybe even binary data, Haxe code, shell instructions... the possibilities are unlimited.
    ]]>
<haxe:else />
    <![CDATA[
        Some king of data here, maybe even binary data, Haxe code, shell instructions... the possibilities are unlimited.
    ]]>
<haxe:endif />

This could be hard to accomplish in one GSoC, but I could implement the first usable subset of features during GSoC and later I would continue the development of the system in my free time.

What do you think about this?

> In my opinion, a template system in haxe should be also usable in client
> side(JS), as it is actually pretty useful.

Yes, I only mentioned PHP, Neko and C++ because of the cache system --only create each template-executable file one time, and check for modifications on the original template-source file each time the template is requested. But it really could have different modes of working --maybe file-parsing mode, with cache system and so on, and string parsing mode, logically without it. It would be written in Haxe, so we could use it in all targets.

> You can host your project on github or google code, and then put it on
> haxelib once it is stable. I encourage you to use github, as one can easily
> fork your code,
> and you can easily merge it. Having a dedicated project website is good, but
> it is better done after the project is stable, put more time on coding
> first.

I agree :)

I will check SPOD and dbtool, they are so interesting and I was looking for something like that to use in the future.

--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: My Google Summer of Code ideas

Valentín
In reply to this post by Valentín
Hello again.

> From: clemos

> Speaking of template systems, I really like the approach of this project :
> https://github.com/hij1nx/weld
> I haven't really used it yet, but I really like the idea of avoiding
> special markup like <?, <%, ${ or whatever.

The Weld approach seems to be a good one... but I'm not feeling very comfortable to how the conditionals seems to work :S .

I mean, the main idea of the template system I am trying to describe is to be a XML dialect that could be parsed in Haxe but not a new template-language --that's the reason to try to avoid smarty-like syntax. I really love the Smarty (and some other systems you are pointing) features, but I think that a HTML designer should know HTML and XML, but not a lot of templating syntax. I think it would be more easy to learn a new set of etiquettes with their attributes rather than {if $something} things. And, also, in this kind of templates we would avoid things such wrong colouring in HTML/XML editors --with Smarty syntax, for example, my text editor warns me when I mix up Smarty and HTML, because it's not a valid XML syntax.

It could be hard to implement all the Smarty (and others) features without introducing some new syntax, but I would try to be the less possible.

So, Haxe would feed and parse the syntax, but the system could be rewritten in C++, Pascal or whatever and the template files would be the same.

[ I think that this text above replies also to Franco Ponticelli about Razor ]

> From: clemos

> It may be a bit longer to write, but still I see it as a way to
> enforce better practices, and especially cross-platform best
> practices, which is rare...
> In your example, <span id="var"/> and ::var:: are actually *almost* the same.
> Because having an actual span around your var makes it easier to use
> with JS, either to update it or to extract data from it.
> So if you write <span class="var"><?= $var ?></span> more often than
> just <?= $var ?>, writing only <span id="var" /> ends up being
> shorter...

I totally agree with you.

> From: Tarwin Stroh-Spijer

> This may be a philosophical difference, but I've generally found Smarty
> templates more annoying than helpful. This is because they define a whole
> new syntax, mostly for doing things that are already available to you in
> PHP; PHP is already a templating language itself (yeah I know it has OOP but
> really that doesn't change the fact that it's roots are templating). Things
> like {$var|capitalize} are strange to me because you could directly write
> this in PHP with <?=ucwords($var)?>. It's no more complex and gives you full
> control, without you having to learn a whole other "language" for no
> benefit.

Using PHP as a templating language is the traditional approach, but I think that in most of the cases it results in a very difficult to maintain code. With the Smarty approach I think that the application can fit better in the MVC pattern, even making possible that the most View code can be written in a more structured and easy to learn language such as HTML/XML.

--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: My Google Summer of Code ideas

Tarwin Stroh-Spijer
One thing you want to think about when creating templating languages is how readable they are. How much they take away from what you see as the structure of your html,code,xml,data,whatever. The reason I like using MTT is that it generally has the least amount of code to do things, hence doesn't ruin the look of my HTML, and I can still understand it as HTML.

I'm not saying it's a bad idea to have more templating, just things to be weary of. I know MTT has problems too - for example it only seems to parse strict XHTML hence trying to do HTML5 stuff in there fails miserably!


Tarwin Stroh-Spijer
_______________________

Touch My Pixel
http://www.touchmypixel.com/
phone: +61 3 8060 5321
_______________________


2011/3/17 Valentín <[hidden email]>
Hello again.

> From: clemos


> Speaking of template systems, I really like the approach of this project :
> https://github.com/hij1nx/weld
> I haven't really used it yet, but I really like the idea of avoiding
> special markup like <?, <%, ${ or whatever.

The Weld approach seems to be a good one... but I'm not feeling very comfortable to how the conditionals seems to work :S .

I mean, the main idea of the template system I am trying to describe is to be a XML dialect that could be parsed in Haxe but not a new template-language --that's the reason to try to avoid smarty-like syntax. I really love the Smarty (and some other systems you are pointing) features, but I think that a HTML designer should know HTML and XML, but not a lot of templating syntax. I think it would be more easy to learn a new set of etiquettes with their attributes rather than {if $something} things. And, also, in this kind of templates we would avoid things such wrong colouring in HTML/XML editors --with Smarty syntax, for example, my text editor warns me when I mix up Smarty and HTML, because it's not a valid XML syntax.

It could be hard to implement all the Smarty (and others) features without introducing some new syntax, but I would try to be the less possible.

So, Haxe would feed and parse the syntax, but the system could be rewritten in C++, Pascal or whatever and the template files would be the same.

[ I think that this text above replies also to Franco Ponticelli about Razor ]

> From: clemos


> It may be a bit longer to write, but still I see it as a way to
> enforce better practices, and especially cross-platform best
> practices, which is rare...
> In your example, <span id="var"/> and ::var:: are actually *almost* the same.
> Because having an actual span around your var makes it easier to use
> with JS, either to update it or to extract data from it.
> So if you write <span class="var"><?= $var ?></span> more often than
> just <?= $var ?>, writing only <span id="var" /> ends up being
> shorter...

I totally agree with you.

> From: Tarwin Stroh-Spijer


> This may be a philosophical difference, but I've generally found Smarty
> templates more annoying than helpful. This is because they define a whole
> new syntax, mostly for doing things that are already available to you in
> PHP; PHP is already a templating language itself (yeah I know it has OOP but
> really that doesn't change the fact that it's roots are templating). Things
> like {$var|capitalize} are strange to me because you could directly write
> this in PHP with <?=ucwords($var)?>. It's no more complex and gives you full
> control, without you having to learn a whole other "language" for no
> benefit.

Using PHP as a templating language is the traditional approach, but I think that in most of the cases it results in a very difficult to maintain code. With the Smarty approach I think that the application can fit better in the MVC pattern, even making possible that the most View code can be written in a more structured and easy to learn language such as HTML/XML.

--
haXe - an open source web programming language
http://haxe.org


--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: My Google Summer of Code ideas

jlm@justinfront.net
You know HaXe does not need more template stuff it just needs everything it has to be cross platform seamless and explained to newbie level and some of the better projects taken to commercial viability, haxe already has PDO... but I gave up trying to use it, maybe I was mixing sql access stuff hacking blindly, but dropping a php sqlite table did not seem to work and the rest seemed flaky... I ended up simulating a backend by writting methods that made writting to a file look the same, I am not a database user and I did not have time to really look in detail but I spent enough time to realise that databases are a mess and they can be simpler, for my use it should have been out of the box easy, neko seems more solid but the ndll are not supporting most platforms out of the box.  As for compiling on any common computer, we are really not there yet and I wish it was more my field to help but compiling ocaml on win7 64 bit without access to vs2012 or wot ever is not easy, I used to think the problems where due to me having a mac but I am not so sure... and it's not my cup of tea but I will help where I can, we keep pushing boundaries but not getting the cross platform out of the box in the way advertised... we are close but no cigar.  It's really not useful that the community is so smart.. we assume that the average web worker can figure out how to use this stuff... sorry but Ruby community are smart but they religiously make dumb ass tutorials, whereas I feel guilty to ask the obvious and really the more people we get past the obvious setup stuff the more real stuff will be contributed.  What Stedorze is asking about and interested in, on the message for hugh is exactly the area haXe needs work on, it's really no good for Hugh to improve the c++ target unless he gets a team round him to make sure it works on all developer systems.  It's mad but I think till we do this all his good work is going to waste, if you compare it with some of the stuff coming out of adobe, microsoft etc... its technical seems better but unless we explain it all the ideas are under exploited. 

So Valentin, my suggestion for a google code would be to make haXe work better than it says on the tin, in many cases it does, or atleast in a few cases it is amazingly easy to use..  but in others it doesn't, but its mainly just setup, maybe it's about defining a core relability and getting that reliable. Don't get me wrong haXe is way out performing as3.   But in other areas I am not sure it is reaching it's potential.

Not sure it's exciting but google summer needs to be spent by someone on consolidating the current technology, and defining goals - for instance linux support on screenweaver, so that people realize that haXe does actually have some of the best technologies, and it really is fluid language with all platforms, browser and target, sometimes it's just filling in the documentation gaps other times it's testing other times its pulling up us as a community and telling us what needs fixing.

Sorry if this is negative but as a haXe user who puts effort to put my small areas of expertise in a simple light I feel that maybe some super smart guys out there assume that everyone should know what they do which frankly is not always more than me, just different :), rather than thinking wow if I made sure these smart guys knew what I know then they can show me how to do what they do. We really have to make the community believe in simplicity, if it's not simple then we need to explain it.

Anyway if you create something new Valentin then hopefully my thoughts will be in your mind when documenting it :)

My quote for the year was something about Stax only for advanced people, and maybe to complex for me.. lets make sure haXe is for everyone, on a side note happy to try Stax but more backend guys than me have looked and moved on,  so elitism needs to be quelled it does not do justice and I think maybe stax has a bit of elitism going on and it can't be doing it any good.

Sorry I am fairly dense and smart at the same time, but felt Valentin should realise where haXe really needs work. New stuff is fun but to really contribute may not be always fun but probably just as rewarding.

Cheers

;j

 
On 17 Mar 2011, at 21:43, Tarwin Stroh-Spijer wrote:

One thing you want to think about when creating templating languages is how readable they are. How much they take away from what you see as the structure of your html,code,xml,data,whatever. The reason I like using MTT is that it generally has the least amount of code to do things, hence doesn't ruin the look of my HTML, and I can still understand it as HTML.

I'm not saying it's a bad idea to have more templating, just things to be weary of. I know MTT has problems too - for example it only seems to parse strict XHTML hence trying to do HTML5 stuff in there fails miserably!


Tarwin Stroh-Spijer
_______________________

Touch My Pixel
http://www.touchmypixel.com/
phone: +61 3 8060 5321
_______________________


2011/3/17 Valentín <[hidden email]>
Hello again.

> From: clemos


> Speaking of template systems, I really like the approach of this project :
> https://github.com/hij1nx/weld
> I haven't really used it yet, but I really like the idea of avoiding
> special markup like <?, <%, ${ or whatever.

The Weld approach seems to be a good one... but I'm not feeling very comfortable to how the conditionals seems to work :S .

I mean, the main idea of the template system I am trying to describe is to be a XML dialect that could be parsed in Haxe but not a new template-language --that's the reason to try to avoid smarty-like syntax. I really love the Smarty (and some other systems you are pointing) features, but I think that a HTML designer should know HTML and XML, but not a lot of templating syntax. I think it would be more easy to learn a new set of etiquettes with their attributes rather than {if $something} things. And, also, in this kind of templates we would avoid things such wrong colouring in HTML/XML editors --with Smarty syntax, for example, my text editor warns me when I mix up Smarty and HTML, because it's not a valid XML syntax.

It could be hard to implement all the Smarty (and others) features without introducing some new syntax, but I would try to be the less possible.

So, Haxe would feed and parse the syntax, but the system could be rewritten in C++, Pascal or whatever and the template files would be the same.

[ I think that this text above replies also to Franco Ponticelli about Razor ]

> From: clemos


> It may be a bit longer to write, but still I see it as a way to
> enforce better practices, and especially cross-platform best
> practices, which is rare...
> In your example, <span id="var"/> and ::var:: are actually *almost* the same.
> Because having an actual span around your var makes it easier to use
> with JS, either to update it or to extract data from it.
> So if you write <span class="var"><?= $var ?></span> more often than
> just <?= $var ?>, writing only <span id="var" /> ends up being
> shorter...

I totally agree with you.

> From: Tarwin Stroh-Spijer


> This may be a philosophical difference, but I've generally found Smarty
> templates more annoying than helpful. This is because they define a whole
> new syntax, mostly for doing things that are already available to you in
> PHP; PHP is already a templating language itself (yeah I know it has OOP but
> really that doesn't change the fact that it's roots are templating). Things
> like {$var|capitalize} are strange to me because you could directly write
> this in PHP with <?=ucwords($var)?>. It's no more complex and gives you full
> control, without you having to learn a whole other "language" for no
> benefit.

Using PHP as a templating language is the traditional approach, but I think that in most of the cases it results in a very difficult to maintain code. With the Smarty approach I think that the application can fit better in the MVC pattern, even making possible that the most View code can be written in a more structured and easy to learn language such as HTML/XML.

--
haXe - an open source web programming language
http://haxe.org

--
haXe - an open source web programming language
http://haxe.org


--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: My Google Summer of Code ideas

Tarwin Stroh-Spijer
I totally agree, though have some comments:
  • I don't know how useful being able to compile the compiler yourself is, unless you're going to be editing it yourself and then you're probably already familiar with OCaml and how to get it working on your system.

  • I don't agree that's it's only the SWF export that is mature and stable. The PHP system is great, and has been working for us for over two years now! Also, the JS works great, although there are some points that could be easier for beginners.

  • C++ export works well, and I'd say is heading towards maturity. The main problem with it is the same problem I assume you get when you try to write CPP by hand, and that's setting up a good development environment. The best IDE I've found, at least easiest to set up for CPP was Code::Blocks. But this is generally not the full solution, because you're wanting to be able to be inside a haxe IDE ie FlashDevelop and have a single click to get it working. I know FDT is working on this as we speak, so hopefully that will be a good solution for some people. We also have the problem here though that the CPP target is still in a state of flux in how you set up your tool chains - but they could be better documented as well. If you get something working, then add it to the haxe wiki! At least it's there, and can be cleaned up later on.

  • I think the problem that a lot face is documentation. And this includes the documentation of what you can use each target for, there strengths and weaknesses. I also think we need to document things such as toolchains as setups per-version, or at least state which version of haxe you are using, as this changes things dramatically sometimes. I also know how hard it is to do documentation, especially when you're still trying to get something working 100%, so we need people who are happy to concentrate particularly on documentation. For example, I've only just started adding very small amounts of documentation to Poko!

  • Just because you can write once, doesn't mean you can deploy everywhere, this really depends on libraries, not on haxe. For example, it would be nice to have a fuller implementation that can go between SWF and CPP - the current one is great but there's a massive lack of useful documentation and examples. Yes there is examples, but in terms of "full project" examples there isn't. So yeah, standard libraries to do specific tasks ie display graphics on different platforms Flash > JS > CPP > Java > C#  > Neko. Again I know there are these would just be good to document them, especially what works on what.

  • I also agree that complexities such as stax can be very confusing to us non-programmers (yep, I'm a script-monkey) but at the same time, having these there is great for pushing peoples understanding of programming. I really like Nicolass's idea that the language really need to be kept simple, as a base. That said I think that some of the base libraries, at least the "tools", such as StringTools, could do with a lot more helper functionality that would allow those people coming from languages with lots (too many?) of base functions ie PHP feel at home and not like they're having to do it all themselves. One thing that struck me when I looked at Ruby again (just then) is that in their example run through, things are easier by the fact they have a "pass-by-reference" like operator "!" that really cuts down on code and simplifies the learning process.
Regards,


Tarwin Stroh-Spijer
_______________________

Touch My Pixel
http://www.touchmypixel.com/
phone: +61 3 8060 5321
_______________________


On Fri, Mar 18, 2011 at 9:02 AM, [hidden email] <[hidden email]> wrote:
You know HaXe does not need more template stuff it just needs everything it has to be cross platform seamless and explained to newbie level and some of the better projects taken to commercial viability, haxe already has PDO... but I gave up trying to use it, maybe I was mixing sql access stuff hacking blindly, but dropping a php sqlite table did not seem to work and the rest seemed flaky... I ended up simulating a backend by writting methods that made writting to a file look the same, I am not a database user and I did not have time to really look in detail but I spent enough time to realise that databases are a mess and they can be simpler, for my use it should have been out of the box easy, neko seems more solid but the ndll are not supporting most platforms out of the box.  As for compiling on any common computer, we are really not there yet and I wish it was more my field to help but compiling ocaml on win7 64 bit without access to vs2012 or wot ever is not easy, I used to think the problems where due to me having a mac but I am not so sure... and it's not my cup of tea but I will help where I can, we keep pushing boundaries but not getting the cross platform out of the box in the way advertised... we are close but no cigar.  It's really not useful that the community is so smart.. we assume that the average web worker can figure out how to use this stuff... sorry but Ruby community are smart but they religiously make dumb ass tutorials, whereas I feel guilty to ask the obvious and really the more people we get past the obvious setup stuff the more real stuff will be contributed.  What Stedorze is asking about and interested in, on the message for hugh is exactly the area haXe needs work on, it's really no good for Hugh to improve the c++ target unless he gets a team round him to make sure it works on all developer systems.  It's mad but I think till we do this all his good work is going to waste, if you compare it with some of the stuff coming out of adobe, microsoft etc... its technical seems better but unless we explain it all the ideas are under exploited. 

So Valentin, my suggestion for a google code would be to make haXe work better than it says on the tin, in many cases it does, or atleast in a few cases it is amazingly easy to use..  but in others it doesn't, but its mainly just setup, maybe it's about defining a core relability and getting that reliable. Don't get me wrong haXe is way out performing as3.   But in other areas I am not sure it is reaching it's potential.

Not sure it's exciting but google summer needs to be spent by someone on consolidating the current technology, and defining goals - for instance linux support on screenweaver, so that people realize that haXe does actually have some of the best technologies, and it really is fluid language with all platforms, browser and target, sometimes it's just filling in the documentation gaps other times it's testing other times its pulling up us as a community and telling us what needs fixing.

Sorry if this is negative but as a haXe user who puts effort to put my small areas of expertise in a simple light I feel that maybe some super smart guys out there assume that everyone should know what they do which frankly is not always more than me, just different :), rather than thinking wow if I made sure these smart guys knew what I know then they can show me how to do what they do. We really have to make the community believe in simplicity, if it's not simple then we need to explain it.

Anyway if you create something new Valentin then hopefully my thoughts will be in your mind when documenting it :)

My quote for the year was something about Stax only for advanced people, and maybe to complex for me.. lets make sure haXe is for everyone, on a side note happy to try Stax but more backend guys than me have looked and moved on,  so elitism needs to be quelled it does not do justice and I think maybe stax has a bit of elitism going on and it can't be doing it any good.

Sorry I am fairly dense and smart at the same time, but felt Valentin should realise where haXe really needs work. New stuff is fun but to really contribute may not be always fun but probably just as rewarding.

Cheers

;j

 
On 17 Mar 2011, at 21:43, Tarwin Stroh-Spijer wrote:

One thing you want to think about when creating templating languages is how readable they are. How much they take away from what you see as the structure of your html,code,xml,data,whatever. The reason I like using MTT is that it generally has the least amount of code to do things, hence doesn't ruin the look of my HTML, and I can still understand it as HTML.

I'm not saying it's a bad idea to have more templating, just things to be weary of. I know MTT has problems too - for example it only seems to parse strict XHTML hence trying to do HTML5 stuff in there fails miserably!


Tarwin Stroh-Spijer
_______________________

Touch My Pixel
http://www.touchmypixel.com/
phone: <a href="tel:%2B61%203%208060%205321" target="_blank">+61 3 8060 5321
_______________________


2011/3/17 Valentín <[hidden email]>
Hello again.

> From: clemos


> Speaking of template systems, I really like the approach of this project :
> https://github.com/hij1nx/weld
> I haven't really used it yet, but I really like the idea of avoiding
> special markup like <?, <%, ${ or whatever.

The Weld approach seems to be a good one... but I'm not feeling very comfortable to how the conditionals seems to work :S .

I mean, the main idea of the template system I am trying to describe is to be a XML dialect that could be parsed in Haxe but not a new template-language --that's the reason to try to avoid smarty-like syntax. I really love the Smarty (and some other systems you are pointing) features, but I think that a HTML designer should know HTML and XML, but not a lot of templating syntax. I think it would be more easy to learn a new set of etiquettes with their attributes rather than {if $something} things. And, also, in this kind of templates we would avoid things such wrong colouring in HTML/XML editors --with Smarty syntax, for example, my text editor warns me when I mix up Smarty and HTML, because it's not a valid XML syntax.

It could be hard to implement all the Smarty (and others) features without introducing some new syntax, but I would try to be the less possible.

So, Haxe would feed and parse the syntax, but the system could be rewritten in C++, Pascal or whatever and the template files would be the same.

[ I think that this text above replies also to Franco Ponticelli about Razor ]

> From: clemos


> It may be a bit longer to write, but still I see it as a way to
> enforce better practices, and especially cross-platform best
> practices, which is rare...
> In your example, <span id="var"/> and ::var:: are actually *almost* the same.
> Because having an actual span around your var makes it easier to use
> with JS, either to update it or to extract data from it.
> So if you write <span class="var"><?= $var ?></span> more often than
> just <?= $var ?>, writing only <span id="var" /> ends up being
> shorter...

I totally agree with you.

> From: Tarwin Stroh-Spijer


> This may be a philosophical difference, but I've generally found Smarty
> templates more annoying than helpful. This is because they define a whole
> new syntax, mostly for doing things that are already available to you in
> PHP; PHP is already a templating language itself (yeah I know it has OOP but
> really that doesn't change the fact that it's roots are templating). Things
> like {$var|capitalize} are strange to me because you could directly write
> this in PHP with <?=ucwords($var)?>. It's no more complex and gives you full
> control, without you having to learn a whole other "language" for no
> benefit.

Using PHP as a templating language is the traditional approach, but I think that in most of the cases it results in a very difficult to maintain code. With the Smarty approach I think that the application can fit better in the MVC pattern, even making possible that the most View code can be written in a more structured and easy to learn language such as HTML/XML.

--
haXe - an open source web programming language
http://haxe.org

--
haXe - an open source web programming language
http://haxe.org


--
haXe - an open source web programming language
http://haxe.org


--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: My Google Summer of Code ideas

Gamehaxe
Hi,
Yes I think simply setting up the build environment can stop people getting
started with c++.  One of the other problems is that there is actually
already 11 build environments: Win(vc), Win(mingw), Mac, Mac64, Linux,  
Linux64,
Android, GPH, iPhone, iPhone Sim, WebOS.  And then on top of this, the  
mobile
dev environments change every 4 months or so!  the IPHONE_VER was 2.1 when
I started, now it is 4.3.  Google change their directory layout from
$ANDROID/prebuilt to $ANDROID/toolchains/arm-eabi-4.4.0/prebuilt, and go  
from
"Oh, you must use cygwin!" to "why are you using cygwin, it's crap?"

So it is not hard to see why this is hard for people not familiar with both
haxe and c++.

I think on mac + linux, it is ok the provide a few docs about how to  
install
the gcc with the local system tools.  But maybe on windows, someone (not  
me!) could
put together a "proper" installer that includes haxe and, say, mingw and
flashdevelop, a bunch of haxelibs pre-installed, same sample projects that
work etc etc.  So they can go "main() { trace("Hello"); }" and have a
working .exe.

Mobile dev is a bit tricker - because of the rapid changes to the compiler.
I have managed to free the android target from the evil clutches of  
eclipse,
but I have not done the same for xcode - and possibly will not be able to,
because apple keeps on changing stuff.

So maybe the project here would be to write a c++ prerequisite checker.
You run the scrip and it outputs:

Checking neko...    your system does not have gc.1.so, please download  
 from ...
Checking haxe...    up to date

Checking hxcpp...   your hxcpp variable points to an old version of hxcpp
                     there is a new version of hxcpp availible
Checking iphone...  your iphone version (3.1) is no longer supported,  
please upgrade to 4.2.
Checking android... You do not have an sdk installed. Please download it  
 from ...

Another idea may be a GUI editor for the .hxcpp_config.xml file, so you can
set the root directories to various things.

Hugh


>    - C++ export works well, and I'd say is heading towards maturity. The
>    main problem with it is the same problem I assume you get when you  
> try to
>    write CPP by hand, and that's setting up a good development  
> environment.

--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: My Google Summer of Code ideas

Andy Li
In reply to this post by Valentín
2011/3/17 Valentín <[hidden email]>
Here I think that the better option could be to create a set of etiquettes that would fit well with the actual HTML syntax. I think that something like

<if condition="obj1.var == true" />
    <p>Some HTML code.</p>
<elif condition="obj2.var == true && obj3.var == 3" />
    <p>Another text, with a HTML-tag-like prints: <print string="obj.var" /> and <print int="obj3.var" /> <!-- This way we can check for types -->
<else />
   <p>Attributes could be a nice way to do output formatting: <print string="obj.var" escape="html" /> and <print int="obj.timestamp" format="date" pattern="l jS \of F Y h:i:s A" /></p>
<endif /> 
But you know, HTML has no <if> or the like, so it is not valid HTML (but is valid XML).
It may also become problematic when used with XML, since they shares the same syntax.
It may be possible to be solved with a proper namespace like you've suggested. Testing is needed.
 

This could be hard to accomplish in one GSoC, but I could implement the first usable subset of features during GSoC and later I would continue the development of the system in my free time.

What do you think about this?
Of course! But remember to state which part you want to finish in summer and which is possible extension. 


I've also found a weld-like template system in the past, called pure. I'm not sure which came first though.
Their approach is definitely creative and interesting, but the lack of "if", "for" and other scripting ability within the template is annoying.
You may try the following approach, which is using html5 custom data attributes.
<div data-hx-if="obj.var1">Variable 1 is true!</div>


One more idea is to use XML comment syntax.
<!-- if (obj.var1) { -->
<div>Variable 1 is true!</div>
<!-- } -->


Keep brain-storming ;)

Andy

--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: My Google Summer of Code ideas

clemos
Hi Andy,

To me, "for" statements is not so much problematic because the
templating system has to be able to duplicate content nodes when the
data to display is an Array or an Iterable.
There are some rules to be defined here, of course (for example: if
the Array is empty, do we leave the content nodes as "default"
content, or do we remove them).
Conditionals are a bit more tricky, and indeed need some other
notation, such as those you said.

I think the interest of this markup approach is to make it possible
for designers to build templates that can be processed on different
platforms, and in particular optimised for Javascript.
One of the big interests of Weld is to be able to make use of native
CSS selectors and DOM manipulations when possible.

So, speaking of conditionnals, I think it could be handled either by
HTML5 data attributes or by custom (namespaced?) css classes, like
this:
<span id="myVar" class="template:not-empty" data-not-empty="true" />
This custom class/data attribute can the be processed through a CSS
selector (js), or through XML manipulation (server side).

Weld also allows for custom options and/or processing method with
which you can also manage more complex situations, IMHO in a more
reusable way.
I feel this approach as bringing a lower coupling between models and
templates than most other templating systems, because most of the
time, you have to somehow format your data structure very precisely to
be adapted to your template.

The point is also, once again, that most of my php templates look
something like:
<? if( $items ) : ?>
<ul class="items">
<? foreach( $items as $item ) : ?>
<li><?= $item->name ?></li>
<? endforeach; ?>
</ul>
<? endif; ?>

So I find it interresting to find workarounds to avoid such crap in
templates, even if in a few cases it will require a bit more work.

+++++
Clément

On Fri, Mar 18, 2011 at 11:54 AM, Andy Li <[hidden email]> wrote:

> 2011/3/17 Valentín <[hidden email]>
>>
>> Here I think that the better option could be to create a set of etiquettes
>> that would fit well with the actual HTML syntax. I think that something like
>>
>> <if condition="obj1.var == true" />
>>     <p>Some HTML code.</p>
>> <elif condition="obj2.var == true && obj3.var == 3" />
>>     <p>Another text, with a HTML-tag-like prints: <print string="obj.var"
>> /> and <print int="obj3.var" /> <!-- This way we can check for types -->
>> <else />
>>    <p>Attributes could be a nice way to do output formatting: <print
>> string="obj.var" escape="html" /> and <print int="obj.timestamp"
>> format="date" pattern="l jS \of F Y h:i:s A" /></p>
>> <endif />
>
> But you know, HTML has no <if> or the like, so it is not valid HTML (but is
> valid XML).
> It may also become problematic when used with XML, since they shares the
> same syntax.
> It may be possible to be solved with a proper namespace like you've
> suggested. Testing is needed.
>
>>
>> This could be hard to accomplish in one GSoC, but I could implement the
>> first usable subset of features during GSoC and later I would continue the
>> development of the system in my free time.
>>
>> What do you think about this?
>
> Of course! But remember to state which part you want to finish in summer and
> which is possible extension.
>
> I've also found a weld-like template system in the past, called pure. I'm
> not sure which came first though.
> Their approach is definitely creative and interesting, but the lack of "if",
> "for" and other scripting ability within the template is annoying.
> You may try the following approach, which is using html5 custom data
> attributes.
> <div data-hx-if="obj.var1">Variable 1 is true!</div>
>
> One more idea is to use XML comment syntax.
> <!-- if (obj.var1) { -->
> <div>Variable 1 is true!</div>
> <!-- } -->
>
> Keep brain-storming ;)
> Andy
> --
> haXe - an open source web programming language
> http://haxe.org
>

--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: My Google Summer of Code ideas

Andy Li
I think the interest of this markup approach is to make it possible
for designers to build templates that can be processed on different
platforms, and in particular optimised for Javascript.
One of the big interests of Weld is to be able to make use of native
CSS selectors and DOM manipulations when possible.
We also have a problem here, which we do not have a CSS selector engine in haXe...
It can be another GSoC project :P
 
So, speaking of conditionnals, I think it could be handled either by
HTML5 data attributes or by custom (namespaced?) css classes, like
this:
<span id="myVar" class="template:not-empty" data-not-empty="true" />
This custom class/data attribute can the be processed through a CSS
selector (js), or through XML manipulation (server side).
Using special css class is good idea!
 
Weld also allows for custom options and/or processing method with
which you can also manage more complex situations, IMHO in a more
reusable way.
I feel this approach as bringing a lower coupling between models and
templates than most other templating systems, because most of the
time, you have to somehow format your data structure very precisely to
be adapted to your template.
I'm not sure, but I feel more like designer formatting the template to adapte to the system.
Maybe that's because I tried designing themes for existing CMS a few times, I like having more control on the template side.


Best,
Andy

--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: My Google Summer of Code ideas

Jason O'Neil
Interesting thread!

for designers to build templates that can be processed on different
platforms, and in particular optimised for Javascript.
One of the big interests of Weld is to be able to make use of native
CSS selectors and DOM manipulations when possible.
We also have a problem here, which we do not have a CSS selector engine in haXe...
It can be another GSoC project :P

I agree that a selector engine in native haXe (so that it is cross platform) would be fantastic.  I had a go at porting the sizzle.js selector engine, famous from jquery, but had a few points where my proficiency with javascript wasn't really enough to understand the code, and understand how to translate it.  It certainly looked like it would be possible though.

Is there anyone on list whose got a strong familiarity with both javascript and haxe that I could occasionally ask for their insight?  If so I might give it another go.

So, speaking of conditionnals, I think it could be handled either by
HTML5 data attributes or by custom (namespaced?) css classes, like
this:
<span id="myVar" class="template:not-empty" data-not-empty="true" />
This custom class/data attribute can the be processed through a CSS
selector (js), or through XML manipulation (server side).
Using special css class is good idea!

Python has a templating system called Genshi which I think has quite a nice, xml based syntax:

http://genshi.edgewall.org/wiki/Documentation/xml-templates.html

Examples might be:
<ul>
<li py:for="item in items">${item}</li>
</ul>
Or
<ul>
<py:for each="item in items">
<li>${item}</li>
</py:for>
</ul>
I wouldn't object to seeing something similar (compatible even?) adopted in haxe.  Though their syntax is namespace based, and I believe haxe's Xml class doesn't support namespaces. I suppose you could always fake it.  Or add support :) 

Interested to see where this goes!
And willing to help make sure it goes somewhere, as a GSOC project or not ;)
Jason

--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: My Google Summer of Code ideas

Franco Ponticelli
<ul>
<py:for each="item in items">
<li>${item}</li>
</py:for>
</ul> 
I really like TAL like syntaxes but even so I recomend you to give a look to Razor/Erazor:

<ul>
for(item in items)
{
  <li>@item</li>
}
</ul>

Honestly I can't think anything easier. And note that the syntax for the logic part is hscript (could be easily extended to haxe if needed) so it is very natural for using methods, variables and arrays.

Franco

--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: My Google Summer of Code ideas

Valentín
In reply to this post by Valentín
Hi!

> From: Andy Li

> You may try the following approach, which is using html5 custom data
> attributes <http://html5doctor.com/html5-custom-data-attributes/>.
> <div data-hx-if="obj.var1">Variable 1 is true!</div>

I like this approach, it seems to be the most standard compliant one.

I also like the Genshi template system mentioned by Jason O'Neil --it's too similar to the syntax I've been thinking about.

> From: clemos

> To me, "for" statements is not so much problematic because the
> templating system has to be able to duplicate content nodes when the
> data to display is an Array or an Iterable.
> There are some rules to be defined here, of course (for example: if
> the Array is empty, do we leave the content nodes as "default"
> content, or do we remove them).
> Conditionals are a bit more tricky, and indeed need some other
> notation, such as those you said.

I think that this is a really good idea too (a template system that automatically expands arrays and iterables), and could solve the problem pointed out by yourself:

> The point is also, once again, that most of my php templates look
> something like:
> <? if( $items ) : ?>
> <ul class="items">
> <? foreach( $items as $item ) : ?>
> <li><?= $item->name ?></li>
> <? endforeach; ?>
> </ul>
> <? endif; ?>
>
> So I find it interresting to find workarounds to avoid such crap in
> templates, even if in a few cases it will require a bit more work.

I have the same problem and I think that it increases the complexity of the syntax so much.

Well... I was really interested in doing this but, sadly, haXe is not accepted in this Summer of Code, so I will try the next time again --maybe I could work on it sooner, but its a bit complicated to work on a project like that working and studying at the same time...

So, thanks for brainstorming!

--
haXe - an open source web programming language
http://haxe.org