www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - Vibe.d on Windows

reply Martyn <norealaddreass somewhere.com> writes:
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 

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.
Sep 21 2020
next sibling parent Imperatorn <johan_forsberg_86 hotmail.com> writes:
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.

 [...]
would love it if it was as easy using D.
Sep 21 2020
prev sibling parent reply tchaloupka <chalucha gmail.com> writes:
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 

 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.
Sep 21 2020
parent reply Martyn <norealaddreass somewhere.com> writes:
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. Many thanks.
Sep 22 2020
next sibling parent reply Imperatorn <johan_forsberg_86 hotmail.com> writes:
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. Many thanks.
Does D not support SQL?
Sep 22 2020
parent Jacob Carlborg <doob me.com> writes:
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
Sep 22 2020
prev sibling parent Abdulhaq <alynch4047 gmail.com> writes:
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. Many thanks.
For future reference, this project seems to support MS SQL via ODBC: https://github.com/buggins/ddbc
Sep 23 2020