www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - dlang website design

reply Ecstatic Coder <ecstatic.coder gmail.com> writes:
Following my previous post about showing to first-time visitors 
of dlang.org some code example that shows how simpler the D code 
looks like compared to mainstream scripting and programming 
languages, is there any plan to change the design of the landing 
page any time soon ?

The current design may be fine to convincing C++ experts to 
switch to D, but I don't think it's that effective for less 
experienced programmers, looking for an alternative to 
JavaScript, Python or Ruby.

I'm a big fan of the python.org website, which is obviously 
targeted at inexperienced programmers.

I've personally taught imperative and object-oriented programming 
to my two teenager kids just with D and Coedit, and it really was 
the perfect beginner language.

D is powerful, indeed, but it's greatest quality is that it's 
easy to learn.

Sorry to come back with this sample, but the following code 
snippet is actually even simpler than what they were able to 
program after one week at one hour of training per day.

class TOTO
{
     bool IsCool;
     int Age;
     TUTU[] Tutus;
     TOTO[string] Totos;

     void Foo( TUTU tutu )
     {
         Tutus ~= tutu;
         Totos[ tutu.Name ] = tutu.Toto;
     }
}

class TUTU
{
     string Name;
     TOTO Toto;

     this( string name )
     {
         Name = name;
         Toto = new TOTO;
     }
}

void Bar(
     TOTO toto
     )
{
     toto.IsCool = !toto.IsCool;
}

void main()
{
     TUTU tutu;
     TOTO toto;

     tutu = new TUTU( "tutu" );

     toto = new TOTO;
     toto.Foo( tutu );
     toto.Bar();
}

I'm sure it's mainly because of D's elegant simplicity, even 
compared to JavaScript, Python, etc.

Selling D as a solid programming language for high performance 
development is obvious and natural, but I think that trying to 
make the website very appealing to inexperienced programmers as 
well could significantly broaden its user base.
Jun 22
next sibling parent reply Cym13 <cpicard openmailbox.org> writes:
On Thursday, 22 June 2017 at 19:19:20 UTC, Ecstatic Coder wrote:
 Following my previous post about showing to first-time visitors 
 of dlang.org some code example that shows how simpler the D 
 code looks like compared to mainstream scripting and 
 programming languages, is there any plan to change the design 
 of the landing page any time soon ?

 [...]
Just so you know the current design was set less than a year ago so while I'm in no position to say no change will happen this seems unlikely. But dlang.org is, like everything, open source so you could make a proposal.
Jun 22
parent Ecstatic Coder <ecstatic.coder gmail.com> writes:
 Just so you know the current design was set less than a year 
 ago so while I'm in no position to say no change will happen 
 this seems unlikely. But dlang.org is, like everything, open 
 source so you could make a proposal.
Indeed...
Jun 22
prev sibling next sibling parent reply ag0aep6g <anonymous example.com> writes:
On 06/22/2017 09:19 PM, Ecstatic Coder wrote:
 The current design may be fine to convincing C++ experts to switch to D, 
 but I don't think it's that effective for less experienced programmers, 
 looking for an alternative to JavaScript, Python or Ruby.
 
 I'm a big fan of the python.org website, which is obviously targeted at 
 inexperienced programmers.
I think you'll have to elaborate on that. How is python.org "obviously" targeted at inexperienced programmers and dlang.org isn't? The home pages look rather similar to me: menu, search box, code sample, sales pitch, those text boxes with icons, etc. What would you change on dlang.org? Completely overhaul everything, or just adjust the wording and other details to be more targeted at newbie programmers?
Jun 22
next sibling parent reply Ecstatic Coder <ecstatic.coder gmail.com> writes:
 I think you'll have to elaborate on that. How is python.org 
 "obviously" targeted at inexperienced programmers and dlang.org 
 isn't? The home pages look rather similar to me: menu, search 
 box, code sample, sales pitch, those text boxes with icons, etc.

 What would you change on dlang.org? Completely overhaul 
 everything, or just adjust the wording and other details to be 
 more targeted at newbie programmers?
First, please notice how simple the landing page is. Its nice visual design exhibits simplicity, and obvioulsy uses a few text as possible to convey the message. I've recently studied web development for two years, and believe me, while not perfect, this landing page clearly matches many of the requirements we were taught. And about the advertising target, the first text paragraph block below the code carousel you will read is : "Get Started Whether you're new to programming or an experienced developer, it's easy to learn and use Python. Start with our Beginner’s Guide" Pretty self-explanatory :) It's actually the same message than in the code carousel, at slide 4 : "Quick & Easy to Learn Experienced programmers in any other language can pick up Python very quickly, and beginners find the clean syntax and indentation structure easy to learn. Whet your appetite with our Python 3 overview." I would summarize their moto as : 1/ Python is a scripting language that gets the job done quickly ("Python is a programming language that lets you work quickly and integrate systems more effectively.") 2/ Python is very easy to learn, not only for experienced developers, but also for beginners ("Whether you're new to programming or an experienced developer, it's easy to learn and use Python.") And look at the code snippets on the five slides of the carousel. * First sample code : # Python 3: Fibonacci series up to n
 def fib(n):
     a, b = 0, 1
     while a < n:
         print(a, end=' ')
         a, b = b, a+b
     print()
 fib(1000)
* Second sample code : # Python 3: List comprehensions
 fruits = ['Banana', 'Apple', 'Lime']
 loud_fruits = [fruit.upper() for fruit in fruits]
 print(loud_fruits)
['BANANA', 'APPLE', 'LIME'] # List and the enumerate function
 list(enumerate(fruits))
[(0, 'Banana'), (1, 'Apple'), (2, 'Lime')] * Third sample code : # Python 3: Simple arithmetic
 1 / 2
0.5
 2 ** 3
8
 17 / 3  # classic division returns a float
5.666666666666667
 17 // 3  # floor division
5 * Fourth sample code : # Python 3: Simple output (with Unicode)
 print("Hello, I'm Python!")
Hello, I'm Python! # Input, assignment
 name = input('What is your name?\n')
 print('Hi, %s.' % name)
What is your name? Python Hi, Python. * Fifth sample code : # For loop on a list
 numbers = [2, 4, 6, 8]
 product = 1
 for number in numbers:
... product = product * number ...
 print('The product is:', product)
The product is: 384 These code snippets are very very simple !!! Almost baby code ;) It seems pretty obvious to me that Python's code carousel targets beginner programmers, showing them simple code that they will easily understand. This website is very effective at convincing people that learning to program in Python won't require much efforts, even if you are new to programming. And I think that this message alone could be one of key reasons which explain Python is so popular, among others... And when I say popular, I mean it. Python is #4 at the Tiobe index (https://www.tiobe.com/tiobe-index) : 1. Java 2. C 3. C++ 4. Python 5. C# 6. VB .NET 7. JavaScript 8. PHP ... It's also #4 on the programming language popularity chart (http://langpop.corger.nl) : 1. JavaScript 2. Java 3. PHP 4. Python 5. C# 6. C++ ... And #3 on the RedMonk Programming Language Rankings (http://redmonk.com/sogrady/2017/03/17/language-rankings-1-17) : 1. JavaScript 2. Java 3. Python 4. PHP 5. C# 6. C++ ... What makes me sad with the above rankings, whether you trust them or not, is that I've actually used Python, Ruby and JavaScript in the past, and for the kind of file processing scripts and tools I develop, I can tell you that D is WAY better !!! But almost nobody knows it. And I don't think that the current website is effective at all in convincing people that D is indeed a better alternative to scripting languages like Python, Ruby or JavaScript, despite it really is.
Jun 22
parent reply ag0aep6g <anonymous example.com> writes:
On 06/23/2017 07:13 AM, Ecstatic Coder wrote:
 I think you'll have to elaborate on that. How is python.org 
 "obviously" targeted at inexperienced programmers and dlang.org isn't? 
 The home pages look rather similar to me: menu, search box, code 
 sample, sales pitch, those text boxes with icons, etc.

 What would you change on dlang.org? Completely overhaul everything, or 
 just adjust the wording and other details to be more targeted at 
 newbie programmers?
First, please notice how simple the landing page is.
python.org's home page looks about as crowded to me as dlang.org's. How is it significantly more simple?
 Its nice visual design exhibits simplicity, and obvioulsy uses a few 
 text as possible to convey the message.
So you'd like to make dlang.org prettier and less wordy?
 I've recently studied web development for two years, and believe me, 
 while not perfect, this landing page clearly matches many of the 
 requirements we were taught.
Aside: Whenever someone says "believe me" that's a sign for me to be skeptical towards their claims. How does dlang.org's home page not match the requirements you were taught? My questions are not rhetorical. I'm trying to find out where you see problems and how you'd like to see them fixed. [...]
 And look at the code snippets on the five slides of the carousel.
[...]
 These code snippets are very very simple !!! Almost baby code ;)
 
 It seems pretty obvious to me that Python's code carousel targets 
 beginner programmers, showing them simple code that they will easily 
 understand.
So you'd like to see simpler code samples on dlang.org? [...]
 And I don't think that the current website is effective at all in 
 convincing people that D is indeed a better alternative to scripting 
 languages like Python, Ruby or JavaScript, despite it really is.
You talked about how python.org is good, but what is bad on dlang.org? How does it fail where python.org succeeds, and how do we fix it?
Jun 22
parent reply Ecstatic Coder <ecstatic.coder gmail.com> writes:
 You talked about how python.org is good, but what is bad on 
 dlang.org? How does it fail where python.org succeeds, and how 
 do we fix it?
On Linux Mint's software manager, about DMD, we can read : "D is a systems programming language. Its focus is on combining the power and high performance of C and C++ with the programmer productivity of modern languages like Ruby and Python." So I'm not saying that dlang.org is bad. I'm just saying that : 1/ it's not especially obvious that D is also an easy to learn scripting language. 2/ I think that python.org's website is quite efficient at convincing people that it could be worth giving it a try. But maybe dlang.org's current design is much better according to how you want it to be perceived.
Jun 22
parent reply ag0aep6g <anonymous example.com> writes:
On 06/23/2017 08:49 AM, Ecstatic Coder wrote:
 1/ it's not especially obvious that D is also an easy to learn scripting 
 language.
Ok, I think I understand your goal now. There's a thing that I'd like to change on the home page, and I think it aligns with your thoughts: "D is a systems programming language" -> "D is a general-purpose programming language". "Systems programming" puts the focus on the low-level side of D, which may not even be its strong side (yet) if one looks at the recent -betterC efforts. "Systems programming" may scare users away who think they're not good enough for that kind of programming. "General-purpose programming" is a better fit, in my opinion. Regarding the examples, I'd prefer very simple ones, too. Hello World, 99 Bottles of Beer -- stuff like that. I think there's the idea that examples should show some cool feature of D, but I'd say they should just show how D looks with easy-to-follow code. Maybe have a distinct page with cooler examples. So, overall, I think dlang.org could be tweaked to be more directed at newbie programmers, and I wouldn't mind that. I don't think it would need a major overhaul of the site; just some tweaks. But personally, I'm not really interested in the marketing of D, so I'm not going to push for these things.
Jun 23
next sibling parent Ecstatic Coder <ecstatic.coder gmail.com> writes:
On Friday, 23 June 2017 at 13:43:00 UTC, ag0aep6g wrote:
 On 06/23/2017 08:49 AM, Ecstatic Coder wrote:
 1/ it's not especially obvious that D is also an easy to learn 
 scripting language.
Ok, I think I understand your goal now. There's a thing that I'd like to change on the home page, and I think it aligns with your thoughts: "D is a systems programming language" -> "D is a general-purpose programming language". "Systems programming" puts the focus on the low-level side of D, which may not even be its strong side (yet) if one looks at the recent -betterC efforts. "Systems programming" may scare users away who think they're not good enough for that kind of programming. "General-purpose programming" is a better fit, in my opinion. Regarding the examples, I'd prefer very simple ones, too. Hello World, 99 Bottles of Beer -- stuff like that. I think there's the idea that examples should show some cool feature of D, but I'd say they should just show how D looks with easy-to-follow code. Maybe have a distinct page with cooler examples. So, overall, I think dlang.org could be tweaked to be more directed at newbie programmers, and I wouldn't mind that. I don't think it would need a major overhaul of the site; just some tweaks. But personally, I'm not really interested in the marketing of D, so I'm not going to push for these things.
+1 :)
Jun 23
prev sibling parent Patrick Schluter <Patrick.Schluter bbox.fr> writes:
On Friday, 23 June 2017 at 13:43:00 UTC, ag0aep6g wrote:
 On 06/23/2017 08:49 AM, Ecstatic Coder wrote:

 "Systems programming" may scare users away who think they're 
 not good enough for that kind of programming.
True.
 "General-purpose programming" is a better fit, in my opinion.
In mine too. What does system porgramming even mean? System without qualifier is as wobbly a term as thing or stuff. System as in operating system, or system as desktop system, or dabase system or web system or, you get the idea, everything can be called a system. Furthermore, as operating system language, D is not even that appropriate as it requires really a lot from the platform it's implemented in: >=32bits, stack, memory protection (or else no TLS), etc. So calling it General-purpose is really something to get behind.
Jun 23
prev sibling parent reply Ecstatic Coder <ecstatic.coder gmail.com> writes:
 What would you change on dlang.org? Completely overhaul 
 everything, or just adjust the wording and other details to be 
 more targeted at newbie programmers?
IMHO, if dlang.org had more or less the same graphic design as python.org, the text blocks under the code carousel should be reduced to just what is required to convince people that D : 1. is a great scripting language, very simple to learn and even more productive than Python or JavaScript. 2. is a great programming language, delivering high performance applications with a better expressivity than C++. 3. is easy to download, install and get started. 4. has great documentations and a lot of tutorials, both for inexperienced and experienced programmers who want to quickly start developing scripts or GUI applications. I know that when I carefully read the current dlang.org page, I can get this information. It's just that I think that python.org is more effective at conveying their main messages with much less text. For more details, you are invited to click on the links.
Jun 22
parent reply Seb <seb wilzba.ch> writes:
On Friday, 23 June 2017 at 06:15:46 UTC, Ecstatic Coder wrote:
 What would you change on dlang.org? Completely overhaul 
 everything, or just adjust the wording and other details to be 
 more targeted at newbie programmers?
IMHO, if dlang.org had more or less the same graphic design as python.org, the text blocks under the code carousel should be reduced to just what is required to convince people that D : ... For more details, you are invited to click on the links.
Huh? You were asked about concrete action points that in your PoV would improve dlang.org. You can't just say "make it (like) python.org" ;-) Could you maybe try to be a bit preciser and create a more detailed lists of points on how you would improve dlang.org?
Jun 23
parent reply Ecstatic Coder <ecstatic.coder gmail.com> writes:
 Huh? You were asked about concrete action points that in your 
 PoV would improve dlang.org. You can't just say "make it (like) 
 python.org" ;-)
 Could you maybe try to be a bit preciser and create a more 
 detailed lists of points on how you would improve dlang.org?
Sorry I can't. Make it look more like "python.org" is just and exactly what I mean. For instance, D is the only scripting language I would use nowadays. BUT I would not take the risk to use D instead of C++ to develop games for instance. D is actually quite easy to sell a scripting language. Convincing people to use D instead of C, C++, Java or C# is another thing. In my personal case, selling D as a better alternative to Python, JavaScript or Ruby would have just needed a well chosen snippet of simple code, which shows me that indeed D is some kind of strongly-typed JavaScript, à la TypeScript, which is both easy to learn and use. And I believe that "python.org" is currently more convincing for "low-profile" programmers/scripters than "dlang.org". Just look at the code snippets...
Jun 23
parent reply cym13 <cpicard openmailbox.org> writes:
On Friday, 23 June 2017 at 07:44:36 UTC, Ecstatic Coder wrote:
 Huh? You were asked about concrete action points that in your 
 PoV would improve dlang.org. You can't just say "make it 
 (like) python.org" ;-)
 Could you maybe try to be a bit preciser and create a more 
 detailed lists of points on how you would improve dlang.org?
Sorry I can't. Make it look more like "python.org" is just and exactly what I mean. For instance, D is the only scripting language I would use nowadays. BUT I would not take the risk to use D instead of C++ to develop games for instance. D is actually quite easy to sell a scripting language. Convincing people to use D instead of C, C++, Java or C# is another thing. In my personal case, selling D as a better alternative to Python, JavaScript or Ruby would have just needed a well chosen snippet of simple code, which shows me that indeed D is some kind of strongly-typed JavaScript, à la TypeScript, which is both easy to learn and use. And I believe that "python.org" is currently more convincing for "low-profile" programmers/scripters than "dlang.org". Just look at the code snippets...
Problem is, low profile programmers aren't the most interesting target for D right now. You have to choose your battles and I believe that isn't done enough in D marketing. For example we have lots of issues promoting the GC because we want to attract people that like that kind of memory management and at the same time people that don't. So we end up saying "yeah, we have a GC, but you can do things without it" and the same question comes over and over again "make up your mind, is it possible or not to code in D without GC?". Right now the marketing targets companies and C++ programmers. Maybe that's not the way to go but it's the path that was choosen until now. To those programmers the message our marketing tries to send is "D is a serious, solid language that gives you the power to build industry software". It's all about being a rock: solid, sturdy, there to stay for years to come. Of course on side channels we talk about it being also a good scripting language etc, but that's not the main image. An image of scripting language is likely to make D loose most of its credibility amongst C++ groups (I may be wrong about it but it's the impression I get). What you're proposing is way more than a website modification, it's a profound marketting change. Maybe it's the right way to go, but if that's what you want you may want to rethink your whole approach with the fact that it's not about dlang.org's cosmetic anymore.
Jun 23
next sibling parent reply Ecstatic Coder <ecstatic.coder gmail.com> writes:
 Problem is, low profile programmers aren't the most interesting 
 target for D right now. You have to choose your battles and I 
 believe that isn't done enough in D marketing. For example we 
 have lots of issues promoting the GC because we want to attract 
 people that like that kind of memory management and at the same 
 time people that don't. So we end up saying "yeah, we have a 
 GC, but you can do things without it" and the same question 
 comes over and over again "make up your mind, is it possible or 
 not to code in D without GC?".

 Right now the marketing targets companies and C++ programmers. 
 Maybe that's not the way to go but it's the path that was 
 choosen until now. To those programmers the message our 
 marketing tries to send is "D is a serious, solid language that 
 gives you the power to build industry software". It's all about 
 being a rock: solid, sturdy, there to stay for years to come. 
 Of course on side channels we talk about it being also a good 
 scripting language etc, but that's not the main image. An image 
 of scripting language is likely to make D loose most of its 
 credibility amongst C++ groups (I may be wrong about it but 
 it's the impression I get).

 What you're proposing is way more than a website modification, 
 it's a profound marketting change. Maybe it's the right way to 
 go, but if that's what you want you may want to rethink your 
 whole approach with the fact that it's not about dlang.org's 
 cosmetic anymore.
Ok no problem, I understand your point :) Indeed the current website conveys quite well the "serious C++-like language for the software industry" concept. Unfortunately it's not an easy task to convince people to use D instead of Java, C#, Go, C++, etc There are much more risks involved in deciding to adopt a new language when it's for people's core business. Same reasons why I'm still using C++ and Go professionally btw, and I'm sorry for that...
Jun 23
parent reply Wulfklaue <wulfklaue wulfklaue.com> writes:
On Friday, 23 June 2017 at 09:02:30 UTC, Ecstatic Coder wrote:
 Indeed the current website conveys quite well the "serious 
 C++-like language for the software industry" concept.

 Unfortunately it's not an easy task to convince people to use D 
 instead of Java, C#, Go, C++, etc

 There are much more risks involved in deciding to adopt a new 
 language when it's for people's core business.

 Same reasons why I'm still using C++ and Go professionally btw, 
 and I'm sorry for that...
The issue goes a bit beyond just the marketing. Somebody posted on Reddit a few days ago, that D can be used for a lot of different fields. From system programming to web development etc ... But the reality is a bit different. If you want web development you need to write your own framework or rely on 3th party solutions like vibe.d ( that means you actually need to discover about vibe.d ). While D is a perfectly capable language that is useful for low profile programmers. Any PHP developer can work with D language easily, its things that are not the language is where it gets troublesome. Case and point: You can install Go and get a HTTP server up and going withing a few minutes. D can not do the same ( even with vibe.d ). Third party packages require knowing about dub. It requires knowing about the package system. It takes more steps then Go. It actually requires some major commitment to D for people to learn the surrounding tools, 3th party solutions, finding a proper working editor ( if you want all the bells ) etc. I understand your point but there seems to be no real support among the current D developers / users. Unless you consider the "write it yourself" as support. ;) D can get much more "low profile programmers". But we need to differ between the language and the actual eco system. And its the eco system that has the bigger learning curve to get into D, especially when people are coming with a PHP/Python/Ruby background.
Jun 23
parent reply Ecstatic Coder <ecstatic.coder gmail.com> writes:
 The issue goes a bit beyond just the marketing.

 Somebody posted on Reddit a few days ago, that D can be used 
 for a lot of different fields. From system programming to web 
 development etc ... But the reality is a bit different.

 If you want web development you need to write your own 
 framework or rely on 3th party solutions like vibe.d ( that 
 means you actually need to discover about vibe.d ).

 While D is a perfectly capable language that is useful for low 
 profile programmers. Any PHP developer can work with D language 
 easily, its things that are not the language is where it gets 
 troublesome.

 Case and point:

 You can install Go and get a HTTP server up and going withing a 
 few minutes.

 D can not do the same ( even with vibe.d ). Third party 
 packages require knowing about dub. It requires knowing about 
 the package system. It takes more steps then Go.

 It actually requires some major commitment to D for people to 
 learn the surrounding tools, 3th party solutions, finding a 
 proper working editor ( if you want all the bells )  etc.

 I understand your point but there seems to be no real support 
 among the current D developers / users. Unless you consider the 
 "write it yourself" as support. ;)

 D can get much more "low profile programmers". But we need to 
 differ between the language and the actual eco system. And its 
 the eco system that has the bigger learning curve to get into 
 D, especially when people are coming with a PHP/Python/Ruby 
 background.
I completely agree with you ! Most JS/PHP programmers should immediately feel at home when starting to use D. And right out of the box, D is fully equiped to develop Perl-like file processing scripts, there is nothing more to download or install to get started. But for the remaining, unfortunately this is not as easy, and this requires some efforts before being able to develop web or GUI applications. That's why I'm in favor of adapting some thirdparty librairies so they become pre-installed standard librairies (std.web, std.ui, etc).
Jun 23
next sibling parent Wulfklaue <wulfklaue wulfklaue.com> writes:
On Friday, 23 June 2017 at 13:29:29 UTC, Ecstatic Coder wrote:
 That's why I'm in favor of adapting some thirdparty librairies 
 so they become pre-installed standard librairies (std.web, 
 std.ui, etc).
Will not happen. I read too many threads already where this was mentioned and it always got shot down. From coding styles, to maintainers etc ... I have always been a believer that a good system has the most used technology as its core library, so the developers are sure that this tech will be supported. But between believing in something and reality, there are major differences. Lets assume vibe.d does not get supported anymore or simply updates take longer and longer. When its a 3th party library, one can kick and scream but nothing will change this. As a core library, you expect there to be is a sense of responsibility and also more usage, that can justify having more maintainers. But one only need to look at the std.xml library. And the std.experimental modules that got stuck there for years ( what demotivates the developers ). The issue is and will always be that 3th party modules are more in danger that the main developer will lose interest or has too much work in his private life. Unfortunately, D has only so may core developers so you have the same issue on the std library. Maybe i am the crazy guy but i prefer to write my own functionality. Maybe take inspiration from how other people solve the issues but only focusing on what i need. Its not efficient but it bypasses the whole 3th party issue. One does not need to learn a new style, you know the code in and out ...
Jun 23
prev sibling parent reply Adam D. Ruppe <destructionator gmail.com> writes:
On Friday, 23 June 2017 at 13:29:29 UTC, Ecstatic Coder wrote:
 But for the remaining, unfortunately this is not as easy, and 
 this requires some efforts before being able to develop web or 
 GUI applications.
I'm kinda tempted to offer a pre-packaged compiler download with my libs and some other useful stuff. PHP has done that before, with the LAMP packages. And now that dmd is fully Boost, there's no legal barrier, but I question if it is really worth it because someone could just download the files themselves easily enough. But still, the compiler+libs+samples and docs and maybe one of the ides could be kinda useful.
Jun 23
parent reply Ecstatic Coder <ecstatic.coder gmail.com> writes:
 I'm kinda tempted to offer a pre-packaged compiler download 
 with my libs and some other useful stuff. PHP has done that 
 before, with the LAMP packages.

 And now that dmd is fully Boost, there's no legal barrier, but 
 I question if it is really worth it because someone could just 
 download the files themselves easily enough.

 But still, the compiler+libs+samples and docs and maybe one of 
 the ides could be kinda useful.
I'm also in favor that some of your personal developments be converted into std libs. For instance, being able to natively implement a small web server with a few lines of standard code, like we can easily do in Go or Node.js, would be great. And I know that you already have implemented that :) So I can't talk for everybody, but I can at least say that having such stuff working out of the box would indeed make a huge difference for newbies like me, who'd prefer not having to chase for open source code which does what the std libraries provide in other languages.
Jun 23
parent reply Adam D. Ruppe <destructionator gmail.com> writes:
On Friday, 23 June 2017 at 18:26:43 UTC, Ecstatic Coder wrote:
 I'm also in favor that some of your personal developments be 
 converted into std libs.
Eh, std libs is where you lose me. I don't mind offering a "just works" dmd download on my website, with my packaging dmd for some particular purposes, or on the official site, that includes all the stuff. But I have no interest in being part of Phobos and losing control of my projects. Now, I think Phobos should be open to those things, where the modules are owned by third parties and just packaged as a standard library. The phobos devs might fork it or whatever, of course, but this would be more like a Linux distribution than a corporate merger - the individual packages in a Linux distro are still owned by outside parties, and the distro maintainers just bring them in and might slightly modify them to fit their thing better. From the user side, it looks like a traditional std lib, but from the developer side, it is more of a bazaar than a cathedral.
Jun 24
next sibling parent reply Laeeth Isharc <laeethnospam nospam.laeeth.com> writes:
On Saturday, 24 June 2017 at 18:10:54 UTC, Adam D. Ruppe wrote:
 On Friday, 23 June 2017 at 18:26:43 UTC, Ecstatic Coder wrote:
 I'm also in favor that some of your personal developments be 
 converted into std libs.
Eh, std libs is where you lose me. I don't mind offering a "just works" dmd download on my website, with my packaging dmd for some particular purposes, or on the official site, that includes all the stuff. But I have no interest in being part of Phobos and losing control of my projects. Now, I think Phobos should be open to those things, where the modules are owned by third parties and just packaged as a standard library. The phobos devs might fork it or whatever, of course, but this would be more like a Linux distribution than a corporate merger - the individual packages in a Linux distro are still owned by outside parties, and the distro maintainers just bring them in and might slightly modify them to fit their thing better. From the user side, it looks like a traditional std lib, but from the developer side, it is more of a bazaar than a cathedral.
what is the barest minimum we need to enable that? someone to organise conventions about module organisation and some kind of package grouping in dub? so you can specify "adamandfriends" as a dependency to bring in the repackaged library under that group name? like yum groupinstall 'blahblah' but more personal.
Jun 24
parent reply Adam D. Ruppe <destructionator gmail.com> writes:
On Saturday, 24 June 2017 at 18:17:42 UTC, Laeeth Isharc wrote:
 what is the barest minimum we need to enable that?
The phobos devs or the dmd packager just have to grab code and docs they are interested in. It's open source; the author has already made it available. Drop it in the default import and lib paths and run. It doesn't have to be a whole production. Alternatively, we could beef up the code.dlang.org website to feature the most useful libraries and do some kind of automatic curation and evaluation coupled with nice presentation and search there. (or both) I have some ideas for code.dlang.org and emailed them during the google summer of code process last time, and have even considered doing it myself, but I don't really have time for it right now... But even basic stuff like taking the download count (available on the existing dub rest api) and using it to weigh in some ranking algorithm might help, and showing more info about subpackages and documentation would definitely be nice, and encourage users to add tutorials to the site and get them searchable.
Jun 24
parent reply Ecstatic Coder <ecstatic.coder gmail.com> writes:
Reading all the above posts on how to use vibe.d for a two line 
web server was very interesting.

I still think that it's more simple to do it with Go and with D, 
but I may be wrong, as I'm currently using Go for web 
development, and not D, for the reasons above.

And I see that not many people on this forum don't think that D 
could improve its popularity if :

1/ it was promoted as :

    a/ a great scripting language for scripters and learners 
looking for an easy to learn and to use typescript-like scripting 
language (which it is)

    b/ a solid general purpose programming language for the 
software industry, already equipped for web and desktop 
application development.

2/ existing web-related D code was refactored to provide the few 
Go-like functions just enough to serve static files, process an 
URL and send back pages/data to the browser, so we can "natively" 
use D for web application development.

3/ any existing GUI library was pre-installed (i.e. imports 
renamed to "std.*") so that we can also "natively" use D for 
desktop application development.

I may be wrong, but I think that refactoring an existing web 
library, renaming the imports of an existing GUI library, and 
making a few "marketing" changes to the D web site to make it 
more beginner-friendly would not require much man-power, while 
this may have the potential to make a HUGE impact on how D is 
actually PERCEIVED.

And I clearly see that many software development experts on this 
forum don't see any interest in those suggestions, which I 
perfectly understand, as we can get the job done with dub, and 
all the required information can be found on the existing website 
anyway.

But for less-skilled developers and scripters who didn't 
graduated from the University (like me), these tiny and seemingly 
insignificant details are often those which will actually make 
the difference between something they will use, because it seems 
really easy to learn and use, and something which doesn't seem 
good for them, because it looks a bit too complicated to learn or 
use.

For instance, in my case, I must say that I actually wasn't 
convinced at all by the current website, which is why I have 
tried several other general purpose scripting/programming 
languages (Python, Ruby, Node.js, Nim, etc) before finally trying 
D, when I was actually lacking other options.

Now I'm happy to have made that last effort, as D has now become 
my favorite programming language, but maybe other people have had 
the same experience as me, and didn't try it at all eventually...
Jun 24
parent reply Ecstatic Coder <ecstatic.coder gmail.com> writes:
 I may be wrong, but I think that refactoring an existing web 
 library, renaming the imports of an existing GUI library, and 
 making a few "marketing" changes to the D web site to make it 
 more beginner-friendly would not require much man-power, while 
 this may have the potential to make a HUGE impact on how D is 
 actually PERCEIVED.
Python language maintainers have a similar approach, and it pays off... If you look at the PYPL page (http://pypl.github.io/PYPL.html), you will read this : "Worldwide, Java is the most popular language, Python grew the most in the last 5 years (8.7%) and PHP lost the most (-5.0%)" Here is what Dlang's official blog says about Python : "On the author’s MacBook Pro, the Python version takes 12.6 seconds, the D program takes 3.2 seconds. This makes sense as the D program is compiled to native code. But suppose we run the Python program with PyPy, a just-in-time Python compiler? This gives a result of 2.4 seconds, actually beating the D program, with no changes to the Python code." (https://dlang.org/blog/2017/05/24/faster-command-line-tools-in-d/) So actually it can even run faster than D, without any significant optimization... For those still not convinced, I suggest they compare the popularity of D, Kotlin, Golang and Python on Google trends : https://trends.google.com/trends/explore?q=dlang,kotlin,golang,python https://trends.google.com/trends/explore?q=dlang%20language,kotlin%20language,golang%20language,python%20language The green line kilometers high above the ground this Python, whose I praised the website. The red line is Kotlin. While available since only a few months, it is already competing with Go's orange line in terms of popularity. Btw their first example is a "Hello World", in different versions. And the completely flat blue line below all the three other curves, which desperately looks like the electrocardiogram of a dead heart, it is D's current popularity (or relative unpopularity should I say) in Google searches. QED... Anyway, it seems that not many people on this forum see any interest in improving D's popularity on the web with just a few cheap cosmetic changes to better align it with contenders like Python or Go, so I will bothered people with unwanted advices. Instead, may I suggest that we dig the grave deeper by putting even more complicated examples on D's code roulette so that we make sure that only the elite of programming could remain interested in using this language ? Whoops, sorry, this is already done at the moment actually. Ok, then I said nothing... LOL
Jun 25
parent reply Wulfklaue <wulfklaue wulfklaue.com> writes:
On Monday, 26 June 2017 at 05:10:34 UTC, Ecstatic Coder wrote:
 Anyway, it seems that not many people on this forum see any 
 interest in improving D's popularity on the web with just a few 
 cheap cosmetic changes to better align it with contenders like 
 Python or Go, so I will bothered people with unwanted advices.
Remove Python from your link: https://trends.google.com/trends/explore?q=dlang,kotlin,golang D does not even register beyond 1, even without python disrupting the whole scale line.
 Whoops, sorry, this is already done at the moment actually. Ok, 
 then I said nothing... LOL
I know how you feel but trust me that trying to fight this seems to be a fight you will not win. If there is something very clear about the D community, its comes mostly down to this: * If you want something done, do it yourself * If you want something done, pay for it * If its a massive obvious flaw, maybe somebody will fix it D with some help can become a much more general accepted programming language that is not just a C++ replacement language. The D language as i stated before is not the problem. Its mostly what is around the language, is where D falls short. But fixing those issues tend to be: * Repetitive work, nobody like doing that * None glorious work. In other words, not a big project where somebody can put there own stamp upon it. This seems to be one of the major issues. A lot of brilliant people but very few that want to do the grunt work. Frankly, there are moments that i wanted to do some of the grunt work but the same issue as everybody else. No time to spend hours and hours into fixing things ( and some of the issues that needs to be fixed can be weeks or months of work unfortunately ). This is why i personally think the only way to "solve" these issues, is if D hires people that work full time on these issues. And that in return needs money. And then we come back to the same sticky point. Why are very few people donating? Maybe its just from my perspective but when i donate, i want to feel that my money will be used good. And because there is no real public accounting on where the money that D gets is being spend, ... maybe there is but again, it feels like you need to dig to find it, like with most D things. --- Saturday i spend some time with Kotlin. And frankly, i liked it more then i expected. Install jetbrains community edition, install JVM. And your ready to rock. * Front end writing / Javascript generation. Works out of the box. * Java generation / writing. Fast, works perfectly. * Great editor support! I just love the whole "rust" style mutable recognition build in. The extra type hinting. The ability to alter the coding formatting. Etc ... and all in the familiar editor then i am used to from my php days. * Kotlin Native (llvm). A bit more work to get going but its only at 0.3 version so one gives it some slack. But they did impressive work in the last two months from the initial release. Hell, they even beat Swift by offering Windows support already *lol* --- While i am sure there are javascript converting modules for D. Again ... no focus on it, 3th party, no clear information etc ... When it comes down to editor support, sorry its mediocre at best. Here are work i am fighting the workspace-d dfmt simply because i have some long shell lines that i want on a single line. They are
 120 characters but dfmt keeps breaking my line formatting. 
Frustrating because it looks bad and because dfmt is compiled into workspace-d, no documentation how to override dfmt. Again, it feel like a lot of modules slapped together and they work but no steps beyond this. ... I am at work so i do not have a lot of time to write all this. D simply feels incomplete compared to its competitors. Not the language, that is great and really feature complete. But everything around it feels fragmented, incomplete, in a constant state of unfinished. That is just my opinion.
Jun 26
parent reply Ecstatic Coder <ecstatic.coder gmail.com> writes:
Thanks for having taken the time to write this very enlighting 
post.

I think this is a very pragmatic analysis of the main roots of 
the problem, which clearly explains why D remains much less 
popular than Go, Python, Kotlin, etc despite the language itself 
is at least as modern and convenient (and even more IMHO).

I don't think the situation will change any time soon, so I feel 
exactly in the same mood as you.

Hence my suggession to simply make a few "cosmetic" changes to 
change D's perception on the web, to compensate for the lack of 
money and manpower.

But they won't probably be applied.

And I know that for the "do it yourself" I'm probably part of the 
problem...
Jun 26
parent reply Martin Tschierschke <mt smartdolphin.de> writes:
On Monday, 26 June 2017 at 08:47:46 UTC, Ecstatic Coder wrote:
 Thanks for having taken the time to write this very enlighting 
 post.

 I think this is a very pragmatic analysis of the main roots of 
 the problem, which clearly explains why D remains much less 
 popular than Go, Python, Kotlin, etc despite the language 
 itself is at least as modern and convenient (and even more 
 IMHO).

 I don't think the situation will change any time soon, so I 
 feel exactly in the same mood as you.

 Hence my suggession to simply make a few "cosmetic" changes to 
 change D's perception on the web, to compensate for the lack of 
 money and manpower.

 But they won't probably be applied.

 And I know that for the "do it yourself" I'm probably part of 
 the problem...
I understand the frustration, brilliant language but not so well designed ecosystem around. Please be aware, that even the setup of the D Foundation is still work in progress. So we are still waiting for the foundation to offer some kind of supporting memberships. But as Andrei A. told us on DConf, the foundation already is paying some students (a small salary) for their work. So best thing we can do is to push the D Foundation (Andrei+Walter) to optimize the support structure. The good thing behind these obvious missing parts is, that there is a strong focus on the language itself, so I am convinced, that D is here to stay, so that every effort in learning the language is a well made investment. Regards mt. (still a bloody beginner, started with D Nov. 2015)
Jun 26
parent reply Wulfklaue <wulfklaue wulfklaue.com> writes:
On Monday, 26 June 2017 at 09:26:01 UTC, Martin Tschierschke 
wrote:
 But as Andrei A. told us on DConf, the foundation already is 
 paying some students (a small salary) for their work. So best 
 thing we can do is to push the D Foundation (Andrei+Walter) to 
 optimize the support structure.
A bit off-topic but what is going on with the students? I remember there are 3 students hired and one of them was at the D conference a while ago, talking about optimizing the D runtime. But has anybody read anything what is going on beyond this? Or even is there any progress? Communications. Another point to add to the complained list *lol*. At my work here, we have weekly status updates where the project leader writes down: * x person is working on y. * x task has been finished. * y is proposed. It saves on a lot of time because we do not need to repeat what we are working on to each boss / college. Sometimes i think that Walter and Andrei are probably also tired of explaining the same thing over and over again. The issue being that a forum simply eats information and unless you read each and every thread, you will always miss (potentially) important or interesting information.
Jun 26
parent reply bachmeier <no spam.net> writes:
On Monday, 26 June 2017 at 09:45:46 UTC, Wulfklaue wrote:
 Communications. Another point to add to the complained list 
 *lol*.

 At my work here, we have weekly status updates where the 
 project leader writes down:

 * x person is working on y.
 * x task has been finished.
 * y is proposed.

 It saves on a lot of time because we do not need to repeat what 
 we are working on to each boss / college.

 Sometimes i think that Walter and Andrei are probably also 
 tired of explaining the same thing over and over again. The 
 issue being that a forum simply eats information and unless you 
 read each and every thread, you will always miss (potentially) 
 important or interesting information.
Interesting that you bring that up. A couple of years ago we had a discussion about the need to improve communication. We said D needed a blog to better communicate what is going on. Now we have one, and by my count, the number of posts from Walter and Andrei are zero. That's okay, because the language itself is not the problem. Almost all problems with the language can be fixed by others. Walter and Andrei don't have much to do with editor support, for instance, and I doubt that they are familiar with the IDE world even if they did want to get involved. Anyone can start a group to work on something. If you want to put together a group to improve the IDE situation, come up with a plan (we need x, y, and z and here's how we'll do it), make an announcement on the forum, and run with it. No need to ask for permission, because there's nobody to ask for permission.
Jun 26
next sibling parent reply Mike Parker <aldacron gmail.com> writes:
On Monday, 26 June 2017 at 10:13:13 UTC, bachmeier wrote:

 Now we have one, and by my count, the number of posts from 
 Walter and Andrei are zero.
Actually, they have one each: Walter's "Snowflake Strings" [1] and Andrei's "Introspection, Introspection Everywhere" [2] There are more in the pipeline, so we'll hear from them again a little ways down the road. https://dlang.org/blog/2017/02/22/snowflake-strings/ https://dlang.org/blog/2017/05/22/introspection-introspection-everywhere/
Jun 26
parent reply bachmeier <no spam.net> writes:
On Monday, 26 June 2017 at 11:09:47 UTC, Mike Parker wrote:
 On Monday, 26 June 2017 at 10:13:13 UTC, bachmeier wrote:

 Now we have one, and by my count, the number of posts from 
 Walter and Andrei are zero.
Actually, they have one each: Walter's "Snowflake Strings" [1] and Andrei's "Introspection, Introspection Everywhere" [2] There are more in the pipeline, so we'll hear from them again a little ways down the road. https://dlang.org/blog/2017/02/22/snowflake-strings/ https://dlang.org/blog/2017/05/22/introspection-introspection-everywhere/
Sorry, I was a bit sloppy. I meant posts from the perspective of leaders saying "this is the plan going forward". These are more of what I would consider technical posts rather than big picture plans for the future posts.
Jun 26
parent reply Seb <seb wilzba.ch> writes:
On Monday, 26 June 2017 at 12:59:56 UTC, bachmeier wrote:
 On Monday, 26 June 2017 at 11:09:47 UTC, Mike Parker wrote:
 On Monday, 26 June 2017 at 10:13:13 UTC, bachmeier wrote:

 Now we have one, and by my count, the number of posts from 
 Walter and Andrei are zero.
Actually, they have one each: Walter's "Snowflake Strings" [1] and Andrei's "Introspection, Introspection Everywhere" [2] There are more in the pipeline, so we'll hear from them again a little ways down the road. https://dlang.org/blog/2017/02/22/snowflake-strings/ https://dlang.org/blog/2017/05/22/introspection-introspection-everywhere/
Sorry, I was a bit sloppy. I meant posts from the perspective of leaders saying "this is the plan going forward". These are more of what I would consider technical posts rather than big picture plans for the future posts.
They publish a high-level vision every six months (e.g. https://wiki.dlang.org/Vision/2017H1) -maybe we should shoot out a short blog post about it in the future, so that it receives more publicity?
Jun 26
parent reply bachmeier <no spam.net> writes:
On Monday, 26 June 2017 at 16:14:32 UTC, Seb wrote:

 They publish a high-level vision every six months (e.g. 
 https://wiki.dlang.org/Vision/2017H1) -maybe we should shoot 
 out a short blog post about it in the future, so that it 
 receives more publicity?
As I recall, the hope was for communication more often than every six months, and with more detail. Personally, I don't know if it would help. They're not involved with much outside of the language itself, and for the most part, the language is not D's problem.
Jun 26
parent jmh530 <john.michael.hall gmail.com> writes:
On Monday, 26 June 2017 at 17:15:50 UTC, bachmeier wrote:
 On Monday, 26 June 2017 at 16:14:32 UTC, Seb wrote:

 They publish a high-level vision every six months (e.g. 
 https://wiki.dlang.org/Vision/2017H1) -maybe we should shoot 
 out a short blog post about it in the future, so that it 
 receives more publicity?
As I recall, the hope was for communication more often than every six months, and with more detail. Personally, I don't know if it would help. They're not involved with much outside of the language itself, and for the most part, the language is not D's problem.
My sense is that communication is moving in the right direction. Not everything needs to come from Walter and Andrei. I agree that a blog post on the next Vision document would be reasonable.
Jun 26
prev sibling parent reply Wulfklaue <wulfklaue wulfklaue.com> writes:
On Monday, 26 June 2017 at 10:13:13 UTC, bachmeier wrote:
 Anyone can start a group to work on something. If you want to 
 put together a group to improve the IDE situation, come up with 
 a plan (we need x, y, and z and here's how we'll do it), make 
 an announcement on the forum, and run with it. No need to ask 
 for permission, because there's nobody to ask for permission.
I think you hit the nail on that head with that one. There is nobody to ask permission but the other side of the shoe is also, there is nobody to push for it. We can talk about it for ages but very few people have the time to pick up projects beyond our own. It helps when you are writing a project and you need a feature/library that D does not have. And in the end you public that feature/library. And the feature/library get maintained as long as that project is relevant to your needs. This is something that is noticeable in D especially, a lot of projects are a result from people needing something, they write it. But the moment they do not need it anymore? There is in a lot of cases nobody to take over the project for various reasons. D feels at times too much incomplete. And the above mentioned point is one of them. There is no real leadership to push for features. It seems to me, that Walter and Andrei live in there happy little world, writing new features into D that they want / find interesting. Nothing wrong with that. But they are somewhat the official leaders of D... Maybe its better if D gets a community leader / director / communication expert or whatever the titles, who's job is not pure development ( some knowledge is always a plus ) but to focus the resources ( by acquiring talent, money, publicity, ... ) in actually enhancing D its eco system. All the talk before technically comes down to this. Its not about simply electing yourself to write a library/feature that D is missing and that is. That does not work because it temporary solves one issue but not the global. Anyway, off lunch, back to the salt mines.
Jun 26
next sibling parent Ecstatic Coder <ecstatic.coder gmail.com> writes:
On Monday, 26 June 2017 at 11:10:42 UTC, Wulfklaue wrote:
 On Monday, 26 June 2017 at 10:13:13 UTC, bachmeier wrote:
 Anyone can start a group to work on something. If you want to 
 put together a group to improve the IDE situation, come up 
 with a plan (we need x, y, and z and here's how we'll do it), 
 make an announcement on the forum, and run with it. No need to 
 ask for permission, because there's nobody to ask for 
 permission.
I think you hit the nail on that head with that one. There is nobody to ask permission but the other side of the shoe is also, there is nobody to push for it. We can talk about it for ages but very few people have the time to pick up projects beyond our own. It helps when you are writing a project and you need a feature/library that D does not have. And in the end you public that feature/library. And the feature/library get maintained as long as that project is relevant to your needs. This is something that is noticeable in D especially, a lot of projects are a result from people needing something, they write it. But the moment they do not need it anymore? There is in a lot of cases nobody to take over the project for various reasons. D feels at times too much incomplete. And the above mentioned point is one of them. There is no real leadership to push for features. It seems to me, that Walter and Andrei live in there happy little world, writing new features into D that they want / find interesting. Nothing wrong with that. But they are somewhat the official leaders of D... Maybe its better if D gets a community leader / director / communication expert or whatever the titles, who's job is not pure development ( some knowledge is always a plus ) but to focus the resources ( by acquiring talent, money, publicity, ... ) in actually enhancing D its eco system. All the talk before technically comes down to this. Its not about simply electing yourself to write a library/feature that D is missing and that is. That does not work because it temporary solves one issue but not the global. Anyway, off lunch, back to the salt mines.
+1
Jun 26
prev sibling parent bachmeier <no spam.net> writes:
On Monday, 26 June 2017 at 11:10:42 UTC, Wulfklaue wrote:

 There is no real leadership to push for features. It seems to 
 me, that Walter and Andrei live in there happy little world, 
 writing new features into D that they want / find interesting. 
 Nothing wrong with that. But they are somewhat the official 
 leaders of D...
At the same time, this is the case for many languages. The leadership worries about the language and leaves IDE support and such to the community. It's not different from what I've seen over the years for Clojure, Python, Haskell, OCaml, Scala, Ruby, R, and probably others.
Jun 26
prev sibling parent reply Ecstatic Coder <ecstatic.coder gmail.com> writes:
On Saturday, 24 June 2017 at 18:10:54 UTC, Adam D. Ruppe wrote:
 On Friday, 23 June 2017 at 18:26:43 UTC, Ecstatic Coder wrote:
 I'm also in favor that some of your personal developments be 
 converted into std libs.
Eh, std libs is where you lose me. I don't mind offering a "just works" dmd download on my website, with my packaging dmd for some particular purposes, or on the official site, that includes all the stuff. But I have no interest in being part of Phobos and losing control of my projects. Now, I think Phobos should be open to those things, where the modules are owned by third parties and just packaged as a standard library. The phobos devs might fork it or whatever, of course, but this would be more like a Linux distribution than a corporate merger - the individual packages in a Linux distro are still owned by outside parties, and the distro maintainers just bring them in and might slightly modify them to fit their thing better. From the user side, it looks like a traditional std lib, but from the developer side, it is more of a bazaar than a cathedral.
+1 :) Actually D doesn't need hundreds of additional types and functions in the libraries. Look for instance this Go code : package main import ( "log" "net/http" ) func main() { http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) { http.ServeFile(w, r, r.URL.Path[1:]); }); log.Fatal(http.ListenAndServe(":80", nil)); } Two lines of code, that's all that's needed to serve an entire website, with all sorts of files (html, css, js, jpg, png, etc) located in plenty of directories. NO framework required. Nada. Just a standard Go installation. Same for Node.js. It's 100% batteries included... So having just a few types and functions similar to those of Go and Node.js, without requiring to install a complete framework like vibe.d for such basic cases would definitely make a HUGE difference in terms of IMMEDIATE usability for D. Go is very popular for web development because most developer can already do 99% of their work JUST with the standard libraries. These few web server functions are generally more than enough to quickly build most functionalities with just a few lines of code. Unfortunately, D lacks these few "standard building blocks". We can implement the same functionalities in D with a THIRDPARTY FRAMEWORK, but not with the few "building blocks" provided by standard libraries functions. Which is very sad, because webserver development is a domain where D can be a perfect contender to Go, Java and C#, and not everybody is willing to use a full framework just to have the same functionalities as these two simple lines of Go code.
Jun 24
next sibling parent reply =?UTF-8?Q?S=c3=b6nke_Ludwig?= <sludwig+d outerproduct.org> writes:
Am 24.06.2017 um 21:22 schrieb Ecstatic Coder:
 package main

 import (
     "log"
     "net/http"
 )

 func main() {
     http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
         http.ServeFile(w, r, r.URL.Path[1:]);
     });

     log.Fatal(http.ListenAndServe(":80", nil));
 }
/++ dub.sdl name "webserver" dependency "vibe-d:http" version="~>0.7.31" +/ module main; import vibe.core.core; import vibe.http.fileserver; import vibe.http.server; void main() { listenHTTP(new HTTPServerSettings, serveStaticFiles("./")); runApplication(); } $ dub main.d Although of course vibe.d is not included with the compiler, this works out of the box for a standard DMD/LDC installation.
Jun 24
next sibling parent reply Ecstatic Coder <ecstatic.coder gmail.com> writes:
On Saturday, 24 June 2017 at 20:29:23 UTC, Sönke Ludwig wrote:
 Am 24.06.2017 um 21:22 schrieb Ecstatic Coder:
 package main

 import (
     "log"
     "net/http"
 )

 func main() {
     http.HandleFunc("/", func(w http.ResponseWriter, r 
 *http.Request) {
         http.ServeFile(w, r, r.URL.Path[1:]);
     });

     log.Fatal(http.ListenAndServe(":80", nil));
 }
/++ dub.sdl name "webserver" dependency "vibe-d:http" version="~>0.7.31" +/ module main; import vibe.core.core; import vibe.http.fileserver; import vibe.http.server; void main() { listenHTTP(new HTTPServerSettings, serveStaticFiles("./")); runApplication(); } $ dub main.d Although of course vibe.d is not included with the compiler, this works out of the box for a standard DMD/LDC installation.
Exactly what I mean. Just rename the three imports into std.*, make this available at installation, et voilà :) Should not require too much work...
Jun 24
parent Adam D. Ruppe <destructionator gmail.com> writes:
On Saturday, 24 June 2017 at 21:04:36 UTC, Ecstatic Coder wrote:
 Just rename the three imports into std.*, make this available 
 at installation, et voilà :)
Or just leave it how it is and let it download the package automatically! I'm pretty sure that always works with an out-of-the box dmd installation today. It isn't ideal to me yet, but I do think it is closer to what you want than you think...
Jun 24
prev sibling next sibling parent Andrei Alexandrescu <SeeWebsiteForEmail erdani.com> writes:
On 6/24/17 9:29 PM, Sönke Ludwig wrote:
 Am 24.06.2017 um 21:22 schrieb Ecstatic Coder:
 package main

 import (
     "log"
     "net/http"
 )

 func main() {
     http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
         http.ServeFile(w, r, r.URL.Path[1:]);
     });

     log.Fatal(http.ListenAndServe(":80", nil));
 }
/++ dub.sdl name "webserver" dependency "vibe-d:http" version="~>0.7.31" +/ module main; import vibe.core.core; import vibe.http.fileserver; import vibe.http.server; void main() { listenHTTP(new HTTPServerSettings, serveStaticFiles("./")); runApplication(); } $ dub main.d Although of course vibe.d is not included with the compiler, this works out of the box for a standard DMD/LDC installation.
This should be a blog post. -- Andrei
Jun 24
prev sibling next sibling parent reply Wulfklaue <wulfklaue wulfklaue.com> writes:
On Saturday, 24 June 2017 at 20:29:23 UTC, Sönke Ludwig wrote:
 /++ dub.sdl
     name "webserver"
     dependency "vibe-d:http" version="~>0.7.31"
 +/
 module main;

 import vibe.core.core;
 import vibe.http.fileserver;
 import vibe.http.server;

 void main()
 {
     listenHTTP(new HTTPServerSettings, serveStaticFiles("./"));
     runApplication();
 }

 $ dub main.d

 Although of course vibe.d is not included with the compiler, 
 this works out of the box for a standard DMD/LDC installation.
No it does not... Attempt 1: ========= Create main.d file, insert code. dub main.d
 readPackageRecipe called with filename with unknown extension: 
 + dub.sdl
      name "webserver"
      dependency "vibe-d
Attempt 2: ========= Dub init xxxxx -> enter sdl -> ... Update xxxxx/src/app.d, insert code. Run dub ...
 Performing "debug" build using dmd for x86.
 webser ~master: building configuration "application"...
 source\app.d(7,8): Error: module core is in file 
 'vibe\core\core.d' which cannot be read
 import path[0] = source
 import path[1] = C:\D\dmd2\windows\bin\..\..\src\phobos
 import path[2] = C:\D\dmd2\windows\bin\..\..\src\druntime\import
 dmd failed with exit code 1.
Attempt 3: ========= dub init xxxxx -> enter sdl -> ... Insert dependency into xxxxx/dub.sdl. Update file xxxxx/src/app.d, insert code. Run dub ... Works Attempt 4: ========= Place dub.sdl into main project root directory. Add the dependency information into the file. workspaces-d ( Visual Studio Code ) crash, crash, crash, crash. Reason. Already a folder called Webserver present and this creates a conflic. Attempt 5: ========= Place dub.sdl into main project root directory. Add the dependency information into the file ( now with different project file ). Create WebTest2.d file, insert code. dub WebTest2.d
 dub .\WebTest2.d
 readPackageRecipe called with filename with unknown extension: 
 + dub.sdl
      name "webserver"
     dependency "vibe-d
Conclusion: =========== From 5 different attempt, only one works. All the rest are how people may attempt it and will run into a crash or other non-working issues. It requires knowledge of dub. It requires selecting the correct sdl format, when running dub init It requires knowing that the dependency needs to be in a dub.sdl file, in a actual project. ... Go idiomatic it is not unfortunately. As Ecstatic Coder pointed out. The Go http is a default core package of Go. For D it means depending on a 3th party solution. Currently vibe.d 0.8 is undergoing a rewrite. This breaks some basic functionally with the more module design. A issue if a user had installed a 0.7.30 or earlier version. There is this bad habit with assuming that people will understand how to run the samples posted or provided on there first attempt at using D. As seen above, its very easy to make mistakes. A programming language is like a drug. If people like there first experience, they may get hooked. If its a bad "trip", most will not mention a word and simply not try again.
Jun 24
next sibling parent =?UTF-8?Q?S=c3=b6nke_Ludwig?= <sludwig+d outerproduct.org> writes:
Am 25.06.2017 um 00:16 schrieb Wulfklaue:
 On Saturday, 24 June 2017 at 20:29:23 UTC, Sönke Ludwig wrote:
 /++ dub.sdl
     name "webserver"
     dependency "vibe-d:http" version="~>0.7.31"
 +/
 module main;

 import vibe.core.core;
 import vibe.http.fileserver;
 import vibe.http.server;

 void main()
 {
     listenHTTP(new HTTPServerSettings, serveStaticFiles("./"));
     runApplication();
 }

 $ dub main.d

 Although of course vibe.d is not included with the compiler, this
 works out of the box for a standard DMD/LDC installation.
No it does not...
I've got to admit that I typed this from the top of my head without actually running it, and of course I got the syntax wrong. The first line must be "/+ dub.sdl:", with a colon at the end. The error message is off, because, after a refactoring, the colon that should end the first line is also accepted on any later line within the comment. I'll prepare a PR to fix this.
Jun 24
prev sibling parent reply Wulfklaue <wulfklaue wulfklaue.com> writes:
On Saturday, 24 June 2017 at 22:16:11 UTC, Wulfklaue wrote:

 Attempt 1:
 Attempt 2:
 Attempt 3:
 Attempt 4:
 Attempt 5:
 =========
Almost forgot to mention, this was done under Windows ( where the inline does not work ). It works under Linux but that is a different issue.
Jun 24
parent reply =?UTF-8?Q?S=c3=b6nke_Ludwig?= <sludwig+d outerproduct.org> writes:
Am 25.06.2017 um 01:01 schrieb Wulfklaue:
 On Saturday, 24 June 2017 at 22:16:11 UTC, Wulfklaue wrote:

 Attempt 1:
 Attempt 2:
 Attempt 3:
 Attempt 4:
 Attempt 5:
 =========
Almost forgot to mention, this was done under Windows ( where the inline does not work ). It works under Linux but that is a different issue.
With inline, do you mean the embedded package recipe? Works for me on Windows if you add the colon.
Jun 25
parent reply Wulfklaue <wulfklaue wulfklaue.com> writes:
On Sunday, 25 June 2017 at 07:34:57 UTC, Sönke Ludwig wrote:
 With inline, do you mean the embedded package recipe? Works for 
 me on Windows if you add the colon.
Strange, colon was there. Did not work on Windows. Same error as without the colon. This is why i mentioned that it worked under linux ( windows linux subsystem ) but not on pure Windows.
Jun 26
next sibling parent Ecstatic Coder <ecstatic.coder gmail.com> writes:
On Monday, 26 June 2017 at 07:19:21 UTC, Wulfklaue wrote:
 On Sunday, 25 June 2017 at 07:34:57 UTC, Sönke Ludwig wrote:
 With inline, do you mean the embedded package recipe? Works 
 for me on Windows if you add the colon.
Strange, colon was there. Did not work on Windows. Same error as without the colon. This is why i mentioned that it worked under linux ( windows linux subsystem ) but not on pure Windows.
LOL QED... ;)
Jun 26
prev sibling parent reply =?UTF-8?Q?S=c3=b6nke_Ludwig?= <sludwig+d outerproduct.org> writes:
Am 26.06.2017 um 09:19 schrieb Wulfklaue:
 On Sunday, 25 June 2017 at 07:34:57 UTC, Sönke Ludwig wrote:
 With inline, do you mean the embedded package recipe? Works for me on
 Windows if you add the colon.
Strange, colon was there. Did not work on Windows. Same error as without the colon. This is why i mentioned that it worked under linux ( windows linux subsystem ) but not on pure Windows.
Can you post the error message? I didn't use the Linux sub system.
Jun 26
parent reply Wulfklaue <wulfklaue wulfklaue.com> writes:
On Monday, 26 June 2017 at 08:29:54 UTC, Sönke Ludwig wrote:
 Am 26.06.2017 um 09:19 schrieb Wulfklaue:
 Can you post the error message? I didn't use the Linux sub 
 system.
From what i remember on my home system, the issue was it tried to store the file in Windows temporary directory. Just tried it on my my work PC ( with visual studio code portable ) and got a slightly different error:
 C:\Users\xxx\AppData\Local\Temp\VSCodePortableTemp\.dub\build\
ibe-d:utils-0.7.31: The directory name is invalid.
I assume the error is similar to the one i had in the weekend because its trying to use the temp folder again. Just different temp path because of the portable editor ;). Note: At home its a full VSC installation, not this portable version.
Jun 26
parent reply =?UTF-8?Q?S=c3=b6nke_Ludwig?= <sludwig+d outerproduct.org> writes:
Am 26.06.2017 um 10:41 schrieb Wulfklaue:
 On Monday, 26 June 2017 at 08:29:54 UTC, Sönke Ludwig wrote:
 Am 26.06.2017 um 09:19 schrieb Wulfklaue:
 Can you post the error message? I didn't use the Linux sub system.
From what i remember on my home system, the issue was it tried to store the file in Windows temporary directory. Just tried it on my my work PC ( with visual studio code portable ) and got a slightly different error:
 C:\Users\xxx\AppData\Local\Temp\VSCodePortableTemp\.dub\build\vibe-d:utils-0.7.31:
 The directory name is invalid.
I assume the error is similar to the one i had in the weekend because its trying to use the temp folder again. Just different temp path because of the portable editor ;). Note: At home its a full VSC installation, not this portable version.
Okay, thanks, that explains it. I didn't realize that I'm using DUB master instead of the latest release, and this issue is already fixed there. A workaround is to use "dub --single webserver.d" instead (performs the build normally instead of building in the temp folder).
Jun 26
parent Wulfklaue <wulfklaue wulfklaue.com> writes:
On Monday, 26 June 2017 at 08:54:23 UTC, Sönke Ludwig wrote:
 Okay, thanks, that explains it. I didn't realize that I'm using 
 DUB master instead of the latest release, and this issue is 
 already fixed there. A workaround is to use "dub --single 
 webserver.d" instead (performs the build normally instead of 
 building in the temp folder).
Indeed, that works a lot better :)
Jun 26
prev sibling parent reply Timon Gehr <timon.gehr gmx.ch> writes:
On 24.06.2017 22:29, Sönke Ludwig wrote:
 Am 24.06.2017 um 21:22 schrieb Ecstatic Coder:
 package main

 import (
     "log"
     "net/http"
 )

 func main() {
     http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
         http.ServeFile(w, r, r.URL.Path[1:]);
     });

     log.Fatal(http.ListenAndServe(":80", nil));
 }
/++ dub.sdl name "webserver" dependency "vibe-d:http" version="~>0.7.31" +/ module main; import vibe.core.core; import vibe.http.fileserver; import vibe.http.server; void main() { listenHTTP(new HTTPServerSettings, serveStaticFiles("./")); runApplication(); } $ dub main.d Although of course vibe.d is not included with the compiler, this works out of the box for a standard DMD/LDC installation.
$ cat main.d /++ dub.sdl name "webserver" dependency "vibe-d:http" version="~>0.7.31" +/ module main; import vibe.core.core; import vibe.http.fileserver; import vibe.http.server; void main() { listenHTTP(new HTTPServerSettings, serveStaticFiles("./")); runApplication(); } $ dub main.d readPackageRecipe called with filename with unknown extension: + dub.sdl name "webserver" dependency "vibe-d What am I doing wrong?
Jun 24
next sibling parent reply =?UTF-8?Q?S=c3=b6nke_Ludwig?= <sludwig+d outerproduct.org> writes:
Am 25.06.2017 um 00:18 schrieb Timon Gehr:
 $ cat main.d
 /++ dub.sdl: <--  colon missing here
 (...)

 What am I doing wrong?
I forgot a colon at the end of the first line. With that it *actually* works now.
Jun 24
parent reply Timon Gehr <timon.gehr gmx.ch> writes:
On 25.06.2017 00:34, Sönke Ludwig wrote:
 Am 25.06.2017 um 00:18 schrieb Timon Gehr:
 $ cat main.d
 /++ dub.sdl: <--  colon missing here
 (...)

 What am I doing wrong?
I forgot a colon at the end of the first line. With that it *actually* works now.
$ dub main.d Failed to listen on :::80 Failed to listen on 0.0.0.0:80 object.Exception ../../.dub/packages/vibe-d-0.7.31/vibe-d/source/vibe/ ttp/server.d(1698): Failed to listen for incoming HTTP connections on any of the supplied interfaces. ----------------
Jun 24
next sibling parent reply Wulfklaue <wulfklaue wulfklaue.com> writes:
On Saturday, 24 June 2017 at 23:00:59 UTC, Timon Gehr wrote:
 $ dub main.d
 Failed to listen on :::80
 Failed to listen on 0.0.0.0:80
 object.Exception ../../.dub/packages/vibe-d-0.7.31/vibe-d/source/vibe/
ttp/server.d(1698): Failed to listen for incoming HTTP connections on any of
the supplied interfaces.
 ----------------
You probably already have a server active on port 80. That is why it fails. You need to use a different port or temporary turn off the service that is using port 80 currently.
Jun 24
parent Timon Gehr <timon.gehr gmx.ch> writes:
On 25.06.2017 01:03, Wulfklaue wrote:
 On Saturday, 24 June 2017 at 23:00:59 UTC, Timon Gehr wrote:
 $ dub main.d
 Failed to listen on :::80
 Failed to listen on 0.0.0.0:80
 object.Exception ../../.dub/packages/vibe-d-0.7.31/vibe-d/source/vibe/
ttp/server.d(1698): 
 Failed to listen for incoming HTTP connections on any of the supplied 
 interfaces.
 ----------------
You probably already have a server active on port 80. That is why it fails. You need to use a different port or temporary turn off the service that is using port 80 currently.
$ sudo netstat -tulpn | grep :80 $
Jun 24
prev sibling parent reply Adam D. Ruppe <destructionator gmail.com> writes:
On Saturday, 24 June 2017 at 23:00:59 UTC, Timon Gehr wrote:
 Failed to listen on :::80
Listening on port 80 requires root anyway. That's why like my cgi.d uses 8085 - anything over 1024 can be listened by any user (and is less likely to have an existing program on it)
Jun 24
parent reply Timon Gehr <timon.gehr gmx.ch> writes:
On 25.06.2017 01:09, Adam D. Ruppe wrote:
 On Saturday, 24 June 2017 at 23:00:59 UTC, Timon Gehr wrote:
 Failed to listen on :::80
Listening on port 80 requires root anyway. That's why like my cgi.d uses 8085 - anything over 1024 can be listened by any user (and is less likely to have an existing program on it)
Thanks! I guessed as much, but I don't have a setup where root can build the code. (And I don't see why it should.)
Jun 24
parent =?UTF-8?Q?S=c3=b6nke_Ludwig?= <sludwig outerproduct.org> writes:
Am 25.06.2017 um 01:12 schrieb Timon Gehr:
 On 25.06.2017 01:09, Adam D. Ruppe wrote:
 On Saturday, 24 June 2017 at 23:00:59 UTC, Timon Gehr wrote:
 Failed to listen on :::80
Listening on port 80 requires root anyway. That's why like my cgi.d uses 8085 - anything over 1024 can be listened by any user (and is less likely to have an existing program on it)
Thanks! I guessed as much, but I don't have a setup where root can build the code. (And I don't see why it should.)
Usually I'd use 8080 for examples, but the original example used port 80, so I just followed along. HTTPServerSettings has a .port field that can be used to change the default.
Jun 28
prev sibling parent Wulfklaue <wulfklaue wulfklaue.com> writes:
On Saturday, 24 June 2017 at 22:18:29 UTC, Timon Gehr wrote:
 $ cat main.d
 /++ dub.sdl
     name "webserver"
     dependency "vibe-d:http" version="~>0.7.31"
 +/
 module main;

 import vibe.core.core;
 import vibe.http.fileserver;
 import vibe.http.server;

 void main()
 {
     listenHTTP(new HTTPServerSettings, serveStaticFiles("./"));
     runApplication();
 }
 $ dub main.d
 readPackageRecipe called with filename with unknown extension: 
 + dub.sdl
     name "webserver"
     dependency "vibe-d

 What am I doing wrong?
See the post above yours. Attempt 3: Run: * CMD> dub init projectname * Enter sdl for your project file * Enter the rest like you want * CMD> cd projectname * Edit the dub.sdl file and add the "dependency "vibe-d:http" version="~>0.7.31"" at the end. * CMD> cd src * Now edit the app.d file and replace the code with. No need for the /++ stuff.
 module main;

 import vibe.core.core;
 import vibe.http.fileserver;
 import vibe.http.server;

 void main()
 {
     listenHTTP(new HTTPServerSettings, serveStaticFiles("./"));
     runApplication();
 }
* Go back to your projectname folder and run dub * CMD> dub * And with some luck it will run correctly. And thank for proving my point that some do not understand that something they consider simply, is not always simply for people doing it the first time. Now frankly, if the whole /++ dub.sdl +/ actually worked as a file based dependency, now that will be a interesting feature ;)
Jun 24
prev sibling parent Adam D. Ruppe <destructionator gmail.com> writes:
On Saturday, 24 June 2017 at 19:22:48 UTC, Ecstatic Coder wrote:
 Two lines of code, that's all that's needed to serve an entire 
 website, with all sorts of files (html, css, js, jpg, png, etc) 
 located in plenty of directories.
Fun fact: I actually do *not* have code that does that in one line. With my cgi.d, you'd have to roll your own with std.file and the cgi params or something. It isn't hard, but I didn't provide my own function since it is useless to me - serving static files is done brilliantly well by your production web server, so why not just use it?! Anyway, my point is that anybody can put a few examples in the stdlib and say "look at how easy this is!", but the real question is how easy it is to do something that the example writers didn't think of. That's why I want to promote decentralization - with a lot of people owning their own projects, you are more likely to find what you need. Just at the same time, you're right that locating, evaluating, and actually using these things is a hassle. (In fact, I find in most languages that libraries are NOT worth the hassle and I avoid using them!) So that's why the balance I want to get is one where the projects are developed individually, but particularly useful/popular ones are bundled by the central maintainers... or ranked by the lib repo website (code.dlang.org or otherwise) and trivially downloaded on demand. I also want tutorials with a lot of fully working examples available and easily discovered to show how to use these. We're currently OK at this, but it could be better.
 Which is very sad, because webserver development is a domain 
 where D can be a perfect contender to Go, Java and C#, and not 
 everybody is willing to use a full framework just to have the 
 same functionalities as these two simple lines of Go code.
The real WTF is you'd use two lines of Go code when you can just copy your files into /var/www/htdocs and let Apache do it for you.
Jun 24
prev sibling parent Martin Tschierschke <mt smartdolphin.de> writes:
On Friday, 23 June 2017 at 08:29:33 UTC, cym13 wrote:
 On Friday, 23 June 2017 at 07:44:36 UTC, Ecstatic Coder wrote:
 Huh? You were asked about concrete action points that in your 
 PoV would improve dlang.org. You can't just say "make it
[...]
 Problem is, low profile programmers aren't the most interesting 
 target for D right now....
[...] Two ideas: A) place a changing slogan (like the changing code snippets) with short arguments - sometimes a joke or. comic from the community. Examples: I think that I can safely say that nobody understands C++ template mechanics. (From the "famous" Richard Deyman https://dlang.org/spec/template.html) Memory safety will kill C. Walter Bright Link: https://www.youtube.com/watch?v=Lo6Q2vB9AAg&t=24m15s The Evolution of Programmers: :C :C++ :D (From the Forum + Alis talk https://www.youtube.com/watch?v=vYEKEIpM2zo) Time is Money - Time is live ... Manu... (please make it complete) 80%-90% of the web is based on interpreting languages, is there no alternative to this waste of CPU, Time and Energy? Vibe.d ! https://w3techs.com/technologies/details/pl-php/all/all http://vibed.org/ EmTee B) Idea please think about an explain flag / link beside the code examples, because if you don't know the foo!baz(value) syntax. The ! is uncommon, I first thought it is like in the "gsub!" expression in ruby... but could not bring it together...:-)
Jun 23
prev sibling parent reply dlangPupil <x x989898998.com> writes:
On Thursday, 22 June 2017 at 19:19:20 UTC, Ecstatic Coder wrote:
 class TOTO

...I think that trying to
 make the website very appealing to inexperienced programmers as 
 well could significantly broaden its user base.
Although I am admittedly an LOB kind of person who cares little for games or gamification, I do see the benefit of using "fun" use-case examples, like a tic-tac-toe game, or a soda machine simulation. Such recognizable zero-overhead/zero-noise metaphors simplify the tasks of understanding a program and learning its language. By contrast, being asked to decipher a mysterious and unintuitive program like the fatuous tutu example would leave me resenting the distraction and cognitive overhead. Dammit Jim, I'm a programmer, not a damned word puzzle competitor! But that's just me! So... instead of showcasing just one or another program type on the website's landing page, why not provide a tabbed dialog or menu that lets users select the kind of program that most interests them, e.g., LOB, web, games, STEM, etc. This would avoid alienating those readers who believe that effective technical and instructional communication require the maximization of signal-to-noise ratio ABOVE ALL ELSE. Some other ideas for introductory illustrative examples for the website would be to include for each program: 1) A description of the program's function so readers know what to look for. 2) The expected output. 3) A walk-through, when needed. 4) The same program in other languages, with call-outs to identify the unique features and benefits of Dlang.
Jun 26
parent reply Ecstatic Coder <ecstatic.coder gmail.com> writes:
On Tuesday, 27 June 2017 at 01:53:20 UTC, dlangPupil wrote:
 On Thursday, 22 June 2017 at 19:19:20 UTC, Ecstatic Coder wrote:
 class TOTO

...I think that trying to
 make the website very appealing to inexperienced programmers 
 as well could significantly broaden its user base.
Although I am admittedly an LOB kind of person who cares little for games or gamification, I do see the benefit of using "fun" use-case examples, like a tic-tac-toe game, or a soda machine simulation. Such recognizable zero-overhead/zero-noise metaphors simplify the tasks of understanding a program and learning its language. By contrast, being asked to decipher a mysterious and unintuitive program like the fatuous tutu example would leave me resenting the distraction and cognitive overhead. Dammit Jim, I'm a programmer, not a damned word puzzle competitor! But that's just me! So... instead of showcasing just one or another program type on the website's landing page, why not provide a tabbed dialog or menu that lets users select the kind of program that most interests them, e.g., LOB, web, games, STEM, etc. This would avoid alienating those readers who believe that effective technical and instructional communication require the maximization of signal-to-noise ratio ABOVE ALL ELSE. Some other ideas for introductory illustrative examples for the website would be to include for each program: 1) A description of the program's function so readers know what to look for. 2) The expected output. 3) A walk-through, when needed. 4) The same program in other languages, with call-outs to identify the unique features and benefits of Dlang.
I agree with you. Let me first say that the tutu code was there just to illustrate to show which features should be shown in examples. Simple D features, not complicated ones. D code is easy to make and read. That is what people should know about the D language. I'm in favor of bein able to select an example among a list on the left side of the screen, and on the right side the example appears with an explanation below. The default example is the classic hello word, then we show how to declare and use integers, strings, arrays, maps, then how to declare classes, then we have interesting "use-case" examples : process a text file line by line, using regular expressions, guess-a-number game, sort lines in alphabetical order, etc. Kotlin uses a quite similar approach if I remember well.
Jun 27
parent Ecstatic Coder <ecstatic.coder gmail.com> writes:
 The default example is the classic hello word, then we show how 
 to declare and use integers, strings, arrays, maps, then how to 
 declare classes, then we have interesting "use-case" examples : 
 process a text file line by line, using regular expressions, 
 guess-a-number game, sort lines in alphabetical order, etc.
Within the next few months I'll try to find some free time to write all these examples and put them in a D_TUTORIAL project on my senselogic github account. The ui/game examples will be based on a small Nuklear-inspired std.ui library, and the web examples based on a small Vibe-inspired std.web library. I guess that as usual this will remain unused, but that doesn't matter actually, as they will be useful to my kids as a reference examples for their personal use, which is already fine by me.
Jun 28