Reply by Erik de Castro Lopo March 9, 20112011-03-09
Erik de Castro Lopo wrote:

> Paul Rubin wrote: > > > Anyway, try googling "evil mangler" > > I know what the "evil mangler" is. It was called that because it > threw away all the principles of good software design in favour > of expediency. GHC now has a new LLVM backend which does not > depend on the evil mangler and I strongly suspect that the backend > which uses the evil mangler will be dumped in the next year or > two.
I have some more information about the replacement of the Evil Mangler. According to this paper: http://llvm.org/pubs/2010-09-HASKELLSYM-LLVM-GHC.pdf the new LLVM backend for the GHC compiler still has a mangler phase, but the new LLVM Mangler is 180 lines of heavily commented Haskell code which replaces a 2000 lines of poorly commented Perl script. Full disclosure: the Perl mangler needs to parse the GNU assembler code while the Haskell mangler only needs to operate on data structures already defined elesewhere. However, the Evil Mangler only handled a small subset of CPU architectures, while the new LLM Mangler works on the architecture independent LLVM intermediate representation.
> > and ask why it wasn't done in Haskell. Same idea. > > Expediency over common sense?
Ignoring the parsing issue, this shows that Haskell was certainly up to the task of doing everything the Evil Mangler was doing. Erik -- ---------------------------------------------------------------------- Erik de Castro Lopo http://www.mega-nerd.com/
Reply by Erik de Castro Lopo March 2, 20112011-03-02
Fred Marshall wrote:

> Python was recommended as one of the languages one might ought to learn > - along with Lisp as I recall. I can program in Fortran, have done some > programs in C and am not doing enough to stay well-practiced. So, I > thought a Python adventure might be worthwhile. And I rather like the > idea of being able to run scripts on an interpreter.
Ok, if you're not doing enough C to stay practiced then I would agree that Python is a better choice than either Ocaml or Haskell. The main reason for this is the simplicity of Python. Ocaml and Haskell do require more thought and are significantly less forgiving for people who only program ocassionally. I suppose my exasperation on the rush to Python is better directed towards people who choose to code widely used applications in a language that can hide so many errors until run time. Erik -- ---------------------------------------------------------------------- Erik de Castro Lopo http://www.mega-nerd.com/
Reply by Fred Marshall March 1, 20112011-03-01
On 3/1/2011 12:43 AM, Erik de Castro Lopo wrote:
> Fred Marshall wrote: > >> I'm interested in developing Python-based programs, including an >> engineering app. ... re-writing from Fortran and C versions. One of the >> objectives would to be make reasonable use of the available structure >> (objects, etc.). So, I'd like to read a couple of good, simple >> scientific-oriented programs that do that kind of thing. > > Why Python? I really can't understand the rush of every man and > his dog to Python. > > Its not that I'm a stick in the mud stuck with C and C++, rather > that I used Python for a number of years from 1998 to 2004 and > rejected it in favour of strict statically typed functional > langauges like Ocaml and Haskell. > > Erik
Erik, Thanks much for the reply. I'll save by not cross-posting... Python was recommended as one of the languages one might ought to learn - along with Lisp as I recall. I can program in Fortran, have done some programs in C and am not doing enough to stay well-practiced. So, I thought a Python adventure might be worthwhile. And I rather like the idea of being able to run scripts on an interpreter. My Microssoft IDE is quite old and I've never done any Windows or GUI programming. Yet I have an app that I'd like to have a GUI front end. So that was a rather immediate objective. Then, to get familiar, I thought I'd port one of my Fortran/C programs to the new language. I don't particularly want to buy tools as my use is pretty limited if and when I get around to actually doing it. As it stands I'm chipping away at installing Python pieces.... So I guess you could say that my requirements are: - available tools - GUI capabilities - not particularly huge or hard to learn.... - reasonable libraries available Fred
Reply by mblume March 1, 20112011-03-01
Am Mon, 28 Feb 2011 08:03:01 -0800 schrieb Fred Marshall:

> I'm interested in developing Python-based programs, including an > engineering app. ... re-writing from Fortran and C versions. One of the > objectives would to be make reasonable use of the available structure > (objects, etc.). So, I'd like to read a couple of good, simple > scientific-oriented programs that do that kind of thing. > > Looking for links, etc. > > Fred
An execellent book in this domain is "Python Scripting for Computational Science" by Hans Petter Langtangen Springer, ISBN 3-450-43508-5 HTH. Martin
Reply by Erik de Castro Lopo March 1, 20112011-03-01
Paul Rubin wrote:

> Erik de Castro Lopo <erikd@mega-nerd.com> writes: > > Why Python? I really can't understand the rush of every man and > > his dog to Python. > > Are you trolling?
All my responses to this thread are really mean for comp.dsp, not for comp.lang.python. Erik -- ---------------------------------------------------------------------- Erik de Castro Lopo http://www.mega-nerd.com/
Reply by Erik de Castro Lopo March 1, 20112011-03-01
Paul Rubin wrote:

> Erik de Castro Lopo <erikd@mega-nerd.com> writes: > > Why Python? I really can't understand the rush of every man and > > his dog to Python. > > Are you trolling?
Definitely not. As I said I used Python for a number of years and ditched it in favour of Ocaml and Haskell. The ease of development and high level language features of Python look really good if all you know is C, C++ and Java. The big difference Python and those three languages is that there are a huge number of classes of bugs which are run time errors in Python but compile time errors in C/C++/Java. I will always chose compile time errors over run time errors.
> Anyway, try googling "evil mangler"
I know what the "evil mangler" is. It was called that because it threw away all the principles of good software design in favour of expediency. GHC now has a new LLVM backend which does not depend on the evil mangler and I strongly suspect that the backend which uses the evil mangler will be dumped in the next year or two.
> and ask why it wasn't done in Haskell. Same idea.
Expediency over common sense? Erik -- ---------------------------------------------------------------------- Erik de Castro Lopo http://www.mega-nerd.com/
Reply by Martin De Kauwe March 1, 20112011-03-01
On Mar 1, 3:03&#2013266080;am, Fred Marshall <fmarshallxremove_th...@acm.org>
wrote:
> I'm interested in developing Python-based programs, including an > engineering app. ... re-writing from Fortran and C versions. &#2013266080;One of the > objectives would to be make reasonable use of the available structure > (objects, etc.). &#2013266080;So, I'd like to read a couple of good, simple > scientific-oriented programs that do that kind of thing. > > Looking for links, etc. > > Fred
you could try searching here http://pypi.python.org/pypi. I had a look for models, but didn't find anything in particular. But would be really useful if anyone does know of some good examples
Reply by Paul Rubin March 1, 20112011-03-01
Erik de Castro Lopo <erikd@mega-nerd.com> writes:
> Why Python? I really can't understand the rush of every man and > his dog to Python.
Are you trolling? Anyway, try googling "evil mangler" and ask why it wasn't done in Haskell. Same idea.
Reply by Richard Dobson March 1, 20112011-03-01
On 01/03/2011 08:43, Erik de Castro Lopo wrote:
> Fred Marshall wrote: > >> I'm interested in developing Python-based programs, including an >> engineering app. ... re-writing from Fortran and C versions. One of the >> objectives would to be make reasonable use of the available structure >> (objects, etc.). So, I'd like to read a couple of good, simple >> scientific-oriented programs that do that kind of thing. > > Why Python? I really can't understand the rush of every man and > his dog to Python. > > Its not that I'm a stick in the mud stuck with C and C++, rather > that I used Python for a number of years from 1998 to 2004 and > rejected it in favour of strict statically typed functional > langauges like Ocaml and Haskell. >
My understanding is/was that Guido originally proposed Python as the replacement for BASIC; i.e. to be the new first language students at school would be exposed to. So rather than compare it to C and C++, I suppose one should, strategically speaking, compare it to Visual Basic and/or Java. The other aspect is purely pragmatic - it has bindings for tk, MIDI and audio (and of course Csound as you know), which adds up to a fairly hefty scripting package complete with GUI design options - great for "knocking up stuff quickly". But - I am ~still~ caught out by the semantic significance of indenting. Looks OK enough on paper, but doing it interactively is another matter. Richard Dobson
Reply by Erik de Castro Lopo March 1, 20112011-03-01
Fred Marshall wrote:

> I'm interested in developing Python-based programs, including an > engineering app. ... re-writing from Fortran and C versions. One of the > objectives would to be make reasonable use of the available structure > (objects, etc.). So, I'd like to read a couple of good, simple > scientific-oriented programs that do that kind of thing.
Why Python? I really can't understand the rush of every man and his dog to Python. Its not that I'm a stick in the mud stuck with C and C++, rather that I used Python for a number of years from 1998 to 2004 and rejected it in favour of strict statically typed functional langauges like Ocaml and Haskell. Erik -- ---------------------------------------------------------------------- Erik de Castro Lopo http://www.mega-nerd.com/