Thread overview
Vibe.d on Windows
Sep 21
Martyn
Sep 22
Martyn
Sep 23
Abdulhaq
September 21
Hi all. New member but been into D for a little while.

Bit of a backstory - I look after software for a particular company. Their systems are old and (still) using things like VB6 and Classic ASP. Yes they are Windows Servers. I have managed to update some of their software to .NET when the opportunity presents itself.

With regards to their web tools - I want to re-write their classic ASP to something else. Now I could use .NET Core or similar.. but I would also be interested in moving their tools over to the D language.

I am primarily a Linux user and have played about with Vibe.d and really like it. However, has anyone experienced using vibe.d for Windows and IIS? Is the process much harder?

Also, they use SQL Server. I have used D libraries for MySQL which are fine - but what is the status regarding D communicating with SQL Server?

I am just wondering if it is worth it - or whether I should just stay with C# .NET Core? I know C# is getting better installed and used in the Linux world but I just feel D is the better language as I could even encourage the company to move to Linux systems and save some pennies.

How do you guys find using D in the Windows environment (real projects and releases) as well as IIS and SQL Server? What about build a D program to be a Windows Service??

Thanks.

September 21
On Monday, 21 September 2020 at 08:50:59 UTC, Martyn wrote:
> Hi all. New member but been into D for a little while.
>
> Bit of a backstory - I look after software for a particular company. Their systems are old and (still) using things like VB6 and Classic ASP. Yes they are Windows Servers. I have managed to update some of their software to .NET when the opportunity presents itself.
>
> [...]

+1 for this. I'm currently also using C# and it's so easy. I would love it if it was as easy using D.
September 21
On Monday, 21 September 2020 at 08:50:59 UTC, Martyn wrote:
> Hi all. New member but been into D for a little while.
>
> Bit of a backstory - I look after software for a particular company. Their systems are old and (still) using things like VB6 and Classic ASP. Yes they are Windows Servers. I have managed to update some of their software to .NET when the opportunity presents itself.
>
> With regards to their web tools - I want to re-write their classic ASP to something else. Now I could use .NET Core or similar.. but I would also be interested in moving their tools over to the D language.
>
> I am primarily a Linux user and have played about with Vibe.d and really like it. However, has anyone experienced using vibe.d for Windows and IIS? Is the process much harder?
>
> Also, they use SQL Server. I have used D libraries for MySQL which are fine - but what is the status regarding D communicating with SQL Server?
>
> I am just wondering if it is worth it - or whether I should just stay with C# .NET Core? I know C# is getting better installed and used in the Linux world but I just feel D is the better language as I could even encourage the company to move to Linux systems and save some pennies.
>
> How do you guys find using D in the Windows environment (real projects and releases) as well as IIS and SQL Server? What about build a D program to be a Windows Service??
>
> Thanks.

In short - as much as I like D, I'd avoid using it in this scenario if you want to make fast progress and don't want to spent a lot of time on it.

1) Creating a windows service - shouldn't be a problem. There's https://code.dlang.org/packages/daemonize (never tried it, but should get you started)

2) Hosting vibe-d application in IIS - probably only by means of reverse proxy - see ie https://stackify.com/how-to-deploy-asp-net-core-to-iis/ as .Net Core is hosted the same way there

3) MS SQL - real problems starts here..

I don't know of any D project to provide MS SQL connectivity for vibe-d.

If I'm not mistaken D provides only basic ODBC bindings here: https://dlang.org/phobos/etc_c_odbc_sql.html
So you would need to work with ODBC drivers with it.

This could be a good starting point: https://github.com/adamdruppe/arsd/blob/master/mssql.d

But there'll probably be a problem with async access needed for vibe (or you'd block fibers).
See https://code.dlang.org/packages/vibe-d-postgresql for a project that works with vibe by using async methods of underlying libpq and socket events handled by vibe-d - you'll need something like that too (and I don't know if ODBC driver can support something like that - seems it should be possible: https://stackoverflow.com/questions/305795/can-i-make-asynchronous-odbc-calls-any-reference-materials).

As this is all pretty lowlevel stuff, you'll end up writing some abstraction layer above.

Other option (probably better but even more time consuming) would be to implement MS SQL communication protocol natively for vibe-d (similarly to mysql-native).

See https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-tds/b46a581a-39de-4745-b076-ec4dbb7d13ec

Rust has it this way too: https://docs.rs/tiberius/0.4.9/tiberius/

So it's all doable, but there isn't existing solution you could use right away and profit.
September 22
On Monday, 21 September 2020 at 13:14:22 UTC, tchaloupka wrote:
> In short - as much as I like D, I'd avoid using it in this scenario if you want to make fast progress and don't want to spent a lot of time on it.
>
> ...

Thank you for the reply.

* I was not aware of daemonize - looks awesome!
* Looks like vibe.d is not that difficult on IIS to setup.
* Yeah, I guess this thread should really be about MS SQL and Dlang... :-)

As much as I would consider moving from MS SQL to MySQL - the reality is that this complicated due to all the software that runs around it - a number which are old and I really do not want to change them unless I really have to.

It looks like for this company I might just stick with C# .NET.
Many thanks.
September 22
On Tuesday, 22 September 2020 at 07:02:18 UTC, Martyn wrote:
> On Monday, 21 September 2020 at 13:14:22 UTC, tchaloupka wrote:
>> In short - as much as I like D, I'd avoid using it in this scenario if you want to make fast progress and don't want to spent a lot of time on it.
>>
>> ...
>
> Thank you for the reply.
>
> * I was not aware of daemonize - looks awesome!
> * Looks like vibe.d is not that difficult on IIS to setup.
> * Yeah, I guess this thread should really be about MS SQL and Dlang... :-)
>
> As much as I would consider moving from MS SQL to MySQL - the reality is that this complicated due to all the software that runs around it - a number which are old and I really do not want to change them unless I really have to.
>
> It looks like for this company I might just stick with C# .NET.
> Many thanks.

Does D not support SQL?
September 22
On 2020-09-22 19:55, Imperatorn wrote:

> Does D not support SQL?

The problem is the protocol used to communicate with the database server. This is different for all database servers (SQLServer, PostgreSQL, MySQL, SQLite).

-- 
/Jacob Carlborg
September 23
On Tuesday, 22 September 2020 at 07:02:18 UTC, Martyn wrote:
> On Monday, 21 September 2020 at 13:14:22 UTC, tchaloupka wrote:
>> In short - as much as I like D, I'd avoid using it in this scenario if you want to make fast progress and don't want to spent a lot of time on it.
>>
>> ...
>
> Thank you for the reply.
>
> * I was not aware of daemonize - looks awesome!
> * Looks like vibe.d is not that difficult on IIS to setup.
> * Yeah, I guess this thread should really be about MS SQL and Dlang... :-)
>
> As much as I would consider moving from MS SQL to MySQL - the reality is that this complicated due to all the software that runs around it - a number which are old and I really do not want to change them unless I really have to.
>
> It looks like for this company I might just stick with C# .NET.
> Many thanks.

For future reference, this project seems to support MS SQL via ODBC:

https://github.com/buggins/ddbc