[Chicago] Who suggested that I study Ocaml?

Lewit, Douglas d-lewit at neiu.edu
Thu Aug 27 18:17:57 CEST 2015


Sometimes Josh you gotta visit other cities in order to fully appreciate
where you live!  No, not an advertisement for Ocaml!  That's not my
purpose.  But I think it's useful to take a peek at other programming
languages, especially since Python is often called upon to glue together
apps written in other languages.

On Thu, Aug 27, 2015 at 9:14 AM, Joshua Herman <zitterbewegung at gmail.com>
wrote:

> Thats not the point I am trying to make. The purpose of the list is to
> discuss python. The email that the person sent looks like an advertisement
> for ocaml. There are other mailing lists to allow for general discussion
> about programming languages.
>
> This is the only paragraph about python
>
> "I wouldn't mind trying this in Python as well, but I've noticed that
> algorithms that are intensively recursive can be very slow in Python.
> Supposedly (according to my reading on the subject) functional languages
> such as Standard ML, Ocaml and Haskell are usually pretty strong when it
> comes to quickly implementing recursive functions.  What's the reason for
> that?  I have no clue!"
>
>
> On Thu, Aug 27, 2015 at 7:37 AM, Osman Siddique <osiddique at gmail.com>
> wrote:
>
>> "If you're not interested in Ocaml, no sweat!  Just delete the email!"
>>
>> next time, maybe put this at the top of the email instead of the third
>> paragraph.
>>
>> On Thu, Aug 27, 2015 at 6:34 AM, Joshua Herman <zitterbewegung at gmail.com>
>> wrote:
>>
>>> I don't understand how this is on topic for the list?
>>> On Thu, Aug 27, 2015 at 4:19 AM Lewit, Douglas <d-lewit at neiu.edu> wrote:
>>>
>>>> Hey guys and gals in Python Land:
>>>>
>>>> Most everyone on the list is going to think I'm nuts!  About a month
>>>> ago someone suggested that I study Ocaml.  Was it Phil Robare?  Well,
>>>> anyhow I accepted the challenge and for the past few weeks I've been diving
>>>> headfirst into the world of Ocaml.  Interesting!  And now I really DO
>>>> appreciate the elegant simplicity of Python!  That being said I'm kind of
>>>> happy with some of my work in Ocaml.  If you have access to the Ocaml
>>>> compiler--and if you care--if you don't, no sweat!, then you might want to
>>>> check out these files.  Just a heads up.  Formatter.ml is a module that
>>>> contains functions used by Mortgage_Calculator.ml, so you would have to
>>>> compile Formatter.ml first and then compile Mortgage_Calculator.ml.  Also,
>>>> when the program asks for a "tolerance", I suggest entering a value between
>>>> 0.20 and 1.00, your choice.  DO NOT enter a value less than 0.10 because
>>>> then the program might crash.  The mortgage payment is found recursively,
>>>> starting with the assumption that your payment is ( interest rate as a
>>>> decimal ) * ( amount borrowed ).  This is always an underestimate of
>>>> course.  The function calls itself repeated until finally the remaining
>>>> balance is very, very close to 0.  It will never be exactly 0 however
>>>> because of the limitations of floating point arithmetic.  Therefore, I
>>>> require the end user to enter a tolerance.  If you owe 20 cents on your
>>>> mortgage at the very end, then hey, that's pretty darn good!  That's
>>>> extremely close to 0, especially if you borrowed $400,000 to buy your condo
>>>> or house.  In some cases the recursion is a wee bit slow, so give your
>>>> computer about a minute or so to figure it out.
>>>>
>>>> I wouldn't mind trying this in Python as well, but I've noticed that
>>>> algorithms that are intensively recursive can be very slow in Python.
>>>> Supposedly (according to my reading on the subject) functional languages
>>>> such as Standard ML, Ocaml and Haskell are usually pretty strong when it
>>>> comes to quickly implementing recursive functions.  What's the reason for
>>>> that?  I have no clue!
>>>>
>>>> If you're not interested in Ocaml, no sweat!  Just delete the email!
>>>> Oh yes.... I was fishing around in my file system and noticed something
>>>> kind of weird.  I have files with the name "Ocaml" in them, but they have a
>>>> .py extension!  So.... not sure what that means.  I guess Ocaml can call
>>>> Python commands or maybe Python can call Ocaml commands?  Kind of
>>>> interesting!
>>>>
>>>> Thanks,
>>>>
>>>> Douglas.
>>>>
>>>> P.S.  I believe these are the correct linking and compiling commands in
>>>> Terminal.  (Did this with a Mac that has the Ocaml compiler installed on
>>>> it. )
>>>>
>>>> ocamlopt -c Formatter.ml
>>>>
>>>> ocamlopt Formatter.cmx unix.cmxa -o Mortgage_Calculator
>>>> Mortgage_Calculator.ml
>>>>
>>>> That should work, I hope!
>>>> _______________________________________________
>>>> Chicago mailing list
>>>> Chicago at python.org
>>>> https://mail.python.org/mailman/listinfo/chicago
>>>>
>>>
>>> _______________________________________________
>>> Chicago mailing list
>>> Chicago at python.org
>>> https://mail.python.org/mailman/listinfo/chicago
>>>
>>>
>>
>> _______________________________________________
>> Chicago mailing list
>> Chicago at python.org
>> https://mail.python.org/mailman/listinfo/chicago
>>
>>
>
> _______________________________________________
> Chicago mailing list
> Chicago at python.org
> https://mail.python.org/mailman/listinfo/chicago
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/chicago/attachments/20150827/6886fe18/attachment.html>


More information about the Chicago mailing list