February 05
On Tuesday, 5 February 2019 at 20:15:55 UTC, sai wrote:
> Funny thing is after reading all these emails I am still confused how to get vibe.d working on windows. Could somebody create a step-by-step instructions with an example that actually works? Pretty please? Thanks in advance.

On a Windows 10 VM I had lying around that should be bare, the following worked for me:
- Installing dmd for Windows from dlang.org
- Not installing anything from Visual Studio during dmd's installation
- Installing the Visual C++ runtimes 2010 and 2013 from microsoft.com (https://www.microsoft.com/download/details.aspx?id=14632 and https://www.microsoft.com/download/details.aspx?id=40784)
- In a command prompt, in whichever directory you'd like to work: `dub init --type=vibe.d hello-web`
- `cd hello-web`
- `dub run --arch=x86_64`

This seemed to be enough to have a Hello World on 127.0.0.1:8080, I hope I hadn't done anything else I've forgotten.
February 07
On Tuesday, 5 February 2019 at 10:47:36 UTC, Laurent Tréguier wrote:
> On Monday, 4 February 2019 at 23:28:51 UTC, Ben wrote:
>> 1. That is a ... Tatum ... LINUX EXAMPLE, so its already not platform agnostic path.
>> 2. You think that running a hashbang example is a good introduction to end users?
>> 3. People lean the wrong way and are bypassing the dub package manager
>>
>> Let me compare to a few languages:
>>
>> Go: import ( "net/http" ) ...
>>
>> Ready, set, go ...
>>
>> Crystal: require "http/server"
>>
>> Ready, set, go ...
>
> My 2 cents:
> The comparison cith Go holds, but comparing D with Crystal is invalid if you are talking about Windows issues; since Crystal isn't natively available on Windows.

Indeed, but the problem remains.

Using D for server and GUI development should appear easy and natural.

The current vibe.d examples isn't conveying that, with all its "black magic" comments.

Contrarily to what D's "leadership" thinks, D has the potential to become a very good competitor to Go and Crystal for server development, as both of them are also performant garbage collected languages.

And with dlangui, developing connected desktop application is a real pleasure.

D should be promoted for what it does best, and should how complex application can be made easily and efficiently with simple code.

February 07
On Thursday, 7 February 2019 at 08:26:50 UTC, Ecstatic Coder wrote:
> On Tuesday, 5 February 2019 at 10:47:36 UTC, Laurent Tréguier wrote:
>> On Monday, 4 February 2019 at 23:28:51 UTC, Ben wrote:
>>> 1. That is a ... Tatum ... LINUX EXAMPLE, so its already not platform agnostic path.
>>> 2. You think that running a hashbang example is a good introduction to end users?
>>> 3. People lean the wrong way and are bypassing the dub package manager
>>>
>>> Let me compare to a few languages:
>>>
>>> Go: import ( "net/http" ) ...
>>>
>>> Ready, set, go ...
>>>
>>> Crystal: require "http/server"
>>>
>>> Ready, set, go ...
>>
>> My 2 cents:
>> The comparison cith Go holds, but comparing D with Crystal is invalid if you are talking about Windows issues; since Crystal isn't natively available on Windows.
>
> Indeed, but the problem remains.
>
> Using D for server and GUI development should appear easy and natural.
>
> The current vibe.d examples isn't conveying that, with all its "black magic" comments.
>
> Contrarily to what D's "leadership" thinks, D has the potential to become a very good competitor to Go and Crystal for server development, as both of them are also performant garbage collected languages.
>
> And with dlangui, developing connected desktop application is a real pleasure.
>
> D should be promoted for what it does best, and should how complex application can be made easily and efficiently with simple code.

From your post I am not sure whether you know the purpose of the comments in the vibe.d example.

The dub.sdl comment is a dub single package descriptor. You can save the lines to a file example.d and run it with command: dub example.d

With latest dub you can even save the file without the extension .d and if you are on a Linux system you can execute it just with command: ./example. That this the purpose of the shebang line.

I would not describe it as black magic but as very convenient way of calling D coding.
Vibe.d does here a very good job and just leverage features of posix os and features of the dub package manager.

Kind regards
Andre


February 07
On Thursday, 7 February 2019 at 11:51:37 UTC, Andre Pany wrote:
> On Thursday, 7 February 2019 at 08:26:50 UTC, Ecstatic Coder wrote:
>> On Tuesday, 5 February 2019 at 10:47:36 UTC, Laurent Tréguier wrote:
>>> On Monday, 4 February 2019 at 23:28:51 UTC, Ben wrote:
>>>> 1. That is a ... Tatum ... LINUX EXAMPLE, so its already not platform agnostic path.
>>>> 2. You think that running a hashbang example is a good introduction to end users?
>>>> 3. People lean the wrong way and are bypassing the dub package manager
>>>>
>>>> Let me compare to a few languages:
>>>>
>>>> Go: import ( "net/http" ) ...
>>>>
>>>> Ready, set, go ...
>>>>
>>>> Crystal: require "http/server"
>>>>
>>>> Ready, set, go ...
>>>
>>> My 2 cents:
>>> The comparison cith Go holds, but comparing D with Crystal is invalid if you are talking about Windows issues; since Crystal isn't natively available on Windows.
>>
>> Indeed, but the problem remains.
>>
>> Using D for server and GUI development should appear easy and natural.
>>
>> The current vibe.d examples isn't conveying that, with all its "black magic" comments.
>>
>> Contrarily to what D's "leadership" thinks, D has the potential to become a very good competitor to Go and Crystal for server development, as both of them are also performant garbage collected languages.
>>
>> And with dlangui, developing connected desktop application is a real pleasure.
>>
>> D should be promoted for what it does best, and should how complex application can be made easily and efficiently with simple code.
>
> From your post I am not sure whether you know the purpose of the comments in the vibe.d example.
>
> The dub.sdl comment is a dub single package descriptor. You can save the lines to a file example.d and run it with command: dub example.d
>
> With latest dub you can even save the file without the extension .d and if you are on a Linux system you can execute it just with command: ./example. That this the purpose of the shebang line.
>
> I would not describe it as black magic but as very convenient way of calling D coding.
> Vibe.d does here a very good job and just leverage features of posix os and features of the dub package manager.
>
> Kind regards
> Andre

Don't get me wrong.

I'm not saying that including dub commands into D source code can't be convenient.

I'm just saying that when you show only one example on the landing page of a programming language, it'd better be crystal clear.

Or people will see this "complication" as the norm with this language.

It's just a matter of public perception.

As you know, I'm personally in favor of showing **THREE** **SIMPLE** **USEFUL** examples :

1. how to declare/initialize/process an array and read/write/split/replace stuff in a text file
2. how to make a "hello world" http web server
3. how to open a window, enter some text, and say "hello xxx" when you push a "hello" button

Simple, easy and concise code.

I'm VERY happy there is a web server example on D's landing page. I mean it.

But removing this sort of "garbage" comment, as useful as it is, would probably make the example more pleasant to read for people evaluating the interest of using D for their next personal/professionnal project...

February 07
On Thursday, 7 February 2019 at 18:18:16 UTC, Ecstatic Coder wrote:
>
> Simple, easy and concise code.
>
> I'm VERY happy there is a web server example on D's landing page. I mean it.
>
> But removing this sort of "garbage" comment, as useful as it is, would probably make the example more pleasant to read for people evaluating the interest of using D for their next personal/professionnal project...

Do you mind if I ask how the current example is dark magic for you?
How would you/we make it better?
February 07
On Thursday, 7 February 2019 at 20:22:17 UTC, Seb wrote:
> On Thursday, 7 February 2019 at 18:18:16 UTC, Ecstatic Coder wrote:
>>
>> Simple, easy and concise code.
>>
>> I'm VERY happy there is a web server example on D's landing page. I mean it.
>>
>> But removing this sort of "garbage" comment, as useful as it is, would probably make the example more pleasant to read for people evaluating the interest of using D for their next personal/professionnal project...
>
> Do you mind if I ask how the current example is dark magic for you?
> How would you/we make it better?

Stupid simple :

void main()
{
    import vibe.d;
    listenHTTP(":8080", (req, res) {
        res.writeBody("Hello, World: " ~ req.path);
    });
    runApplication();
}

Not stupid simple :

#!/usr/bin/env dub
/+ dub.sdl:
name "hello_vibed"
dependency "vibe-d" version="~>0.8.0"
+/
void main()
{
    import vibe.d;
    listenHTTP(":8080", (req, res) {
        res.writeBody("Hello, World: " ~ req.path);
    });
    runApplication();
}

It's just pure cosmetics. But as with everything, "how it looks" is something that matter.

If I arrive at a professional IT appointment with my customer with a three day beard and my jogging clothes, he won't judge me the same as if I'm shaved and with my suit and tie.

When you are evaluating a programming language, the first lines of code you see give you a good or bad impression about it. And in all matters it's always better to give a good impression from the start.

I guess some people are very fond of cryptic languages with esoteric syntaxes, etc. But honestly I'm not sure it's the norm, and that most people dislike simple, crystal clear code.

February 07
On Thursday, 7 February 2019 at 20:49:31 UTC, Ecstatic Coder wrote:
> On Thursday, 7 February 2019 at 20:22:17 UTC, Seb wrote:
>> On Thursday, 7 February 2019 at 18:18:16 UTC, Ecstatic Coder wrote:
>>> [...]
>>
>> Do you mind if I ask how the current example is dark magic for you?
>> How would you/we make it better?
>
> Stupid simple :
>
> void main()
> {
>     import vibe.d;
>     listenHTTP(":8080", (req, res) {
>         res.writeBody("Hello, World: " ~ req.path);
>     });
>     runApplication();
> }
>
> Not stupid simple :
>
> #!/usr/bin/env dub
> /+ dub.sdl:
> name "hello_vibed"
> dependency "vibe-d" version="~>0.8.0"
> +/
> void main()
> {
>     import vibe.d;
>     listenHTTP(":8080", (req, res) {
>         res.writeBody("Hello, World: " ~ req.path);
>     });
>     runApplication();
> }
>
> It's just pure cosmetics. But as with everything, "how it looks" is something that matter.
>
> If I arrive at a professional IT appointment with my customer with a three day beard and my jogging clothes, he won't judge me the same as if I'm shaved and with my suit and tie.
>
> When you are evaluating a programming language, the first lines of code you see give you a good or bad impression about it. And in all matters it's always better to give a good impression from the start.
>
> I guess some people are very fond of cryptic languages with esoteric syntaxes, etc. But honestly I'm not sure it's the norm, and that most people dislike simple, crystal clear code.

Is it pure cosmetics? I thought the whole point of the dub comment was so that you could just run "dub server.d" and it would just work?

In your super simple example, it won't just work, you need to do to the whole dub fetch/build thing. Not saying it's a bad thing, but we are talking about first impressions, and I can see pros/cons to both approaches.

Jordan



February 07
On Thu, Feb 07, 2019 at 09:27:47PM +0000, Jordan Wilson via Digitalmars-d wrote:
> On Thursday, 7 February 2019 at 20:49:31 UTC, Ecstatic Coder wrote:
[...]
> > Stupid simple :
> > 
> > void main()
> > {
> >     import vibe.d;
> >     listenHTTP(":8080", (req, res) {
> >         res.writeBody("Hello, World: " ~ req.path);
> >     });
> >     runApplication();
> > }
> > 
> > Not stupid simple :
> > 
> > #!/usr/bin/env dub
> > /+ dub.sdl:
> > name "hello_vibed"
> > dependency "vibe-d" version="~>0.8.0"
> > +/
> > void main()
> > {
> >     import vibe.d;
> >     listenHTTP(":8080", (req, res) {
> >         res.writeBody("Hello, World: " ~ req.path);
> >     });
> >     runApplication();
> > }
[...]
> Is it pure cosmetics? I thought the whole point of the dub comment was so that you could just run "dub server.d" and it would just work?
> 
> In your super simple example, it won't just work, you need to do to the whole dub fetch/build thing. Not saying it's a bad thing, but we are talking about first impressions, and I can see pros/cons to both approaches.
[...]

I think his point is that whatever effect is triggered by the dub comment should be made the *default* behaviour, such that you don't need to type out any of it explicitly and the compiler/toolchain/whatever will just Do It(tm), whatever It may be.  The current default is that it will not work if the dub comment isn't there.  His argument is that this default should be changed so that it *does* work.  In theory, dub "should" be able to detect the "import vibe.d" line and from there figure out what to do "automatically".

I'm unsure whether I agree with him, though.  In order to pull this off, dub will have to implement heuristics for detecting VibeD imports and somehow map that to the requisite vibe-d dependency declaration.  I'm uncertain I'm entirely comfortable with this kind of IMO hackish implementation that may end up interacting badly with other things once you get beyond trivial projects.

But regardless, he certainly has a point in making things work out-of-the-box with minimal effort, even if we may disagree on just how minimal this minimal effort should be.  Not everyone is a masochistic programmer like myself who would shun such niceties and prefer manually compiling and linking stuff on the command-line. (This is why it'd probably be a bad idea to put me on the marketing / UI design team. :-P)


T

-- 
Those who don't understand Unix are condemned to reinvent it, poorly.
February 07
On Thursday, 7 February 2019 at 21:47:07 UTC, H. S. Teoh wrote:
> On Thu, Feb 07, 2019 at 09:27:47PM +0000, Jordan Wilson via Digitalmars-d wrote:
>> [...]
> [...]
>> > [...]
> [...]
>> [...]
> [...]
>
> I think his point is that whatever effect is triggered by the dub comment should be made the *default* behaviour, such that you don't need to type out any of it explicitly and the compiler/toolchain/whatever will just Do It(tm), whatever It may be.  The current default is that it will not work if the dub comment isn't there.  His argument is that this default should be changed so that it *does* work.  In theory, dub "should" be able to detect the "import vibe.d" line and from there figure out what to do "automatically".
>
> I'm unsure whether I agree with him, though.  In order to pull this off, dub will have to implement heuristics for detecting VibeD imports and somehow map that to the requisite vibe-d dependency declaration.  I'm uncertain I'm entirely comfortable with this kind of IMO hackish implementation that may end up interacting badly with other things once you get beyond trivial projects.
>
> But regardless, he certainly has a point in making things work out-of-the-box with minimal effort, even if we may disagree on just how minimal this minimal effort should be.  Not everyone is a masochistic programmer like myself who would shun such niceties and prefer manually compiling and linking stuff on the command-line. (This is why it'd probably be a bad idea to put me on the marketing / UI design team. :-P)
>
>
> T

Ah I see.

I pretty much started using dub because I was sick of manually dealing with includes/libs from within my previous IDE, and thought the ability to simply put dependency "vibe-d" version="~>0.8.4" in my project and be done was great; the thought of even more automagic convenience didn't even occur to me!

Jordan

February 07
On Thursday, 7 February 2019 at 21:47:07 UTC, H. S. Teoh wrote:
> I think his point is that whatever effect is triggered by the dub comment should be made the *default* behaviour

I'm pretty sure it's just that it looks messy because of the dub stuff (which isn't _strictly_ necessary).  I honestly kind of agree.

Sure, removing it would remove your ability to just paste it in a file and run it, but... do people actually do that?

I wonder if it'd be helped by putting a comment explaining the top matter?  Or link to a "runnable" version?

-Wyatt
1 2 3 4 5 6