d bare bones

Leandro Lucarella luca at llucax.com.ar
Fri Sep 6 09:24:07 PDT 2013


eles, el  6 de September a las 16:20 me escribiste:
> On Friday, 6 September 2013 at 14:09:15 UTC, Iain Buclaw wrote:
> >On 6 September 2013 14:13, Dicebot <public at dicebot.lv> wrote:
> >>On Friday, 6 September 2013 at 12:25:56 UTC, eles wrote:
> >>>
> >>>On Friday, 6 September 2013 at 10:43:38 UTC, Iain Buclaw
> >>>wrote:
> >>>>
> >>>>On 6 September 2013 10:35, eles <eles at eles.com> wrote:
> >And all I'm saying is that if you want to use it on bare metal
> >then
> >you have to strip out phobos and re-implement everything from
> >druntime.
> 
> Yes, I know, the kernel provides an almost complete and fully
> from-scratch reimplementation of the C standard lib. It would be
> almost impossible to rely on the libc provided by GNU, as the
> latter... relies on the kernel.
> 
> While reimplementing the C standard lib is simpler than
> reimplemented Druntime/Phobos, it could be argued that writing code
> using the libraries should be easier when relying on
> Druntime/Phobos, so this could be acceptable.
> 
> Problem is that D is needing those libraries not only for functions,
> but also for functionalities (of the language itself).
> 
> In C, you can use the language without a library, and I mean any
> subset of the language (yes, that will be a bare does-nothing
> application, but you know what you can rely on and what not).
> 
> In D you cannot. You have to avoid features *of the language*
> relying on Druntime and, worse, it is not even clear or guaranteed
> which of them.

LDC used to have a --no-runtime switch or something like that, that
aborted compilation if a call to the runtime was emitted. I don't know
if it still does, but that's extremely useful if you want to use the
D subset that only generates assembly without calling to external
functions. D runtime is mostly written in D, and for obvious reasons
can't use those language constructions that uses the features you are
implementing. So is possible (although extremely inconvenient right
now).

-- 
Leandro Lucarella (AKA luca)                     http://llucax.com.ar/
----------------------------------------------------------------------
GPG Key: 5F5A8D05 (F8CD F9A7 BF00 5431 4145  104C 949E BFB6 5F5A 8D05)
----------------------------------------------------------------------
FINALMENTE EL CABALLITO FABIAN VA A PASAR UNA BUENA NAVIDAD
	-- Crónica TV


More information about the D.gnu mailing list