www.digitalmars.com         C & C++   DMDScript  

D - Portability

reply ziomus <ziomus_member pathlink.com> writes:
I read phobos library sources.... D is portability.... for Windows or Linux....
bleah.... portability ? 

And what at BSD, SunOS... other UNIX-Systems... and general others system. ?

portable code for linux is not portable ;ppp

when will be dmd portable ?

I don't understand chapter "The C Preprocessor vs D"

Why you compare MACRO to functions and constant variables ?, this are different
things


..?
Aug 03 2003
parent reply Ilya Minkov <midiclub 8ung.at> writes:
ziomus wrote:
 I read phobos library sources.... D is portability.... for Windows or Linux....
 bleah.... portability ? 
 
 And what at BSD, SunOS... other UNIX-Systems... and general others system. ?

We've got a (currently defunct) project to bind the front-end to GCC or output compilable C or C++ code. Then we'll be very portable. The only library part hindering portability at large i'm aware of is a GC. Some other parts will probably requiere bugfixing after there's a cross-platform compiler. :)
 portable code for linux is not portable ;ppp
 
 when will be dmd portable ?

As soon as some people join in which have enough time and skill to do something, and actually come to write it. You won't be alone, you've got experienced Jan Knepper on your side, who is quite busy, and probably also undermotivated by the lack of people who'd help. I first considered helping, but now i think i don't like D that much after all.
 I don't understand chapter "The C Preprocessor vs D"

What don't you understand specifically? D doesn't include a C-like preprocessor. This chapter explains, how you can solve the tasks in D, for which you use a preprocessor in C.
 Why you compare MACRO to functions and constant variables ?, this are different
 things

Hopefully yes. :) but when developing in C, you are often forced to emulate constants and lightweight functions through macros, which is... well, you answer your own question. :) -i.
Aug 03 2003
parent reply "Rich C" <no spam.com> writes:
"Ilya Minkov" <midiclub 8ung.at> wrote in message
news:bgjbkv$2l4m$1 digitaldaemon.com...

 I first considered helping, but now i think i don't like D that much
 after all.

Just curious as to what you don't like about it? Rich C.
Aug 03 2003
parent reply Ilya Minkov <midiclub 8ung.at> writes:
Rich C wrote:
 Just curious as to what you don't like about it?

Oh, there's enough to it. First, i *hate* C syntax. Second, as i ran over D, i have cut myself hard on C, and was afraid to learn C++. D is much easier. Now, that i've learned C++, the need in D is not that major. Besides, i have discovered Sather, which has a syntax i like, as well as a sane semantics, which is gorgeous. :) It has not only much more theoretical beauty, it feels also very simple, natural and convenient, without sharp corners. Like, take OCaml. A magnificcent language, but overcomplicated and *with* sharp semantic corners. And a horrible syntax, which implies hundreds of operators and wild name disambiguation. Another example with sharp corners is a paranoid Eiffel. Though seemingly similar to Sather, it's actually not. So, don't let me hold you back from using D. -i.
Aug 04 2003
next sibling parent reply "Mike Wynn" <mike.wynn l8night.co.uk> writes:
 Besides, i have discovered Sather, which has a syntax i like, as well as
 a sane semantics, which is gorgeous. :) It has not only much more
 theoretical beauty, it feels also very simple, natural and convenient,
 without sharp corners.

I looked through the Sather docs sometime back, and although I do argee with you view on Sather to me it suffers from the fault as Delphi ... great features, 90% of the syntax is good but lack the symbolic short cuts and has different use of ';' I like the C `if` (prefer the perl `if <bool><block>[<elseif/else>]`| <statement> if <bool> ) I always got driven mad by if <bool> then <stat> else <stat> ';' and resorted to begin and end with every if delphi code. don't you miss a++ and b += foo; etc ?
Aug 04 2003
parent reply "Sean L. Palmer" <palmer.sean verizon.net> writes:
You certainly had to type a lot more in Pascal/Delphi to get the same thing
to happen.

I don't see how anybody can think begin/end is more "readable" than { / }.
It's certainly less writable!!

Yes, a = succ(a) certainly seems less readable than a++.  (slightly
different semantics though).  In Delphi you can't put assignments anywhere
in an expression, they have to be their own statement.

I like syntactical shortcuts, so long as they don't cause ambiguity.  If you
can replace a symbol/keyword with a shorter one and maintain everything else
being equal I'd rather them be shorter.  I can use the saved keystrokes to
make my identifiers longer.  ;)

Sean

"Mike Wynn" <mike.wynn l8night.co.uk> wrote in message
news:bgls6m$1sq6$1 digitaldaemon.com...
 Besides, i have discovered Sather, which has a syntax i like, as well as
 a sane semantics, which is gorgeous. :) It has not only much more
 theoretical beauty, it feels also very simple, natural and convenient,
 without sharp corners.

I looked through the Sather docs sometime back, and although I do argee

 you view on Sather to me it suffers from the fault as Delphi ... great
 features, 90% of the syntax is good but lack the symbolic short cuts and

 different use of ';'
 I like the C `if`  (prefer the perl `if <bool><block>[<elseif/else>]`|
 <statement> if <bool> )
 I always got driven mad by if <bool> then <stat> else <stat> ';'
 and resorted to begin and end with every if delphi code.

 don't you miss a++ and b += foo; etc ?

Aug 05 2003
parent Ilya Minkov <midiclub 8ung.at> writes:
Sean L. Palmer wrote:
 You certainly had to type a lot more in Pascal/Delphi to get the same
 thing to happen.

Not really. Because most of function calls in C++ would be replaced by property assignments and reads in Delphi. None of these ugly () midst in expressions, which already have enough of parenthesis. But well... the library wasn't that advanced, and the lack of templates caused conceptually more typing, that's true. Not syntax.
 I don't see how anybody can think begin/end is more "readable" than {
 / }. It's certainly less writable!!

/methinks begin...end is cool. Readable and writable. I have a hard time stretching my fingers to get shift, ctrl, and alt right, to type in these special symbols! while hatural keywords are very fast and strain-free to type.
 Yes, a = succ(a) certainly seems less readable than a++.  (slightly 
 different semantics though).  In Delphi you can't put assignments
 anywhere in an expression, they have to be their own statement.

Who uses succ sux! The right way is "Inc (a);"!!!
 I like syntactical shortcuts, so long as they don't cause ambiguity.
 If you can replace a symbol/keyword with a shorter one and maintain
 everything else being equal I'd rather them be shorter.  I can use
 the saved keystrokes to make my identifiers longer.  ;)

Short keywords are good, as long as they are used vey often. Nothing against "bool", "int", ... -i.
Aug 05 2003
prev sibling next sibling parent reply "Sean L. Palmer" <palmer.sean verizon.net> writes:
D is currently better than C.

That isn't saying much.  Alot of it is unfinished, either in design or
implementation.  It still lacks polish and a certain amount of elegance.
There are certain points in the language design that I don't think are ever
going to be resolved to my satisfaction either because of irrational
backward compatibility with C or that Walter and I just don't see eye to eye
on many issues.  ;)

I don't think D is ready for prime time yet.  The core language design still
needs work.  The primary implementation is missing several language
features.  There needs to be more implementations or at least a GCC frontend
for D.

D has great potential, but for now, I have to use C++.

There are languages coming out that are better, but none that "have it all",
so to speak, and so I can't really switch to them either.

I agree with you Ilya about OCaml.  It could be a great language, but I
think it was designed by crazed Frenchmen;  it's a really alien feeling
language to people used to C++.  It seems complicated, and relies much on
convention for naming of conversions and print methods.  I really dislike
the syntax.

Sather is better in many ways but still don't like it.  It's just a gut
reaction;  maybe I can overcome it.

I wish one of the array languages like Nial would get popular or merge
somehow with one of the good functional languages.  ;)

Sean

"Ilya Minkov" <midiclub 8ung.at> wrote in message
news:bglnqq$1o8p$1 digitaldaemon.com...
 Rich C wrote:
 Just curious as to what you don't like about it?

Oh, there's enough to it. First, i *hate* C syntax. Second, as i ran over D, i have cut myself hard on C, and was afraid to learn C++. D is much easier. Now, that i've learned C++, the need in D is not that major. Besides, i have discovered Sather, which has a syntax i like, as well as a sane semantics, which is gorgeous. :) It has not only much more theoretical beauty, it feels also very simple, natural and convenient, without sharp corners. Like, take OCaml. A magnificcent language, but overcomplicated and *with* sharp semantic corners. And a horrible syntax, which implies hundreds of operators and wild name disambiguation. Another example with sharp corners is a paranoid Eiffel. Though seemingly similar to Sather, it's actually not. So, don't let me hold you back from using D. -i.

Aug 04 2003
next sibling parent reply Mark Evans <Mark_member pathlink.com> writes:
I agree with you Ilya about OCaml.  It could be a great language, but I
think it was designed by crazed Frenchmen;  it's a really alien feeling
language to people used to C++

Counterarguments: http://caml.inria.fr/archives/200104/msg00013.html http://caml.inria.fr/caml-list/1542.html
Aug 04 2003
parent Mark Evans <Mark_member pathlink.com> writes:
Try 
http://merjis.com/richj/computers/ocaml/tutorial/


http://caml.inria.fr/archives/200104/msg00013.html
http://caml.inria.fr/caml-list/1542.html

Aug 15 2003
prev sibling parent Ilya Minkov <midiclub 8ung.at> writes:
Sean L. Palmer wrote:

 I agree with you Ilya about OCaml.  It could be a great language, but I
 think it was designed by crazed Frenchmen;  it's a really alien feeling
 language to people used to C++.  It seems complicated, and relies much on
 convention for naming of conversions and print methods.  I really dislike
 the syntax.

It simply coudn't be different, else it wouldn't be OCaml. :) And it has nothing to do with crazy frenchmen, since i don't appear to know any frenchman to use OCaml. :) Though some to use C++. And the problem is not with the syntax itself - the tokens and their order can be changed. It's in the semantics. For global type infererence to work, all names have to be disambiguated -- and that refers not only to identifiers, but also to operators. Every datatype defines its own set of operators. A reference defines its own special kind of assignment... and so on. And i'm just not ready to take time to study deeply another language, which is not even a bit less complex than C++. It's a peak (one of the possible peaks) of what a functional language can reach, and it's impressiing. But it's so complex... so that when i'd have to decide between C++ and OCaml, i'd still and alwas choose C++, which is at least widely used. And with all the advantage which follows it. Including somewhat crazy but experienced frenchmen giving me tips on my personal projects. :) Well, it's probably not very realistic, but the libraries on my hands are.
 Sather is better in many ways but still don't like it.  It's just a gut
 reaction;  maybe I can overcome it.

It took me some time to realise that OCaml is an interesting and powerful language. :) However, i still wouldn't like to get acquainted with it any further.
 I wish one of the array languages like Nial would get popular or merge
 somehow with one of the good functional languages.  ;)

Hm... There are still so many languages i haven't heard of... dispite Mark always dropping a link, and myself always following them. -i. P.S. http://www.csse.monash.edu.au/~damian/papers/ Human factors in programming languages.
Aug 04 2003
prev sibling parent reply Frank Wills <fdwills sandarh.com> writes:
Ilya Minkov wrote:
 Rich C wrote:
 
 Just curious as to what you don't like about it?

Oh, there's enough to it. First, i *hate* C syntax. Second, as i ran over D, i have cut myself hard on C, and was afraid to learn C++. D is much easier.

I've been using C/C++ since around '84. Anything that kind of like C/C++ is out of my comfort zone, except assembly, which I like, but don't need so much. D works for me because it is essentially a modernization of C/C++, with a new OO foundation. Also, since it is more of an open source effort, with a minimal footprint (unlike C# and Java), I can hope that no one will be as able to turn it into some kind of monster language (again, like C++, C#, and Java). I can look forward for writing my own libraries, or using others that are developed as open source software, and can refine everything as much as I want for my own use. It's a language that I can "own", rather than getting "owned" by some corporation because I bought into their tools. I imagine that this is the general case for many others using D. It's also the reason I am doing all I can to use *BSD and Linux.
Aug 04 2003
parent reply Frank Wills <fdwills sandarh.com> writes:
Frank Wills wrote:
 Ilya Minkov wrote:
 
 Rich C wrote:

 Just curious as to what you don't like about it?

Oh, there's enough to it. First, i *hate* C syntax. Second, as i ran over D, i have cut myself hard on C, and was afraid to learn C++. D is much easier.

I've been using C/C++ since around '84. Anything that kind of like C/C++ is out of my comfort zone, except assembly, which I like, but don't need so much.

correction: Anything that _isn't_ kind of like C/C++ is out of my comfort zone.
Aug 04 2003
parent reply "Walter" <walter digitalmars.com> writes:
"Frank Wills" <fdwills sandarh.com> wrote in message
news:bgmbtr$2c97$2 digitaldaemon.com...
 Frank Wills wrote:
 I've been using C/C++ since around '84. Anything that kind of
 like C/C++ is out of my comfort zone, except assembly, which
 I like, but don't need so much.

my comfort zone.

I'm with you there. I've used it so much it is just second nature to me. Looking at pascal syntax just sets my teeth on edge <g>.
Aug 05 2003
parent reply Frank Wills <fdwills sandarh.com> writes:
Walter wrote:
 "Frank Wills" <fdwills sandarh.com> wrote in message
 news:bgmbtr$2c97$2 digitaldaemon.com...
 
 I'm with you there. I've used it so much it is just second nature to me.
 Looking at pascal syntax just sets my teeth on edge <g>.
 
 

for all of our college lab assignments. I was also a self-appointed C evangelist, which they weren't yet offering as a course.
Aug 05 2003
parent reply "Walter" <walter digitalmars.com> writes:
"Frank Wills" <fdwills sandarh.com> wrote in message
news:bgnsb4$pgl$1 digitaldaemon.com...
 Walter wrote:
 "Frank Wills" <fdwills sandarh.com> wrote in message
 news:bgmbtr$2c97$2 digitaldaemon.com...
 I'm with you there. I've used it so much it is just second nature to me.
 Looking at pascal syntax just sets my teeth on edge <g>.

for all of our college lab assignments. I was also a self-appointed C evangelist, which they weren't yet offering as a course.

I wrote several pascal programs long ago. Most of the programming time was spent *fighting* the compiler, as it thwarted me at every turn. It was so bad I was turning to using assembly language. Then I chanced on a copy of K+R, and it was like a breath of fresh air. No longer was I fighting the compiler, as the language allowed me to do what I wanted. I also simply liked the terseness of C. When you write a lot of code, the long wordy keywords of Pascal just get annoying.
Aug 05 2003
parent reply Ilya Minkov <midiclub 8ung.at> writes:
Walter wrote:

 I wrote several pascal programs long ago. Most of the programming time was
 spent *fighting* the compiler, as it thwarted me at every turn. It was so
 bad I was turning to using assembly language. Then I chanced on a copy of
 K+R, and it was like a breath of fresh air. No longer was I fighting the
 compiler, as the language allowed me to do what I wanted.

You had a wrong compiler. :) Nowadays they don't have these problems.
 I also simply liked the terseness of C. When you write a lot of code, the
 long wordy keywords of Pascal just get annoying.

No they don't! -i.
Aug 05 2003
next sibling parent reply "Mike Wynn" <mike.wynn l8night.co.uk> writes:
"Ilya Minkov" <midiclub 8ung.at> wrote in message
news:bgp2e4$1vin$1 digitaldaemon.com...
 I also simply liked the terseness of C. When you write a lot of code,


 long wordy keywords of Pascal just get annoying.

No they don't!

I think it is very much personal taste, having had to write in C, C++, Java, Delphi, Perl and PHP all sections of the same project often all in the same day, and with some code having to be ported from one lang to another, you start to develope strong personal preferences over how to do things. personally I lean towards the Java way for most stuff, it have the shortcuts and it defines the order of eval of params to functions. delphi as I remember will not allow you to write if i := func( foo ) then .... ; in Java you can write i = ar[idx++]; or even func( ar[idx++], ar[idx++], ar[idx] ); => func( ar[idx], ar[idx+1], ar[idx+2] ); idx+=2; pointers are another stumbling point to me with pascal/deplhi/modular2 I always found them a little confusing and akward, once I leant C I found pointers much more useable. and although passing 'var' params is nice I prefer the C *, &foo or c++ & I do miss sets, they where useful but that is realy the only good thing I can say about pascal based langs pascal based langs also try to give the illusion of robustness by (imho) hiding much of what they are doing away from the programmer, C makes no illusion about letting you walk of either end of your array! on the whole I would say C makes you aware that you have to program robustly and unlike c++ of delphi there is little going on outside your code that you have to be aware of.
Aug 07 2003
parent "Walter" <walter digitalmars.com> writes:
"Mike Wynn" <mike.wynn l8night.co.uk> wrote in message
news:bgu082$k41$1 digitaldaemon.com...
 pascal based langs also try to give the illusion of robustness by (imho)
 hiding much of what they are doing away from the programmer, C makes no
 illusion about letting you walk of either end of your array!
 on the whole I would say C makes you aware that you have to program

 and unlike c++ of delphi there is little going on outside your code that

 have to be aware of.

You're right that what-you-write-is-what-you-get in C can be very appealing.
Aug 07 2003
prev sibling parent "Walter" <walter digitalmars.com> writes:
"Ilya Minkov" <midiclub 8ung.at> wrote in message
news:bgp2e4$1vin$1 digitaldaemon.com...
 Walter wrote:
 I wrote several pascal programs long ago. Most of the programming time


 spent *fighting* the compiler, as it thwarted me at every turn. It was


 bad I was turning to using assembly language. Then I chanced on a copy


 K+R, and it was like a breath of fresh air. No longer was I fighting the
 compiler, as the language allowed me to do what I wanted.


What those old pascal compilers did was implement the language per Wirth's spec. It wasn't until years later that compiler companies figured out that pascal, as specified, is an unusable language. Each then put in a boatload of mutually incompatible extensions to fix that, making pascal a very unportable language.
 I also simply liked the terseness of C. When you write a lot of code,


 long wordy keywords of Pascal just get annoying.


<g>
Aug 07 2003