4

I've only heard PHP is terrible (e.g. in the context of Mt. Gox) and a more efficient/more security-oriented language would be preferable for matching orders and account security. Which programming language, and due to what reasons, would be better?

5
  • It's what you do with it that counts :) PHP isn't terrible, but it's not the right tool for an exchange back-end. I know some use C/C++.. I suspect most do.. for speed/efficiency and code quality.
    – George
    Nov 20, 2014 at 6:44
  • 1
    @George, take a look at meta.bitcoin.stackexchange.com/questions/633/….
    – morsecoder
    Nov 20, 2014 at 16:53
  • fair enough. I didn't think it quite warranted being a full answer as I don't actually know what most exchanges use so it was more of a comment than an answer.
    – George
    Nov 20, 2014 at 17:47
  • 1
    @StephenM347 I don't think George's reply could serve as an answer, not at least until he decides to get into more detail and justify his arguments.
    – user11221
    Nov 20, 2014 at 19:58
  • Hey new_to_bitcoin, it seemed to me that your underlying question was rather to ask a best-practice recommendation and reasoning, than just an iteration of the status quo. I've thusly edited your question. If you feel that it's not what you wanted to ask anymore, feel free to rollback or further modify. For a short intro how our site works, check out tour and How to Ask.
    – Murch
    Nov 23, 2014 at 13:28

5 Answers 5

2

There is no possible way of knowing what are the technologies used by the exchanges.

C++, C# and C have been typically used by the financial and trading software industry as they can be optimized for low latency / high frequency behavior needed for real-time trading. Java, F#, Python, VBA, Haskell as well as other programming languages have also been used but it all comes to a matter of a personal taste, what technologies you or your team are familiar with, what open source (or not) modules are out there that will prevent you from reinventing the wheel and much more that are out of the context of this forum.

Another way to get an idea for the technologies used by an exchange is to spy on its job adverts. Still, what you'll get might not be accurate or it might refer to another or new product or service of that exchange, or even a migration of the existing technologies towards some other but still you'll get an idea.

2

A lot of financial industry prefers Python. Some remarkable Bitcoin exchanges, like Bitstamp and LocalBitcoins are built on the top of Python and Django web framework (though there exist other web frameworks you might want to use).

The reasons to choose Python include

  • Open source ecosystem with a lot of modules to choose from, like ones for Bitcoin

  • It is not only web development language, but has large use base in scientific computing, making it ideal for data analysis and number crunching (see e.g. IPython, NumPy projects). This makes Python different from Ruby, which is more heavily web only.

  • Python applications have very good security track record, compared to e.g. PHP applications. To confirm this, see CVE entries to the programming language, related frameworks (Python, PHP)

  • Unlike more static languages, like Java and C#, which optimize CPU-bound performance, Python optimizes development time, making it very productive. You can always port your code to more heavy platform if your service grows popular and you have money to spend. This is especially important if your project is not backed up by a big corporation, but more startup oriented.

1
  • Interesting because recently I read an article who quite says the opposite and was more for c++/java (8+). Unfortunately I couldn't find it to contribute here :-/
    – Anna Klein
    Sep 25, 2018 at 18:32
1

TL;DR I would use Scala, F# or Rust. If you don't like FP, then Java/C#.

Statically typed: The reason I would avoid Php, and most other dynamically typed languages, is to avoid bugs. Dynamically typed langs are easy to learn and code, but a statically typed lang like Java / C# will avoid a certain kind of bugs, and make refactoring easier.

Automatic memory management: I would also avoid langs where you manage memory, like C/C++, mostly because I fear bugs. Remember Heartbleed? That category of bugs can only happen when the programmer manages memory. Rust/Go are better.

Functional: I know that FP is considered hard, but it is a way to avoid bugs, especially if you are running a multithreaded app where the threads communicate with each other (like trading). FP's most important feature is that you work with immutable data structures. Functional langs are Haskell, F#, Scala and Erlang.

0

Python is too slow for exchange job. Some rates Python about five times slower than Java. Java is not acceptable either. Mostly for VM/GC and somehow dirty code practices often employed by Java developers. C++ is gold standard for performance AND huge waste of time – tedious and long work required. However, usually code is high quality as developers forced to clean after themselves. Apparently it enforces good practices after years of practice. Then there are couple of exotic languages like Erlang and Go, would suit the requirements. Erlang promises to screw your brains and waste a lot of time – see C++. If you’ll get though of it - results might be good. Go seems to be the simplest choice specifically tailored for parallel processing. Not sure if it fits to financial application needs.

1
  • Please provide sources for your claims.
    – Anna Klein
    Sep 25, 2018 at 18:36
-1

Checking the partial UI rendered pages for

Cryptsy it seems they are using jquery, bootstrap

coinsquare is using fast-cgi, Angularjs, Angularjs

coinsetter seems to be using Java, jquery, bootstrap.js

Mtgox famously used PHP

Javascript farmework 1.Angularjs 2. Nodejs 3.Phython 4.ruby on rails.

It really depends upon the skill your team have or is willing to learn.

Building a thin client over HTML5, Angularjs, bootstrap, nodejs, Java are common denominator among many exchanges.

2
  • I'm confused - how did you arrive at this information?
    – Nick ODell
    Nov 23, 2014 at 16:14
  • 1
    Looking at the client side libraries and talking to some of the developers. Also looking at the skills the companies have been hiring. Nov 25, 2014 at 22:58

Not the answer you're looking for? Browse other questions tagged or ask your own question.