The Sparrow language

Timon Gehr via Digitalmars-d digitalmars-d at puremagic.com
Wed Apr 6 14:42:31 PDT 2016


On 06.04.2016 15:15, Andrei Alexandrescu wrote:
> I just got word about Sparrow (from its creator no less):
>
> presentation_offline_Sparrow.pdf - https://db.tt/m2WwpxIY

The sum of squares of odd fibonacci numbers example is... unconvincing. 
It is inefficient and incorrect.

> Speak.mp4 - https://db.tt/RDmrlEu7
> ThesisLucTeo.pdf - https://db.tt/1ylGHuc1

- He wrongly claims that dynamic memory allocation is disallowed in D 
during CTFE, dismissing it immediately.

- Concepts such as ctorFromCt are not discussed sufficiently well.

- No discussion of of out-of-bounds vector accesses. It seems that the 
compiler implementation might allow UB during compile time?

- I haven't found anything about modules, forward references or ordering 
of compile-time computations (which can have externally observable effects).

>
> An interesting language that shares a lot of D's vision and features.
> The languages differ in a few aspects: Sparrow has a much more flexible
> syntax allowing a variety of custom operators. (I happen to disagree
> that's a good thing as I believe highly flexible syntax easily leads to
> transmission noise code). On the plus side Sparrow has a smoother
> integration of compile-time vs. run-time computation, which makes it a
> bit easier to transition from one to another.

- No array literal enum mess.
- Overloading based on constants.

What else?

> Another feature we could
> consider adding to D is a simple definition of concepts as complex
> Boolean predicates. That's essentially identical to isForwardRange etc.
> etc. but makes for simpler use of these predicates.
> ...

Compile-time parsers with meaningful error messages for DSLs should 
probably also be supported at some point.


More information about the Digitalmars-d mailing list