Click Here
home features news forums classifieds faqs links search
5669 members 
Amiga Q&A /  Free for All /  Emulation /  Gaming / (Latest Posts)
Login

Nickname

Password

Lost Password?

Don't have an account yet?
Register now!

Support Amigaworld.net
Your support is needed and is appreciated as Amigaworld.net is primarily dependent upon the support of its users.
Donate

Menu
Main sections
Home
Features
News
Forums
Classifieds
Links
Downloads
Extras
OS4 Zone
IRC Network
AmigaWorld Radio
Newsfeed
Top Members
Amiga Dealers
Information
About Us
FAQs
Advertise
Polls
Terms of Service
Search

IRC Channel
Server: irc.amigaworld.net
Ports: 1024,5555, 6665-6669
SSL port: 6697
Channel: #Amigaworld
Channel Policy and Guidelines

Who's Online
47 crawler(s) on-line.
 20 guest(s) on-line.
 1 member(s) on-line.


 rzookol

You are an anonymous user.
Register Now!
 rzookol:  47 secs ago
 K-L:  7 mins ago
 miggymac:  15 mins ago
 TRIPOS:  20 mins ago
 nikosidis:  20 mins ago
 sicky:  23 mins ago
 g0blin:  24 mins ago
 Cool_amigaN:  25 mins ago
 kamelito:  28 mins ago
 zipper:  36 mins ago

/  Forum Index
   /  General Technology (No Console Threads)
      /  Computer Programming Languages
Register To Post

Goto page ( Previous Page 1 | 2 | 3 | 4 | 5 | 6 Next Page )
PosterThread
Trekiej 
Re: Computer Programming Languages
Posted on 24-May-2019 19:29:48
#81 ]
Cult Member
Joined: 17-Oct-2006
Posts: 696
From: Unknown

@Amigo1

LOL I knew it I knew it

_________________
John 3:16

 Status: Offline
Profile     Report this post  
Trekiej 
Re: Computer Programming Languages
Posted on 24-May-2019 19:31:13
#82 ]
Cult Member
Joined: 17-Oct-2006
Posts: 696
From: Unknown

@bison

Sounds cool

_________________
John 3:16

 Status: Offline
Profile     Report this post  
bison 
Re: Computer Programming Languages
Posted on 24-May-2019 21:41:28
#83 ]
Super Member
Joined: 18-Dec-2007
Posts: 1402
From: N-Space

@Trekiej

Quote:
Sounds cool

Well, Lisp programmers think it is. You can write code that modifies itself while it's executing. I'm not entirely sure that's a good idea.

I'd like to see a concrete case where that's really useful. Maybe it is; I don't know. I'm just a simple-minded C programmer.

_________________
"Unix is supposed to fix that." -- Jay Miner

 Status: Offline
Profile     Report this post  
Trekiej 
Re: Computer Programming Languages
Posted on 25-May-2019 2:51:54
#84 ]
Cult Member
Joined: 17-Oct-2006
Posts: 696
From: Unknown

@bison

Unfortunately my programming skills are at the Undergraduate level.
I am not in a computer career anymore.
Lisp is a language I never got into learning.
It was seen in a book from Radio Shack about Artificial Intelligence (edit) back in say, 1983.
I had only 8 bit computers at the time.

Last edited by Trekiej on 25-May-2019 at 05:22 AM.

_________________
John 3:16

 Status: Offline
Profile     Report this post  
pgf_666 
Re: Computer Programming Languages
Posted on 25-May-2019 22:55:16
#85 ]
Member
Joined: 29-Dec-2007
Posts: 36
From: Unknown

@Samurai_Crow

Quote:
You forgot to mention which dialect of BASIC you want updated. I know how to implement BASIC as a pass-and-a-half transpiler using C as a backend. I was considering doing one based on AMOS Kittens.


Well, I usually use HiSoft Basic 2, but I've used a lot of BASICs over the years, and I like the general philosophy that the @#$%^&*! computer should do the drudge work. I've written over 100 lines of clean, bug-free code in a 4-hour programming day--ran clean, first time.

But I've used many other dialects, and like most of them; what I really like is the philosophy that the @#$%^&*! machine should do the drudge work, not me. No need to declare non-global variables before I use them, undimensioned arrays are set to x(10)--which is fine for most quick & dirty one shots--and string manipulation, while not perfect, is a lot more orthasgonal than ther C system libraries.

And no need to #include them....

 Status: Offline
Profile     Report this post  
pgf_666 
Re: Computer Programming Languages
Posted on 25-Jun-2019 5:47:01
#86 ]
Member
Joined: 29-Dec-2007
Posts: 36
From: Unknown

:Dreaded Duplicate Post Error"

Last edited by pgf_666 on 25-Jun-2019 at 05:50 AM.

 Status: Offline
Profile     Report this post  
pgf_666 
Re: Computer Programming Languages
Posted on 25-Jun-2019 5:57:28
#87 ]
Member
Joined: 29-Dec-2007
Posts: 36
From: Unknown

@bison

Quote:

(In Re: Self Modifying Code:)

Well, Lisp programmers think it is. You can write code that modifies itself while it's executing. I'm not entirely sure that's a good idea.

I'd like to see a concrete case where that's really useful. Maybe it is; I don't know. I'm just a simple-minded C programmer.


It can allow you to execute control structures that the language has no direct support for, for instance or do some really bizarre decision trees, which, in this bizarre world, can be useful. But I prefer it if the language has direct support....


Last edited by pgf_666 on 25-Jun-2019 at 05:58 AM.

 Status: Offline
Profile     Report this post  
pgf_666 
Re: Computer Programming Languages
Posted on 25-Jun-2019 6:03:48
#88 ]
Member
Joined: 29-Dec-2007
Posts: 36
From: Unknown

O.K., does anyone know of a decent "B2C" program that can translate standard BASIC to standard--say, gcc--code?Even if it isn't perfect, or is a bit obsolete, if the source is available, then it could make a good starting point...I really like the language, but all the BASIC compilers I've delt with had their weaknesses, many registering in the low single didgets on the Torricelli scale....


 Status: Offline
Profile     Report this post  
OldFart 
Re: Computer Programming Languages
Posted on 25-Jun-2019 11:12:25
#89 ]
Elite Member
Joined: 12-Sep-2004
Posts: 2923
From: Stad; en d'r is moar ain stad en da's Stad. Makkelk zat!

@Trekiej

Quote:
Does anyone here like Julia programming?


Oh, yes! And I like Shelley programming and Cora programming, but aunt Emma should steer clear of it.

@Amigo1
Quote:
Julia is my girlfriend, I programmed her. She already does what I want.


Do you really think so? My friend, believe me: she programmed YOU! And so to read she did a perfect and wonderfull job as you still believe you programmed HER. Man, oh man, oh man, you just made my day!

@All
Having done a bit of coding in the past (started in 1973), using BASIC, COBOL, PL/1, RPG-II, RPG-III, RPG/400 (ILE) and C since halfway the 80's, I must say I am quite content with C. If you can bring yourself to act disciplined and thoughtfull, it's a great and strong language. I am very suspicious of what I call false disciplinary concepts like 'short-and-sweet': they often make a shiver go down my spine.

Concepts in C I like are enumerations and #defines, as they can make source code that much more readable.
A concept I truly dislike is in the "inline" keyword.

OK, that was it for this time. Thought I had to chime in.
OldFart

_________________
The younger and less experienced a coder is, the more difficult it is to prove him wrong...

 Status: Offline
Profile     Report this post  
bison 
Re: Computer Programming Languages
Posted on 25-Jun-2019 15:12:28
#90 ]
Super Member
Joined: 18-Dec-2007
Posts: 1402
From: N-Space

@pgf_666

Quote:
O.K., does anyone know of a decent "B2C" program that can translate standard BASIC to standard--say, gcc--code?

Bacon.

http://www.basic-converter.org/

http://basic-converter.proboards.com/

By default it generates an executable -- use the -p switch to retain the generated .c code:

bison@home ~/test $ cat rot.bac 
SPLIT ARGUMENT$ BY " " TO arg$ SIZE argc

IF argc < 2 THEN
PRINT "Usage: rot STRING"
END
ENDIF

FOR indx = 1 TO LEN(arg$[1])
chr = ASC(MID$(arg$[1], indx, 1))
IF chr > 64 AND chr < 78 THEN
PRINT CHR$(chr + 13);
ELIF chr > 77 AND chr < 91 THEN
PRINT CHR$(chr - 13);
ELIF chr > 96 AND chr < 110 THEN
PRINT CHR$(chr + 13);
ELIF chr > 109 AND chr < 123 THEN
PRINT CHR$(chr - 13);
ELSE
PRINT CHR$(chr);
END IF
NEXT

PRINT

bison@home ~/test $ bacon -p rot.bac
Converting 'rot.bac'... done, 24 lines were processed in 0.005 seconds.
WARNING: 'indent' not found on this system!
Generated source code cannot be beautified.
Compiling 'rot.bac'... cc -c rot.bac.c
cc -o rot rot.bac.o -lbacon -L. -lm
Done, program 'rot' ready.

bison@home ~/test $ ./rot 'Gur fanxr juvpu pnaabg pnfg vgf fxva unf gb qvr. Nf jryy gur zvaqf juvpu ner ceriragrq sebz punatvat gurve bcvavbaf; gurl prnfr gb or zvaq.'
"The snake which cannot cast its skin has to die. As well the minds which are prevented from changing their opinions; they cease to be mind."

Last edited by bison on 25-Jun-2019 at 03:25 PM.

_________________
"Unix is supposed to fix that." -- Jay Miner

 Status: Offline
Profile     Report this post  
OneTimer1 
Re: Computer Programming Languages
Posted on 26-Jun-2019 21:54:11
#91 ]
Regular Member
Joined: 3-Aug-2015
Posts: 485
From: Unknown

@bison

The problem with a Basic to C translator is IMHO different.

BASIC coders want to have commands for openning a screen and drawing pixels and text to it.

Handling of libraries (static or linked) is an uncommon idea for BASIC coders, but when it comes to libraries they are confronted with pointers or structures that makes BASIC very inconvenient to them.

 Status: Offline
Profile     Report this post  
Lou 
Re: Computer Programming Languages
Posted on 27-Jun-2019 13:32:47
#92 ]
Elite Member
Joined: 2-Nov-2004
Posts: 3976
From: Rhode Island

@bison

Quote:

bison wrote:
@pgf_666

Quote:
O.K., does anyone know of a decent "B2C" program that can translate standard BASIC to standard--say, gcc--code?

Bacon.

http://www.basic-converter.org/

http://basic-converter.proboards.com/

By default it generates an executable -- use the -p switch to retain the generated .c code:
bison@home ~/test $ cat rot.bac 
SPLIT ARGUMENT$ BY " " TO arg$ SIZE argc

IF argc < 2 THEN
PRINT "Usage: rot STRING"
END
ENDIF

FOR indx = 1 TO LEN(arg$[1])
chr = ASC(MID$(arg$[1], indx, 1))
IF chr > 64 AND chr < 78 THEN
PRINT CHR$(chr + 13);
ELIF chr > 77 AND chr < 91 THEN
PRINT CHR$(chr - 13);
ELIF chr > 96 AND chr < 110 THEN
PRINT CHR$(chr + 13);
ELIF chr > 109 AND chr < 123 THEN
PRINT CHR$(chr - 13);
ELSE
PRINT CHR$(chr);
END IF
NEXT

PRINT

bison@home ~/test $ bacon -p rot.bac
Converting 'rot.bac'... done, 24 lines were processed in 0.005 seconds.
WARNING: 'indent' not found on this system!
Generated source code cannot be beautified.
Compiling 'rot.bac'... cc -c rot.bac.c
cc -o rot rot.bac.o -lbacon -L. -lm
Done, program 'rot' ready.

bison@home ~/test $ ./rot 'Gur fanxr juvpu pnaabg pnfg vgf fxva unf gb qvr. Nf jryy gur zvaqf juvpu ner ceriragrq sebz punatvat gurve bcvavbaf; gurl prnfr gb or zvaq.'
"The snake which cannot cast its skin has to die. As well the minds which are prevented from changing their opinions; they cease to be mind."


The Select Case statement, which accepts ranges really cleans up things like the code above...

https://docs.microsoft.com/en-us/dotnet/visual-basic/language-reference/statements/select-case-statement

VB.NET rules! And the compiler is open-source now...
https://github.com/dotnet/roslyn

 Status: Offline
Profile     Report this post  
bison 
Re: Computer Programming Languages
Posted on 27-Jun-2019 15:34:40
#93 ]
Super Member
Joined: 18-Dec-2007
Posts: 1402
From: N-Space

@OneTimer1

If you look at the code Bacon generates you can see how they deal with some of that. But works, at least with trivial programs.

@Lou

My knowledge of Basic is ancient, rudimentary, and not likely to improve.

_________________
"Unix is supposed to fix that." -- Jay Miner

 Status: Offline
Profile     Report this post  
Samurai_Crow 
Re: Computer Programming Languages
Posted on 27-Jun-2019 19:21:03
#94 ]
Elite Member
Joined: 18-Jan-2003
Posts: 2158
From: Ft. Collins, Colorado, USA

Re:BASIC to C

To get a non-structured or semi-structured BASIC to translate to C requires only to do a state machine. Ignore all of the structured commands of C but instead, generate a state enumeration variable, the enum statement will contain all of the label names, error states and a normal state. The main function will look something like this:

Quote:

while (statevar > error_states) {
switch (statevar) {
case start:
...
case dest1:
...
statevar=dest1;
break; /* goto dest1 */
}
}
... /* process errors here */

Note that fallthroughs on case statements are intended because they are labels.

 Status: Offline
Profile     Report this post  
Karlos 
Re: Computer Programming Languages
Posted on 30-Jun-2019 22:17:38
#95 ]
Elite Member
Joined: 24-Aug-2003
Posts: 2020
From: As-sassin-aaate! As-sassin-aaate! Ooh! We forgot the ammunition!

I just saw the original post and I have one significant pro for COBOL: experienced developers are becoming rare but certain large industries still depend on it while frantically trying to migrate away. That being the case, knowing it could land you a very lucrative job one day ;)

_________________
IBrowse/AWeb user? amiga.org - classic browser edition

 Status: Offline
Profile     Report this post  
pgf_666 
Re: Computer Programming Languages
Posted on 2-Jul-2019 19:22:42
#96 ]
Member
Joined: 29-Dec-2007
Posts: 36
From: Unknown

@bison & everyone else who responded....

While the source is available, it isn't precompiled to either a Windows or Amiga/ARos executable...

And without a standardized GFX package alot of BASIC code....not so much.

Anyone thought of porting the basic (npi) Amiga C graphics calls to something that could be used in Mac, Linux, or (choke) WionDon't?
I'm guessing that the code itself is already written for ARos....



 Status: Offline
Profile     Report this post  
Lou 
Re: Computer Programming Languages
Posted on 2-Jul-2019 23:22:33
#97 ]
Elite Member
Joined: 2-Nov-2004
Posts: 3976
From: Rhode Island

@pgf_666

There is an SDL port which is a port of an early version of Microsoft's DirectX, IIRC, that made it easier to port a lot early of Windows games... Pretty sure any language can call the functions of an external library such as SDL... Though I think on the Amiga port, it never got 3D functionality, again, IIRC... Perhaps on AROS_x86 got a more complete port?

https://www.libsdl.org/

Last edited by Lou on 02-Jul-2019 at 11:23 PM.

 Status: Offline
Profile     Report this post  
pgf_666 
Re: Computer Programming Languages
Posted on 3-Jul-2019 17:10:02
#98 ]
Member
Joined: 29-Dec-2007
Posts: 36
From: Unknown

@Lou

OL, 3D support would be great, but first:
__________

Screen 1
Window 1(0,0)-(700,11000
pset (5,6),7
line to (87,231)
__________

needs to be translated correctly--as well as all the other funny commands, like AREAFILL that AmigaBASIC supports.

And all the .library commands need to be turned into .DLLs.....



 Status: Offline
Profile     Report this post  
Lou 
Re: Computer Programming Languages
Posted on 3-Jul-2019 19:00:53
#99 ]
Elite Member
Joined: 2-Nov-2004
Posts: 3976
From: Rhode Island

@pgf_666

http://aminet.net/package/dev/misc/SDL-Amiga

 Status: Offline
Profile     Report this post  
pgf_666 
Re: Computer Programming Languages
Posted on 5-Jul-2019 18:57:37
#100 ]
Member
Joined: 29-Dec-2007
Posts: 36
From: Unknown

@Lou

Interesting, but....

While I can see how the B2C might be able to use this to translate my snippet of code, I was hoping for a trans-platform .lib file, or even a .DLL, perhaps converted from the ARo/s project, or even reverse engineered from HB2,library--or whatever it's called....

BTW, there is at least one doozy of a bug introduced with HB2, and, apparently, continued with MB3, converting single precision FP numbers for use in RANDOM files....

 Status: Offline
Profile     Report this post  
Goto page ( Previous Page 1 | 2 | 3 | 4 | 5 | 6 Next Page )

[ home ][ about us ][ privacy ] [ forums ][ classifieds ] [ links ][ news archive ] [ link to us ][ user account ]
Copyright (C) 2000 - 2019 Amigaworld.net.
Amigaworld.net was originally founded by David Doyle