back

by teleforce·5y ago·view on hn ↗
The question is why not? If creating a superset languages based on D will encourage more people to use D either directly or indirectly me think it's really worth it.

Please check Terra language (now in beta), on how they created Lua like language to enable easier optimization in C++ and other languages [1]. They reported Terra-based autotuner for BLAS routines performs within 20% of ATLAS, and DSL for stencil computations that runs 2.3x faster than hand-written C [2].

According to D language origins paper, D is meant to be general-purpose programming language with support for procedural, object-oriented, generic, generative, and functional programming [3]. It'll be a shame not to fully utilize the powerful nature of D. In addition, D also supports D language compiler DMD as a library [4], and there's also libDSL, a library for developing embedded domain specific languages in D via template metaprogramming [5].

[1]https://terralang.org/

[2]https://terralang.org/pldi071-devito.pdf

[3]https://dl.acm.org/doi/pdf/10.1145/3386323

[4]https://dlang.org/blog/2017/08/01/a-dub-case-study-compiling...

[5]https://dl.acm.org/doi/10.1145/2658761.2658770

1 comments
dmd as a library does not give you access to the compilers backend as of today.

The whole point in D is to write the program in D or write the DSL directly into a D file.

If I can be blunt here, why not? Because it would be crap. It's like sprinting in Wellies, by using a scripting language you either create an absolute Herculean task to wrap everything properly or immediately lose all the powerful things D let's you do.

Well, "wrap everything" is not really a concern (phew!) and I can't see how would anyone "lose all the powerful things D let's you do" with D being the language you'll write most of the code, anyway.

But maybe you're right about writing everything always in D!!! It's, hands down, the final answer to everything anyone would want, isn't? I wonder if there is some way of warning people who write software in Javascript, PHP, Ruby, Python, Perl, Erlang, Elixir, Tcl and all those other clearly inferior languages about that... I'm pretty sure they'll switch to D right away!!!!1!

(Just kidding: I'm writing Til because I want to and nothing more.)