Advertise D's great compatibilty with JavaScript
Ecstatic Coder
ecstatic.coder at gmail.com
Thu Oct 12 11:00:16 UTC 2017
On Sunday, 18 June 2017 at 10:38:49 UTC, Ecstatic Coder wrote:
> Something I really appreciate a lot with D is how close it is
> to JavaScript.
>
> For instance, I have to maintain two similar versions of
> Pendown, a Markdown alternative for colored documents.
>
> There is a server-side version, in D :
>
> https://github.com/senselogic/PENDOWN/blob/master/pendown.d
>
> And a client-side version, in JavaScript :
>
> https://github.com/senselogic/PENDOWN/blob/master/pendown.js
>
> If you look at both file, you should see how close both files
> are.
>
> Thanks to a few methods (charAt, slice, push, pop, etc) added
> to the string and array types, when I change a function
> implementation in one version, all I have to do is copy-paste
> the modifications in the other file and just make a few minor
> changes (==/===, ~/+, etc).
>
> Everything else works unchanged : string and array methods
> (length, split, join, startsWith, endsWith), closures, etc.
>
> I think that's really AWESOME to have designed the D language
> and its standard library in such a way, keeping it so close to
> JavaScript, the most used scripting languages on earth !!!
>
> That's why I personally advertise it like a "strongly-typed
> super-powered JavaScript", as it is the best scripting language
> I know.
>
> Even if D is obviously much more than that, this still
> accurately describes what many programmers should feel when
> using this fantastic language.
>
> Therefore I think that this closeness is something that should
> be advertised much more, so that people know that :
> - a JavaScript programmer will immediately feel at home with D;
> - porting text manipulation code back and forth between D and
> JavaScript is just a breeze.
Not directly related to my post, but in the unlikely event that
somebody on this forum has started to use Pendown, I must inform
you that I've slightly changed the list and image syntaxes to
make the even more practical.
I always do my best to avoid making breaking changes in my open
source tools, but as this project has zero stars on Github, I
thought I could freely fix the syntax, as this generally implies
that people have no interest in using it.
And if I was wrong, that's really easy to fix the existing
documents anyway, by making just a few find'n'replace in any
plain text editor...
More information about the Digitalmars-d
mailing list