Poster | Thread |
Anonymous
| |
Re: The PortablE compiler - AmigaE reborn! Posted on 14-Apr-2006 23:01:07
| | [ # ] |
|
| |
|
|
|
opi
| |
Re: The PortablE compiler - AmigaE reborn! Posted on 14-Apr-2006 23:33:42
| | [ #22 ] |
|
|
|
Team Member |
Joined: 2-Mar-2005 Posts: 2752
From: Poland | | |
|
| |
Status: Offline |
|
|
Bean
| |
Re: The PortablE compiler - AmigaE reborn! Posted on 15-Apr-2006 0:59:30
| | [ #23 ] |
|
|
|
Super Member |
Joined: 4-Apr-2003 Posts: 1225
From: U.K. | | |
|
| @opi
Quote:
Fromage's 99 bottles of beer |
What an excellent page. Look at all those languages!
Cheers, Bean.
_________________ OS4.1 + SAM Flex RIP my A1XE.. that used to have an appetite for batteries! |
|
Status: Offline |
|
|
Anonymous
| |
Re: The PortablE compiler - AmigaE reborn! Posted on 15-Apr-2006 1:12:33
| | [ # ] |
|
| Hi opi,
Well, well, well:
Compare Java to C To BASIC
#include ? #define ? MODULE_AUTHOR("Stefan Scheler "); ?
WHY IS SOMETHING SO SIMPLE such a crime?
And check out C++.
And after all that, the author's comment in the program says "Note that this will probably no compile immediately" on the first try as some other stuff needs to be taken into consideration! What a nightmare!
Then there's JScript/Net. Yuk.
I didn't look through all of them, but that might be the scariest one.
Can it honestly be said that still, anyone can learn this myriad of incomprehensible languages?
I'd rather be trying to find any logic errors than trying to figure out how to write it, and then later what it was that I wrote. |
|
|
|
|
Anonymous
| |
Re: The PortablE compiler - AmigaE reborn! Posted on 15-Apr-2006 1:41:39
| | [ # ] |
|
| Okay, I saw E there and, well, let's just say....Well If you can't say anything nice then....
I took the Basic and modified it to AMOS Pro (The King).
REM Basic version of 99 bottles of beer REM Modified by Atheist REM from prior version found on this site. REM (Modified to correct "1 bottle" grammar)
FOR X=99 TO 3 STEP -1 PRINT X;" bottles of beer on the wall,";X;" bottles of beer" PRINT "Take one down and pass it around,";X-1;" bottles of beer on the wall" NEXT X
PRINT "2 bottles of beer on the wall, 2 bottles of beer" PRINT "Take one down and pass it around, 1 bottle of beer on the wall" PRINT "1 bottle of beer on the wall, 1 bottle of beer" PRINT "Take one down and pass it around," PRINT "No bottles of beer on the wall"
PRINT "We stumble and fall after it all" PRINT "Time to sleee..." |
|
|
|
|
hatschi
| |
Re: The PortablE compiler - AmigaE reborn! Posted on 15-Apr-2006 2:11:25
| | [ #26 ] |
|
|
|
Elite Member |
Joined: 1-Dec-2005 Posts: 2328
From: Good old Europe. | | |
|
| @Atheist
Quote:
I took the Basic and modified it to AMOS Pro (The King). REM Basic version of 99 bottles of beer REM Modified by Atheist |
You definately need to upload this to Aminet. It would make an invaluable addition besides Helgis recently uploaded MODs.
|
|
Status: Offline |
|
|
Hans
| |
Re: The PortablE compiler - AmigaE reborn! Posted on 15-Apr-2006 3:40:03
| | [ #27 ] |
|
|
|
Elite Member |
Joined: 27-Dec-2003 Posts: 5067
From: New Zealand | | |
|
| @Atheist
Quote:
Well, well, well:
Compare Java to C To BASIC
|
Note that this is not a good comparision. The basic version implements the "basic" 99 bottles of beer program. The C version implements it as a Linux device driver. Hence, most of the code required for a Linux driver. The 99 bottles of beer part of the C version is actually the same size (or mabe even a little shorter) than the Basic version. The Java version is trying to show off fancy OOP class stuff. Really, the Java version could have used the core of the C version (minus all the device driver garbage), it's much simpler. Finally, the C++ programmer really wanted to show off his/her skills. Unlike the other versions of this program, the C++ version takes the time to print out the number of bottles of beer as words, not numbers. C++ templates are used to achieve this in a rather clever, but unfortunately difficult to read manner). Once, again totally unnecessary.
The problem with the comparison is that the programs don't do exactly the same thing. Each programmer seems to have added features to their own version rather than following the design specification.
Hans
_________________ http://hdrlab.org.nz/ - Amiga OS 4 projects, programming articles and more. Home of the RadeonHD driver for Amiga OS 4.x project. https://keasigmadelta.com/ - More of my work. |
|
Status: Offline |
|
|
Samurai_Crow
| |
Re: The PortablE compiler - AmigaE reborn! Posted on 15-Apr-2006 4:03:30
| | [ #28 ] |
|
|
|
Elite Member |
Joined: 18-Jan-2003 Posts: 2320
From: Minnesota, USA | | |
|
| @Atheist
-> E version of 99 bottles of beer -> Modified by Samurai_Crow
PROC main() FOR X:=99 TO 3 STEP -1 Writeln(X," bottles of beer on the wall,",X," bottles of beer") Writeln("Take one down and pass it around,",X-1," bottles of beer on the wall") ENDFOR
Writeln("2 bottles of beer on the wall, 2 bottles of beer") Writeln("Take one down and pass it around, 1 bottle of beer on the wall") Writeln("1 bottle of beer on the wall, 1 bottle of beer") Writeln("Take one down and pass it around,") Writeln("No bottles of beer on the wall")
Writeln("We stumble and fall after it all") Writeln("Time to sleee...") ENDPROC
See it's just about identical except that it supports object-oriented code if you need it. That's why AmigaE is one of my favorite languages. Last edited by Samurai_Crow on 15-Apr-2006 at 04:15 AM.
|
|
Status: Offline |
|
|
Anonymous
| |
Re: The PortablE compiler - AmigaE reborn! Posted on 15-Apr-2006 4:50:35
| | [ # ] |
|
| Hi Samurai_Crow,
I'm confused, as in, that's an object? (Not really knowing what one is.)
Also, if it had been a "Procedure" in AMOS Pro, would it not have been in essence, the same thing?
edit -- Silly me, I just noticed that that is exactly what you wrote..... See, I don't like when things like "main()" need to be put in, because as far as I can see, it is "nothing". Meanwhile, Procedures in AMOS Pro, can have variables passed in, or out, and are NOT mentioned, if not actually used.
edit2 -- Also redundant using () AND "" to print strings of text, also := doesn't make any kind of normal sense to me, when in school 2+3=5 sufficed with ONLY one "=" sign, and the SW can cope with only one "=". Also don't like or understand the use of "==". I normally know from looking if there is a comparison or a point to assign it a value. It seems like a deliberate attempt to frustrate and po regular people to me. Last edited by Atheist on 15-Apr-2006 at 05:02 AM. Last edited by Atheist on 15-Apr-2006 at 04:56 AM.
|
|
|
|
|
opi
| |
Re: The PortablE compiler - AmigaE reborn! Posted on 15-Apr-2006 7:56:33
| | [ #30 ] |
|
|
|
Team Member |
Joined: 2-Mar-2005 Posts: 2752
From: Poland | | |
|
| @Atheist
Quote:
See, I don't like when things like "main()" need to be put in |
But it makes your code readable. It says this program starts here. That way, you don't have t o write "what's first, will be on the top".
Quote:
Also redundant using () AND "" to print strings of text |
It's not. () are marking list of parameters, while "" marks the string, that's a parameter for the Writeln function.
Quote:
:= doesn't make any kind of normal sense to me |
It's used to avoid common mistake in if(). If you'll type following code in some C-based languages:
if(atheist = true){ .. }
If will always occur because it reads: if I can make atheist varible equal true. And you wanted to value varible against true, like this:
if(atheist == true){ .. }
It's hard to mistype := in a if()
Quote:
frustrate and po regular people to me. |
That, or maybe you don't have this "it" to program?_________________ OpenWindows Initiative. Port PS3 hardware to bananas. For free. Join today and receive expired $50 cupon from AI! |
|
Status: Offline |
|
|
Mr_Capehill
| |
Re: The PortablE compiler - AmigaE reborn! Posted on 15-Apr-2006 8:55:26
| | [ #31 ] |
|
|
|
Super Member |
Joined: 15-Mar-2003 Posts: 1933
From: Yharnam | | |
|
| @Atheist
I did post Lua & Python examples for you in the BASIC thread. In the end examples are smaller than yours despite of me being a novice in both.
link link
Actually, Python might be a dream come true to those who hate curly brackets...sorry for this off topic rant...anyway, both Lua and Python have an interpreter mode where you can experiment, or you can run the scripts with ease.
EDITed links.
Last edited by Mr_Capehill on 16-Apr-2006 at 12:13 PM.
|
|
Status: Offline |
|
|
Mr_Capehill
| |
Re: The PortablE compiler - AmigaE reborn! Posted on 15-Apr-2006 9:07:57
| | [ #32 ] |
|
|
|
Super Member |
Joined: 15-Mar-2003 Posts: 1933
From: Yharnam | | |
|
| @Atheist
Sorry, but you can also make spaghetti code (non-structural, no classes except the main) in Java if you wish. And that C example, a Linux kernel module??! Same goes for C++. It's pointless to "show off" the language features for trivial hello world type programs. It doesn't serve the purpose.
I can write the 99 beer example in about the same space in C/C++ as you in BASIC.
Last edited by Mr_Capehill on 16-Apr-2006 at 12:30 PM.
|
|
Status: Offline |
|
|
xeron
| |
Re: The PortablE compiler - AmigaE reborn! Posted on 15-Apr-2006 9:15:39
| | [ #33 ] |
|
|
|
Elite Member |
Joined: 22-Jun-2003 Posts: 2440
From: Weston-Super-Mare, Somerset, England, UK, Europe, Earth, The Milky Way, The Universe | | |
|
| @Athiest
You'll never learn another language if you take the attitude that "its not like AMOS! Its too hard! WAH WAH WAH!".
Just accept the fact that other languages are just different to AMOS, but it doesn't make them worse. I used to think like you, a long time ago. Well, not quite. I didn't think everything that wasn't AMOS was hard and therefore not as good, I just thought I wouldn't get the hang of all these "trickier" languages.
However, I taught myself Amiga E and C pretty much at the same time and it only took a few months, and from there I've learnt more than 20 languages.
Just because something doesn't work the same as AMOS, doesn't mean its harder, its just different to how you're used to. You just need to try with a positive attitude instead of "oh, thats not like AMOS, thats no good to me".
Now I wouldn't touch AMOS with a forty foot barge pole. _________________ Playstation Network ID: xeron6 |
|
Status: Offline |
|
|
ChrisH
| |
Re: The PortablE compiler - AmigaE reborn! Posted on 15-Apr-2006 9:16:00
| | [ #34 ] |
|
|
|
Elite Member |
Joined: 30-Jan-2005 Posts: 6679
From: Unknown | | |
|
| @elwood who said Quote:
Could you post an example PortablE source code ? |
Ummm, it (currently) looks almost exactly like AmigaE source code, except that it is typed checked. Well, maybe there are no good examples of AmigaE source code these days, so try this:
PROC main() DEF i, monster[200]:ARRAY OF PTR TO CHAR FOR i := 0 TO 199 DO handleMonster(monster[i]) ENDPROC
PROC handleMonster(monster:PTR TO CHAR) ->do something interesting here! ENDPROC
@Atheist & everyone, please do NOT post here about AMOS or Blitz! This is a thread about PortablE. I am happy to answer your questions about PortablE, but it might be an idea if you first followed the links I provided about AmigaE.Last edited by ChrisH on 15-Apr-2006 at 01:40 PM. Last edited by ChrisH on 15-Apr-2006 at 01:21 PM.
_________________ Author of the PortablE programming language. It is pitch black. You are likely to be eaten by a grue... |
|
Status: Offline |
|
|
Mr_Capehill
| |
Re: The PortablE compiler - AmigaE reborn! Posted on 15-Apr-2006 9:20:24
| | [ #35 ] |
|
|
|
Super Member |
Joined: 15-Mar-2003 Posts: 1933
From: Yharnam | | |
|
| @ChrisH
You can indent with PRE tags and spaces I think.
|
|
Status: Offline |
|
|
elwood
| |
Re: The PortablE compiler - AmigaE reborn! Posted on 15-Apr-2006 11:12:33
| | [ #36 ] |
|
|
|
Elite Member |
Joined: 17-Sep-2003 Posts: 3428
From: Lyon, France | | |
|
| @ChrisH
Ok thanks. I just had the impression that your language wasn't like AmigaE. Now I understand. _________________ Philippe 'Elwood' Ferrucci Sam460 1.10 Ghz AmigaOS 4 betatester Amiga Translator Organisation |
|
Status: Offline |
|
|
ChrisH
| |
Re: The PortablE compiler - AmigaE reborn! Posted on 15-Apr-2006 18:03:20
| | [ #37 ] |
|
|
|
Elite Member |
Joined: 30-Jan-2005 Posts: 6679
From: Unknown | | |
|
| @T_Power who said Quote:
One important consideration is good documentation with MANY, many examples. |
Yeah, once PortablE has matured a bit, I will look into that. But I will be relying on the existing AmigaE documentation until then, plus my own explanation of PortablE's differences. PortablE will be most suited to AmigaE fans until then._________________ Author of the PortablE programming language. It is pitch black. You are likely to be eaten by a grue... |
|
Status: Offline |
|
|
ChrisH
| |
Re: The PortablE compiler - AmigaE reborn! Posted on 15-Apr-2006 18:08:18
| | [ #38 ] |
|
|
|
Elite Member |
Joined: 30-Jan-2005 Posts: 6679
From: Unknown | | |
|
| @BigBentheAussie who said Quote:
So, I'm a little confused as to why you would target possibly the least portable language first. |
Not sure whether you're talking about AmigaE or OPL, but lots of reasons in both cases: 1. I know the language very well, having used it a lot. 2. The language is supported by my favourite OSes, which is good enough for me! 3. They don't have any real type checking, which makes it easier.
Also, I originally started working on PortablE so that I could generate OPL code for use on my Psions. That reason still exists!_________________ Author of the PortablE programming language. It is pitch black. You are likely to be eaten by a grue... |
|
Status: Offline |
|
|
wegster
| |
Re: The PortablE compiler - AmigaE reborn! Posted on 15-Apr-2006 21:39:36
| | [ #39 ] |
|
|
|
Elite Member |
Joined: 29-Nov-2004 Posts: 8554
From: RTP, NC USA | | |
|
| @opi Looks like, err, BF is gone now? Bummer, not that anyone would WANT to really use it, still funny tho.
It's almost too bad the 99 bottle site wasn't more strict, some of the examples are WAY beyond the minimum..
_________________ Are we not done with the same silly arguments and flames yet??! |
|
Status: Offline |
|
|
ChrisH
| |
Re: The PortablE compiler - AmigaE reborn! Posted on 16-Apr-2006 10:33:43
| | [ #40 ] |
|
|
|
Elite Member |
Joined: 30-Jan-2005 Posts: 6679
From: Unknown | | |
|
| @ChrisH who said Quote:
what I was planning was something completely new to me (maybe even UNbelievable), so I had no way to know how long it would take, or even if I could achieve it. | (Oh dear, talking to myself now!)
I'm not even sure if anyone has ever done anything like PortablE before - when I did a search for programming language translators I came across some (e.g. a 50k line ADA to C translator that didn't even produce fully legal code!), but nothing that was designed to output to more than one language..._________________ Author of the PortablE programming language. It is pitch black. You are likely to be eaten by a grue... |
|
Status: Offline |
|
|