Use ArangoDB from C++ - c++

Despite being written in C++, ArangoDB does not provide a C++ driver, limiting the choice of languages to Java, Go, C#, Node.js and Python.
Since my application is written in C++ I'm looking for ways to overcome this. Legacy docs, old SO questions and blog posts point to Fuerte which has long been discontinued.
Is there an up to date C++ driver?
If not, is using the http/REST API over something like cpp-httplib a sane choice? Are people doing this and is there a downside to it (limited features, difficulty in expressing built-in constructs like Graphs etc.)?
If the second option is suggested I'd appreciate any links to open source projects that use ArangoDB in this fashion - just to make the phrase "are people doing this" more concrete.

Related

Using google library in coldfusion without using Java library

Referring to the following library and my previous thread, I have two questions:
Question #1: I have decided not to mess up with Java Libraries and hence could anyone tell me if there is another way to figure out how to use the libphonenumber library in coldfusion?
Question #2: As discussed in my previous thread, that many people are porting it to different programming languages like JavaScript, Ruby, PHP as they are not written in Java. The google library libphonenumber is written in PHP and I am wondering why someone would port it to PHP language.
(This is more of a comment, but is a little too long)
Seems like this was already answered in the comments of your other thread, but to reiterate:
Is there another way to use a java library from CF?
No. There is basically only one way to use java libraries from CF. Add the jar(s) to the class path and use createObject. You could also use a dynamic class loader like Mark Mandel's JavaLoader.cfc (or the rip of that project baked into CF10+). However, ultimately they all do the same thing.
Since using java libraries is pretty simple in CF, I am curious why you do not want to use it. While I suppose you could rewrite it in pure CFML, I would ask why? The whole point of libraries is reuse, which saves development time. Since there already is a compatible library available to you, there is not much point in rewriting it. Not unless you are doing it as a learning exercise.
The google library libphonenumber is written in PHP
No. There is port that is written in PHP. The "official" project is "a Java, C++ and Javascript library.". So it sounds like your options are the java version (server side) or javascript version (client side use). That is it.
I am wondering why someone would port it to PHP language.
Because the java library is not compatible with every platform out there, PHP being one of them. If a developer on an unsupported platform wanted to use it, they have two choices: port it or write their own from scratch. Since the google project already did most of the heavy lifting, porting is simpler.

Something like unity but for C++ programmers

is there anything similar to unity but with the difference that instead of javascript I can use C++?
It is funny, I was looking to learn a little bit of unity as I seen it as requirement for some postings... and I found this question.
I think Ogre3D is great... it may be what you are looking for.
here is the link ogre3d.org
Ogre3D is what I used. http://www.ogre3d.org/
It is somewhat of a misconception that Unity uses Javascript. The so-called Javascript used in Unity is actually a dialect of Javascript that is CLI-compatible and is not exactly the same as the official Javascript. Also, you are not limited to using Javascript in Unity. You can also use C#, which is similar to C++ and Java in some ways or the less commonly used Boo script.
Personally, I would recommend using C# in Unity because it is very powerful and allows calling of native C/C++ functions via P/Invoke. Here is a link to the use of plugins:
http://unity3d.com/support/documentation/Manual/Plugins.html
Link to list of Game Engines. Please take your time to read and consider them:
http://en.wikipedia.org/wiki/List_of_game_engines
If you want accessibility offered by Unity, C++ is certainly wrong choice. Much better would be interpreted/script language, such as Python. They are more flexible in terms of working in web browser/many os-es.
If you're interested in targetting mobile platforms then Marmalade might be a good fit.
Panda3D It's not a think compared to Unity, but it can work as a web plugin, cross-platform. It has a lack of IDE, but it is opensource.
As far as I know, there is no need to use JavaScript or Boo with Unity, and there is nothing wrong with C# acting like script language ( which is really hard with C++ ).
as a unity developer, I liked to add c++ to by knowledge base as all AAA games are made by C++ and I was looking for something like unity but for CPP. the only good cpp engine is unreal that doesn't really support c++. the language is a dialect of c++ and there are big differences. like very
rare usages of pointer and references
more syntaxes like c# attributes(cpp has not attribute)
...
so you don't learn memory management. the nearest thing that I could find was COCOS2dx as the whole framework is written in pure standard c++ and many libraries like UI and Physics are already added. you can write your own engine and editor with it.
Unreal Engine uses C++
default standard is C++14
https://www.unrealengine.com

Learn C++ when mastering VB.NET

I consider myself a master at vb.net, and now I'd like to learn C++. I know they are similar in many ways, so instead of starting from a standard "learn C++ Basics" which there are thousands of, and then move on from there on, as I have done with all other languages. I would love if someone could point me to a tutorial that learns, someone with knowledge in vb.net, C++. Or maybe a page pointing out the differences between the two.
Also, with them being similar, is their simple converter, that can convert code on line-base from vb.net to C++? I would like to convert my current asp.net website (less than 30 lines of code right now) project to C++, as I find the best way to learn is through doing it.
As #ildjarn and #GregHewgill pointed out, C++ is quite different from vb.net. C# and (to some extent) C++/CLI would be much closer (and despite the name, C++/CLI is not C++).
C++ (by itself) does essentially nothing to support web development, so converting an asp.net web site to C++ will most likely be a decidedly non-trivial exercise. There are frameworks (e.g., Wt, POCO, ACE) that support network and web development in C++, but I don't believe they have automated tools to convert from asp.net. In any case, converting a web site to C++ using one of these libraries is not going to teach you much about C++. At best, it's going to teach you about that library.
I feel obliged to point out, however, that if web development is your primary interest, C++ probably isn't your best possible choice. At the very least it's quite an unpopular choice for that purpose.
The typical answer for people who already know how to program in some other language and want to learn C++ is Accelerated C++ (but you may want to see The Definitive C++ Book List for other possibilities).

C++ for small, individual projects (i.e. hobby programming)

I recently started C++. I am using PHP right now and decided to take a look at C++. Web programming had me working with a couple of languages, with a couple of people. I wanted to do programming where I only had to bother with one language and create small utility apps (mostly not web-based). I wanted a compiled, strongly-type language without memorizing a tome of classes. Basically I wanted to learn C++ for the following:
mobile programming (I don't ever want to go touching Java, and I don't have a Mac for Objective C or IPhone SDK)
small desktop apps like DTRs, POSs
creating small desktop-based games
creating small Air-like applications that can access the web for additional content
I heard that C++ is not beginner-friendly and is mostly used for huge projects with lots of calculations and fine details (like 3D games). Is it practical or even possible for me to use C++ for the above cases? (Sorry, I haven't delved on C++ that much yet, so aside from "huge, monolithic project", I don't know any other uses for it)
You can certainly use C++ in all the areas you mention, though whether it is best of breed for any of them is open to debate. C++ is very large and complex language, and requires a fair bit of effort to get up to speed on. If I were you, I would pick one of the areas you mention that you are most interested in, and then find out which language(s) are best suited for that area and learn that.
If you are set on learning C++ you will need to read at least one book on it - you cannot learn it from internet resources alone. See this question The Definitive C++ Book Guide and List for a book list.
On the droid you can use other languages aside from Java - check out their ASE (Active Scripting Environment). C++ / C should really only be used when you have no other choice - i.e. speed critical code, operating systems etc. It's very easy to make a mistake that's difficult to diagnose and there are lots of task where it'll take way longer than it should to write and odds are others have already done so and done it way better - reinventing the wheel is bad. If it interests you though by all means learn and eventually you may master it. It's an excellent skill to have.
It's also not a completely object oriented language however, it's a hybrid one that supports most object oriented features, but some such as inheritance and polymorphism are a bit awkward to deal with in C++ - for example you have to define methods as virtual in base classes in order to be allowed to redefine them in subclasses - sort of like predicting the future - will this method every be desired to be redefined by an inheritor? Really what happens in that case is you make the base class method virtual later on to enable it to be redefinable - that is if you happen to have access to the source code to do just that - if not then oh well. For an example of this confusing stuff in C++ and other gotchas: Pitfalls
Look at other languages such as Ruby or Python - in particular Stackless Python where a combination of it and C++ (used where necessary) was used to create EVE Online as well as the functional languages such Erlang and Haskell.
For 2, 3 and 4, I recommend C# over C++, for the reasons I wrote here.
About 1, you can do iPhone development with .NET but I've never tried it and I don't know how viable it is.
Edit
To answer your actual question: yes, it's totally practical to write small and large desktop apps in C++. Especially if you use quality tools like Visual Studio and Qt. It's just that I think it'd waste a lot of your time for no reason, unless you intend to go into professional game development eventually.
I went to C++ from PHP like you, but I was more interested in 3D games and such. Now I have moved on to C# and find it much more enjoyable than C++.
As for your specific areas of interest however, C++ is certainly an option but C# may be better.
Mobile programming with C++ is probably not a good idea. I know it's possible with NDKs and such but for a beginner it's probably not so good. For iPhone development, other than the official SDK, the next best option is the (commercial) MonoTouch framework from Novell. However, you may still need a mac to deploy (I don't know). In terms of Android, if you don't want to touch Java (don't blame you) I believe a C# framework (similar to MonoTouch) is in development and other languages may be available. Other platforms? No idea.
Small desktop apps is also very possible with C++. Assuming you're running Windows, you can use the Win32 API (pain) or the C++/CLI API (better). You could also use a different GUI framework like Qt, wxWidgets or GTK+ which are all also supported on other platforms. Again coming back to C#, GUI development using GTK# in MonoDevelop is so much fun. Having used WinForms in Visual C# Express back in my Windows days, I can say that I now enjoy the process whereas I didn't before.
Games are my main area of interest and the reason I originally picked up C++. Seeing as you've said small and desktop-based, using C++ for performance reasons is way overkill IMO. You could make a decent, fun, playable game in Python using pygame without the pain of using a language like C++. In C# (yes, I'm trying to sell it to you) you could create awesome games using the XNA framework from Microsoft or other frameworks like (my personal favorite) OpenTK.
Rich internet applications. C++ is probably not the right tool to use here. It's certainly possible but seeing as C++ has no standard networking library, you would have to figure some of this stuff out yourself. C# may not be the right tool either but it makes it a little easier. There are other options as well (like Python) but it's not something I know much about.
Despite what I've said about it, I still think C++ is a good language to learn. It teaches you about lower-level things you never think about in PHP land. If you want to learn it, the book that really helped me was "C++: A beginners guide" by Herbert Schildt and also "Programming" by Bjarne Stroustrup.
Yes, your use cases can all be done with C++, more or less (YMMV on mobile devices).
To some degree or another, a language like C# will be more rapid to develop in, however.
In my opinion, once you get away from the straight-up form design features and hack for a while in a language & application, language feature comparisons begin to diminish in meaningfulness.
I recommend C++ as a first "heavyweight" language; see here for my most recent discussion on it.

Any good C/C++ web toolkit? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 7 years ago.
Improve this question
I've been looking around and came across the WT toolkit, Is it stable? Any good?
I was stumped on how to go about this in C++, given the lack of libraries and resources concerning web developement. (CGI/Apache)
The purpose of my application is to populate some data from a Sybase ASE15 database running GNU/Linux & Apache Hence allow some user interactions.
I am going to use Sybase open client library (libct) to retrieve columns from the Server, feed this data back to wt model/view.
My requests:
Is there any more practical solution rather than using other scripting languages?
I mean by practical, an interface with ODBC retrieving, and MVC mechanism?
If not available in C++, any alternative in Java?
C++ isn't a very popular choice for
web applications - probably because
it's too easy to leave security holes,
and development time tends to be a lot
slower than for the scripting
languages.
Dynamically typed scripting languages convert compile-time errors to runtime errors. Detecting those might not be as easy as reading through the compiler output. Scripting languages may be OK for quick-and-dirty simple projects. Beyond a certain level of complexity one needs strongly typed, well-structured languages. Such as C++, or Java.
Most scripting languages encourage sloppy programming.
As to the "security holes": if you refer to buffer overruns, allocation/deallocation errors, the answer is "STL". And proper training of course :-)
http://www.webtoolkit.eu/wt#/
http://cppcms.sourceforge.net/wikipp/en/page/main
C++ web service framework
For starters. There are certainly more I'm sure - a healthy google search probably wouldn't hurt. Also, you could try the #C++ channel on freenode - they have an offtopic channel that you can ask about if you want to talk about non STL C++ and the people there would happily answer your questions I'm sure. Good Luck.
tntnet (http://www.tntnet.org) is great for creating web applications with C++.
Give this one a look. I never much liked Wt's design. But then, I'm kind of an anti-framework guy.
http://cppcms.sourceforge.net/wikipp/en/page/main
CGI programs are pretty damn easy to write in both C and C++ - you don't really need any special library, though having one will obviously make development a little faster. Do you really understand how CGI works? Basically, your program reads environment variables with getenv(), does some processing, and then writes some HTML out to the program's standard output.
You might want to check out klone:
http://koanlogic.com/klone/index.html
Basically, it's a framework AND server that makes writing C++ web backends easy...
The best web toolkit for C/C++ would be Apache httpd. Just write a module and you can use libct to access your database.
There is MVC modules out there like mod_spin but I don't have any experience with it.
C++ isn't a very popular choice for web applications - probably because it's too easy
to leave security holes, and development time tends to be a lot slower than for the
scripting languages. I'd say 99% of web applications don't need the speed that
C++ brings.
So this leads to a lack of good frameworks.
From my fairly light look at the area I'd say Wt is probably your best bet, although
it's more of a library of useful things (like page templates) than a framework.
I'd seriously consider not doing this in C++ though. Even Java (I prefer C++ myself) has
much stronger support for web development.
Another alternative may be the "FastCGI / CGI C++ Library" that is aimed for Boost integration at someday: http://cgi.sourceforge.net/
Qt is going to grow day by day. And Wt is the trying to stand for web tool kit based on Qt. C++ the powerful language and the best in my opinion. If you like gnu projects and independent tech. I really suggest to use them. I used PHP, Phyton, C#, VisualBasic, Fortran etc. but I did not like as much as C++ among of them.
I gave Wt a try and really liked it. I will not give you any cons or pros for using it from scratch, but when you have a backend written in C/C++ with millions of API entries then Wt is an obvious choice. There are some very powerful features that is easier to use for example dynamically loaded tables. Signal processing on the server etc.
One thing I really disliked at Wt is that it is not compatible with Apache on Windows as of time of this writing. You either have to use Unix, or IIS on Windows. Wt also offers its own http server, that is very convenient for developing your applications but I would not trust it in the role of production server as I am not sure of its security.
My personal choice for web development is Ruby on Rails, but if you have to chose between C, C++ or Java for web development, my suggestion is to use Java with JavaServer Faces
Apache Celix looks like a promising active project that meets the requirements of this (albeit old) question. See: http://celix.apache.org/
From the Apache Project description page:
Celix is an implementation of the OSGi specification adapted to C. It will follow the API as close as possible, but since the OSGi specification is written primarily for Java, there will be differences (Java is OO, C is procedural). An important aspect of the implementation is interoperability between Java and C. This interoperability is achieved by porting and implementing the Remote Services specification in Celix.