PortablE r5 released (now runs on MorphOS)
  • Order of the Butterfly
    Order of the Butterfly
    ChrisH
    Posts: 167 from 2009/11/26
    PortablE_small_logo.PNG
    A new version of PortablE has been released. PortablE is an AmigaE compiler, written from scratch in E, and able to compile itself. It supports Windows, Amiga OS3, OS4, AROS & MorphOS.


    This release has focused on optimising PortablE, although other things were also done:

    * Experimental MorphOS support (for C++), including MOS executables! MUI seems to work.

    * Modules provided by others for AHI, CD_Play, FreeDB, MPEGA & some MUI bits.

    * PortablE is up to 65% faster than before.

    * PortablE's memory usage has been halved! Now similar to GCC's.

    * MUI programs with custom classes can now be compiled by AmiDevCpp for OS3.

    * Added emulation of AmigaE's ! (floating-point) operator to the compatibility mode.

    * FastNew is implemented using an enhanced TLSF algorithm, greatly reducing memory usage.

    * Programs produced by PortablE run faster, and PEGCC produces smaller executables.

    * Lists are now truely stack-allocated, rather than being dynamically faked.

    * Implemented the missing string formatting codes (\l, \r, \z, [w] & (x,y)) for C++.

    * For speed, multi-threading support is now disabled unless you use OPT MULTITHREADED.

    * Directory scanning is now much more robust on Windows.

    * Improved documentation; clickable links, added bold/etc & special characters now visible.

    * More examples of portable code.

    * Various bug fixes.


    If you want to find out more, or wish to download it, then please visit it's home page:
    http://cshandley.co.uk/portable
    Author of the PortablE programming language.
    It is pitch black. You are likely to be eaten by a grue...
  • »27.11.09 - 14:35
    Profile Visit Website
  • Order of the Butterfly
    Order of the Butterfly
    ChrisH
    Posts: 167 from 2009/11/26
    Please note that someone has reported that the Installer hangs in a busy-loop for him. I'd appreciate hearing if this does or does not happen to anyone else. (I do not have a MOS machine, and so cannot heavily test it for MOS.)

    In any case, manual installation instructions are also provided.

    [ Edited by ChrisH on 2009/11/27 13:58 ]
    Author of the PortablE programming language.
    It is pitch black. You are likely to be eaten by a grue...
  • »27.11.09 - 14:47
    Profile Visit Website
  • Acolyte of the Butterfly
    Acolyte of the Butterfly
    Leif
    Posts: 111 from 2006/5/31
    From: Sweden
    Quote:


    In any case, manual installation instructions are also provided.



    Where ? I can't seem to find them. I don't like installing with an executable
    but prefer a somewhat readable script (either installer or shell).
  • »27.11.09 - 16:21
    Profile
  • MorphOS Developer
    itix
    Posts: 1520 from 2003/2/24
    From: Finland
    I can confirm it hangs on my machine. You probably should try create non-ixemul build.
    1 + 1 = 3 with very large values of 1
  • »27.11.09 - 22:47
    Profile
  • Order of the Butterfly
    Order of the Butterfly
    ChrisH
    Posts: 167 from 2009/11/26
    @leif
    Please read the INSTALL_AMIGA.txt file for installation instructions!

    Sorry about the binary installer, but it allowed me to have one installer solution for all supported platforms (including Windows).
    Author of the PortablE programming language.
    It is pitch black. You are likely to be eaten by a grue...
  • »28.11.09 - 09:01
    Profile Visit Website
  • Order of the Butterfly
    Order of the Butterfly
    ChrisH
    Posts: 167 from 2009/11/26
    OK, please wait a while, I will recompile the installer with -noixemul, then we can see if that helps.

    The problem may be nothing to do with ixemul, because I have had small MUI programs (compiled by AmiDevCpp) reported as working.

    [ Edited by ChrisH on 2009/11/28 8:39 ]
    Author of the PortablE programming language.
    It is pitch black. You are likely to be eaten by a grue...
  • »28.11.09 - 09:02
    Profile Visit Website
  • Order of the Butterfly
    Order of the Butterfly
    ChrisH
    Posts: 167 from 2009/11/26
    @itix
    I had forgotten, but -noixemul has no effect on AmiDevCpp, when compiling for MorphOS :-(

    If you are able to try compiling it yourself, to see if it makes a difference, I have put the C++ code here:
    http://cshandley.co.uk/temp/InstallPortablE_MorphOS.zip
    Author of the PortablE programming language.
    It is pitch black. You are likely to be eaten by a grue...
  • »28.11.09 - 09:16
    Profile Visit Website
  • Acolyte of the Butterfly
    Acolyte of the Butterfly
    Leif
    Posts: 111 from 2006/5/31
    From: Sweden
    Quote:


    please read the INSTALL_AMIGA.txt file for installation instructions!



    Ah thx, not sure how I could miss that one :)
    Seems I installed it correctly anyway..
    The txt misses to mention you need to increase stack in shell to atleast
    100KB. (compiler complains about this) But this is the 68k stack
    (PPC stack cannot even be changed by user in MorphOS).
    You need to use NewPPCStackSwap() function in MorphOS to change the PPC stack.

    Now, compiling examples/gadtoolsgadgets.e requires a whopping 100MB
    on my system, and MUI stuff not even possible to compile because
    it runs out of memory and eventually crashes. I have about 160MB
    memory left before I try.
    GCC (2.95.3) uses way way less memory for similar sources,
    so I guess this is some kind of bug.

    Trying the AmigaOS3 version of the compiler it seems memory usage drops
    to half of the MorphOS version, though.
  • »28.11.09 - 10:09
    Profile
  • MorphOS Developer
    itix
    Posts: 1520 from 2003/2/24
    From: Finland
    Quote:


    I had forgotten, but -noixemul has no effect on AmiDevCpp, when compiling for MorphOS



    Are you sure? Such compiler is seriously bugged and I recall jahc is using AmiDevCpp to build MorphOS executables.

    Quote:


    If you are able to try compiling it yourself, to see if it makes a difference, I have put the C++ code here:



    It sort of works now. I had to add following lines to code:

    Quote:


    } else if( StrCmp(pe_TargetOS, (char*) "MorphOS")) {
    tempFolder = (char*) "Executables/MorphOS/";



    I also see you are using following subroutine to set an OS string:

    Quote:


    void new_base2() {
    pe_TargetOS = (char*) "MorphOS";
    return ;



    You can change this to:

    Quote:


    void new_base2() {
    #if defined(__MORPHOS__)
    pe_TargetOS = (char*) "MorphOS";
    #else
    pe_TargetOS = /* ... */
    #endif
    return ;
    }



    There are defines to detect Windows, OS3, OS4 and AROS at compile time: WIN32, AMIGA (can mean OS3, OS4, AROS or MorphOS), __amigaos4__ and __AROS (IIRC).

    There is also an error with installer code:

    Quote:


    Welcome to PortablE's basic installer.

    Destination for executables is "ram:" (must be in command path).
    Is this destination folder OK [Y/N]? y

    Destination for PEmodules is "Work:PEmodules".
    Is this destination folder OK [Y/N]? n
    What folder do you want to use? ram:PEmodules
    This folder does not exist. Do you want to create it [Y/N]? y

    Destination for PEmodules is "ram:PEmodules".
    Is this destination folder OK [Y/N]? y

    Your installation choices are:
    Destination for executables is "ram:" (must be in command path).
    Destination for PEmodules is "ram:PEmodules".
    Is it OK to proceed with installation [Y/N]? y

    Copying executables, please wait...
    WARNING: Failed to copy "Executables/MorphOS/PortablE" to "ram:/PortablE".
    Copying PEmodules, please wait...
    Added PEmodules: assignment to "S:User-Startup".
    Checking for obsolete modules, please wait...

    WARNING: Installation was not entirely successful.



    The default dir suggested by installer was C: and C:/Portable would have worked in that case.

    [ Edited by itix on 2009/11/28 12:26 ]
    1 + 1 = 3 with very large values of 1
  • »28.11.09 - 11:23
    Profile
  • MorphOS Developer
    itix
    Posts: 1520 from 2003/2/24
    From: Finland
    Quote:


    You need to use NewPPCStackSwap() function in MorphOS to change the PPC stack.



    You can automatize it. If it is an ixemul build you can set stack using ixstack program and for non-ixemul builds you can add following line to your code:

    Quote:


    int __stack = 100000; // stack size in bytes



    Latter also works on OS3 builds if libnix is used.
    1 + 1 = 3 with very large values of 1
  • »28.11.09 - 11:28
    Profile
  • Yokemate of Keyboards
    Yokemate of Keyboards
    amigadave
    Posts: 2795 from 2006/3/21
    From: Northern Calif...
    Is there a brief description somewhere of the advantages of Amiga "E", or PortablE over other programming languages, such as C, C++, etc. that I can read to find out more about it?
    MorphOS - The best Next Gen Amiga choice.
  • »28.11.09 - 11:34
    Profile
  • Order of the Butterfly
    Order of the Butterfly
    ChrisH
    Posts: 167 from 2009/11/26
    @itix
    My mistake: AmiDevCpp does support -noixemul :-) so I'll use that from now on.

    Quote:

    It sort of works now. I had to add following lines to code:

    Ooops, seems I forgot to add the MorphOS source directory, that explains it :-( . Many thanks for spotting that.

    I'll provide an updated package ASAP.

    Quote:

    The default dir suggested by installer was C: and C:/Portable would have worked in that case.

    Sorry, can you please clarify if "C:" did actually work?
    Author of the PortablE programming language.
    It is pitch black. You are likely to be eaten by a grue...
  • »28.11.09 - 13:05
    Profile Visit Website
  • Order of the Butterfly
    Order of the Butterfly
    ChrisH
    Posts: 167 from 2009/11/26
    @all
    Sorry for the Installer oversight. I have now uploaded a fixed version (r5a). Please let me know of any other problems...
    Author of the PortablE programming language.
    It is pitch black. You are likely to be eaten by a grue...
  • »28.11.09 - 14:22
    Profile Visit Website
  • Order of the Butterfly
    Order of the Butterfly
    ChrisH
    Posts: 167 from 2009/11/26
    @all
    In my haste to fix it, the old version of the installer managed to get into r5a :-( , so I have had to re-release it (as r5b). Please download again...
    Author of the PortablE programming language.
    It is pitch black. You are likely to be eaten by a grue...
  • »28.11.09 - 15:25
    Profile Visit Website
  • Order of the Butterfly
    Order of the Butterfly
    ChrisH
    Posts: 167 from 2009/11/26
    @amigadave Quote:

    Is there a brief description somewhere of the advantages of Amiga "E", or PortablE over other programming languages, such as C, C++, etc. that I can read to find out more about it?

    I gave some thought to this, but the honest answer is no. There are perhaps some long and/or technical descriptions as to why, but nothing short.

    My short answer would be:
    * E (all AmigaE descendants) is IMHO much more readable than C/C++, since (for example) it favours keywords over cryptic symbols, and it also avoids overloading symbols with multiple meanings that depend on context. You can learn to read C/C++ well, but I think most people will find that a lot of effort, and I think E is a lot easier.

    * E has many functions built-in, so no need to put a load of boiler-plate #include<std/*> at the top of every source code.

    * It also avoids much of the type-casting nightmare of C/C++. AmigaE itself has no type checks, while PortablE adds one that (attempts to) learn from the mistakes of C/C++ (and not burden the user more than it helps him).

    * I believe that PortablE has a nicer Object Orientated Programming model than C++, which is full of tons of "gotchas", even if it is technically more powerful (and so experts may find it better suited to certain tasks).

    I cover some of these points (as well as others) in a lot more detail here:
    http://cshandley.co.uk/CppConsideredHarmful.html

    [ Edited by ChrisH on 2009/12/3 12:03 ]
    Author of the PortablE programming language.
    It is pitch black. You are likely to be eaten by a grue...
  • »03.12.09 - 13:02
    Profile Visit Website
  • MorphOS Developer
    CISC
    Posts: 619 from 2005/8/27
    From: the land with ...
    @ChrisH:

    Please don't group that horrible beast with the ill conceived name C++ with C, thank you. ;)</rant>


    - CISC
  • »03.12.09 - 13:35
    Profile
  • Order of the Butterfly
    Order of the Butterfly
    ChrisH
    Posts: 167 from 2009/11/26
    @CISC
    Sorry! I agree that C++ is an abomination of some appalling experiment gone wrong. Where-as I think C is merely a "so-so" language that has some poor choices (but if you don't mind it's limitations then I can certainly imagine you could learn to like it).
    Author of the PortablE programming language.
    It is pitch black. You are likely to be eaten by a grue...
  • »03.12.09 - 15:35
    Profile Visit Website
  • Order of the Butterfly
    Order of the Butterfly
    koan
    Posts: 303 from 2005/11/21
    From: UK
    Hi ChrisH,

    I read your comparison and comments posted here.

    I use C++ a lot and C to some extent. I can understand why you don't
    like C++, there are many things I would prefer to change too.

    However, all of your commentary is very subjective. Basically,
    C++ is not strongly typed enough for you and you make mistakes (?)
    To other people, concepts like polymorphism are actually very
    powerful and make many tasks much easier. Programmers
    can make bugs using any language.

    So far I haven't come across anything significantly better than
    C/C++. Google's Go looks interesting but probably not suitable
    for desktop applications. Java has many annoyances. And so on.

    Anyway, I did not come here to debate programming languages.
    I think you should stick to emphasising what is good about E
    rather than what seems like a long rant against C++.

    Perhaps you can enlighten us to any advantages that E might have
    over C for writing MorphOS applications?
  • »03.12.09 - 16:12
    Profile
  • Order of the Butterfly
    Order of the Butterfly
    ChrisH
    Posts: 167 from 2009/11/26
    @koan Quote:

    Basically, C++ is not strongly typed enough for you and you make mistakes (?)

    No, if anything C++ is TOO strongly typed in some situatiations. I specifically relaxed PortablE's type-checking, to try to find a balance between "too strong" & "non-existent".

    Quote:

    To other people, concepts like polymorphism are actually very powerful and make many tasks much easier.

    Where did I say polymorphism was bad?!? E has this, and I use it all the time. Unless you are talking about ad-hoc polymorphism, which I do (in general) dislike, even if it may occasionally have it's uses.

    Quote:

    I think you should stick to emphasising what is good about E rather than what seems like a long rant against C++.

    The page I linked to was SUPPOSED to be a "rant" against C++ :-) , hence the title! I agree that complaining about C++ in general is not a good idea, because that upsets C++ fans, which is why I try to avoid doing it.

    But it seems rather hard to explain how E does something better, without comparing it to something else. "Good" implies there is a "bad". "Better" implies there is a "worse". It would be a bit like trying to explain light without darkness (to a blind person), or peace without war, etc. Possibly it can be done, but I don't think it can be done succinctly (which was what was asked for).

    [ Edited by ChrisH on 2009/12/4 8:40 ]
    Author of the PortablE programming language.
    It is pitch black. You are likely to be eaten by a grue...
  • »04.12.09 - 09:36
    Profile Visit Website
  • Acolyte of the Butterfly
    Acolyte of the Butterfly
    Leif
    Posts: 111 from 2006/5/31
    From: Sweden
    @koan

    A starting point might be the wikipedia description of AmigaE:

    "Amiga E's main benefits are fast compilation (allowing it to be used in place of a scripting language), very readable source code, flexible type system, powerful module system, exception handling (not C++ variant) and Object oriented programming."

    Personally I'd remove the "..used in place of scripting language" part. Not that it could not work that way, but it is hardly something E is commonly used for.

    The module system is afaik quite unique. Sure pascal/modula has module systems
    but they are in no way as powerful as in AmigaE. The exception handling is very nice
    unlike the retarded (oops there came the bashing of another language) thing C++ has.

    One obvious disadvantage is the small number of people actually using the language,
    as a result of compilers only being available on AmigaOS(like) systems.

    In the end, it is about the whole package.. try it out, look at sources, compile stuff, etc

    My personal description of AmigaE/ECX:
    It get things done with minimal amount of fuzz,
    the compiler does not try to outsmart me as a programmer,
    the language has a nice mix of high and low level features,
    In general "working" i E is comfortable and fun.
    Compilers are stable, efficient and quite bug free.

    Note: I do not consider PortablE to be "AmigaE" it breaks too much stuff, even fundamental things. AmigaE inspired/based is a better word. Just for the sake of clearity. I hope Chris doesnt get too upset now :)

    Some links:
    AmigaE http://strlen.com/e
    ECX http://blubbedev.net/ecx
  • »04.12.09 - 12:35
    Profile
  • Yokemate of Keyboards
    Yokemate of Keyboards
    amigadave
    Posts: 2795 from 2006/3/21
    From: Northern Calif...
    Thanks for the reply ChrisH & Leif, as someone who is learning to program and who has not mastered any one language, it is always interesting to learn the pros and cons of different programming languages and see comparisons. If I were 18 again, I would have plenty of time to learn a dozen programming languages and pick which ones I liked the most and wanted to use. Being 53+, I tend to lean on what other programmers have learned over the years to try to avoid wasting my precious time and shorten the time it will take me to become productive (if ever).

    [ Edited by amigadave on 2009/12/4 21:04 ]
    MorphOS - The best Next Gen Amiga choice.
  • »05.12.09 - 05:03
    Profile