News for hackers. Stuff that matters.
Re:The reference D compiler is now open source by iamNumber4 on Friday April 07, 2017 @03:15PM (#14062688)
Good news indeed.

Switched to D 4 years ago, and have never looked back. I wager that you can sit down a C++/Java/C# veteran, and say write some D code. Here's the manual, have fun. They will with in a few hours be comfortable with the language, and be fairly competent D programmer. Very little FUD surrounding the switching to yet another language with D.

D's only issue is that it does not have general adoption, which I'm willing to assert is only because it's not on the forefront of the cool kids language of the week. Which is a good thing. New does not always Mean, improved. D has a historical nod to languages of the past, and is trying to improve the on strengths of C/C++ and smooth out the rough edges, and adopt more modern programming concepts. Especially with trying to be ABI compatible, it's a passing of the torch from the old guard to the new.

Regardless of your thoughts on D; My opinion is I'm sold on D, It's here to stay. In 10 years D will still be in use, where as the fad languages will just be foot notes in Computer Science history as nice experiments that brought in new idea's but were just too out there in the fringes limiting themselves to the "thing/fad" of that language.

Re:The reference D compiler is now open source by coding123 on Friday April 07, 2017 @06:04PM (#14063840)
I think a lot of languages that get popular have to have a thing. Like a thing they do well, and hopefully change the world a little...

Python had math and has lots more maths now. R also has math and started to kill Python, but now Python has Tensorflow and PyTorch. Scala has Spark. Java has Tomcat, and everything that followed, which is probably 20% of the world's mass by volume. Go has Docker Ruby has/had a railroad or something? JS has well, f... I don't know where to start here.

Does D have a thing?

Re:The reference D compiler is now open source by WalterBright on Friday April 07, 2017 @06:34PM (#14064003)
> Does D have a thing?

Probably its most useful feature is rather subtle. It's very easy to express diverse ideas in code in D without having to resort to contortions. It's something people realize after having worked with D for a while.

It is not the result of having feature X (you can always find feature X in other languages or a way to make X work), it's the combination of various X's.

For example, some algorithms express naturally in a functional manner, some imperative, some OOP, etc. It isn't necessary to buy into a manner for the whole program, just use the manner that fits the particular part of the program.

You might like to use FP here and there, but don't want to deal with monads. You can use OOP for the AST, but don't want to box integers into an OOP class. You like dynamic typing for one type, but it's a bad fit for another. You can garbage collect for a quick prototype or a seldom used part of the code, and carefully manage memory for the release or the hot spots. (The Warp preprocessor I wrote did that. https://github.com/facebookarchive/warp)

There's a lot less time hammering square pegs into round holes.

I've seen more than enough presentations on "How To Do Technique X In Language Y" and everyone says how clever that is but the contortions are just too awful to contemplate.

The flip side is that D won't be satisfying to a purist adherent of any of those paradigms.

Re:The reference D compiler is now open source by jordigh on Friday April 07, 2017 @07:10PM (#14064152)
I really like how purity in D is so... practical. I like that a for loop is totally allowed in pure code as long as it modifies no data outside the pure block. One of the most annoying things in Haskell was to translate some algorithm that looks very natural in a for loop into some other sort of combination of map or reduce or something even more complicated.

(Yes, I know Haskell can also fake for loops more cleanly with monads, but they still feel awkward and unnatural.)

Re:The reference D compiler is now open source by buzzybee on Saturday April 08, 2017 @12:47AM (#14065359)
My recollection from the last time I worked with D was that pure could be more complicated and strict than expected when using standard libraries functions, e.g. using trigonometry sets hardware global state, thus impure. I don't remember if there was a good workaround to convey intent of purity despite that.
Re:The reference D compiler is now open source by p0nce on Saturday April 08, 2017 @06:22PM (#14069393)
In D "pure" means "referentially transparent".
Re:The reference D compiler is now open source by pekk on Saturday April 08, 2017 @03:09AM (#14065747)
R is old. R always had math. That's not new. Python always had a lot of other things. Strange depiction.
Re:The reference D compiler is now open source by lazzlazzlazz on Sunday April 09, 2017 @04:02PM (#14074079)
I think you're a new engineer - R has always been math, from the bottom up. Python is the relative newcomer to math.

Go was exciting before Docker existed.

JS has the browser, and then had Node.

Scala has functional programming and the JVM. Spark is not really a "Scala thing" (although it is written in Scala). You can use other languages with Spark.

Tomcat is hardly the first thing that comes to mind with Java.

What a bizarre perspective you have!

Re:The reference D compiler is now open source by tracker1 on Monday April 10, 2017 @09:11PM (#14084067)
JS has an actual write once run anywhere with an above-average async story.
Re:The reference D compiler is now open source by milesrout on Friday April 07, 2017 @07:48PM (#14064341)
Python was not popular because of maths. Python was very popular long before the scientific computing stuff. Python was chosen for that for two reasons: ease of extension using C, and being extremely easy to read and write.

There's a reason that Python is commonly referred to as 'executable pseudocode'.

But yes, Ruby had Rails, JS had web browsers, Perl made string handling easy, Java was appealing to managers (don't let your moron employees write undefined behaviour: CHOOSE JAVA!), etc.

Re:The reference D compiler is now open source by kahnpro on Sunday April 09, 2017 @09:47PM (#14075435)
I'm pretty sure Java's feature is that it has java.lang.NullPointerException
Re:The reference D compiler is now open source by adamnemecek on Friday April 07, 2017 @07:28PM (#14064251)
> D's only issue is that it does not have general adoption, which I'm willing to assert is only because it's not on the forefront of the cool kids language of the week. Which is a good thing.

The reference compiler not being open source makes a language not cool with the cool kids. (Not that I'm blaming anyone).

Re:The reference D compiler is now open source by lomnakkus on Friday April 07, 2017 @03:35PM (#14062874)
I'm not sure that "it's going to stay", as you say, but at the very least it's been hugely influential on C++ (if constexpr, anyone?) and even for just that it is and has been valuable for everyone working in C++ land.
Re:The reference D compiler is now open source by mhh__ on Friday April 07, 2017 @05:12PM (#14063536)
I think D will hit some sort of critical mass soon, probably through the form of a corporate sponsor ( a la google and Go).

Obviously, it's entirely possible that D will indeed fade away, but that would be a real shame.

The way D is designed is very holistic: the combination of ranges, UFCS and CTFE (and modules) all made me really hate using C++. I've ended up being more productive (even with toys that I never touch again) in D than with that dynamically typed languages like python and js.

Re:The reference D compiler is now open source by milesrout on Friday April 07, 2017 @07:50PM (#14064357)
If constexpr is not inspired by static if. In fact, proposals of static if and things like it were explicitly rejected by the committee.
Re:The reference D compiler is now open source by eco on Friday April 07, 2017 @08:52PM (#14064609)
Walter, Andrei, and Herb proposed "static if" in N3329 (after it's big success in D) which was ultimately rejected. Ville Voutilainen explicitly revived it in N4461 with changes. Ville then iterated on that proposal a few times (P0128R0 and P0128R1). Finally, Jens Maurer took that and made some syntax changes with commitee input resulting in P0292R1 which was the accepted proposal. "static if" from D absolutely was the inspiration for "constexpr if". Each proposal references the last in a chain going back to Walter, Andrei, and Herb's proposal.
Re:The reference D compiler is now open source by lomnakkus on Saturday April 08, 2017 @03:27AM (#14065791)
AFAICT, yes it was. Obviously, it wasn't accepted as-is, but it was certainly motivated (i.e. "inspired") by the success of "static if" in D.
Re:The reference D compiler is now open source by milesrout on Saturday April 08, 2017 @08:32AM (#14066601)
I do not agree at all. It's very obvious functionality, and would be in D either way.
Re:The reference D compiler is now open source by lomnakkus on Saturday April 08, 2017 @04:20PM (#14068794)
I'm not sure I understand what you're trying to say. IIUC the causality in your last sentence is opposite to what've you been arguing? Maybe it's just a typo, but either way you're going to have to provide evidence.
Re:The reference D compiler is now open source by milesrout on Saturday April 08, 2017 @07:36PM (#14069667)
I meant 'would be in C++ either way', typo.

C++ has been gaining constexpr features for years. These have nothing to do with D at all, except in the sense that all languages everywhere influence each other slightly. Certainly constexpr wasn't drawn directly from D.

if constexpr was the obvious logical next step. It has been suggested and proposed for years. Yes people formally proposed static if, which was heavily inspired by D's static if, but that proposal was rejected because it was poorly designed, and C++'s new if constexpr is about as different as it's possible for two compile-time conditional compilation constructs to be.

Re:The reference D compiler is now open source by TTPrograms on Friday April 07, 2017 @06:10PM (#14063874)
How well does Dub work? That could be another issue preventing widespread adoption.
Re:The reference D compiler is now open source by giancarlostoro on Saturday April 08, 2017 @09:10AM (#14066724)
I want to say it's somewhat good, but sometimes it just doesn't work out too well, and experience may vary between developers. But I totally agree, if some of it's quirks were sorted out... Sidenote: I'm really sorry I can't mention any off the top of my head, it's been a year or more since I last touched it. I did enjoy using dub, but ran into some odd issues from time to time. If it breaks, you can't use it properly basically.
Re:The reference D compiler is now open source by qznc on Saturday April 08, 2017 @01:41AM (#14065511)
I use it for various smaller protects and have no issues with it. Looks good to me.
Re:The reference D compiler is now open source by p0nce on Saturday April 08, 2017 @06:24PM (#14069401)
Works well for me, I use a subset though. I like dub.
Re:The reference D compiler is now open source by Tagore on Saturday April 08, 2017 @02:15AM (#14065590)
Interesting. I prefer to write in high-level strongly dynamically typed garbage-collected languages when I can.

But of course I can't always do so and get the performance I want. My approach is generally to prototype in languages like Python, but implement in C89. See: https://www.youtube.com/watch?v=WNTOpl30MIQ . That's 10s of thousands of times faster than our initial prototype and...

We profiled all sorts of things in order to make it that fast. Right down to cache misses, branch mis-prediction, etc, how concurrency on the CPU interacts with I/O.

Re:The reference D compiler is now open source by oblio on Friday April 07, 2017 @03:17PM (#14062710)
What do you consider as "fad languages"?
Re:The reference D compiler is now open source by iamNumber4 on Friday April 07, 2017 @03:20PM (#14062739)
Not going to start a flame war. Everyone has their opinions, However there are languages that come and go, and then are swift to become popular, but then are left to rust, because people stopped having smalltalk about them.
Re:The reference D compiler is now open source by oblio on Friday April 07, 2017 @04:12PM (#14063132)
Despite the puns, as long as people start building production systems with those languages, they're going to stick around.

And several of those languages are probably used by 10x or more people than D is.

Luckily, there are so many things to build and so many programmers out there that almost any languages gets a spot under the sun these days.

When was the last time a programming language died out? My guess the last one was a language tied to its hardware...

Re:The reference D compiler is now open source by milesrout on Friday April 07, 2017 @07:51PM (#14064364)
Coffeescript is essentially dead, many production web sites were written in it.
Re:The reference D compiler is now open source by jononor on Friday April 07, 2017 @08:34PM (#14064531)
For what definition of dead? Sure, not so many use it for new projects, but it is still being maintained. There is an upcoming major release which will output ES2015.

I've got some tens of libraries/apps written in CS, no plans to migrate them. Works as well today as it did 3 years ago.

Re:The reference D compiler is now open source by i336_ on Sunday April 09, 2017 @06:48AM (#14071603)
> For what definition of dead?

It's at 71.0% (5th from top) on the Dreaded tab here:

http://stackoverflow.com/insights/survey/2016#technology-mos...

> I've got some tens of libraries/apps written in CS, no plans to migrate them. Works as well today as it did 3 years ago.

You might have a different view to the above then. Sounds like you're using it for the kinds of things it's good for, perhaps. (Languages can fall into vogue and (infuriatingly) go viral for all the wrong reasons... with everyone fighting it and not understanding why)

Re:The reference D compiler is now open source by jononor on Monday April 10, 2017 @06:55AM (#14077400)
Not sure I'm using it for anything special... But one reason I chose it is my preference for minimal syntax, which is not a fashion thing and has not changed since I did Python 8 years ago. It also fixes some bugs in JS, like defaulting to globals on omitted `var` or implicit conversions on `!=`.

I do wish to have gradual static typechecking available though. This may unfortunately force me over to TypeScript or ES2015+Flow.

Re:The reference D compiler is now open source by oblio on Monday April 10, 2017 @04:27AM (#14076872)
Heh, that's kind of funny. If that's the main criteria for "death", then Coffeescript is in good company. Except for Visual Basic, which is basically a cockroach refusing to be killed by Microsoft, everything else is alive and vibrant.

Possibly horrible by geek purity standards, but waaaaaay more used than D :)

Re:The reference D compiler is now open source by netzone on Monday April 10, 2017 @07:03AM (#14077424)
I think it says a lot that the only top 5 in the "Loved" tab that's also present on the whole "Wanted" tab is Swift. Not that I use Swift, but it's the one with a mainstream use case today pretty much. It will be interesting to see how it looks in 5 years.
Re:The reference D compiler is now open source by oconnor663 on Friday April 07, 2017 @03:35PM (#14062867)
> languageS that Come and go, And then are swift to become popuLar, but then Are

> languageS Come And popuLar Are

> S C A L A

Did I do that right?

Re:The reference D compiler is now open source by iamNumber4 on Friday April 07, 2017 @03:54PM (#14063021)
I think you hit that Node, with a ruby of a pun, and are on the right railroad tracks my friend.
Re:The reference D compiler is now open source by hackbinary on Friday April 07, 2017 @05:16PM (#14063562)
Re:The reference D compiler is now open source by vram22 on Friday April 07, 2017 @05:45PM (#14063743)
Yes, he's certainly Going Forth.
Re:The reference D compiler is now open source by human_error on Saturday April 08, 2017 @12:15AM (#14065276)
I agree except the swift part (I don't even code in Swift). It's impossible for it to die because of iOS unless Apple kills it for something else.
Re:The reference D compiler is now open source by RantyDave on Friday April 07, 2017 @06:43PM (#14064036)
Go is not going anywhere.
Re:The reference D compiler is now open source by human_error on Saturday April 08, 2017 @12:18AM (#14065287)
Unfortune, isn't it? We have D, Swift, Rust, Kotlin. Go looks very sad (and borderline ridiculous) compared to these.
Re:The reference D compiler is now open source by i336_ on Sunday April 09, 2017 @06:51AM (#14071614)
In trying to group those together, the best my brain has been able to come up with is a raspberry-flavored pretzel.

I'm... slightly confused. :/

Re:The reference D compiler is now open source by rufugee on Saturday April 08, 2017 @12:37PM (#14067741)
Practically? How so?
Re:The reference D compiler is now open source by turbohedgehog on Friday April 07, 2017 @03:45PM (#14062956)
That's a brainfuck
Re:The reference D compiler is now open source by senorjazz on Friday April 07, 2017 @03:37PM (#14062885)
;)
Re:The reference D compiler is now open source by lomnakkus on Friday April 07, 2017 @03:41PM (#14062920)
To paraphrase: On a long-enough timescale all languages are fads.

The ultimate power that can actually be manifested in physical reality (as far as we know) is still Turing Machines[1]... the rest is mostly ergonomics.

[1] Well, QM may add a "little bit" of efficiency, but it doesn't add any oracular power, per se. AFAIUI, at least.

Re:The reference D compiler is now open source by jacquesm on Friday April 07, 2017 @06:23PM (#14063953)
FORTRAN users beg to differ. The horse they backed will be here until the lights go out because it probably is used to power the lights at some level.
Re:The reference D compiler is now open source by throwaway7645 on Friday April 07, 2017 @08:55PM (#14064612)
Yes it most certainly is. All the power system applications written in the 60's and 70's were done so in Fortran as they had to be fast and run numerical analysis on massive matrices. However, a lot of it is being rewritten in more modern languages like C++ or C depending on the application.
Re:The reference D compiler is now open source by shakna on Friday April 07, 2017 @10:50PM (#14065007)
> However, a lot of it is being rewritten in more modern languages like C++ or C depending on the application.

And a lot of it is embedding FORTRAN or COBOL in the new pretty C/++.

New skin, same system.

Re:The reference D compiler is now open source by FabHK on Saturday April 08, 2017 @06:49AM (#14066327)
> numerical analysis on massive matrices. However, a lot of it is being rewritten

In Julia, too.

Re:The reference D compiler is now open source by throwaway7645 on Saturday April 08, 2017 @07:24AM (#14066422)
Probably some, but in the industry I'm referring to, nobody is going to let you write a critical system in some new relatively unknown language. Options are Fortran, C, C++, or Java. Julia is cool, but still really new in the cosmic scale.
Re:The reference D compiler is now open source by hydromet on Saturday April 08, 2017 @07:48AM (#14066492)
> nobody is going to let you write a critical system in some new relatively unknown language.

Whose permission do you seek who will "let you" or not "let you" write a critical system in some new relatively unknown language? What if you work for yourself or are creating a startup?

Re:The reference D compiler is now open source by i336_ on Sunday April 09, 2017 @06:54AM (#14071626)
Obviously a startup with no history is a totally different context. The parent commentator did mention "industries". Power in particular (think nuclear power especially!) are... necessarily conservative.
Re:The reference D compiler is now open source by FabHK on Saturday April 08, 2017 @08:13AM (#14066550)
I was surprised to learn that Blackrock uses Julia.

https://juliacomputing.com/case-studies/blackrock.html

Re:The reference D compiler is now open source by lomnakkus on Sunday April 09, 2017 @12:31PM (#14073041)
Ha! I can't say I've ever programmed in Fortran[1], but surely it too will perish... eventually. Idle meta-thought: It's actually kind of interesting how hard it is to replace "legacy" in programming... I wonder if there's something we could/should be doing to make it easier to do on a large scale?

[1] I think it's spelled that way these days, but of course given the context of the thread, maybe you're talking about old-school FORTRAN.

Re:The reference D compiler is now open source by ASalazarMX on Friday April 07, 2017 @08:09PM (#14064438)
I think you answered yourself why D is not more popular with the "cool kids". C++/Java/C# are overengineered, verbose, horrible languages to use. Java is a bastard of C++, and C# is the better looking bastard.

Yes we use them, and even like them in a weird Stockholm Syndrome way, but they're not fun to work with. We use them because we need them, not because we enjoy them.

Disclaimer: the personal pronoun "we" as used here means the author plus zero or more people.

Re:The reference D compiler is now open source by jnordwick on Friday April 07, 2017 @08:20PM (#14064482)
Java is very simple and has, hands down, the best tooling of any major language out today. That is why it is the most popular.

Java isn't my favorite language, but even I can remove my blinders enough to see its strengths.

Re:The reference D compiler is now open source by TylerE on Friday April 07, 2017 @09:49PM (#14064805)
Say what?

The words that come to mind when I think of Java tooling is certainly not "best". More like "Bloated, slow, too-fscking-much-XML"

Re:The reference D compiler is now open source by Too on Saturday April 08, 2017 @02:19AM (#14065607)
Name another language + tooling ecosystem where you can do ALL of: * Perform automatic refactoring of a 100k+ LOC project and be confident that absolutely nothing breaks. * Reliable edit and continue in the debugger. * Fast incremental compile times. * Easily pull in third party libraries without messing with include-dirs, link-dirs and whatnot, and automatically get the documentation built in and ready for autocompletion.

I won't list all other things you can do but no other popular language even come close to the tooling of Java or C#. C and C++ has too many different build systems and too much lazy evaluated templates and typecasts for the IDEs to handle well. Python, Ruby, JS, PHP...well they are all dynamic so good luck with fancy IDE features.

Re:The reference D compiler is now open source by TylerE on Saturday April 08, 2017 @07:20PM (#14069609)
Do not go up against Erlang. You will lose.
Re:The reference D compiler is now open source by jnordwick on Tuesday April 11, 2017 @02:34AM (#14085379)
Erlang as some pretty dope tooling, but still Java has a much larger selection and some low-level tools that are just fantastic for performance (JMH is one of my favorites).
Re:The reference D compiler is now open source by tracker1 on Monday April 10, 2017 @09:16PM (#14084100)
Spend a week trying to get the project to actually run on a computer, with a project you haven't touched before...
Re:The reference D compiler is now open source by jnordwick on Saturday April 08, 2017 @12:41AM (#14065344)
XML? That's probable Spring. I hate that thing. But Java's tooling for monitoring is crazy good. The benchmarking harness that gives back the assembly code generated for hot code, unmatched on any other non-native language. The editors and how good hinting and auto-complete are, I don't know of another language that integrates so well.

Java really raised the bar on tooling and other languages/platforms have really had to drive hard to get just a close comparable place.

Re:The reference D compiler is now open source by homarp on Saturday April 08, 2017 @01:17AM (#14065446)
try spring boot. not a line of xml :)

https://spring.io/guides/gs/spring-boot/

Re:The reference D compiler is now open source by jnordwick on Saturday April 08, 2017 @01:33PM (#14067978)
A quote I found one time, can't remember who: "When your framework has a framework, there's a problem."
Re:The reference D compiler is now open source by StevePerkins on Saturday April 08, 2017 @08:03AM (#14066523)
Whenever someone brings up XML as a critique of Java, they might as well be saying, "I haven't glanced at Java in well over a decade".

There's just no faster route to completely discrediting yourself in eyes of anyone who's actually used it recently.

Re:The reference D compiler is now open source by koko775 on Friday April 07, 2017 @10:42PM (#14064986)
Maybe you're a better programmer than you are a configure-r. But its tooling is insanely, insanely good.
Re:The reference D compiler is now open source by protomyth on Saturday April 08, 2017 @08:01AM (#14066517)
Java had a full court press advertising campaign with powerful partners at a time when 'web' was the new thing and it was going to be that language. The superior support and tooling was a result and sustains it to this day.