www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - Why is stdio ... stdio?

reply Chris Katko <ckatko gmail.com> writes:
Simple curious question.

Why isn't :

import std.stdio;

instead:

import std.io;

(Also, while we're at it. Why doesn't this form have code 
highlighting? It would much improve readibility. Doesn't that 
seem almost essential for a programming forum?)


I mean, I get it. stdio is the c header from a thousand years 
ago. But this isn't C. So it's kind of odd to ask for the 
"Standard standard" io library.
Nov 08 2018
next sibling parent reply Neia Neutuladh <neia ikeran.org> writes:
On Fri, 09 Nov 2018 02:03:36 +0000, Chris Katko wrote:
 Simple curious question.
 
 Why isn't :
 
 import std.stdio;
 
 instead:
 
 import std.io;
IO includes things like memory mapping, sockets, listing files, named pipes, that sort of thing. Standard IO includes only reading and writing to files and the console.
 (Also, while we're at it. Why doesn't this form have code highlighting?
 It would much improve readibility. Doesn't that seem almost essential
 for a programming forum?)
It's not a forum. It's a newsgroup that happens to have a web interface. Newsgroups are text-only. So bbcode is out, html is out, but interpreting markdown might be reasonable. But nobody's done that work.
Nov 08 2018
parent reply Jonathan M Davis <newsgroup.d jmdavisprog.com> writes:
On Thursday, November 8, 2018 7:25:45 PM MST Neia Neutuladh via Digitalmars-
d-learn wrote:
 It's not a forum. It's a newsgroup that happens to have a web interface.
 Newsgroups are text-only. So bbcode is out, html is out, but interpreting
 markdown might be reasonable. But nobody's done that work.
Honestly, having markdown in messages being typical would be _really_ annoying for those of us not using the web interface, because we'd see all of those backticks and the like as backticks, not as syntax highlighting. It would be like seeing html, albeit far less intrusive. I for one would much rather that things just stay as pure text and that we not be adding any features to the web interface that encourages adding _any_ kind of markup to messages. The web interface makes it easier for folks who don't want to use a newsgroup or mailing list to interact with the newsgroup, but it's still a newsgroup, and _many_ of us use it as such. - Jonathan M Davis
Nov 08 2018
next sibling parent reply Kagamin <spam here.lot> writes:
On Friday, 9 November 2018 at 06:42:37 UTC, Jonathan M Davis 
wrote:
 Honestly, having markdown in messages being typical would be 
 _really_ annoying for those of us not using the web interface, 
 because we'd see all of those backticks and the like as 
 backticks, not as syntax highlighting. It would be like seeing 
 html, albeit far less intrusive. I for one would much rather 
 that things just stay as pure text and that we not be adding 
 any features to the web interface that encourages adding _any_ 
 kind of markup to messages. The web interface makes it easier 
 for folks who don't want to use a newsgroup or mailing list to 
 interact with the newsgroup, but it's still a newsgroup, and 
 _many_ of us use it as such.
You used markdown three times in your message.
Nov 09 2018
parent reply Jonathan M Davis <newsgroup.d jmdavisprog.com> writes:
On Friday, November 9, 2018 1:27:44 AM MST Kagamin via Digitalmars-d-learn 
wrote:
 On Friday, 9 November 2018 at 06:42:37 UTC, Jonathan M Davis

 wrote:
 Honestly, having markdown in messages being typical would be
 _really_ annoying for those of us not using the web interface,
 because we'd see all of those backticks and the like as
 backticks, not as syntax highlighting. It would be like seeing
 html, albeit far less intrusive. I for one would much rather
 that things just stay as pure text and that we not be adding
 any features to the web interface that encourages adding _any_
 kind of markup to messages. The web interface makes it easier
 for folks who don't want to use a newsgroup or mailing list to
 interact with the newsgroup, but it's still a newsgroup, and
 _many_ of us use it as such.
You used markdown three times in your message.
No, I didn't. I just used underscores, which has been used with plain text for emphasis for decades. Supporting markdown, would involve stuff like backticks for code highlighting, and special markup for urls - stuff that doesn't actually provide information to someone who's reading plain text but just gets in the way, whereas the underscores _do_ provide information to someone reading plain text. - Jonathan M Davis
Nov 09 2018
next sibling parent reply Chris Katko <ckatko gmail.com> writes:
On Friday, 9 November 2018 at 09:11:37 UTC, Jonathan M Davis 
wrote:
 On Friday, November 9, 2018 1:27:44 AM MST Kagamin via 
 Digitalmars-d-learn wrote:
 On Friday, 9 November 2018 at 06:42:37 UTC, Jonathan M Davis

 wrote:
 [...]
You used markdown three times in your message.
No, I didn't. I just used underscores, which has been used with plain text for emphasis for decades. Supporting markdown, would involve stuff like backticks for code highlighting, and special markup for urls - stuff that doesn't actually provide information to someone who's reading plain text but just gets in the way, whereas the underscores _do_ provide information to someone reading plain text. - Jonathan M Davis
FYI, Allegro.CC just uses <code> int main() { return 0; } </code> as well as <pre> for pre-formatted "monospace" text. Neither of those would pollute a mailing list in plain-text mode because they'd exist only at the start and end of code. I'm sure you had no problem reading my above code.
Nov 09 2018
parent "H. S. Teoh" <hsteoh quickfur.ath.cx> writes:
On Fri, Nov 09, 2018 at 05:36:54PM +0000, Chris Katko via Digitalmars-d-learn
wrote:
[...]
 FYI, Allegro.CC just uses
 
 <code>
 int main()
  {
  return 0;
  }
 </code>
 
 as well as <pre> for pre-formatted "monospace" text.
 
 Neither of those would pollute a mailing list in plain-text mode
 because they'd exist only at the start and end of code. I'm sure you
 had no problem reading my above code.
I find those HTML-like tags very distracting. Markdown has a far less-intrusive syntax: ```` int main() { return 0; } ```` I wouldn't mind having the web interface interpret messages as markdown, actually. Mainly because I won't be seeing it. :-D But as someone has already pointed out, writing emphases like _this_ and bold like *this* is already established convention, and markdown was designed precisely to pick up on these kinds of conventions, so it could be added to the web forum without requiring anyone to change the way they type their messages, and it would be readable to everyone. T -- I am Ohm of Borg. Resistance is voltage over current.
Nov 09 2018
prev sibling parent reply Kagamin <spam here.lot> writes:
On Friday, 9 November 2018 at 09:11:37 UTC, Jonathan M Davis 
wrote:
 No, I didn't. I just used underscores, which has been used with 
 plain text for emphasis for decades. Supporting markdown, would 
 involve stuff like backticks for code highlighting
Backticks are from ddoc. What's the other way to indicate a code fragment?
 markup for urls - stuff that doesn't actually provide 
 information to someone who's reading plain text but just gets 
 in the way
If the url is messy, it's already a mess. If it isn't, it's easier to leave url as is than bother to markup it.
 whereas the underscores _do_ provide information to someone 
 reading plain text.
I think what's really missing is code highlighting. Emphasis isn't very useful, in your example the verb "do" is already emphasis, so markup doesn't provide any additional information, just gets in the way.
Nov 10 2018
next sibling parent reply Chris Katko <ckatko gmail.com> writes:
On Saturday, 10 November 2018 at 13:53:14 UTC, Kagamin wrote:
 On Friday, 9 November 2018 at 09:11:37 UTC, Jonathan M Davis 
 wrote:
 No, I didn't. I just used underscores, which has been used 
 with plain text for emphasis for decades. Supporting markdown, 
 would involve stuff like backticks for code highlighting
Backticks are from ddoc. What's the other way to indicate a code fragment?
 markup for urls - stuff that doesn't actually provide 
 information to someone who's reading plain text but just gets 
 in the way
If the url is messy, it's already a mess. If it isn't, it's easier to leave url as is than bother to markup it.
 whereas the underscores _do_ provide information to someone 
 reading plain text.
I think what's really missing is code highlighting. Emphasis isn't very useful, in your example the verb "do" is already emphasis, so markup doesn't provide any additional information, just gets in the way.
There is another possibility. Have the website run (fallible) heuristics to detect a snippet of code and automatically generate it. That would leave the mailing list people completely unchanged. However, HOW fallible becomes a huge issue. It may be so well implemented that nobody ever complains. Or, it could be so bad that it often breaks up the author's post in ways the author never planned--almost taking away the poster as the controller of what they present. That's a bit of an extreme, and unlikely, but I feel that examining extremes can be helpful to define the potential domain of the problem. We can also easily have a checkmark next to each post that disables highlighting for that post (as well as disable them in your account settings), and even a button people could press that says "this post is highlighted wrong." and the developer would get a log with the code. How many implementation "fixes" are needed depends on how fallible the detection code really is. -------------------------------------------------------------------------------------- But, really, I don't personally see it being "that" bad for people to put code tags / code markers around code. It's not like they're going to be peppered everywhere. If you can ignore a comment in code, you can ignore two tags (start and end) in a single post. It's an interesting argument to extend bold and italics... because people ARE already using them! But I never suggested we should support "full markdown". There's no need to support an entire standard if your forum only needs part of it. It seems like a reasonable compromise favoring maximum utility, to support code tags, as well as tags people already use like italics and bold. Automatic URL linking is a feature of 99% of forums and that would also have zero impact on the mailing list people. There may be others. Even if the goal is "minimum changes for mailing list people" it can still be done.
Nov 10 2018
parent Patrick Schluter <Patrick.Schluter bbox.fr> writes:
On Saturday, 10 November 2018 at 18:47:19 UTC, Chris Katko wrote:
 On Saturday, 10 November 2018 at 13:53:14 UTC, Kagamin wrote:
 [...]
There is another possibility. Have the website run (fallible) heuristics to detect a snippet of code and automatically generate it. That would leave the mailing list people completely unchanged. [...]
Simply using markup convention used in stackoverflow and reddit of formatting as code when indented by 4 blanks would already be a good step forward. I do it now even on newsgroup like comp.lang.c, the only newsgroup I still use via thunderbird (yeah, for the D groups I prefer the web interface which is really that good, contrary to all other web based newsgroup reader I ever saw).
 [...]
Nov 10 2018
prev sibling parent reply Jonathan M Davis <newsgroup.d jmdavisprog.com> writes:
On Saturday, November 10, 2018 6:53:14 AM MST Kagamin via Digitalmars-d-
learn wrote:
 On Friday, 9 November 2018 at 09:11:37 UTC, Jonathan M Davis

 wrote:
 No, I didn't. I just used underscores, which has been used with
 plain text for emphasis for decades. Supporting markdown, would
 involve stuff like backticks for code highlighting
Backticks are not from ddoc. They're from markdown and only got added to ddoc later. The fact that they got added to ddoc just further degrades it as a proper, macro-based markup language. Regardless, if it isn't clear that something is code, just put it on its own line, just like folks have been doing in mailing lists and newsgroups for decades. - Jonathan M Davis
Nov 10 2018
parent reply Adam D. Ruppe <destructionator gmail.com> writes:
On Saturday, 10 November 2018 at 23:29:12 UTC, Jonathan M Davis 
wrote:
 The fact that they got added to ddoc just further degrades it 
 as a proper, macro-based markup language.
The backticks were added to ddoc because they enabled something that was *virtually impossible* in ddoc before - proper character escaping. It actually originally had nothing to do with syntax sugar nor even with presentation - just the constant repetition of that myth has made it into a bit of reality. On the forum though, characters are already escaped properly, so there's no need here. Syntax highlighting for larger blocks is something I'm meh on - I don't really care either way if we wanted to do it.
Nov 10 2018
parent reply Jonathan M Davis <newsgroup.d jmdavisprog.com> writes:
On Saturday, November 10, 2018 7:51:36 PM MST Adam D. Ruppe via Digitalmars-
d-learn wrote:
 On Saturday, 10 November 2018 at 23:29:12 UTC, Jonathan M Davis

 wrote:
 The fact that they got added to ddoc just further degrades it
 as a proper, macro-based markup language.
The backticks were added to ddoc because they enabled something that was *virtually impossible* in ddoc before - proper character escaping. It actually originally had nothing to do with syntax sugar nor even with presentation - just the constant repetition of that myth has made it into a bit of reality.
It may be that a feature was needed to do better character escaping, but backticks really don't fit in with ddoc as a whole, and they've only encouraged folks to try and add further markdown features to ddoc, which IMHO, is incredibly negative. On the whole, the worst features of ddoc are the ones that act least like macros. They're the ones that are most "magical" and the ones that generally have to be fought and worked around. Adding more markdown features just makes things worse. As such, I very much wish that we'd found a different way to fix the character escaping problem. Regardless, none of that has anything to do with what we do with syntax highlighting in the newsgroup's web interface.
 On the forum though, characters are already escaped properly, so
 there's no need here. Syntax highlighting for larger blocks is
 something I'm meh on - I don't really care either way if we
 wanted to do it.
I don't really care what the web interface tries to highlight, but I don't want it doing anything that encourages people to start putting markdown in their messages, because I don't use the web interface, I don't want to have to see markdown in the middle of plain text messages any more than I want to see html. - Jonathan M Davis
Nov 10 2018
parent Adam D. Ruppe <destructionator gmail.com> writes:
On Sunday, 11 November 2018 at 03:57:22 UTC, Jonathan M Davis 
wrote:
 It may be that a feature was needed to do better character 
 escaping
Yeah, I would have preferred to just escape all of it (and axe the biggest mis"feature" ddoc has imo - embedded HTML), but it got rejected :(
 On the whole, the worst features of ddoc are the ones that act 
 least like macros. They're the ones that are most "magical" and 
 the ones that generally have to be fought and worked around.
I have no problem with the --- code --- or with the params: a = whatever bit... though the stupid _highlight crap is awful, and random: being a header drives me a bit nuts too. So I guess I see where you're coming from. Of course, I no longer care about ddoc, since I just did a custom doc gen.
 but I don't want it doing anything that encourages people to 
 start putting markdown in their messages, because I don't use 
 the web interface, I don't want to have to see markdown in the 
 middle of plain text messages any more than I want to see html.
Frankly, people already do this stuff and I don't see that changing. When I wrote my competitor for the forum back in the day, I had it trying to auto-detect code by looking for { or ; at the end of a line, or // at the beginning. I thought it worked reasonably well, but in the end i didn't really like it because IMO highlighting code on a forum is worthless anyway. But so many people write the --- or ``` or <code> thing that it prolly wouldn't hurt to read it too.
Nov 11 2018
prev sibling parent reply bauss <jj_1337 live.dk> writes:
On Friday, 9 November 2018 at 06:42:37 UTC, Jonathan M Davis 
wrote:
 On Thursday, November 8, 2018 7:25:45 PM MST Neia Neutuladh via 
 Digitalmars- d-learn wrote:
 It's not a forum. It's a newsgroup that happens to have a web 
 interface. Newsgroups are text-only. So bbcode is out, html is 
 out, but interpreting markdown might be reasonable. But 
 nobody's done that work.
Honestly, having markdown in messages being typical would be _really_ annoying for those of us not using the web interface, because we'd see all of those backticks and the like as backticks, not as syntax highlighting. It would be like seeing html, albeit far less intrusive. I for one would much rather that things just stay as pure text and that we not be adding any features to the web interface that encourages adding _any_ kind of markup to messages. The web interface makes it easier for folks who don't want to use a newsgroup or mailing list to interact with the newsgroup, but it's still a newsgroup, and _many_ of us use it as such. - Jonathan M Davis
I just want to say everyone who doesn't use the web-interface has to look at markdown anyway because people still write code in backticks etc. despite no support; even I do that. Using markdown without support to me is not so much about whether it should be highlighted or not, but just that you can separate content from code in your message. Similar to how signatures are usually separated by 3 or more slashes and then a new line: Ex: --- Some signature
Nov 12 2018
parent Mike Parker <aldacron gmail.com> writes:
On Monday, 12 November 2018 at 10:10:37 UTC, bauss wrote:

 I just want to say everyone who doesn't use the web-interface 
 has to look at markdown anyway because people still write code 
 in backticks etc. despite no support; even I do that.
Me, too. It's easy and unobtrusive. As for actually rendering it, Validimir has commented on this in the past. From the D Blog:
 First, people using NNTP/email won’t see the rendered versions. 
 Which isn’t a big deal by itself since it’s just text, but does 
 create feature imparity. It *is* possible to write Markdown 
 that looks fine when rendered but is unreadable in source form, 
 especially with some common extensions such as GitHub Flavored 
 Markdown.
 Second, unless we’re careful with this, people using 
 NNTP/mailing lists might trigger Markdown formatting that could 
 make their post unreadable. This could be avoided, though, by 
 only rendering messages with Markdown if they originate from 
 the web interface, which allows previewing posts."
And that quote is followed by this commentary from me: "Even so, he’s hoping to add support for Markdown at some point in the future." https://dlang.org/blog/2016/06/10/core-team-update-vladimir-panteleev/
Nov 12 2018
prev sibling parent "H. S. Teoh" <hsteoh quickfur.ath.cx> writes:
On Fri, Nov 09, 2018 at 02:03:36AM +0000, Chris Katko via Digitalmars-d-learn
wrote:
 Simple curious question.
 
 Why isn't :
 
 import std.stdio;
 
 instead:
 
 import std.io;
The reason is that std.stdio is basically just a nice D wrapper with syntactic sugar around the C library's stdio.h. There has been a std.io in the works, but unfortunately it hasn't quite materialized yet. So for now, we're stuck with std.stdio.
 (Also, while we're at it. Why doesn't this form have code
 highlighting? It would much improve readibility. Doesn't that seem
 almost essential for a programming forum?)
[...] Because this "forum" isn't really a web forum, but just a web interface to an NNTP server that also has a mailing list interface (I (mostly) use the mailing list interface). Haven't really felt a need for syntax highlighting myself, though most opinions differ. :-D T -- Latin's a dead language, as dead as can be; it killed off all the Romans, and now it's killing me! -- Schoolboy
Nov 08 2018