The Sparrow language
Alex Parrill via Digitalmars-d
digitalmars-d at puremagic.com
Wed Apr 6 14:50:58 PDT 2016
On Wednesday, 6 April 2016 at 21:35:51 UTC, mate wrote:
> On Wednesday, 6 April 2016 at 20:48:20 UTC, Lucian Radu
> Teodorescu wrote:
>> On Wednesday, 6 April 2016 at 18:27:25 UTC, BLM768 wrote:
>>> On Wednesday, 6 April 2016 at 18:25:11 UTC, BLM768 wrote:
>>>>
>>>> Aside from the explicit annotations, I don't see how their
>>>> solution is more flexible than D's CTFE, but I might be
>>>> missing something.
>>>
>>> Never mind. Just saw their language embedding example. Neat!
>>
>> Compared to CTFE, in Sparrow you can run at compile-time *any*
>> algorithm you like. No restrictions apply. Not only you can do
>> whatever your run-time code can do, but can also call external
>> programs at compile-time.
>>
>> Imagine that you are calling the D compiler from inside the
>> Sparrow compiler to compile some D code that you encounter.
>
> Wow, could be dangerous to compile source code.
Spawning processes during compilation is as dangerous as
executing the program you just compiled (which you're going to
do; the entire point of compiling a program is to execute it). I
wouldn't be too concerned.
If you're hosting an online compiler, then you're (hopefully)
already sandboxing the compiler (to prevent source code that does
a lot of CTFE/has large static arrays/etc from eating all your
cpu+mem) and the compiled program (for obvious reasons) anyway.
(Same argument for D's string import paths not allowing you into
symlinks/subdirectores; there are more thorough sandboxing
options for those concerned)
More information about the Digitalmars-d
mailing list