Bitcoin Forum

Bitcoin => Development & Technical Discussion => Topic started by: anorphirith on February 01, 2014, 02:26:27 AM



Title: language of choice for a secure orderbook ?
Post by: anorphirith on February 01, 2014, 02:26:27 AM
what would be the language of choice to create a secure and relatively high volume orderbook used on an exchange ?
thanks !


Title: Re: language of choice for a secure orderbook ?
Post by: grue on February 01, 2014, 03:05:47 AM
PHP compiled for the front-end
python would be a better choice.


Title: Re: language of choice for a secure orderbook ?
Post by: empoweoqwj on February 01, 2014, 03:15:46 AM
If you are talking security, the language is relatively unimportant. Its whether you understand the security risks and guard against them. You can achieve this in several languages. For a speedy trading engine, certainly C.


Title: Re: language of choice for a secure orderbook ?
Post by: rethaw on February 01, 2014, 03:54:17 AM
If you are talking security, the language is relatively unimportant. Its whether you understand the security risks and guard against them. You can achieve this in several languages. For a speedy trading engine, certainly C.

Best bet is to get some implementation. Most services fail due to lack of traction, not failure to scale.


Title: Re: language of choice for a secure orderbook ?
Post by: cinderflame on February 01, 2014, 09:59:09 AM
If you are talking security, the language is relatively unimportant. Its whether you understand the security risks and guard against them. You can achieve this in several languages. For a speedy trading engine, certainly C.

Best bet is to get some implementation. Most services fail due to lack of traction, not failure to scale.

I concur.. C would be my choice as well..  ;)


Title: Re: language of choice for a secure orderbook ?
Post by: coinrevo on February 01, 2014, 03:48:31 PM
I hear good things about Plankalkül these days. Its a bit old, but it has excellent support for electric vacuum tubes.

More serious answer: if you can't answer that question its a long road ahead. Essentially there are only 8-10 languages which cover 99% of the market. and for ultra high performance there are 4-5 choices: C, C++, Erlang, Skala, golang + maybe Java, C#.


Title: Re: language of choice for a secure orderbook ?
Post by: empoweoqwj on February 02, 2014, 03:34:00 AM
Why not assembler? - that's well faster than even the best C++ compiler if properly written. It would just take 10 years to write  :D


Title: Re: language of choice for a secure orderbook ?
Post by: daybyter on February 02, 2014, 03:43:56 PM
I also prefer java for some reason. The only reason, I would consider C++, would be operator overloading (I know: dangerous). But those BigDecimal statements just look ugly. Maybe Scala or some jvm language as a compromise?


Title: Re: language of choice for a secure orderbook ?
Post by: empoweoqwj on February 03, 2014, 03:26:37 AM
I also prefer java for some reason. The only reason, I would consider C++, would be operator overloading (I know: dangerous). But those BigDecimal statements just look ugly. Maybe Scala or some jvm language as a compromise?


What's dangerous about operator overloading???


Title: Re: language of choice for a secure orderbook ?
Post by: maaku on February 03, 2014, 07:19:32 AM
This is so very much the wrong way to ask the question. Figure out what your orderbook design will be, and how you will make it consistent at scale. Your strategy for that will determine what databases or locking frameworks you intend to use, and then look at which languages integrate best with that infrastructure.


Title: Re: language of choice for a secure orderbook ?
Post by: rethaw on February 05, 2014, 03:42:20 AM
Quote
"Best bet is to get some implementation. Most services fail due to lack of traction, not failure to scale."

can you elaborate on this ? what do you mean by lack of traction ?
thanks

Lack of traction means people not choosing to use it, and come back to it. If Mt. Gox had waited until they had a full featured socketed API, or DDoS protection, they may not have become such a popular exchange, for example. I would call this the businessman's answer.

This is so very much the wrong way to ask the question. Figure out what your orderbook design will be, and how you will make it consistent at scale. Your strategy for that will determine what databases or locking frameworks you intend to use, and then look at which languages integrate best with that infrastructure.

This is the engineer's answer.


Title: Re: language of choice for a secure orderbook ?
Post by: empoweoqwj on February 05, 2014, 03:51:32 AM
Quote
"Best bet is to get some implementation. Most services fail due to lack of traction, not failure to scale."

can you elaborate on this ? what do you mean by lack of traction ?
thanks

Lack of traction means people not choosing to use it, and come back to it. If Mt. Gox had waited until they had a full featured socketed API, or DDoS protection, they may not have become such a popular exchange, for example. I would call this the businessman's answer.

This is so very much the wrong way to ask the question. Figure out what your orderbook design will be, and how you will make it consistent at scale. Your strategy for that will determine what databases or locking frameworks you intend to use, and then look at which languages integrate best with that infrastructure.

This is the engineer's answer.

Yeah, Gox have still got a dead slow trading engine, and they gone the full business cycle from roaring success to near collapse. Well done Gox!!


Title: Re: language of choice for a secure orderbook ?
Post by: doof on February 05, 2014, 09:54:04 AM
Language won't make much difference. The bottle neck will be at the database.  Depending if your models are just DTOs, or you add business logic in there or get SQL to aggregate on the fly or persisting aggregated values in SQL.

As your grow, you can improve performance by horizontal partitions, or using OLAP cubes to pre aggregate.  Use a cloud provider and just scale when required.  Hosting is cheap, developers are not.

The online retailer i worked for where doing about 4million rows a month in the order items table, without too much pain.


Title: Re: language of choice for a secure orderbook ?
Post by: r3wt on February 05, 2014, 10:00:02 AM
Language won't make much difference. The bottle neck will be at the database.  Depending if your models are just DTOs, or you add business logic in there or get SQL to aggregate on the fly or persisting aggregated values in SQL.

As your grow, you can improve performance by horizontal partitions, or using OLAP cubes to pre aggregate.  Use a cloud provider and just scale when required.  Hosting is cheap, developers are not.

The online retailer i worked for where doing about 4million rows a month in the order items table, without too much pain.

hmm interesting perspective, and i agree the bottle neck will always be the db, though i certainly don't have the experience to be making to many statements in this thread.

for the record, i'm using php compiled with hhvm executed from a shell script. pretty damn fast. takes a second to bitbash the trade table, then about 3 seconds to query all the wallets and check for new deposits.