个人项目——下一个实际的语言/技术学习Personal Project - Next practical language/tech to learn
I'm working on a personal project doing some finance analysis. It's a totally new field for me, and I'm really having fun with it so far, plus working in the high-level language arena is a great break from my embedded systems daytime work.
I have a MySQL backend on a non-local server with a pile of stock data. My task now is to do some analysis of the stocks and produce something approximating a useful result. There are a couple technical difficulties.
(1) I have a lot of records. To be precise, I believe I'm near 100K records right now, and this number grows by 6.1K each weekday. I need to create a way to rummage through these fields and do data analysis - based on a given computation, go look at this other set. Fine and dandy, nothing too outre. But this means I could really use a straightforward API for talking to MySQL.
(2) Ideally, it runs on OS X 10.4.11. No Windows/Linux machine at home.
(3) I can use PHP, C++, Perl, etc. I even have an R installation. I'm pretty flexible with stuff, so long as it runs on OS X. (Lots of options here, pick water, H20, or dihydrogen monoxide ;-) )
(4)Lack of hassle. While I like clever and fun ways of doing things, I'm trying to get some analysis done, not spend ten hours doing installation work and scratching my head figuring out a theoretical syntax question needed to spout out "hello world".
What's the question?
I'd like to dig into something different than my usual PHP/C++/C toolset. I'm looking for recommendations for languages/technologies that will assist me and meet the above requirements.
In particular, I've heard a lot of buzz about F# and Python on SO. I've used CLISP for small problems before, and kinda liked it. I'm seeking opinions about those in particular.
edit:since I rent the DB server and have a limited amount of CPU time online, I'm trying to do the analysis on a local machine.
The easiest would be Python. it's already installed on mac, and has more than reasonably performance for anything SQL related.
if you liked LISP, there's PLT Scheme for mac; but i don't know how well it interfaces to MySQL. Another interesting LISP is arc, i'm still checking it myself, hope to get it to 'practical' uses.
another not so mainstream option is Lua, which does have a SQL libraries, is by far the fastest scripting language, has a very neat and clean syntax, and stays close to language design principles, almost like Scheme.
(原文：I would also second that Lua would not be a terrible option.)jonnii的回复:Lua是工厂困境# 39;年代我的名单上的下一个语言学习。
(原文：Lua is fab, it's next on my hit list of languages to learn.)
What about Ruby, Haskell or Erlang?
(原文：I'm too loopy for Haskell. I looked into it once and couldn't stand the lack of loops. What, specifically, are the benefits of Ruby & Erlang as applied to my situation?)jonnii的回复:我爱写在ruby中,变# 39;伟大的语言,为web merb和rails的东西。两个伟大的web框架。
(原文：I love writing in ruby, it's a great language, and for web stuff you have merb and rails. Two great web frameworks.)
How about going with something completely different, free, and interesting? WebObjects, included with Xcode on your Mac. There's an Eclipse plug-in to provide an IDE for WebObjects development, or you can use Xcode/Textmate/etc.
It'll also simplify some of your development tasks, as you mention in your question. From the Wikipedia article: "Given a data model, WebObjects can automatically create a customizable Web application without writing a single line of code."
(原文：That looks remarkably heavyweight. I'll look into it, it might be a very useful stack to get some knowledge of.)Robert S.的回复:它生成纯Java代码,所以不需要运行时,但我猜& # 39;重量级# 39;可能意味着很多东西。:)
(原文：It generates pure Java code, so no runtime is needed, but I guess 'heavyweight' can mean a lot of things. :))
I'd stick with CLISP, frankly. If you don't know it well yet, then learn that. You may end up writing "PHP in Lisp", but that's not so bad, and CLISP has any language feature you can possibly want, being that it's Common Lisp from which all known language features seem to have derived from at some point or another :-).
Play with CLISP, play with your project, learn some macros. You'll have a good time.
I would suggest Python, although in a few months (after some percolation time) F# might be a better choice.
(原文：Why do you say that, EBGreen?)EBGreen的回复:好吧,我说Python是好的,因为它与大规模数据操作的记录已经证明(见谷歌# 39;使用Python)。它也会让你容易去非常低的水平,容易集成C代码,如果你需要。
(原文：Well, I say Python is good because it has a proven track record with large scale data manipulation (see google's use of python). It would also let you easily go very low level and easily integrate C code if you needed too.)Paul Nathan的回复:为什么你说f#几个月可能是一个更好的选择吗?
(原文：Why would you say F# might be a better choice in a few months?)EBGreen的回复:至于f#可能等待,只是等待他们的是更多的用户仅提供例子。虽然现在我看你的需求,但在Mac上运行可能会阻止f#。我不要,不知道在那里站在Mono环境。
(原文：As for potentially waiting on F#, it is just a matter of waiting for their to be more adopters to just provide examples. Although now that I look at your requirements, the running on a Mac may preclude F#. I don't know where it stands in the Mono environment.)EBGreen的回复:f#提供非常健壮的多线程能力,所以,如果你的数据分析将有助于它,这就是我将f#可能会给你的优势。
(原文：F# provides very robust multi-threading abilities, so if your data analysis would lend itself to it, that is where I would see the advantage that F# might give you.)
You could look at python and ruby with C extensions, scala, clojure, F#, ocaml, haskell, erlang, all the languages that the wide finder submissions are in
如果你考虑Haskell(我不能保证你不会碰到一些理论语法问题),看看这篇文章: 构成合同:金融工程的冒险 http://research.microsoft.com/ simonpj /论文/ papers.html
If you're looking into Haskell (and I can't promise that you won't bump into some "theoretical syntax questions"), check out this paper:
Composing contracts: an adventure in financial engineering
I would recommend to use R for that. It can handle data matrices well (SQL is not suitable for that). I don't have personal experience with it, but I had a colleague who was also dabbling in financial analysis and was very happy with R. But I believe that with other (more general) languages, you would soon run into some library problems, but with R you have everything you need for statistics and large datasets handling. As a next choice, I would use Python, but it's a personal preference and not necessarily better than the others.
Rebol is great for Finance, it's a multi-paradigm (Functional and OOP) language like F# so learning Rebol first could help you tackle F# afterwards.
You can find here a few financial examples:
Derivatives Option Pricer (based on Black & Scholes Formula): http://reboltutorial.com/blog/derivative-options-pricer/
As for data, you can use the free MySQL Driver or even a pure text data file format which can cope with millions of rows: http://reboltutorial.com/blog/mysql/ or http://reboltutorial.com/blog/rebol-sqllinq-like-text-database-engine-blaze-through-millions-of-rows-a-second/
Rebol is also especially great at parsing data see for example parsing google finance csv file http://reboltutorial.com/blog/parse-csv/
- 如何编写一个mysql查询,将读取数据从一个表和写信给另一个?How do I write a mysql query that will read data from one table and write to another?
- 如何使用外键为新表how to use foreign key into new table
- 如果不存在MYSQL:创建表MYSQL: Create Table If Not Exists
- 当我应该使用执照;不是NULL”在MySQL表和有什么好处吗?When should I be using “NOT NULL” in a MySQL table and are there any benefits?
- 你怎么两个语句吗?How do you OR two LIKE statements?
- 个人项目——下一个实际的语言/技术学习Personal Project - Next practical language/tech to learn
- MySQL—;马克1匹配的行MySQL — mark all but 1 matching row
- 什么你读过的最好的书或文章优化mysql服务器(linux)?(关闭)Whats the best book or article you have read on optimizing mysql servers (linux)? [closed]
- 发现差异在MySQL的两个表的行数Finding difference in row count of two tables in MySQL
- 如何设置连接超时根据MySQL用户登录的吗How to setup a connection timeout depending of the user login in MySQL
- MySQL计数(不同的())意想不到的结果MySQL COUNT(DISTINCT()) unexpected results