tag:blogger.com,1999:blog-6655746112052720933.post174723951644493464..comments2022-03-30T18:43:33.525-05:00Comments on Notes on Haskell: Ruby vs. Haskell: Choose what worksAdam Turoffhttp://www.blogger.com/profile/11941071792943377879noreply@blogger.comBlogger8125tag:blogger.com,1999:blog-6655746112052720933.post-17964163643613155782008-02-21T21:42:00.000-05:002008-02-21T21:42:00.000-05:00Hmn,Yes F# is pretty cool - given it's an OCaml de...Hmn,<BR/>Yes F# is pretty cool - given it's an OCaml descendant, that's hardly surprising! ;)<BR/><BR/>F# does give you access to .NET (the runtime, APIs, etc) and you can presumably integrate Ruby code using IronRuby (though how mature that is right now, I'm not sure). <BR/><BR/>I'd hazard a guess that our host is probably now able to choose a microsoft technology (such as F#) over something with *slightly lower costs*, e.g. RoR. Yes, there are free IDEs & tools and yes I know all about mono (which is v. cool by the way), but for most peeps, choosing .NET means choosing windows, both of which are often political choices more than technological.<BR/><BR/>Both OCaml and Haskell have decent foreign function interfaces (OCaml's is good but a bit clunky, although ocamlidl helps minimize the pain!) and Haskell's is excellent and quite simple to follow. Because of these two points, interfacing between ruby and OCaml and/or Haskell is possible.<BR/><BR/>But wait! Didn't we want to get the heck away from using 'C' to write code! Arrgghhh! :P<BR/><BR/>So my suggestion is this: leave your web front end alone, providing it works. Put something on the back end that is fast and reliable and interface to it *simply* - this probably means *not* using FFI and the like. Pipes or Sockets would make a good choice, unless you're extremely worried about traffic - which I doubt because you're running Rails! :P<BR/><BR/>OCaml has some particularly nice IO features that could help with this - including functions that operate on (unix) file descriptors or sockets alike, using bufferred I/O. In fact, I suspect it wouldn't be at all hard to make (* some Ocaml *) look like a file descriptor to Ruby, giving you a simple touch point.<BR/><BR/>Paul's point about java is a good one. You might now like it, but it's library support is awesome, expecially where things like xml/xslt are concerned. <BR/><BR/>This point bares some repeating I think. I'm writing some server side *stuff* at the moment using Erlang (with bits of OCaml floating around beside it), and the lack of decent library support is a pain, expecially where it comes to xml/xslt processing - which I really need - because there isn't any; at least not that can stand to work with [e.g. xmerl - yuk].This fact means that I'm stuck writing FFI code in C/C++ so that my erlang code can call into libxslt. Not an enjoyable way to spend ones time (although it is - educational, let's say). <BR/><BR/>Think hard about library support pertinent to your problem domain, before rushing into any decisions. <BR/><BR/>Having said that - I love Haskell and would probably choose it in a pinch!Tim Watsonhttps://www.blogger.com/profile/16721228546494454349noreply@blogger.comtag:blogger.com,1999:blog-6655746112052720933.post-57393082141279297332007-02-03T07:31:00.000-05:002007-02-03T07:31:00.000-05:00OCaml is also an excellent language and the derive...OCaml is also an excellent language and the derived language F# gives you access to .NET's XML parsing and Unicode support whilst probably being a lot faster than Haskell (and definitely Ruby, Python etc.).<br /><br />Have a look at F#.Jon Harrophttps://www.blogger.com/profile/11059316496121100950noreply@blogger.comtag:blogger.com,1999:blog-6655746112052720933.post-44410837125556027122007-02-01T13:44:00.000-05:002007-02-01T13:44:00.000-05:00Any thought of working on RubyInline::Haskell? Th...Any thought of working on RubyInline::Haskell? That could be a fun way to bring the two languages closer together.gnupatehttps://www.blogger.com/profile/10492341480170667775noreply@blogger.comtag:blogger.com,1999:blog-6655746112052720933.post-46331742227434851592007-02-01T09:33:00.000-05:002007-02-01T09:33:00.000-05:00Just wondering.
How does the Ruby front end intera...Just wondering.<br />How does the Ruby front end interact with the haskell back end? <br />Only through the database?filippohttps://www.blogger.com/profile/17480111740286441555noreply@blogger.comtag:blogger.com,1999:blog-6655746112052720933.post-32776312683966824882007-02-01T09:21:00.000-05:002007-02-01T09:21:00.000-05:00i think it is funny you mention ActiveRecord on th...i think it is funny you mention ActiveRecord on the backend and then mention that you will just be doing file and xml operations on the data - why mention it, if you are not going to use it? that's a nice bait and switch premise.<br /><br />you would have had a more convincing story if you had coded it in ruby and then told us it wasn't fast enough after optimization. and why haskell? java is the defacto server side language - why did you deviate - is there something wrong with java? now your customer has 2 languages that are not mainstream to support.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-6655746112052720933.post-2707954874167028352007-02-01T08:39:00.000-05:002007-02-01T08:39:00.000-05:00Makes perfect sense to me - in fact I've been pond...Makes perfect sense to me - in fact I've been pondering both the use of compiled Haskell as a backend as well whether it would be possible to call Haskell code directly from my Rails/Ruby apps.Keith Lancasterhttps://www.blogger.com/profile/10483542984438178536noreply@blogger.comtag:blogger.com,1999:blog-6655746112052720933.post-19103625861535629322007-02-01T08:27:00.000-05:002007-02-01T08:27:00.000-05:00You can stay with Ruby using Nitro (http://www.nit...You can stay with Ruby using Nitro (http://www.nitroproject.org). You can go with python that compiles to machine code too. But if you like Haskell you can obvously rewrite to it too ;)Kartesushttps://www.blogger.com/profile/05581004157438311332noreply@blogger.comtag:blogger.com,1999:blog-6655746112052720933.post-48411087878924417882007-02-01T01:34:00.000-05:002007-02-01T01:34:00.000-05:00You might also think about doing the work in Java....You might also think about doing the work in Java. Among other things, you get smoking XML performance, correct Unicode support, and you can integrate your favorite Ruby bits via JRuby. (Not that I'd dissuade you from doing it in Haskell, but Java is looking more and more like an excellent adjunct to Ruby and vice versa.)Anonymousnoreply@blogger.com