Live data from Hacker News

PowerNex: a kernel written in the D Programming Language

github.com

61–70 of 79 posts

Re: PowerNex: a kernel written in the D Programming Language

#62
post #57

Hey. I'm the developer of this kernel. If you want to read a blog post about how and why I made PowerNex you can read it here. http://dlang.org/blog/2016/06/24/project-highlight-the-power... AMA aswell I guess :)

Good luck with that and I can't wait to try it out. Cheers.

Re: PowerNex: a kernel written in the D Programming Language

#63
post #60

Earlier quoted context omitted.

Yea, that's disappointing. I'd assume an Object-Oriented language would be better at implementing a microkernel. Objects, in my mind, really represent the idea of a service well so I'd be excited to see what it would look like. Too bad we're never going to get out 128 core SPARC machines with an open-source microkernel like was prophesied in the Linux-MINIX debate.

I would want to create a microkernel, but that would be really hard so I'm targeting a hybridkernel design.

Have you checked out the GRUB features to load blob file systems for you into memory? It's one of the best ways to implement that kind of feature (for this sort of hardware).

Do you sit on some IRC somewhere? I'd be interested in talking to you about how you're approaching this work. Very cool

Re: PowerNex: a kernel written in the D Programming Language

#64
post #16
post #9

Will someone with familiarity with both Rust and D talk a bit about the similarities and differences?

I think this is a valid question. They're pretty different languages in terms of design, but they're definitely worth comparing—their problem domains do overlap in spite of design differences. I've used both, but can't claim to be much of an expert in either. Similarities: • Compile to fast, easy-to-deploy native code • Abstraction continuum ranging from very low-level C-like style to a high-level more functional sty…

Additions & corrections:

1) While the majority of all users will profit from the convenience of the GC, it's not a big deal to use D without a GC. (apart from this kernel, another famous example is the next-level large-scale storage company Weka. They have had such real-time concerns that they invented their own Ethernet protocol - more details: http://dconf.org/2016/talks/zvibel.html) Moreover since last summer D got an amazing support of allocation building block with it's new Allocator API: http://dlang.org/phobos/std_experimental_allocator.html

2) What's Rust's advantage on concurrency? This can be done quite well in D too, see e.g. this book chapter: http://www.informit.com/articles/article.aspx?p=1609144

There are a couple of advantages of D that are important to me and you didn't mention: - error-saving contracts (builtin unittests, assert, in & out blocks, invariants) - OOP (abstract classes, interfaces, ...) - mixins & code generation - compile time function evaluation and introspection (this makes your code even faster) - clean syntax & style (@property methods, lambdas, ...)

Re: PowerNex: a kernel written in the D Programming Language

#65
post #16

Earlier quoted context omitted.

I think this is a valid question. They're pretty different languages in terms of design, but they're definitely worth comparing—their problem domains do overlap in spite of design differences. I've used both, but can't claim to be much of an expert in either. Similarities: • Compile to fast, easy-to-deploy native code • Abstraction continuum ranging from very low-level C-like style to a high-level more functional sty…

Which projects use D as the main language ? Rust has Servo. Redox got some light. But D has always been a language's language.

Areas of D usage: http://dlang.org/areas-of-d-usage.html Organizations using D: http://dlang.org/orgs-using-d.html

Re: PowerNex: a kernel written in the D Programming Language

#66
post #65

Earlier quoted context omitted.

Which projects use D as the main language ? Rust has Servo. Redox got some light. But D has always been a language's language.

Areas of D usage: http://dlang.org/areas-of-d-usage.html Organizations using D: http://dlang.org/orgs-using-d.html

I should have tried harder. No, I should have tried.

Re: PowerNex: a kernel written in the D Programming Language

#67
post #16

Earlier quoted context omitted.

I think this is a valid question. They're pretty different languages in terms of design, but they're definitely worth comparing—their problem domains do overlap in spite of design differences. I've used both, but can't claim to be much of an expert in either. Similarities: • Compile to fast, easy-to-deploy native code • Abstraction continuum ranging from very low-level C-like style to a high-level more functional sty…

Which projects use D as the main language ? Rust has Servo. Redox got some light. But D has always been a language's language.

I use D for econometrics. The ability to easily call C libraries and interoperate with R (D embedded in R and vice versa) is very handy.

Re: PowerNex: a kernel written in the D Programming Language

#68
post #16

Earlier quoted context omitted.

I think this is a valid question. They're pretty different languages in terms of design, but they're definitely worth comparing—their problem domains do overlap in spite of design differences. I've used both, but can't claim to be much of an expert in either. Similarities: • Compile to fast, easy-to-deploy native code • Abstraction continuum ranging from very low-level C-like style to a high-level more functional sty…

Personally I find D a much more comfortable option. I tried Rust a few times, and it contains a few nice features ('match', expressional if-else, built-in tuples/multiple return) which would be cool to see in something like D, but I found the overt emphasis in Rust on safety to be entirely too aggravating to work with. Perhaps I might try it again in the future, though, who knows. To any Rust pros here, I'm curious:…

Once you internalise the rules, it clicks and becomes second nature, and you learn to really appreciate the explicitness. Lifetime/ownership errors go way down, and the ones you do get are usually trivial to fix.

In saying that, as with any powerful type system there are always going to become some confounding cases, but for me the trade-off is worth it. It also makes the complexity of your domain more evident up front with shifts experimentation to the compile time phase as opposed to the run-time phase. I prefer the former though, because it is always a joy to have your code compile after a big refactor, and have it run pretty much as you expect.

Re: PowerNex: a kernel written in the D Programming Language

#69
post #37

Earlier quoted context omitted.

I didn't say D wasn't suitable for writing OSes. Might as well throw Singularity into the list of GCed operating systems. I did say D is unsuitable for real-time and soft-real-time programs, OS or otherwise. You can't write an RTOS in D.

> You can't write an RTOS in D. Can't is a pretty strong word. You can write C-style code in D that compiles and behaves identically to C, including malloc/free.

I… I just got corrected by Walter Bright.

That's true. You actually can write an RTOS in D, and it would still be more pleasant than in C (thanks to D's excellent metaprogramming). The problem I have with opt-out GC in D is that it leaves you with very little else as far as memory safety goes—you have RAII, but nothing like Rust or Cyclone or other languages that are explicitly safe without a GC. You can leak, you can crash, you can have race conditions, etc, almost as easily as in C. Some sort of D version of unique_ptr would get you part of the way there, but it's still not as complete as Rust.

Re: PowerNex: a kernel written in the D Programming Language

#70
post #69

Earlier quoted context omitted.

> You can't write an RTOS in D. Can't is a pretty strong word. You can write C-style code in D that compiles and behaves identically to C, including malloc/free.

I… I just got corrected by Walter Bright. That's true. You actually can write an RTOS in D, and it would still be more pleasant than in C (thanks to D's excellent metaprogramming). The problem I have with opt-out GC in D is that it leaves you with very little else as far as memory safety goes—you have RAII, but nothing like Rust or Cyclone or other languages that are explicitly safe without a GC. You can leak, you ca…

D does have @safe, which does a good job of preventing large classes of unsafe pointer issues. It is not perfect yet (we're working on it) but it is far better than "nothing like", and far better than C/C++.

For example, it does array bounds checking.

Post reply on HN