Live data from Hacker News

The reference D compiler is now open source

forum.dlang.org

301–310 of 313 posts

Re: The reference D compiler is now open source

#301
post #295
post #140

Earlier quoted context omitted.

I think one of the very good features of D is that it provides a lot of infrastructure that helps with lots of little generic things -- things that are not really needed in the language, but help reduce the amount of code you write or simplify common actions you take. It seems like Walter (and all the other contributors) have distilled their experience writing programs into creating a language that helps a lot with s…

Good list. Another good feature: Interfacing to C is somewhat easy at least for the basics. (I haven't looked at advanced cases yet, but maybe someone else can comment on that.) https://dlang.org/spec/interfaceToC.html This is a great feature IMO, because it allows you to (re)use the huge number of existing C libraries out there. Here is a simple example: Calling a simple C function from D - strcmp: https://jugad2.bl…

Just added another D post to that list:

Porting the text pager from Python to D (DLang)

https://jugad2.blogspot.in/2017/04/porting-text-pager-from-p...

Re: The reference D compiler is now open source

#302

Earlier quoted context omitted.

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

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…

I'm pretty sure Java's feature is that it has java.lang.NullPointerException

Re: The reference D compiler is now open source

#303
post #239
post #156

Earlier quoted context omitted.

I can have non-deterministic performance even when using C. Also if I use Boehm GC with C, does that disqualify C as system language?

Is GC with C mandatory? it is in Go. See the difference? C doesn't come with a GC.

GC in D is NOT mandatory.

Re: The reference D compiler is now open source

#304
post #290

Earlier quoted context omitted.

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

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

#305
post #290

Earlier quoted context omitted.

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

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

#306
post #290

Earlier quoted context omitted.

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

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

#307
post #147

Good to hear the news, and congrats to all involved. Since I see some comments in this thread, asking what D can be used for, or why people should use D, I'm putting below, an Ask HN thread that I had started some months ago. It got some interesting replies: Ask HN: What are you using D (language) for? https://news.ycombinator.com/item?id=12193828

Too late to the party to add my answer to your AskHN, but here we go: I use D at Netflix for machine learning backend.

Super interesting, could you say a little more ? Any blog posts that talk about this. From what I gathered from HN part of Adroll's ML is in D.

Re: The reference D compiler is now open source

#308
post #186

Earlier quoted context omitted.

Go does allocate and free at runtime, it just isn't explicit because its a garbage collected language and the garbage collector handles most of the freeing for you. Different GC'd languages handle allocations differently, some have a keyword, some do it whenever creating an instance of a type over a certain size. With C, C++ and Rust allocating memory often boils down to calling something equivalent to malloc and fre…

Does modern C++ or rust allow you to say "deallocate this pointer here " (like free or delete)? I was under the impression that Rust (and safe_ptr) deallocate at scope end, which could also cause framerate issues (unless you do ugly scope hacks). I do agree that you're unlikely to bump into this issue, though.

The are a couple of options in C++.

You can just use delete, as you mentioned, it is a C++ only construct as far as I know.

For the std library smart pointer, you can get their value (the raw pointer), delete that then assign nullptr to the smart pointer. I would consider this a code smell, and ask hard questions of the authors of such code.

The simplest thing to do is to add new scopes. You can introduce as many blocks with { and } as you like. It is a common pattern to lock a mutex with a class that releases the mutex in its destructor (and acquired it in the constructor). The std library includes std::lock_guard[0]. To insure the smallest possible use of the lock a new scope can be introduce around just the critical section and the first line of the block can pass the mutex to the scope guard and it should be about as small and efficient as can be, while be exception safe and easy to write. Hopefully this is also easy to read.

You can introduce new scopes with std::shared_ptr or std::unique_ptr as well. This seems common and reasonable.

[0] - http://en.cppreference.com/w/cpp/thread/lock_guard

Re: The reference D compiler is now open source

#309

Earlier quoted context omitted.

Thanks for the writeup. I've just been evaluating Rust, D, and Nim, and reading about your experience has been helpful. Can you elaborate on how D is planning to sort out the garbage collection? Nim's GC is extremely fast and thread local, and can be disabled without breaking libraries (according to the author, it does something with memory regions that I haven't 100% grasped yet). I've googled about D's garbage coll…

Like Nim, you can also disable GC in D, and you can avoid GC altogether by not allocating GC'd memory (GC is only ever triggered at allocation time), or at least by preallocating and then disabling the collector. Raw allocation is always possible, and you can "emplace" D structs and classes into unmanaged memory. The collector itself isn't being improved as far as I know -- at least I haven't seen any initiatives men…

There has been work done to improve the collector but nothing has made it into mainline. For example one implementation was missing parts for Windows but worked in Linux thus it couldn't be pulled in and used.

Re: The reference D compiler is now open source

#310

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…

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

JS has an actual write once run anywhere with an above-average async story.
Post reply on HN