Still not sure it makes sense. Nice example, but now add the comlex stuff - multiple signals, trading logic.... without making it either a SQL style of debugging hell (i.e. one hugh statement without a proper debugger), or.... well... a generic programming langauge
Thanks. It would be a big project, but worth well doing. That link to NF is interesting. I have done more extensive research on it, and it looks like a good way to do it in .Net is using http://www.codeplex.com/ometasharp
A DSL makes perfect sense. I believe most of if not all of you are missing the number one reason to implement a DSL: once in place, it makes testing new systems and ideas almost trivial. Your productivity in terms of research explodes. One of my mentors in programming told me very early on, the best programmers don't program a solution to a problem, they implement a mini language in which the domain is naturally expressed, and then implement the solution in that system. I have never forgotten that and every day I measure how good a programmer I am by how well I am able to do this. So, if you needed a system to do rendering of documents, you don't program the system to render documents by running a C# program, you invent the .pdf format, and you run an interpreter capable of reading and rendering .pdf formats.
I was told: Programming is about choosing the right set of primitives. The query languages of complex event processing systems look a lot like SQL: http://esper.codehaus.org/ http://coffeeonesugar.wordpress.com/2009/07/21/getting-started-with-esper-in-5-minutes/ From the example below - embedded in some Java code: Code: select * from StockTick(symbol='AAPL').win:length(2) having avg(price) > 6.0 I remember the first editions of Hibernate; their "HQL" language was simply SQL with some search and replace - so this is not necessarily that hard to implement. One idea that you toy could with if you had an event query language is to bind the language together with standard Java/.NET via annontations/attributes: Code: public class MyFirstTradingSystem { @OnEvent("select * from ticks where price > 30.00 and symbol like 'J%'") public void execute(Event event) { // handle the filtered ticks in some standard Java code } } Another interesting platform - focused on model-building / model-exploring: http://www.quantmod.com/ Which sits on top of R.
I like you idea of raising an event on a pattern match native in the language. Also, thanks for the interesting links. I will point out that this idea sort of already exists with LINQ, if you made it "realtime". Here is an attempt to do just this: http://www.codeplex.com/clinq It is still immature to use, but it is the right idea, imo.
BOO now has an installer right into VS2008. http://www.codeplex.com/BooLangStudio Highly recommended, and fast becoming my language of choice for DSLs.
This book here describes DSL amongst others: http://www.manning.com/rahien/ DSL is interesting but one can also do a lot just by utilizing fluent interface programming