Entries:
Comments:
Posts:

Loading User Information from Channel 9

Something went wrong getting user information from Channel 9

Latest Achievement:

Loading User Information from MSDN

Something went wrong getting user information from MSDN

Visual Studio Achievements

Latest Achievement:

Loading Visual Studio Achievements

Something went wrong getting the Visual Studio Achievements

GoingNative 8: Introducing Casablanca - A Modern C++ API for Connected Computing

Download

Right click “Save as…”

Welcome to the 9th installment of GoingNative. Charles flies solo this time around as Diego is on a well-deserved break from work.

At GoingNative 2012, Herb Sutter addressed the need for more general purpose standard C++ libraries - high level libraries - for use in modern computing. So, things like HTTP, REST, JSON are important today (and working with these technologies is not as easy as it should be in C++), not to mention simplifying asynchronous programming for C++ developers. We live an asynchronous world and C++ libraries need to evolve to compensate for this fact (and catch up to .NET and Java in this regard both on the client and on the server...).  What's the story for C++ in the cloud?

A very small group of C++ developers inside Microsoft have started an incubation project to make native libraries that afford both developer productivity and performance and power - and for C++ developers. We love this! This is the Casablanca API and it takes full advantage of C++11.

This episode is dedicated to the Casablanca "dev lab" project with the hope that all of you will download and experiment with the API, vet it, push it, break it, provide feedback to speed up its maturation (it is alpha quality, of course (it's an incubation and this is the first release), so there will be a few bugs, but it's stable enough to be useful right now). Go get it!

What does Casablanca provide, exactly?

With Casablanca, you get support for doing things like developing REST services for Azure, or accessing them from clients via an HTTP library, sending JSON data, accessing Azure blob and queue storage, and using TCP for flexible networking needs, all in a library that takes advantage of modern C++.

Casablanca also gives you a convenient model for composing asynchronous operations. C++ 11 offers a whole new set of capabilities that can make dealing with asynchronous operations easy, and Casablanca takes advantage of that throughout.

Another aspect of Casablanca is its implementation of the actor programming model, which has proven itself useful in building reliable and scalable systems. (not familiar with the Actor Model, well, learn from the inventor of it here).


Table of Contents
:

[00:00] GoingNative(); //Charles flies solo for this episode (Diego is on vacation). Quick chat about what's coming (new STL series (the person, not the library)), introduction to Casablanca, a modern C++ API (incubation) for asynchronous client/server computing (so, modern C++ for the cloud and the client)
 
[01:49] Charles has a conversation with Casablanca engineering team members Niklas Gustafsson and Steve Gates.

[44:20] ~GoingNative(); //Charles talks about Casablanca - please download the libraries and experiment, provide feedback, help vet this new (experimental) API.

Tags:

Follow the Discussion

  • felix9felix9 the cat that walked by itself

    NICE ! The April GoingNative in the last minute.

  • Eric AguiarHeavens​Revenge Know Thyself

    Steve Gates was way too bland, go deep or go home Tongue Out

  • devcodexdevcodex SWGANH.com

    This is amazing, I have been toying around with a pet project that interacts with several REST/JSON  based API's and seriously feeling the lack of a good library for this type of work in native c++. This is the type of effort that I've been looking forward to and I can't wait to start playing with it.

    @Charles Good job on the solo mission man, this was a great ep!

  • NoSenseEtAlNoSenseEtAl

    STL will be back! Im sooooo happy. :)
    Now will watch the rest of the show...

  • ZuraZura

    This is great!

    Samples are very elegant. This brings C++ to a whole new level.

    Charles, on a similar (C++) note, always wanted to ask here, do you know Jeff Alger and where is he now? He is the author of favorite book of my "teenagehood" - "C++ for Real Programmers". He used to work on MS at that time.

    Thank you!
    Zura

  • CharlesCharles Welcome Change

    @Zura: Hi Zura,

    I have no idea where Jeff Alger is these days.

    In terms of samples and Casablanca SDK, I couldn't agree more. It's great to see a modern C++ API that doesn't involve too much ceremony to do to relatively simple things. This approach is clean and user-friendly. Bravo, Casablanca team! Way to go modern. Smiley

    C

  • CharlesCharles Welcome Change

    @NoSenseEtAl: Indeed. We're very excited to get STL back into our studio! Smiley

    C

  • XTFXTF

    What platforms does this API support?

    Just Windows? Sad

    C++ needs cross-platform libs.

  • Niklas GustafssonNiklas Gustafsson

    We discuss this in the DevLabs forum on Casablanca. The short answer is as an incubation project, it's Windows-only, but it's not our intent to keep it that way.

    http://social.msdn.microsoft.com/Forums/en-US/casablanca/thread/82f5d4a2-91a6-4abc-8509-5bb48a277ab7

    Niklas

  • Super excited to see some ideas from Axum coming back to life. That was a sick project.

  • This is a really nice library, something that I would love to see in the standard. The client code I wrote was really simple and clean. You really start to see the goodness of C++11 when you use a library like this.

    One comment - is there a reason why the field/key operators in the json::value class only return by reference and not by const reference as well?

    Something like this:

    void kung_foo(json::value const& jobject)
    {
        int id = static_cast<int>(jobject["id"].as_double());
    }

    won't compile.

  • @Int64: Sounds like it's modeled similarly to std::map, where operator[] inserts an element if one is not there, and so cannot be const.  Does it have an at() function?  Or a find() function? I can't check it myself at this time.

    And speaking of that @Devs, is there any way for us to view the code online or off without having to run a setup program that only works on Windows?  Or at least a way to see the full interface even if we can't see the implementation?

  • freeflyfreefly

    I really appreciate the efforts with new libraries for C++. This is a huge step forward.
    I wish that Microsoft will consider moving the development to windows phone platform as well.

  • @benjaminLindley: Ah, that makes sense. Looking at the interface, it appears the solution is to return a const ref to the underlying field map and/or element vector and use their find/at functions:

    auto& fields = jobject.fields();
    auto iter = fields.find("id");
    if (iter != fields.end())
        id = static_cast<int>(iter->second.as_double());

    The field map is implemented as stdext::hash_map - wonder why no std::unordered_map?

  • Niklas GustafssonNiklas Gustafsson

    benjaminLindley is absolutely right -- it's so we can use the operator on either side of an assignment operator. And yes, it is modeled after existing STL collections. No at() or find() yet -- I will add that to the list of things to augment with.

  • PetkePetke

    Wishlist: SOAP and HTTPS

  • CharlesCharles Welcome Change

    @Petke: Thanks for the feedback. The team is aware of the need for HTTPS, for sure.
    C

Remove this comment

Remove this thread

close

Comments Closed

Comments have been closed since this content was published more than 30 days ago, but if you'd like to continue the conversation, please create a new thread in our Forums,
or Contact Us and let us know.