www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - Zig mentions D in justifying its existence

reply Joakim <dlang joakim.fea.st> writes:
Probably a good sign that they mention D with C++ and Rust and 
have looked at D features:

https://github.com/zig-lang/zig/wiki/Why-Zig-When-There-is-Already-CPP%2C-D%2C-and-Rust%3F

These recent articles also mention D or talk about some similar 
features:

http://videocortex.io/2017/Bestiary/
https://medium.com/ kasperpeulen/10-features-from-various-modern-languages-that-i-would-like-to-see-in-any-programming-language-f2a4a8ee6727
Nov 13
next sibling parent reply Jonathan M Davis <newsgroup.d jmdavisprog.com> writes:
On Monday, November 13, 2017 16:12:42 Joakim via Digitalmars-d wrote:
 Probably a good sign that they mention D with C++ and Rust and
 have looked at D features:

 https://github.com/zig-lang/zig/wiki/Why-Zig-When-There-is-Already-CPP%2C->
D%2C-and-Rust%3F
Glancing over what they say there, it sounds like they're trying to write a better version of C. - Jonathan M Davis
Nov 13
next sibling parent reply Ola Fosheim =?UTF-8?B?R3LDuHN0YWQ=?= writes:
On Monday, 13 November 2017 at 16:30:23 UTC, Jonathan M Davis 
wrote:
 Glancing over what they say there, it sounds like they're 
 trying to write a better version of C.
Yes http://ziglang.org/: «Zig competes with C instead of depending on it. The Zig Standard Library does not depend on libc.» The syntax seems to be mixing C with a little bit of Rust. But no plans to add meta-programming or type system support for memory? Ugh. Ola.
Nov 13
parent Ola Fosheim =?UTF-8?B?R3LDuHN0YWQ=?= writes:
On Monday, 13 November 2017 at 17:00:56 UTC, Ola Fosheim Grøstad 
wrote:
 But no plans to add meta-programming or type system support for 
 memory?
Hm, the github page says «Zig has no macros and no metaprogramming», but their homepage says «Generic data structures and functions» and «Compile-time reflection and compile-time code execution.» So… Not sure what they mean. Maybe they mean no AST-macros? *shrug*
Nov 13
prev sibling next sibling parent Kagamin <spam here.lot> writes:
On Monday, 13 November 2017 at 16:30:23 UTC, Jonathan M Davis 
wrote:
 Glancing over what they say there, it sounds like they're 
 trying to write a better version of C.
More like go with generics.
Nov 14
prev sibling parent reply Tony <tonytdominguez aol.com> writes:
I am surprised C hasn't tried to become a "better C". Add a 
string datatype (and maybe other datatypes like datetime). Add an 
array type (static and/or dynamic) that doesn't suffer from 
"array decay" when passed to a function or returned from a 
function. Provide an alternative to the ridiculous syntax for 
declaring a function pointer. And copy the scope() guard from D. 
They could also add some data structure code to the standard 
library. Not a lot of changes and suddenly the language is a lot 
more usable for all those GNU programs (and any like them) that 
are written in C.
Nov 15
next sibling parent codephantom <me noyb.com> writes:
On Thursday, 16 November 2017 at 02:48:27 UTC, Tony wrote:
 I am surprised C hasn't tried to become a "better C". Add a 
 string datatype (and maybe other datatypes like datetime). Add 
 an array type (static and/or dynamic) that doesn't suffer from 
 "array decay" when passed to a function or returned from a 
 function. Provide an alternative to the ridiculous syntax for 
 declaring a function pointer. And copy the scope() guard from 
 D. They could also add some data structure code to the standard 
 library. Not a lot of changes and suddenly the language is a 
 lot more usable for all those GNU programs (and any like them) 
 that are written in C.
What I really love about the evolution of C, is that 'it can' resist giving in to those temptations ;-) I still have 'The C Programming Language' (1988) next to my pc, and I enjoy glancing over it now and then, knowing that everything in it is still valid. ;-) And anyway, one change..always leads to another..and then another..and then another...... resist! resist! A better C belongs in a new language.
Nov 15
prev sibling parent Ola Fosheim =?UTF-8?B?R3LDuHN0YWQ=?= writes:
On Thursday, 16 November 2017 at 02:48:27 UTC, Tony wrote:
 I am surprised C hasn't tried to become a "better C".
Most of the people that wanted to work on a spec for a better C has already moved to C++ or other languages. The ones that remain want C to stay simple, but they have added new stuff, even generics: https://en.wikipedia.org/wiki/C11_(C_standard_revision) Ola
Nov 16
prev sibling next sibling parent reply Ali <fakeemailadress example.com> writes:
On Monday, 13 November 2017 at 16:12:42 UTC, Joakim wrote:
 Probably a good sign that they mention D with C++ and Rust and 
 have looked at D features:

 https://github.com/zig-lang/zig/wiki/Why-Zig-When-There-is-Already-CPP%2C-D%2C-and-Rust%3F
https://sympa.inria.fr/sympa/arc/caml-list/2017-11/msg00031.html From the link: "The position is part of the SecurOCaml project (http://ocamlpro.github.io/SecurOCaml/) and aims at improving the usability and reliability of OCaml for the development of high-assurance applications." I think HAA seems like where many people are looking at the moment I am not convinced that this will make a dent in C or C++ popularity or usage but, yet, it will be a sizable niche that C or C++ will not dominate
Nov 13
parent Ola Fosheim =?UTF-8?B?R3LDuHN0YWQ=?= writes:
On Monday, 13 November 2017 at 18:11:45 UTC, Ali wrote:
 I think HAA seems like where many people are looking at the 
 moment
 I am not convinced that this will make a dent in C or C++ 
 popularity or usage
 but, yet, it will be a sizable niche that C or C++ will not 
 dominate
But how is that relevant for Zig? It doesn't appear to use formal methods.
Nov 13
prev sibling next sibling parent reply codephantom <me noyb.com> writes:
On Monday, 13 November 2017 at 16:12:42 UTC, Joakim wrote:
 Probably a good sign that they mention D with C++ and Rust and 
 have looked at D features:
An interesting project. Some good points made too. As someone new to D, I think this point stood out the most(for me): "C++, Rust, and D have a large number of features and it can be distracting from the actual meaning of the application you are working on. One finds themselves debugging their knowledge of the programming language instead of debugging the application itself."
Nov 13
next sibling parent reply Fra Mecca <me francescomecca.eu> writes:
On Tuesday, 14 November 2017 at 01:01:16 UTC, codephantom wrote:
 On Monday, 13 November 2017 at 16:12:42 UTC, Joakim wrote:
 Probably a good sign that they mention D with C++ and Rust and 
 have looked at D features:
An interesting project. Some good points made too. As someone new to D, I think this point stood out the most(for me): "C++, Rust, and D have a large number of features and it can be distracting from the actual meaning of the application you are working on. One finds themselves debugging their knowledge of the programming language instead of debugging the application itself."
That is c++. I don't have this problem with D, but Go for sure represent that feeling taken to the extreme
Nov 13
next sibling parent Ola Fosheim =?UTF-8?B?R3LDuHN0YWQ=?= writes:
On Tuesday, 14 November 2017 at 06:11:34 UTC, Fra Mecca wrote:
 On Tuesday, 14 November 2017 at 01:01:16 UTC, codephantom wrote:
 "C++, Rust, and D have a large number of features and it can 
 be distracting from the actual meaning of the application you 
 are working on. One finds themselves debugging their knowledge 
 of the programming language instead of debugging the 
 application itself."
That is c++. I don't have this problem with D, but Go for sure represent that feeling taken to the extreme
Why Go? The Go semantics are fairly straight forward except their take on "exception handling".
Nov 14
prev sibling parent codephantom <me noyb.com> writes:
On Tuesday, 14 November 2017 at 06:11:34 UTC, Fra Mecca wrote:
 That is c++. I don't have this problem with D, but Go for sure 
 represent that feeling taken to the extreme
I'm not sure i can agree with the comment about go. if wanted a language I could get my head around, and my only choice was go or d, then I'd go go...without doubt. don't get me wrong. i love d. it's a refreshing language full off new possibilites. but at the moment, is seems less like the planet mars, and more like a few galaxies crashing into each other....with the newly formed galaxy still being under construction. of course, that too would be an exciting thing to observe. I would expect that the future of D (or future users of D), will need to distill this chaos into something that's a little more managable. In the mean time, I'll enjoy the chaos...while it lasts :D c++ however, is like a gigantic black hole...which D too will become, I guess, at some point.
Nov 14
prev sibling next sibling parent Mark <smarksc gmail.com> writes:
On Tuesday, 14 November 2017 at 01:01:16 UTC, codephantom wrote:
 On Monday, 13 November 2017 at 16:12:42 UTC, Joakim wrote:
 Probably a good sign that they mention D with C++ and Rust and 
 have looked at D features:
An interesting project. Some good points made too. As someone new to D, I think this point stood out the most(for me): "C++, Rust, and D have a large number of features and it can be distracting from the actual meaning of the application you are working on. One finds themselves debugging their knowledge of the programming language instead of debugging the application itself."
This is pretty much inevitable, since C++, Rust and D all aim at being a general-purpose language. Therefore they must provide solid support for multiple programming paradigms. So there is nothing to prevent a user of any of these languages to use all the features of the language in an incoherent or obfuscated manner.
Nov 14
prev sibling parent reply solidstate1991 <laszloszeremi outlook.com> writes:
On Tuesday, 14 November 2017 at 01:01:16 UTC, codephantom wrote:
 As someone new to D, I think this point stood out the most(for 
 me):

 "C++, Rust, and D have a large number of features and it can be 
 distracting from the actual meaning of the application you are 
 working on. One finds themselves debugging their knowledge of 
 the programming language instead of debugging the application 
 itself."
The best thing about language features, that you don't have to use them. I just very recently started using certain language features (eg. templates, conditional compilation), and for a long time I used it like Java without forcing classes into everything. Often I just don't find a use for them, so I won't make the compiler to do CTFE if it's not needed.
Nov 16
parent bauss <jj_1337 live.dk> writes:
On Thursday, 16 November 2017 at 22:58:32 UTC, solidstate1991 
wrote:
 Often I just don't find a use for them, so I won't make the 
 compiler to do CTFE if it's not needed.
Why wouldn't you? It gives less overhead at run-time, giving your application better performance.
Nov 16
prev sibling next sibling parent reply Michael V. Franklin <slavo5150 yahoo.com> writes:
On Monday, 13 November 2017 at 16:12:42 UTC, Joakim wrote:
 Probably a good sign that they mention D with C++ and Rust and 
 have looked at D features:

 https://github.com/zig-lang/zig/wiki/Why-Zig-When-There-is-Already-CPP%2C-D%2C-and-Rust%3F
"D has property functions, which are methods that you call with what looks like field access, so in the above example, c.d might call a function." That turned me off. Despite everything I hate about D, I keep coming back to it for the "Modeling Power" and "Modern Convenience". No other language that I'm aware of can complete with D on those two merits. Also, everything ends up calling a subprocedure of some or another when all is said and done, so embrace it and leverage it, I say. Mike
Nov 13
parent codephantom <me noyb.com> writes:
On Tuesday, 14 November 2017 at 01:25:32 UTC, Michael V. Franklin 
wrote:
 That turned me off.  Despite everything I hate about D, I keep 
 coming back to it for the "Modeling Power" and "Modern 
 Convenience".  No other language that I'm aware of can complete 
 with D on those two merits.
 ...

 Mike
Yes. That's why I like D too. My concern (which doesn't really affect me these days), is the potential for loss of productivity, from having to maintain someone else's D code - given the many different paradigms and features the D lang supports. Finding developers that can be productive under those circumstances, may be challenging. I think this would be a primary concern for anyone considering whether to adopt D into their codebase. I go through a lot D code on github, to learn about how to use D...I still don't see the light at the end of the tunnel.. everyone uses it differently. I don't think that metaphor can even be used when it comes to D ;-)
Nov 13
prev sibling parent Walter Bright <newshound2 digitalmars.com> writes:
On 11/13/2017 8:12 AM, Joakim wrote:
 Probably a good sign that they mention D with C++ and Rust and have looked at
D 
 features:
 
 https://github.com/zig-lang/zig/wiki/Why-Zig-When-There-is-Already-CPP
2C-D%2C-and-Rust%3F 
Aaannnddd, it's now on reddit: https://www.reddit.com/r/programming/comments/7cumiy/why_use_zig_when_c_d_and_rust_exist
Nov 14