March 23, 2014 Re: Improve D's syntax to make it more python like | ||||
---|---|---|---|---|
| ||||
Posted in reply to Russel Winder | On 3/22/14, 12:43, Russel Winder wrote:
> On Sat, 2014-03-22 at 16:14 +0000, Brian Rogoff wrote:
>> On Saturday, 22 March 2014 at 13:03:06 UTC, Russel Winder wrote:
>>> ALGOL60 did not have significant whitespace and an offside
>>> rule, just
>>> like C, C++ and D don't, whereas Python, OCaml, etc. do.
>>
>> I've programmed in OCaml for many years and I somehow missed the
>> significant whitespace. Even the Revised syntax for OCaml (the
>> improved and unused one) did not use significant whitespace,
>> though I recall that there were unloved projects to provide such
>> a syntax.
>
> I appear to have typed OCaml when I meant Haskell, possibly because I am
> trying to build Unison. You are correct (obviously :-) OCaml does not
> use an offside rule approach. In his response, Paulo points out that F#
> does, I did not appreciate this, so that is definitely a WILT.
>
>> C++ has a much nastier syntax than D (IMO of course :-) but the
>> SPECS proposal for a resyntaxed C++ never caught on. I liked some
>> of the improvements suggested there, in particular the more
>> Pascal-ish or Scala-ish declaration syntax, and would have liked
>> something like that in D, but there are so many more issues to be
>> fixed that daydreams of improved syntax seem frivolous to me.
>
> The Scala, Go, Rust, etc. use of "type after variable name" reads better
> for me, but C, C++, D, Java, Groovy, Ceylon are all "type before
> variable" (well the C++ rule is spiral out, but…), so I just get used to
> switching.
>
I find I think of the type as an adjective, and since I'm only fluent in english it makes perfect sense that the "adjective" would come before the "noun".
What is X? X is an integer. Integer describes what X is.
"type after variable name" just doesn't have that mental model to it, hence I like it less.
|
March 23, 2014 Re: Improve D's syntax to make it more python like | ||||
---|---|---|---|---|
| ||||
Posted in reply to Andrei Alexandrescu | On 3/21/14, 20:47, Andrei Alexandrescu wrote:
> On 3/21/14, 5:18 PM, w0rp wrote:
>> On Friday, 21 March 2014 at 21:52:47 UTC, H. S. Teoh wrote:
>>> I'm disappointed about how many discussions revolve around superficial
>>> things such as syntax, while neglecting weightier matters such as
>>> semantics and expressiveness.
>>>
>>>
>>> T
>>
>> http://www.haskell.org/haskellwiki/Wadler%27s_Law
>>
>> People love to debate syntax. Semantics are much more interesting and
>> worth talking about.
>
> Well, one issue that's happening is that every so often github pull
> requests that are simple but important (such as documentation) sit there
> without getting due review. The regular contributors are spending time
> looking into them, with takes away time from more important issues they
> could work on.
>
> A dozen people are doing the simple work and the complicated work, while
> the rest of the forum sits on the sidelines wringing hands about what to
> do about the future of D.
>
>
> Andrei
>
You really want me to contribute? Cause I will.
And due to my lack of education on the matter I will get all up in your way. You want the community to help participate? Get a list of simple moderate and hard jobs that are relatively high priority, and update the list weekly. A "stickied" post on the announce forum would work.
Cause if there's something simple I can do, I'll do it. I just don't know what I can do.
|
March 23, 2014 Re: Improve D's syntax to make it more python like | ||||
---|---|---|---|---|
| ||||
Posted in reply to 1100110 | On 03/23/2014 02:01 PM, 1100110 wrote: > ... > > I find I think of the type as an adjective, It's a noun. > and since I'm only fluent in > english it makes perfect sense that the "adjective" would come before > the "noun". > > What is X? X is an integer. ... Exactly. |
March 23, 2014 Re: Improve D's syntax to make it more python like | ||||
---|---|---|---|---|
| ||||
Posted in reply to logicchains | On 3/22/14, 23:33, logicchains wrote:
> On Friday, 21 March 2014 at 18:47:49 UTC, Pedro Larroy wrote:
>> Hi
>>
>> As a newcomer to D, I wonder, how difficult would be and would it be
>> welcome by the D community to have D's syntax with significant
>> whitespace and without brackets more like python?
>>
>>
>> Thanks.
>
> It's interesting to see this being discussed, as somebody recently
> created a Go-like language with Pythonic syntax that compiles to Go. The
> Go community however didn't appear to be particularly interested in it:
> https://groups.google.com/forum/#!topic/golang-nuts/-STRYo2Cc0g
...And that is a perfect example of why I don't like Go. The Community seems overly hostile.
|
March 23, 2014 Re: Improve D's syntax to make it more python like | ||||
---|---|---|---|---|
| ||||
Posted in reply to 1100110 | Am Sun, 23 Mar 2014 08:09:03 -0500 schrieb 1100110 <0b1100110@gmail.com>: > A "stickied" post on the announce forum would work. ... stickied ... in a NNTP news group ... :) -- Marco |
March 23, 2014 Re: Improve D's syntax to make it more python like | ||||
---|---|---|---|---|
| ||||
Posted in reply to Timon Gehr | On 3/23/14, 8:23, Timon Gehr wrote: > On 03/23/2014 02:01 PM, 1100110 wrote: >> ... >> >> I find I think of the type as an adjective, > > It's a noun. It's technically a metaphor =) > >> and since I'm only fluent in >> english it makes perfect sense that the "adjective" would come before >> the "noun". >> >> What is X? X is an integer. ... > > Exactly. > |
March 23, 2014 Re: Improve D's syntax to make it more python like | ||||
---|---|---|---|---|
| ||||
Posted in reply to 1100110 | On 3/23/2014 9:01 AM, 1100110 wrote:
>
> I find I think of the type as an adjective, and since I'm only fluent in
> english it makes perfect sense that the "adjective" would come before
> the "noun".
>
> What is X? X is an integer. Integer describes what X is.
>
> "type after variable name" just doesn't have that mental model to it,
> hence I like it less.
I like "type name;" order because I usually know the type I want (even if it's just "auto") before I know what I want to name the variable. So it's more natural for me to write.
I've done plenty of "name : type;" code before, and I'm fine with it, but I usually end up either writing the type first and then moving back to write the name, or come up with a name first while making sure not to forget what type I'd already had in mind. So a little bit more awkward for me.
|
March 24, 2014 Re: Improve D's syntax to make it more python like | ||||
---|---|---|---|---|
| ||||
Posted in reply to Marco Leise | On 3/23/14, 9:36, Marco Leise wrote:
> Am Sun, 23 Mar 2014 08:09:03 -0500
> schrieb 1100110 <0b1100110@gmail.com>:
>
>> A "stickied" post on the announce forum would work.
>
> .... stickied ... in a NNTP news group ... :)
>
Haha, I just meant bump it so that it stays active.
There's a reason I used quotes! =P
|
March 24, 2014 Re: Improve D's syntax to make it more python like | ||||
---|---|---|---|---|
| ||||
Posted in reply to Pedro Larroy | I would appreciate being allowed to omit the trailing semicolon as in Scala, Go, Kotlin and some other newer languages. Not terribly important, but in most cases the end-of-line character is simply redundant. |
March 24, 2014 Re: Improve D's syntax to make it more python like | ||||
---|---|---|---|---|
| ||||
Posted in reply to Ola Fosheim Grøstad | On 3/22/2014 2:38 PM, "Ola Fosheim Grøstad" <ola.fosheim.grostad+dlang@gmail.com>" wrote: > On Saturday, 22 March 2014 at 17:54:16 UTC, Russel Winder wrote: >> like "end to end" the same language. Many are asking about server-side >> Dart as well as client-side Dart in the browser. > > Yes, a CLI/server Dart VM exists that is suitable for a http server. The > advantage of client/server code sharing is obvious when you write > web-apps, but I am a bit weary of using dynamic languages on web servers > since runtime errors can be nasty. I personally would like to see a Dart > version with a much stricter type system, but I think the Dart library > is just about right for web development and the language itself is > pretty well rounded and pragmatic (but nothing spectacular). > Using the same language on client/server is indeed quite nice, partly because of less mental context-switching, and also because of increased code sharing (which also makes it easier to move things between client vs server if you need to). Because of that, and an irritating need to support cheapo shared/PHP-hosting servers (which are NEVER run by companies who have the slightest comprehension of security), I'd been using Haxe pretty heavily for a good while. Haxe is a rather "ok" language, which is practically high praise coming from me - I'm typically very critical of languages. FWIW though, lately I've been swinging back over to the side of "I'd rather use the best language I can whenever possible, code duplication and other concerns over multiple languages be damnned." Life's too short to tolerate subpar tools. |
Copyright © 1999-2021 by the D Language Foundation