• What is Diamond?


    Diamond is a full-stack web-framework written The D Programming Langauge, using vibe.d

  • How does Diamond work?


    Diamond can be used in 3 different ways whom all function different.

    For websites Diamond works by first (during compile-time) parse all views into D classes that can be invoked at run-time for maximum performance.
    This has the downside that each change in a view requires a new compilation, but it's necessary for the performance. This process can be automated however.

    For web-apis Diamond works by parsing each controller action mapped by routes into a look-up map for quick access.

    For both websites and web-apis Diamond will run a vibe.d server, but if necessary you can choose from where and when the server is started.

    Being stand-alone is the last way Diamond work, which basically just gives you access to Diamond as a library, but most web (Everything depending on vibe.d) has been excluded.

    The primary usage for Diamond stand-alone is the template and view-engine.

  • How can I help?


    All help towards the development of Diamond is appreciated. It's a project that is worked on in spare-time and there is no specific dedicated time to it.

    This also means that sometimes development can be slowed down as it isn't a funded project.

    You can help by either working on Diamond fixing bugs, implementing features or improving upon it or you can donate to the project, which will help paying for the website and as well the possibility to allocate time for development on Diamond.

    If you're a business owner and you use Diamond or are interested in using Diamond, you can also donate to show you value the project.

    Your donation will also have us prioritize you and your company's need in terms of functionality, features and bug fixes.

    Please visit here for more information.

  • Why another web-framework?


    There are virtually no web frameworks written in D that are reliable or can be used properly with enterprise work.

    There is vibe.d, but it requires the user to know D and to write a good application in vibe.d you need quite good knowledge of D and vibe.d's API.

    Diamond exists to work around the issue of having to be a D guru and learning vibe.d's huge API, by providing a user-friendly API and the possibility to work without using D or at the very least minimum D.

    Diamond's main goal is to be used enterprise and thus it serves as a high-level layer on top of vibe.d, providing the same functionality, but sometimes wrapped in more user-intuitive ways.

  • Why D?


    D is a very powerful programming language and comes with all modern concepts, but also provides the power of native compilation.

    It's very easy to write cross-platform code in D without it being a pain.

    On top of that metaprogramming and templates in D are so useful for generating generic, dynamic and fast code.

    Diamond uses a lot of metaprogramming, templates and a lot of functionality is executed during compile-time, such as view rendering.

  • Why vibe.d?


    vibe.d is a very powerful web-framework and the most used web-framework in D.

    It provides the power necessary to have a solid framework such as Diamond.

  • Why the name Diamond?


    The name Diamond comes from that its main goal is to be beautiful and elegant, just like a shining Diamond.

  • How stable is Diamond?


    While Diamond is always under development, then it current is stable and can be used in production.

  • How does Diamond scale?


    Because Diamond is built on-top of vibe.d then it scales very well and can be used for both small and big projects.

  • Who's behind Diamond?


    Diamond was developed by Jacob Jensen, the development started in 2016.

    However Diamond would not be possible without a lot of people from the D community.

    This includes, but is not limited to everyone behind vibe.d, mysql-native and the D programming language.

  • Which sites uses Diamond?


    Currently there are no big consumers of Diamond, but Diamond's own website is developed entirely with Diamond.

  • Is Diamond a CMS or can it be used for CMS?


    Diamond is not a CMS framework, but it can be extended to be used by one.

    Diamond provides a lot of functionality that CMS frameworks also provides and extending them could make Diamond function like a CMS.

    There is currently a CMS framework in development, which is based on Diamond. It's maintained by the official Diamond team.

    You can find it here.

  • How can I download Diamond?


    You can download Diamond from here.

  • How do I install Diamond?


    Please follow the instructions here.

  • Where do I find Diamond's documentation?


    You can find the documentation here.

  • Can I get Diamond's documentation for offline usage?


    You can get an offline version of the docs here.

  • Where do I get started with Diamond?


    Please see the documentation here.

  • How does Diamond perform?


    Diamond is based on vibe.d which is known for its high performance. Diamond utilizes that and thus performs very well.

  • Does Diamond support Phobos?


    Yes. All functionality of Phobos is theoretically available and can be used in Diamond.

    Some functionality is available implicit in views such as certain functions from std.conv, std.algorithm, std.array, std.string etc.

  • Can you use all of vibe.d's features with Diamond?


    Yes, most features will work in Diamond without having to explicit do anything extra.

    Diamond is a ligh-weight, but heavily functional layer on-top of a normal vibe.d application.

  • Should I use the stable version of Diamond or the development version?


    If you're interested in developing a project that should be used in production, then you should go with the stable version.

    However if you're interested in contributing to Diamond, then you should go with the development version.

  • How do I handle errors in Diamond?


    There are plenty of error-handling mechanisms in Diamond. Please see this for more information.

  • Are views dynamic?


    Views are dynamic, but statically compiled and thus if you change a view you need to recompile the whole project.

    This means that the dynamic data of views can be rendered blazingly fast.

  • What code can views contain?


    All D code is allowed in views, thanks to D supporting almost everything within function bodies.

  • Why did you choose to use a similar syntax to ASP.NET razor and not something else?


    I (The core developer of Diamond) came from a background working with ASP.NET, so it was what I was familiar with.

    I wasn't a big fan of the syntax Diet templates in vibe.d uses and thus Diamond actually started as just an alternative template engine.

  • How secure is Diamond?


    Diamond is built with security in mind and thus there shouldn't be any major security risks in using Diamond.

    In fact there are a lot of security functionality built-in which you can use or extend to secure your applications even more.

  • I have found a security problem, what should I do?


    Depending on what it is then you should file an issue here.

    If the security problem exists within one of Diamond's dependencies such as vibe.d, mysql-native, D runtime or Phobos, please report it to them and not us.

    Only report security issues in Diamond that are strictly related to Diamond.

  • Do I have to use your project structure?


    No, but we recommend it as some functionality does depend on it.

    You're not forced to however, but it could mean specific limits.

  • Does Diamond support NoSQL databases?


    Yes. Diamond has support for both Mongo and Redis.

  • Does Diamond support MySql or MariaDb?


    Yes. Diamond supports MySql and MariaDb through its dependency to mysql-native.

    By default there is an ORM built into Diamond that wraps around MySql/MariaDb also.

    The ORM can be extended to use any type of data and not just MySql/MariaDb however.

  • Does Diamond support MSSQL?


    No. There is no official support for MSSQL, but it's possible to extend Diamond and use it.

  • Can I use static files with Diamond?


    Yes, static files are supported by Diamond and you specify multiple paths that Diamond should search for static files in.

  • Can Diamond manage users, roles and permissions?


    Diamond has basic support for user roles and permissions, which can be used like ACL.

    You can extend the functionality however you want.

  • Can Diamond handle authentication?


    Diamond has authentication built-in and it can be combined with the built-in ACL functionality.

  • How can I contribute to Diamond?


    Please see here.

  • I submitted a bug fix, why has it not received a response or been merged?


    Diamond is a volunteer project and thus it isn't worked on 24/7, which means that there isn't always time to check pull-requests etc.

  • Which editor/IDE should I use with Diamond?


    It's recommended to use VS Code, because using the D programming language extensions provides project templates for Diamond.

  • Which operating system should I use with Diamond?


    Diamond is cross-platform and supports multiple operating systems such as Windows, Linux & macOS.

    It's possible that it works on other platforms too.

  • Do I need to know D in order to use Diamond?


    It's recommended to at least know basic D, but it isn't strictly necessary.

    If you're familiar with other C-like languages and/or ASP.NET Razor, then you should be able to come by, regardless of your D expertise.

  • Can I learn D if I don't know C or C++?


    Yes. D is a very easy language to learn and can even be suitable for first-time programmers.

  • How do I learn to program in D?


    Please see the official website for The D Programming Langauge here.

  • Where should I deploy my Diamond project to?


    Diamond can be deployed to any type of server that's able to run the hosted application.

    This means that Diamond can run on both Windows Servers, Linux Servers etc.

  • How do I deploy a Diamond project?


    Please see this for a guide to deploying Diamond to various platforms.

  • Can I use Diamond with an existing vibe.d code-base?


    Yes, but it minor rewriting in the vibe.d code-base might have to take place.

    Remember, Diamond is a layer on top of vibe.d and thus both plays well together.

  • Does Diamond have a blog?


    Yes and you can find it here.

  • What is the latest stable version of Diamond?


    The current stable version of Diamond is 2.9.3

  • What is the current development version of Diamond?


    The development version of Diamond does not have a specific version.

    Diamond's version depends on which features has been merged into the master branch during release.

    Diamond uses segmantic versioning, but depends heavily on what kind of changes are made.

    Thus the version cannot be determined until release, because some features may force the version to be bumped up by a minor etc.

    Diamond is not going to have its major version bumped up any time soon. That wouldn't be unless Diamond had a change of infrastructure.