Live data from Hacker News

TIL: Tcl-inspired command language on top of D

til-lang.github.io

21–26 of 26 posts

Re: TIL: Tcl-inspired command language on top of D

#22
post #11

After C and DasBetterC (safer C) have officially become the subsets of D language [1], it will be very interesting what languages will be the de-facto superset of D. With excellent support for metaprogramming and CTFE in D (amongst other features), these supersets language can be very flexible and fast at the same time. Kudos to the TIL's author for trailblazing this idea based on TCL. It will be very beneficial and…

The De facto super set of D code will always be D. DasBetterC is mainly a thing to use if you really need it, and the ImportC work is supposed to import C. If you want to see data science done in D take a look at the Mir libraries for example. Symmetry Investments have their own DSL which has a bunch of stuff in it for data wrangling. It's closed source (I have no insider knowledge here so potentially for good), but…

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

Re: TIL: Tcl-inspired command language on top of D

#23
post #20
post #16

Earlier quoted context omitted.

I'm not sold. Why do I want a scripting language to glue together that is designed to be good a glueing things together? It's a common misconception that programming languages are either fast or expressive - D is both. The rub is probably that you need to know more about programming in the sense that you have to have good aesthetic taste but also a knowledge of what makes programs actually fast to achieve both. And b…

>Why do I want a scripting language to glue together that is designed to be good a glueing things together? A good example might be calling legacy libraries like BLAS and LAPACK. These are battle-tested libraries that represent probably hundreds of millions of dollars of developer time, but Fortran is annoying for IO-heavy tasks (at least in my opinion). I like that I can spin up a scripting language like python and…

Again, D is designed to make calling into C code easy within the same program you were working on. The idea that you can't have a language that is both expressive and fast is just Stockholm syndrome from C++ being unergonomic.

Check it out on the website, you can write an RPN calculator in D in less lines than a Haskell implementation last time I checked, all while checked to be pure by the compiler.

Not only would a scripting language be slower because the compiler would be a hack without access to LTO and not have a proper type system etc., It would he a complete waste of time.

Re: TIL: Tcl-inspired command language on top of D

#24
post #11

Earlier quoted context omitted.

The De facto super set of D code will always be D. DasBetterC is mainly a thing to use if you really need it, and the ImportC work is supposed to import C. If you want to see data science done in D take a look at the Mir libraries for example. Symmetry Investments have their own DSL which has a bunch of stuff in it for data wrangling. It's closed source (I have no insider knowledge here so potentially for good), but…

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 computa…

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.

Re: TIL: Tcl-inspired command language on top of D

#25
post #21

I wonder if the distinction of SubLists and SimpleLists makes static code analysis and syntax highlighting more viable than in Tcl where you cant distinguish between "code" and "data"...

That's one benefit, for sure.

The main reason for this was to allow each class to have its own specific behavior (specially when evaluating), pushing some work into the parser instead of the runtime, since a SubList is a list of lists while a SimpleList is always a plain list itself, so no need for ".plain" methods in the last one. This makes things faster and the cognitive load is not affected so much (on the contrary, probably: I feel the syntax seems more familiar in the end).

Re: TIL: Tcl-inspired command language on top of D

#26
post #24

Earlier quoted context omitted.

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 computa…

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…

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.)

Post reply on HN