Live data from Hacker News

The reference D compiler is now open source

forum.dlang.org

281–290 of 313 posts

Re: The reference D compiler is now open source

#281
Is there support for BigFloat in D/phobos or any auxiliary library? I was playing around with D sequences and wrote a D program that calculates a Fibonacci sequence (iterative) with overflow detection that upgrades reals to BigInts. I wanted to also use Binet's formula which requires sqrt(5) but it only works up to n=96 or so due to floating point precision loss.

Re: The reference D compiler is now open source

#282

Earlier quoted context omitted.

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.

> 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?

[deleted]

Re: The reference D compiler is now open source

#283

Earlier quoted context omitted.

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…

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.

In D "pure" means "referentially transparent".

Re: The reference D compiler is now open source

#284

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, whic…

How well does Dub work? That could be another issue preventing widespread adoption.

Works well for me, I use a subset though. I like dub.

Re: The reference D compiler is now open source

#285
post #21
post #17

Earlier quoted context omitted.

D is easier than Rust and safer than C++. That is a valuable point IMHO.

There's a wide range of possibilities int that statement that include the case where you would almost always want D over Rust, and the case where you would almost never want D over Rust. The question is, how much easier is D than Rust, and how much safer is D than C++.

> how much easier is D than Rust

https://z0ltan.wordpress.com/2017/02/21/goodbye-rust-and-hel...

D gets tricky for resource management and avoiding GC.

> how much safer is D than C++.

Bounds checking and default initialization alone fix most memory errors you may have in C++.

Re: The reference D compiler is now open source

#286
post #248
post #233

Earlier quoted context omitted.

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"

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 autocompl…

Do not go up against Erlang. You will lose.

Re: The reference D compiler is now open source

#287

Earlier quoted context omitted.

I do not agree at all. It's very obvious functionality, and would be in D either way.

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.

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

#288
post #16

Earlier quoted context omitted.

I would be careful calling it the "least encumbering"- there are definitely shorter, easier to understand licenses with fewer restrictions (i.e. zero).

We investigated public domain, but that has international legal problems with it. Boost was the best solution.

What about CC0? I thought it was explicitly made to be a public domain replacement where there is no "public domain"?

Re: The reference D compiler is now open source

#289
post #53

Please get rid of GC :( I want to have smart pointers instead

Actually, please don't get rid of the GC. The GC makes programming easier and there is rust now if a programmer believes that they can not possibly tolerate one. Complaining about the GC is like complaining about python's white space, lisp's parentheses, go's lack of generics etc. It's demanding that the entire language changes to suit the complainant. However, if you're going to have one and people keep bringing it up, you should work hard to make sure that it is the best that it can be. Golang has been very good in this regard with their very publicized work on reducing the stop the world time of their GC. Personally, I think that it would be a win if Dlang did something similar (in addition to the @nogc stuff). It doesn't need to concentrate on reducing the GC pause time, it just needs to be seen to be getting better.

Re: The reference D compiler is now open source

#290

Earlier quoted context omitted.

Coffeescript is essentially dead, many production web sites were written in it.

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.

> 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)

Post reply on HN