![]() |
![]() |
#301 | ||||||||
Registered User
Join Date: Sep 2007
Location: Stockholm
Posts: 4,348
|
Quote:
Quote:
Quote:
Of course, the exact names of these statements may be haphazard, and I think it took me fifteen years to understand what WEND meant. COMAL tries to sort this out by unifying the format of the block terminators – e.g. FOR…ENDFOR, IF…ENDIF, WHILE…ENDWHILE and so forth. Quote:
Lisp may not be so bad, though. When I took a programming course in school at 17, the first teaching language was Scheme. Quote:
One could wish for a much better string handling in BASIC, but then again one can wish for that in any language that doesn't play on the same level as ARexx. Quote:
Quote:
Quote:
|
||||||||
![]() |
![]() |
#302 | ||||||||
Glastonbridge Software
Join Date: Jan 2012
Location: Edinburgh/Scotland
Posts: 2,243
|
Quote:
Quote:
Quote:
Quote:
Quote:
Quote:
Quote:
Anyway i'm still puzzled by this claim of BASIC's "accessibility". You still have to learn it, just like anything else. It might "look a bit like English," but it isn't English. You can't just type "hack into CIA mainframe". And anyway that doesn't help anyone who doesn't speak English, which is most people in the world. The most you can say about it is that it doesn't look too scary, and maybe a lack of unfamiliar characters might help with that, maybe it's time for a language that uses emoji. Quote:
|
||||||||
![]() |
![]() |
#303 | |||
Shameless recidivist
Join Date: Jun 2012
Location: Duluth, Minnesota (USA)
Age: 38
Posts: 266
|
Quote:
Quote:
Quote:
Code:
1 to: 10 do: [ :x | Transcript print: x ] |
|||
![]() |
![]() |
#304 | ||
AMOS Extensions Developer
Join Date: Jun 2007
Location: near Cambridge, UK
Age: 44
Posts: 1,924
|
Quote:
Quote:
Code:
For Y=0 to 250 For X=0 to 319 MYCOLOR=INT((X/50)+10+(Y*50)) Mod 16 Plot X,Y,MYCOLOR Next X Next Y |
||
![]() |
![]() |
#305 | |
Glastonbridge Software
Join Date: Jan 2012
Location: Edinburgh/Scotland
Posts: 2,243
|
Quote:
BASIC is loosely based around English syntax. A programming language based around Arabic? Well we can but dream... but modern science and mathematics owes an awful lot to them (i actually have a very good book to read on this subject, and i will get back to you when i have read it.) |
|
![]() |
![]() |
#306 |
Shameless recidivist
Join Date: Jun 2012
Location: Duluth, Minnesota (USA)
Age: 38
Posts: 266
|
Interesting.
|
![]() |
![]() |
#307 |
Registered User
Join Date: May 2014
Location: inside the emulator
Posts: 377
|
People that complain about syntactic indentation seem to never have used a language using it, often making ridiculous assertions while ignoring the problems with their favorite language (most often C family languages).
With that said and disregarding the visual clarity of syntactic indentation I personally think block based syntax is a better choice for readability. Examples from my toy project: Code:
if x=123 ... -- actually a valid statement :) end if x=123 then ... -- short version without block for i=0..100 by 2 ... end for i=0..100 by 2 do ... -- short version |
![]() |
![]() |
#308 |
Shameless recidivist
Join Date: Jun 2012
Location: Duluth, Minnesota (USA)
Age: 38
Posts: 266
|
I don't dispute that indentation is a very useful readability aid. I'm also not going to argue that curly braces are the only way - I'm fine with languages that employ English-like block delimiters or even inferred block delimiters.
What I will have none of, however, is the idea that actually defining scope in terms of whitespace is no problem. That stuff is absolute nonsense. |
![]() |
![]() |
#309 |
Total Chaos forever!
Join Date: Aug 2007
Location: Waterville, MN, USA
Age: 49
Posts: 2,193
|
The fact that tabs OR spaces but not both can be used with Python is a terrible annoyance, indeed. I still lean in favor of a graphical tree gadget though.
|
![]() |
![]() |
#310 | |||
Glastonbridge Software
Join Date: Jan 2012
Location: Edinburgh/Scotland
Posts: 2,243
|
Quote:
Quote:
Code:
Start of a block: | inner statement | Start of a block | | inner inner statements | | inner statement Quote:
Also interesting: http://mobile.nytimes.com/2015/08/16...ion-uzbek.html Last edited by Mrs Beanbag; 25 August 2015 at 12:35. |
|||
![]() |
![]() |
#311 | |
Registered User
Join Date: May 2014
Location: inside the emulator
Posts: 377
|
Quote:
![]() An earlier iteration used colon to indicate a short statement but it was easy to misread. I consider that a problem in Python too. OTOH in this language short statements should be relatively uncommon due to guarded execution: Code:
-- guarded variant factorial: (n: nat)^nat ^1 if n=0 -- read: return 1 if n is equal to 0 ^n*factorial(n-1) end -- select variant, not really a guard but sharing similar syntax -- here the return isn't conditional and the if selects between two values factorial2: (n: nat)^nat ^1 if n=0 else n*factorial2(n-1) end |
|
![]() |
![]() |
#312 |
Glastonbridge Software
Join Date: Jan 2012
Location: Edinburgh/Scotland
Posts: 2,243
|
the advantage is that you can always tell there is a block there, basically "do...end" is equivalent to "{...}" but with friendlier symbols. Another idea that just occurred to me, is to use a colon for the long form and a comma for the short form. This is a bit like how we'd use punctuation in English:
Code:
if n=0, return 1 -- or if n=0: return 1 end Last edited by Mrs Beanbag; 25 August 2015 at 13:10. |
![]() |
![]() |
#313 |
pixels
Join Date: May 2014
Location: Australia
Age: 53
Posts: 476
|
My brain hurts
![]() ![]() I do appreciate the discussion though as it might inspire more..... coding ![]() As a non topic related thought I have been tempted on making maps from the chaos engine tiles for a top down racing game ![]() ![]() |
![]() |
![]() |
#314 |
Registered User
Join Date: Dec 2013
Location: GR
Age: 47
Posts: 1,416
|
#include <stdio.h>
main() { int s=0,i; for (i=0; i<=10; i++) { printf("c%cme back on t%cpic please\n",111,111); s=i; } printf("%d times\n",s); getchar(); return(0); } I am getting better :P |
![]() |
![]() |
#315 |
Banned
Join Date: May 2015
Location: Australia
Posts: 67
|
Seriously though, perhaps its time to move the last few pages elsewhere?
Very much off topic by now. |
![]() |
![]() |
#316 |
Glastonbridge Software
Join Date: Jan 2012
Location: Edinburgh/Scotland
Posts: 2,243
|
maybe i opened up a can of worms...
it all began, iirc, when i suggested that what we really lack is a programming environment with the game-oriented feature sets of AMOS/Blitz but with a much more modern & fast compiled programming language. People get trapped in AMOS, unable to escape, even though as a language it is very limited, but nothing else offers a quick or easy way to get better results. It's why i personally took the plunge straight in asm but i appreciate how intimidating that is. I think some better tools are in order. The idea of a games library for C has been mooted elsewhere (and also criticised, so it goes), personally i think it's a great idea, but i also appreciate that C is not ideal, either. Well you can find faults with anything i suppose. |
![]() |
![]() |
#317 |
Registered User
Join Date: Dec 2013
Location: GR
Age: 47
Posts: 1,416
|
For me C is fun. I like C. Everything is reasonable so far. There are rules like all languages. I am not into Amos or Blitz, they are dead languages that will not be useful for anything else than Amiga coding from scratch, and i find them very strange for some reason.
I guess then if i approach the Amiga libraries to handle graphics etc given the complexity of the system my head will explode for sure and 0's and 1's will jump out together with some bitwise &, &&, != etc. |
![]() |
![]() |
#318 |
Phone Homer
Join Date: Jun 2006
Location: 5150
Posts: 5,808
|
Ok one last thing - when I hear - I cant do that because of AMOS lol I always think No! you cant do it because thats you!
I would say Amos can make a platformer etc - without any extentions from my own tests 68000 - would you not agree? |
![]() |
![]() |
#319 | |
Glastonbridge Software
Join Date: Jan 2012
Location: Edinburgh/Scotland
Posts: 2,243
|
Quote:
back in the days of AMOS 1.3 i read an article about coding styles (did it actually come in the AMOS 1.3 box?) that said "spaghetti coding" was faster than structured coding, well it astounded me at the time but even in AMOS Pro it turned out to be right. Procedure calls are apparently very costly, don't ask me why, but that's why PuzCat's main loop all happens in one big procedure. So apologies to anyone who's tried to get their heads around it. Last edited by Mrs Beanbag; 25 August 2015 at 15:57. |
|
![]() |
![]() |
#320 |
Phone Homer
Join Date: Jun 2006
Location: 5150
Posts: 5,808
|
Thank you for your reply - my main loop is just controls and then im gosubing everything.
Id love to get the time and motivation to try changing that to procedures and/or just making it all one loop just to test speeds - Im also not sure if theres any difference once its compiled. I think I might even have read Brian Bell thought Amos1.3 compiled was fasted than pro. anyways thats enough of my silliness please continue as you were ![]() |
![]() |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
What is the technically most impressive A500 game? | mc68060 | Amiga scene | 67 | 03 June 2015 22:32 |
The Tales of Grupp - Another impressive homebrew ZX Spectrum title! | Neil79 | Retrogaming General Discussion | 3 | 24 February 2015 19:19 |
New One Of "Homebrew" 68k Amiga Magazine Idea | fishyfish | Retrogaming General Discussion | 6 | 16 April 2013 08:57 |
Impressive and Amazing PD Software! Any thoughts? | hamster | Retrogaming General Discussion | 0 | 18 July 2004 01:42 |
|
|