February 10, 2012
We have C and C++

How about D- and D?

D- would be the have a similar use as today's C compilers.

===========================
Why create this language?
===========================

Well I would love to have a D compiler that supports microcontrollers.
The ones that have say 32 K of RAM and 64K of FLASH.
A language that is targeted for embedded and/or low resource environments.
It would be nice to have a modern language for low resource environments.

A potential way to implement this language is to use the DMD frontend,
then flag the unsupported features of D,
Next create a backend, like "C front" that outputs C code instead of assembler.


===========================
What do I envision with D-,
D-- or Dm or what ever you want to call it.
===========================

This language would basically be D without the garbage collection.
For example there would be structures but no classes.
There would be regular arrays but no dynamic arrays.
Code that is mostly equivalent to C, but you would still have structures with functions and overloading support,
and other features like templates etc.

I think you get the idea.

What are your thoughts?
February 10, 2012
On 02/10/2012 01:02 PM, Tim Krimm wrote:
> We have C and C++
>
> How about D- and D?
>
> D- would be the have a similar use as today's C compilers.
>
> ===========================
> Why create this language?
> ===========================
>
> Well I would love to have a D compiler that supports microcontrollers.
> The ones that have say 32 K of RAM and 64K of FLASH.
> A language that is targeted for embedded and/or low resource environments.
> It would be nice to have a modern language for low resource environments.
>
> A potential way to implement this language is to use the DMD frontend,
> then flag the unsupported features of D,
> Next create a backend, like "C front" that outputs C code instead of
> assembler.
>
>
> ===========================
> What do I envision with D-,
> D-- or Dm or what ever you want to call it.
> ===========================
>
> This language would basically be D without the garbage collection.
> For example there would be structures but no classes.
> There would be regular arrays but no dynamic arrays.
> Code that is mostly equivalent to C, but you would still have structures
> with functions and overloading support,
> and other features like templates etc.
>
> I think you get the idea.
>
> What are your thoughts?

I would love this as well. I *think* you wouldn't have to recreate the language, just recreate the runtime. You can currently use D and can completely avoid the use of the GC by just using static functions. From what I understand, dynamic arrays are also controlled and provided through the runtime. You can also export C symbols if you wanted to.
February 10, 2012
On 2/10/12 11:02 AM, Tim Krimm wrote:
> We have C and C++
>
> How about D- and D?

No please.

Andrei

February 10, 2012
On Fri, Feb 10, 2012 at 08:02:52PM +0100, Tim Krimm wrote:
> We have C and C++
> 
> How about D- and D?
[...]

Great, just what I need: a D- in programming!

:-P


T

-- 
PNP = Plug 'N' Pray
February 10, 2012
On Friday, 10 February 2012 at 20:21:53 UTC, Andrei Alexandrescu wrote:
> On 2/10/12 11:02 AM, Tim Krimm wrote:
>> We have C and C++
>>
>> How about D- and D?
>
> No please.
>
> Andrei

Please elaborate.
February 10, 2012
On 2/10/12 12:54 PM, Tim Krimm wrote:
> On Friday, 10 February 2012 at 20:21:53 UTC, Andrei Alexandrescu wrote:
>> On 2/10/12 11:02 AM, Tim Krimm wrote:
>>> We have C and C++
>>>
>>> How about D- and D?
>>
>> No please.
>>
>> Andrei
>
> Please elaborate.

The last thing we need is balkanization of the community. You are of course free to initiate such a project but if you care about D it would be great to apply your talent in a different direction.

Thanks,

Andrei
February 10, 2012
On Friday, 10 February 2012 at 21:04:26 UTC, Andrei Alexandrescu wrote:
> On 2/10/12 12:54 PM, Tim Krimm wrote:
>> On Friday, 10 February 2012 at 20:21:53 UTC, Andrei Alexandrescu wrote:
>>> On 2/10/12 11:02 AM, Tim Krimm wrote:
>>>> We have C and C++
>>>>
>>>> How about D- and D?
>>>
>>> No please.
>>>
>>> Andrei
>>
>> Please elaborate.
>
> The last thing we need is balkanization of the community. You are of course free to initiate such a project but if you care about D it would be great to apply your talent in a different direction.
>
> Thanks,
>
> Andrei

It seems like D would catch on faster if it could be used more places,
but at the same time I do understand your concern about the language fragmentation that could occur. That is a major, major issue.

D is superior to C and C++ but
D is fighting an up hill battle when it comes to market share.
Unfortunately, I guess for now, I am stuck using the C/C++ tools that are available for all of the different microcontrollers out there.


February 10, 2012
I would love to be able to use D on memory limited devices like arduino but
creating a whole new language would certainly add up to the confusion for
many new potential users (they can't deal with two standard library's, let
alone two language named nearly the same)
if one were to do such project I would certainly hope he'd keep nearly
everything the same and only strip out what's really necessary.


February 10, 2012
On Friday, 10 February 2012 at 21:04:26 UTC, Andrei Alexandrescu wrote:
> On 2/10/12 12:54 PM, Tim Krimm wrote:
>> On Friday, 10 February 2012 at 20:21:53 UTC, Andrei Alexandrescu wrote:
>>> On 2/10/12 11:02 AM, Tim Krimm wrote:
>>>> We have C and C++
>>>>
>>>> How about D- and D?
>>>
>>> No please.
>>>
>>> Andrei
>>
>> Please elaborate.
>
> The last thing we need is balkanization of the community. You are of course free to initiate such a project but if you care about D it would be great to apply your talent in a different direction.
>
> Thanks,
>
> Andrei

Can we minimize the fragmentation issues by handling this with a flag in the front end of the compiler, similar to the way we handle "The SafeD Subset".
February 10, 2012
On Fri, Feb 10, 2012 at 01:04:26PM -0800, Andrei Alexandrescu wrote:
> On 2/10/12 12:54 PM, Tim Krimm wrote:
> >On Friday, 10 February 2012 at 20:21:53 UTC, Andrei Alexandrescu wrote:
> >>On 2/10/12 11:02 AM, Tim Krimm wrote:
> >>>We have C and C++
> >>>
> >>>How about D- and D?
> >>
> >>No please.
> >>
> >>Andrei
> >
> >Please elaborate.
> 
> The last thing we need is balkanization of the community. You are of course free to initiate such a project but if you care about D it would be great to apply your talent in a different direction.
[...]

Perhaps one solution is to simply have the compiler recognize all valid D constructs, but to give an error when it sees a construct not supported by the target platform. For example:

	input.d(123): Error: dynamic arrays not supported by target
	platform.

This way, we don't cause fragmentation of D, and at the same time users will know which constructs should be avoided due to target platform limitations.


T

-- 
Never trust an operating system you don't have source for! -- Martin Schulze
« First   ‹ Prev
1 2 3 4 5 6 7 8 9
Top | Discussion index | About this forum | D home