Re: vibe.d 0.7.12 released

2013-02-13 Thread Michael
Another one template engine that has pretty syntax is Razor in 
ASP.NET MVC. It's opensource and can be used in non-web areas.


Although it would be good to read a simple tutorial "how to 
use/integrate 3rd party template engine with vibe.d".


Re: vibe.d 0.7.12 released

2013-02-12 Thread Sönke Ludwig
Am 12.02.2013 09:36, schrieb Johannes Pfau:
> 
> mustache has a D implementation since some time:
> https://github.com/repeatedly/mustache-d
> 
> There's no special vibe.d integration, but it shouldn't be hard to get
> it working. I've used mustache-d before it's pretty easy to use but
> it's a simple template system, it might not have all features you'd
> expect.
> 

In particular it just has to have support for writing to a char/dchar output 
range (vibe.d's
OutputStream implements a range interface).


Re: vibe.d 0.7.12 released

2013-02-12 Thread Johannes Pfau
Am Mon, 11 Feb 2013 20:08:44 +0100
schrieb FG :

> Great project -- a flagship example of D's real world application!
> 
> On 2013-02-11 19:11, Ali Çehreli wrote:
> > same code as Python, translated to D. Of course, the solution that
> > use vibe.d does not have Python's infamous GIL; instead, it comes
> > with parallelism and concurrency out of the box. And you are aware
> > of typos in your code even before running your program. ;)
> 
> Running worker processes can make the GIL problem a little less of a
> PITA, but having the typos pointed out before running the app... is
> just priceless. :)
> 
> I'm struggling with the temptation to move a Python website to vibe.d.
> What keeps me from doing that are Django templates. Not even because
> vibe's templates have to be recompiled each time some small markup
> change is introduced -- I got used to that with LaTeX ;) -- but
> because of Jade. It's way too far off course from HTML for my tastes.
> I see no reason for inventing a completely new format when all you
> need is templating.
> 
> So let me use this opportunity to ask you: is somebody working on
> other template systems for vibe.d already or shall I get involved
> myself? I'm thinking about something similar to this, syntax-wise:
> http://jinja.pocoo.org/

mustache has a D implementation since some time:
https://github.com/repeatedly/mustache-d

There's no special vibe.d integration, but it shouldn't be hard to get
it working. I've used mustache-d before it's pretty easy to use but
it's a simple template system, it might not have all features you'd
expect.



Re: vibe.d 0.7.12 released

2013-02-12 Thread Nathan M. Swan

On Monday, 11 February 2013 at 21:41:33 UTC, Jacob Carlborg wrote:

On 2013-02-11 22:07, FG wrote:

The problem I have with those is that they are designed for 
HTML.

What if I wanted to make an email template instead?


Erb is like a Ruby preprocessor that can be used for any 
format. It's used for many things in Ruby on Rails:


index.html.erb - Erb preprocessor, result is HTML

<% if foo %>
  asd
<% end %>

bar.js.coffee.erb - Erb then CoffeeScript preprocessor, result 
is JavaScript


<% if foo %>
  bar = -> console.log("asd")
<% end %>

foo.text.erb - Erb preprocessor, result is plain text

<% if foo %>
  asd
<% end %>

database.yml.erb - Erb preprocessor, result is YAML

development:
  username: <%= username %>
  password: <%= password %>


This really makes sense for D. It can be easily combined with D's 
mixin capabilities to make it so you don't even need to implement 
stuff like various loops:


<%  [d code] %>   ->   [d code]
<%= [d expr] %>   ->   buffer.write([d expr]);
[text]->   buffer.write("[text]");

NMS


Re: vibe.d 0.7.12 released

2013-02-11 Thread Sönke Ludwig
Am 11.02.2013 20:08, schrieb FG:
> 
> So let me use this opportunity to ask you: is somebody working on other 
> template systems for vibe.d
> already or shall I get involved myself? I'm thinking about something similar 
> to this, syntax-wise:
> http://jinja.pocoo.org/

I personally also wanted to start a purely text based template system for a 
while*, but never got
around to it, yet. My idea was to make something that is similar to the 
existing template syntax, so
it feels more consistent (i.e. use #{expr} or !{expr} for inserting strings). I 
also wanted to more
directly use D statements instead of special casing all of them, like the 
Twig-likes do - which is a
lot of work and probably has higher memory requirements during compilation 
(which is already often
at it's limit right now).

Of course, for people coming from Twig/Django it would be a big familiarity 
advantage to provide the
same syntax, and existing templates could be reused. So that would be great to 
have.

However, as soon as I really need it and nothing else exists yet, I will 
probably implement a very
basic version of the former that can be extended later. Twig, from the first 
looks, just seems like
much more involved than I can afford for this ATM.


* For HTML I very much prefer to have all the syntax overhead of HTML taken 
off. It's faster to type
and more readable (more readable also because it's possible to leave blank 
lines to structure the
code without having them appear in the output). But of course this is a topic 
of personal
taste/preference.


Re: vibe.d 0.7.12 released

2013-02-11 Thread Sönke Ludwig
Am 11.02.2013 22:29, schrieb Nick Sabalausky:
> On Mon, 11 Feb 2013 12:53:55 +0100
> Sönke Ludwig  wrote:
> 
>> Changes:
>>
>>  - Refactored the MongoDB client to better match the actual database
>>structure + range interface for query results (by Dicebot)
>>
>>  - A number of important fixes in the HttpClient and ConnectionPool
>>
>>  - Correct memory alignment is now enforced in the custom memory
>> allocators (Caused exceptions on 32-bit Linux)
>>
>>  - Added task management methods (interrupt(), join() and running)
>>
>>  - Lots of smaller fixes and enhancements
>>
>> Full change log: http://vibed.org/blog/posts/vibe-release-0.7.12
>> Download: http://vibed.org/download?file=vibed-0.7.12.zip
>> GitHub: https://github.com/rejectedsoftware/vibe.d
> 
> The full changelog is missing this:
> 
> HttpFileServerSettings.maxAge is changed from (was it int/ulong/..?
> Forget what it was) to Duration. Pull #178
> 

Thanks, it's in now. It's easy to get lost in the commit log/issue list.

It would be nice to have an automated solution, but that won't work, as trivial 
things and fixes for
unreleased stuff just adds noise and needs to be manually filtered out 
somehow...


Re: vibe.d 0.7.12 released

2013-02-11 Thread Dicebot
I have considered writing and proposing one, but it is a very low 
priority to me now, sorry. Should be not that difficult 
considering driver for MySQL can be used as an example ( 
http://registry.vibed.org/packages/mysql-native ), just 
time-consuming.


Re: vibe.d 0.7.12 released

2013-02-11 Thread David
Am 11.02.2013 12:53, schrieb Sönke Ludwig:
> Changes:
> 
>  - Refactored the MongoDB client to better match the actual database
>structure + range interface for query results (by Dicebot)
> 
>  - A number of important fixes in the HttpClient and ConnectionPool
> 
>  - Correct memory alignment is now enforced in the custom memory allocators
>(Caused exceptions on 32-bit Linux)
> 
>  - Added task management methods (interrupt(), join() and running)
> 
>  - Lots of smaller fixes and enhancements
> 
> Full change log: http://vibed.org/blog/posts/vibe-release-0.7.12
> Download: http://vibed.org/download?file=vibed-0.7.12.zip
> GitHub: https://github.com/rejectedsoftware/vibe.d
> 

Cool, but one thing hinders me from moving from Python to Vibe, is a
Postgres DB driver (any plans on integrating Postgres?)

and (non vibe related) something so amazing and fucking awesome like
SqlAlchemy!


Re: vibe.d 0.7.12 released

2013-02-11 Thread Jacob Carlborg

On 2013-02-11 22:07, FG wrote:


The problem I have with those is that they are designed for HTML.
What if I wanted to make an email template instead?


Erb is like a Ruby preprocessor that can be used for any format. It's 
used for many things in Ruby on Rails:


index.html.erb - Erb preprocessor, result is HTML

<% if foo %>
  asd
<% end %>

bar.js.coffee.erb - Erb then CoffeeScript preprocessor, result is JavaScript

<% if foo %>
  bar = -> console.log("asd")
<% end %>

foo.text.erb - Erb preprocessor, result is plain text

<% if foo %>
  asd
<% end %>

database.yml.erb - Erb preprocessor, result is YAML

development:
  username: <%= username %>
  password: <%= password %>

--
/Jacob Carlborg


Re: vibe.d 0.7.12 released

2013-02-11 Thread Nick Sabalausky
On Mon, 11 Feb 2013 12:53:55 +0100
Sönke Ludwig  wrote:

> Changes:
> 
>  - Refactored the MongoDB client to better match the actual database
>structure + range interface for query results (by Dicebot)
> 
>  - A number of important fixes in the HttpClient and ConnectionPool
> 
>  - Correct memory alignment is now enforced in the custom memory
> allocators (Caused exceptions on 32-bit Linux)
> 
>  - Added task management methods (interrupt(), join() and running)
> 
>  - Lots of smaller fixes and enhancements
> 
> Full change log: http://vibed.org/blog/posts/vibe-release-0.7.12
> Download: http://vibed.org/download?file=vibed-0.7.12.zip
> GitHub: https://github.com/rejectedsoftware/vibe.d

The full changelog is missing this:

HttpFileServerSettings.maxAge is changed from (was it int/ulong/..?
Forget what it was) to Duration. Pull #178



Re: vibe.d 0.7.12 released

2013-02-11 Thread jerro

On Monday, 11 February 2013 at 21:06:41 UTC, FG wrote:

On 2013-02-11 21:37, Jacob Carlborg wrote:

On 2013-02-11 20:08, FG wrote:
I'm struggling with the temptation to move a Python website 
to vibe.d.
What keeps me from doing that are Django templates. Not even 
because
vibe's templates have to be recompiled each time some small 
markup
change is introduced -- I got used to that with LaTeX ;) -- 
but because
of Jade. It's way too far off course from HTML for my tastes. 
I see no
reason for inventing a completely new format when all you 
need is

templating.


I like Haml, it's similar to Jade but without the pipes for 
the plain text.


What about plain HTML, like Ruby (Erb) or PHP uses.



The problem I have with those is that they are designed for 
HTML.

What if I wanted to make an email template instead?


If you need a D templating engine that can be used for anything, 
not just HTML, you could try http://mustache.github.com/.


Re: vibe.d 0.7.12 released

2013-02-11 Thread Nick Sabalausky
On Mon, 11 Feb 2013 20:08:44 +0100
FG  wrote:

> Great project -- a flagship example of D's real world application!
> 
> On 2013-02-11 19:11, Ali Çehreli wrote:
> > same code as Python, translated to D. Of course, the solution that
> > use vibe.d does not have Python's infamous GIL; instead, it comes
> > with parallelism and concurrency out of the box. And you are aware
> > of typos in your code even before running your program. ;)
> 
> Running worker processes can make the GIL problem a little less of a
> PITA, but having the typos pointed out before running the app... is
> just priceless. :)
> 
> I'm struggling with the temptation to move a Python website to vibe.d.
> What keeps me from doing that are Django templates. Not even because
> vibe's templates have to be recompiled each time some small markup
> change is introduced -- I got used to that with LaTeX ;) -- but
> because of Jade. It's way too far off course from HTML for my tastes.
> I see no reason for inventing a completely new format when all you
> need is templating.
> 
> So let me use this opportunity to ask you: is somebody working on
> other template systems for vibe.d already or shall I get involved
> myself? I'm thinking about something similar to this, syntax-wise:
> http://jinja.pocoo.org/

I admit I'm not a fan of Jade either. Indent-syntaxes just aren't my
thing. And fixing the larger semantic issues I have with HTML/CSS isn't
part of Jade's charter, AFAICT. (That said, I don't have any problem
with it being in Vibe.d.)

Personally, I just use Adam's HTML DOM for D:
https://github.com/adamdruppe/misc-stuff-including-D-programming-language-web-stuff

I've built up a couple utility libs that use the DOM to help automate
some stuff (defining a page, caching rendered pages, repeating elements
on a page, building/validating forms). It's mostly independent of
Vibe.d, but I do use it with Vibe.d.

I've been planning to release those utility libs when they're a
little bit more ready (they're still a little too closely integrated
into a private project of mine, and they still need some more work).



Re: vibe.d 0.7.12 released

2013-02-11 Thread FG

On 2013-02-11 21:37, Jacob Carlborg wrote:

On 2013-02-11 20:08, FG wrote:

I'm struggling with the temptation to move a Python website to vibe.d.
What keeps me from doing that are Django templates. Not even because
vibe's templates have to be recompiled each time some small markup
change is introduced -- I got used to that with LaTeX ;) -- but because
of Jade. It's way too far off course from HTML for my tastes. I see no
reason for inventing a completely new format when all you need is
templating.


I like Haml, it's similar to Jade but without the pipes for the plain text.

What about plain HTML, like Ruby (Erb) or PHP uses.



The problem I have with those is that they are designed for HTML.
What if I wanted to make an email template instead?



Re: vibe.d 0.7.12 released

2013-02-11 Thread FG

On 2013-02-11 21:11, Russel Winder wrote:

Python is not being compared to D here, vibe.d is being compared to
 Flask, Bottle,…


Who knows, maybe Python was being compared. You can have a nice HTTP server in 
Python in 0 lines of code, by running: python -m SimpleHTTPServer   :)



Issues about Python GIL are irrelevant (even if true) as people just use
process pools via multiprocessing or concurrent.futures.


Exactly, for example spawn a few processes with uWSGI and the Python script 
doesn't have to deal with multithreading or even use greenlets. So in most of 
the cases there is no GIL issue... unless you really need multithreading for a 
fast web service keeping internal states and locks, entering a no-python land.



Connections to SQL, MongoDB, Cassandra, Redis, Neo4J, etc. and
templating engines are the real kicker here not the even loop.  If it's
all in place get the marketing material in place and let the presses
roll.


Yeah, a sane templating engine is a must. Once you have those things covered, 
you can win people over by playing to the performance tune. They love that.

Of course having a big traffic site using it would help a lot.


Re: vibe.d 0.7.12 released

2013-02-11 Thread Nick Sabalausky
On Mon, 11 Feb 2013 20:11:13 +
Russel Winder  wrote:

> On Mon, 2013-02-11 at 10:11 -0800, Ali Çehreli wrote:
> […]
> > I use vibe.d as an example of how useful a tool D is. Recently,
> > somebody has shown me a web server code written in Python: It was
> > in 14 lines, could you belive it? Well, I've responded back with a
> > vibe.d example. It was basically the same code as Python,
> > translated to D. Of course, the solution that use vibe.d does not
> > have Python's infamous GIL; instead, it comes with parallelism and
> > concurrency out of the box. And you are aware of typos in your code
> > even before running your program. ;)
> 
> Python is not being compared to D here, vibe.d is being compared to
>  Flask, Bottle,…
> 

The "aware of typos in your code even before running your program" is
definitely a direct Python vs D thing. And it's a huge deal, IMO (And
yea, I'm saying that after having [tried to] use Python/Bottle).

> I would suggest that vibe.d can be a real competitor in the Flask,
> Sinatra, Ratpack, etc. in the microframework space. But it needs the
> word spreading, which means serious applications mentioned in Python,
> Ruby, Groovy, and Go mailing lists. Issues about Python GIL are
> irrelevant (even if true) as people just use process pools via
> multiprocessing or concurrent.futures. It is important to not
> obviously compare apples with wing nuts ;-)
> 

While I agree that Vibe.d vs Flask/DJango/etc is the bigger comparison
here, I think GIL is still relevant: With the Python-based
stuff (as far as I'm aware), it's something that has to be actively
worked around. When I tried to use Python/Bottle, I didn't even *know*
how to do that ('Course, I'm not super-experienced with Python - and
hope to never be - but still.) With D/Vibe.d, OTOH, GIL is simply
a non-issue period.



Re: vibe.d 0.7.12 released

2013-02-11 Thread Jacob Carlborg

On 2013-02-11 20:08, FG wrote:

Great project -- a flagship example of D's real world application!

On 2013-02-11 19:11, Ali Çehreli wrote:

same code as Python, translated to D. Of course, the solution that use
vibe.d
does not have Python's infamous GIL; instead, it comes with
parallelism and
concurrency out of the box. And you are aware of typos in your code
even before
running your program. ;)


Running worker processes can make the GIL problem a little less of a
PITA, but having the typos pointed out before running the app... is just
priceless. :)

I'm struggling with the temptation to move a Python website to vibe.d.
What keeps me from doing that are Django templates. Not even because
vibe's templates have to be recompiled each time some small markup
change is introduced -- I got used to that with LaTeX ;) -- but because
of Jade. It's way too far off course from HTML for my tastes. I see no
reason for inventing a completely new format when all you need is
templating.

So let me use this opportunity to ask you: is somebody working on other
template systems for vibe.d already or shall I get involved myself? I'm
thinking about something similar to this, syntax-wise:
http://jinja.pocoo.org/


I like Haml, it's similar to Jade but without the pipes for the plain text.

What about plain HTML, like Ruby (Erb) or PHP uses.

--
/Jacob Carlborg


Re: vibe.d 0.7.12 released

2013-02-11 Thread Russel Winder
On Mon, 2013-02-11 at 10:11 -0800, Ali Çehreli wrote:
[…]
> I use vibe.d as an example of how useful a tool D is. Recently, somebody 
> has shown me a web server code written in Python: It was in 14 lines, 
> could you belive it? Well, I've responded back with a vibe.d example. It 
> was basically the same code as Python, translated to D. Of course, the 
> solution that use vibe.d does not have Python's infamous GIL; instead, 
> it comes with parallelism and concurrency out of the box. And you are 
> aware of typos in your code even before running your program. ;)

Python is not being compared to D here, vibe.d is being compared to
 Flask, Bottle,…

I would suggest that vibe.d can be a real competitor in the Flask,
Sinatra, Ratpack, etc. in the microframework space. But it needs the
word spreading, which means serious applications mentioned in Python,
Ruby, Groovy, and Go mailing lists. Issues about Python GIL are
irrelevant (even if true) as people just use process pools via
multiprocessing or concurrent.futures. It is important to not obviously
compare apples with wing nuts ;-)

Connections to SQL, MongoDB, Cassandra, Redis, Neo4J, etc. and
templating engines are the real kicker here not the even loop.  If it's
all in place get the marketing material in place and let the presses
roll.

-- 
Russel.
=
Dr Russel Winder  t: +44 20 7585 2200   voip: sip:russel.win...@ekiga.net
41 Buckmaster Roadm: +44 7770 465 077   xmpp: rus...@winder.org.uk
London SW11 1EN, UK   w: www.russel.org.uk  skype: russel_winder


signature.asc
Description: This is a digitally signed message part


Re: vibe.d 0.7.12 released

2013-02-11 Thread FG

On 2013-02-11 20:40, Aleksandar Ruzicic wrote:

I'm working on porting Twig (http://twig.sensiolabs.org/) to D (so I can use it
with vibe.d) but I'm still far even from a preview release.. I'm hoping to have
more spare time in upcoming months to implement at least small usable subset of
Twig features.


Splendid. Tell me if you need help with that.



Re: vibe.d 0.7.12 released

2013-02-11 Thread Aleksandar Ruzicic

On Monday, 11 February 2013 at 19:08:16 UTC, FG wrote:
Great project -- a flagship example of D's real world 
application!


On 2013-02-11 19:11, Ali Çehreli wrote:
same code as Python, translated to D. Of course, the solution 
that use vibe.d
does not have Python's infamous GIL; instead, it comes with 
parallelism and
concurrency out of the box. And you are aware of typos in your 
code even before

running your program. ;)


Running worker processes can make the GIL problem a little less 
of a PITA, but having the typos pointed out before running the 
app... is just priceless. :)


I'm struggling with the temptation to move a Python website to 
vibe.d.
What keeps me from doing that are Django templates. Not even 
because vibe's templates have to be recompiled each time some 
small markup change is introduced -- I got used to that with 
LaTeX ;) -- but because of Jade. It's way too far off course 
from HTML for my tastes. I see no reason for inventing a 
completely new format when all you need is templating.


So let me use this opportunity to ask you: is somebody working 
on other template systems for vibe.d already or shall I get 
involved myself? I'm thinking about something similar to this, 
syntax-wise: http://jinja.pocoo.org/


I'm working on porting Twig (http://twig.sensiolabs.org/) to D 
(so I can use it with vibe.d) but I'm still far even from a 
preview release.. I'm hoping to have more spare time in upcoming 
months to implement at least small usable subset of Twig features.


I will post in this forum/NG once I have something to show..


Re: vibe.d 0.7.12 released

2013-02-11 Thread FG

Great project -- a flagship example of D's real world application!

On 2013-02-11 19:11, Ali Çehreli wrote:

same code as Python, translated to D. Of course, the solution that use vibe.d
does not have Python's infamous GIL; instead, it comes with parallelism and
concurrency out of the box. And you are aware of typos in your code even before
running your program. ;)


Running worker processes can make the GIL problem a little less of a PITA, but 
having the typos pointed out before running the app... is just priceless. :)


I'm struggling with the temptation to move a Python website to vibe.d.
What keeps me from doing that are Django templates. Not even because vibe's 
templates have to be recompiled each time some small markup change is introduced 
-- I got used to that with LaTeX ;) -- but because of Jade. It's way too far off 
course from HTML for my tastes. I see no reason for inventing a completely new 
format when all you need is templating.


So let me use this opportunity to ask you: is somebody working on other template 
systems for vibe.d already or shall I get involved myself? I'm thinking about 
something similar to this, syntax-wise: http://jinja.pocoo.org/


Re: vibe.d 0.7.12 released

2013-02-11 Thread Ali Çehreli

On 02/11/2013 03:53 AM, Sönke Ludwig wrote:


Full change log: http://vibed.org/blog/posts/vibe-release-0.7.12
Download: http://vibed.org/download?file=vibed-0.7.12.zip
GitHub: https://github.com/rejectedsoftware/vibe.d


Great work! :)

I use vibe.d as an example of how useful a tool D is. Recently, somebody 
has shown me a web server code written in Python: It was in 14 lines, 
could you belive it? Well, I've responded back with a vibe.d example. It 
was basically the same code as Python, translated to D. Of course, the 
solution that use vibe.d does not have Python's infamous GIL; instead, 
it comes with parallelism and concurrency out of the box. And you are 
aware of typos in your code even before running your program. ;)


Ali


Re: vibe.d 0.7.12 released

2013-02-11 Thread Jordi Sayol
Al 11/02/13 12:53, En/na Sönke Ludwig ha escrit:
> Changes:
> 
>  - Refactored the MongoDB client to better match the actual database
>structure + range interface for query results (by Dicebot)
> 
>  - A number of important fixes in the HttpClient and ConnectionPool
> 
>  - Correct memory alignment is now enforced in the custom memory allocators
>(Caused exceptions on 32-bit Linux)
> 
>  - Added task management methods (interrupt(), join() and running)
> 
>  - Lots of smaller fixes and enhancements
> 
> Full change log: http://vibed.org/blog/posts/vibe-release-0.7.12
> Download: http://vibed.org/download?file=vibed-0.7.12.zip
> GitHub: https://github.com/rejectedsoftware/vibe.d
> 

Congratulations for this new release Sönke! Great work!

-- 
Jordi Sayol



vibe.d 0.7.12 released

2013-02-11 Thread Sönke Ludwig
Changes:

 - Refactored the MongoDB client to better match the actual database
   structure + range interface for query results (by Dicebot)

 - A number of important fixes in the HttpClient and ConnectionPool

 - Correct memory alignment is now enforced in the custom memory allocators
   (Caused exceptions on 32-bit Linux)

 - Added task management methods (interrupt(), join() and running)

 - Lots of smaller fixes and enhancements

Full change log: http://vibed.org/blog/posts/vibe-release-0.7.12
Download: http://vibed.org/download?file=vibed-0.7.12.zip
GitHub: https://github.com/rejectedsoftware/vibe.d