Login
Username:

Password:

Remember me



Lost Password?

Register now!

Sections

Who's Online
46 user(s) are online (25 user(s) are browsing Forums)

Members: 0
Guests: 46

more...

Support us!

Headlines

 
  Register To Post  

(1) 2 »
Create a programing language
Quite a regular
Quite a regular


See User information
Hi All,

I'm looking for advices for the development of a small programing language.
I'd like to create a language similar to AmosPRO (and DarkBASIC) and dedicaced to Amiga OS 4.x

To win time on the development, I'd like to use directly a linker. It should allow me to develop the language structured as some sort of lib files and then the compiler will use the linker to join all needed components ...

Does someone have any experience/tutorials on the way to do that ?

Thank you.

Kindest Regards
Fred

Go to top
Re: Create a programing language
Quite a regular
Quite a regular


See User information
Hi freddix,

Do you know how you plan to structure the commands? Because I can only use AmoProfessional, as it's the best command structured language available to use.

If it's possible, I'd like to give advice on how a command should look, so it can be used by the average person.

Support Amiga Fantasy cases!!!
How to program: 1. Start with lots and lots of 0's. 10. Add 1's, liberally.
"Details for OS 5 will be made public in the fourth quarter of 2007, ..." - Bill McEwen
Whoah!!! He spoke, a bit late.
Go to top
Re: Create a programing language
Quite a regular
Quite a regular


See User information
@freddix

That's the sort of task that a team of experienced programmers would take years to do. The fact that you don't know the magnitude of the task suggests that it's over your head.

I would suggest that you learn one of the existing languages first: there are several BASIC variations that run on OS4, on OS4Depot or Aminet. One of them would probably do what you want without wasting time reinventing the wheel.

cheers
tony
Go to top
Re: Create a programing language
Quite a regular
Quite a regular


See User information

A1200+Mediator+VooDoo3+060/50+96mo+IIYAMA 17"+CD,CDRW,ZIP SCSI-KIT
SAM440EP on Mapower 3000+AOS4.1

Amiga Docs Disk Preservation Project
Go to top
Re: Create a programing language
Quite a regular
Quite a regular


See User information
@tonyw
I am able to do that on old amiga 680x0 but I'm new on Amiga OS 4.
I did develop plugins for AmosPROFESSIONAL on past ... A plugin to handle AGA as AmosPRO didn't do ..
I don't think it should take years to do that ... for Example, Lee Bamber did the job alone for DarkBASIC v1 (PC) in 2 years if I'm not wrong ...
I know how AmosV1 and AmosPRO work on Interpreting, compiling and plugin system. I also know how DarkBASIC v1 and DarkBASIC Professional works on Interpreting, compiling and plugin system. I have an enough complete experience on these domains to start such a big project.

I know how I can create it using full 680x0 Assemblers under old Amiga OS, but It should take more time if I do the same in 100% full assembler, that's why if I use a linker, I can reduce the development time ...

And nothing say that I can maybe later accept the help of others developers that may become interested in the project when it'll start to look to something interesting ...

More to this, are there some interesting language under amigaOS4 that handle fully Warp 3D or OpenGL ?

Finally, You should never underestimate someone on which you know so few ...

@Mrodfr : I'm not a deustch speaking person ... I only know french and english.

Go to top
Re: Create a programing language
Just can't stay away
Just can't stay away


See User information
@freddix

Why not use an existing assembler as well as linker?

GCC has as (assembler) and ln (linker) that you can use.

GCC is included with the OS4 SDK.

Since AmigaOS4 only runs on PPC CPUs in order to write a compiler you need to learn PPC assembler which is very different from m68k assembler:
6xx_pem.pdf

Go to top
Re: Create a programing language
Quite a regular
Quite a regular


See User information
@salass00:
Thank you for these informations,
it's exactly what I'm looking for :p
Yes, I wanna use a linker like GCC one.
(it's what I planed for because I know no other linker on Amiga...

can these linkers be used and included in a ShareWare/Commercial project without restrictions ?

Thank you.

Go to top
Re: Create a programing language
Just can't stay away
Just can't stay away


See User information
@freddix

Since gcc is GPL that would depend if your compiler can be considered a derivative work or not. If it is considered a derivative work, which is possible, then your compiler would have to be GPLed as well, unfortunately.

There is also VBCC, which is also included in the SDK. This has vasmppc_std (assembler) and vlink (linker). In this case you should probably contact the authors (Volker?Barthelmann and Frank Wille) if you're going to include files with your program, or you could just require that users of your compiler have the SDK installed.

http://sun.hasenbraten.de/vbcc/
http://sun.hasenbraten.de/vasm/
http://sun.hasenbraten.de/vlink/

Go to top
Re: Create a programing language
Just popping in
Just popping in


See User information
@freddix

DarkBasic Pro was written in C++ rather than Assembly. That's why he was able to come out with such quick results.

How good are you with MiniGL and C? If you don't mind coding some MiniGL equivalences for the Mattathias runtime libraries, I'd appreciate the help!

Sidewinder is working on getting a software development suite working at his place of employment so he can work on Mattathias' parser generator any spare minute he gets!

If you want to help, be sure to let me know by contacting the Mattathias mailing list. BTW, the license to what we are writing is LGPL 3.0 so don't use anything patentable and don't plan on keeping your code a secret if you work with us.

Go to top
Re: Create a programing language
Just can't stay away
Just can't stay away


See User information
@freddix

Does someone have any experience/tutorials on the way to do that ?
SDLBasic is a favorite--
http://pgdc.purdue.org/sdltutorial/01/
Shows interfacing a game to SDL system.

Go to top
Re: Create a programing language
Quite a regular
Quite a regular


See User information
@Samurai_Crow : Yes I know, and I'm in direct contact with the TheGameCreators developers so when I need an advice, I can directly get it from them :p

In fact, I don't want to get involved in an existing project (sorry). I have a precise idea of what I want to do and why I want to do this ... The only thing to precise is the way to achieve the project.

@Snuffy : Thank you for this link, will check it :)

Go to top
Re: Create a programing language
Just popping in
Just popping in


See User information
@Snuffy

sdlBasic homepage is at the link I just gave. Maybe it will be helpful to others. That tutorial about programming SDL in C might be helpful to others also though.

Go to top
Re: Create a programing language
Quite a regular
Quite a regular


See User information
@freddix

Quote:

@Mrodfr : I'm not a deustch speaking person ... I only know french and english.


amiblitz3 is in english also. Programmers around amiblitz3 talk english and there are an english part on the amiforce.de forum about amiblbitz3.

see: http://www.amiforce.de/

It's just for you to see what exist actually around amiga and basic.

You can download actual amiblitz3 environment and play litle with it for your point of view.

A1200+Mediator+VooDoo3+060/50+96mo+IIYAMA 17"+CD,CDRW,ZIP SCSI-KIT
SAM440EP on Mapower 3000+AOS4.1

Amiga Docs Disk Preservation Project
Go to top
Re: Create a programing language
Quite a regular
Quite a regular


See User information
@Samurai_Crow

i wrote a message to the author of SDL_Basic. He was very interested to know the development of the Amiga version. I'll keep him informed.

Go to top
Re: Create a programing language
Just popping in
Just popping in


See User information
@freddix

Quote:

freddix wrote:
Hi All,


To win time on the development, I'd like to use directly a linker. It should allow me to develop the language structured as some sort of lib files and then the compiler will use the linker to join all needed components ...

Does someone have any experience/tutorials on the way to do that ?


Hi,

I did that with my Modula-2 compiler, and also used the assembler to create the ELF object files.

ie, the compiler produces a PPC assembly text file that feeds into
"as". That has worked pretty well. It saved me a whole lot of time trying to get the ELF file format correct, and "as", though the docs can be misleading, is not very balky.

And using "ln" to link the files together is even more time saving. I wrote a little program to gather up the required obj files and libs and create the linker script so that the user does not have to be concerned with the linker settings.

So, I have spent most of the two years or so on generating good PPC code, and still have lots of work to do on the "good" part of it. The ABI is documented pretty well in an older document "Sys V PPC ABI" that you can download from the Internet. Getting that right is not the simplest thing. Actually, I don't thing "as" and "ln" really care if you use that the specified calling sequences and registers, but you will need to if you are going to link to amiga libraries and have the Grim Reaper give you a stack traceback when your programs crash,
if ever :)

regards,

Tom
tmb@virginia.edu

Go to top
Re: Create a programing language
Quite a regular
Quite a regular


See User information
Hi freddix,

I just hope you make a language that people can write in, for example, I have tried 8 different ways to open a file to read in Brandy Basic for AOS4.0 and it doesn't want to open the file, or at least I can't get data read from the file, tried amny ways, nothing works, because when it exits, it says "files were closed".

Maybe the Brandy Basic just isn't working, I don't know. But ways to communicate with AmiBlitz and Hollywood are garbage too. AMOSProfessional is closest to a normal way to write software.

Script files and Arexx are unintelligible as well.

Support Amiga Fantasy cases!!!
How to program: 1. Start with lots and lots of 0's. 10. Add 1's, liberally.
"Details for OS 5 will be made public in the fourth quarter of 2007, ..." - Bill McEwen
Whoah!!! He spoke, a bit late.
Go to top
Re: Create a programing language
Quite a regular
Quite a regular


See User information
@Atheist:

Commands to read or write to files should become something like :

Open To Read CHANNEL, FILE$
Open To Write CHANNEL, FILE$
Close File CHANNEL

INTEGER = Read Byte( CHANNEL )
FLOAT# = Read Float( CHANNEL )
INTEGER = Read Word( CHANNEL )
INTEGER = Read Long( CHANNEL )
STRING$ = Read String( CHANNEL )

Write Byte CHANNEL, BYTETOWRITE
Write Float CHANNEL, FLOATTOWRITE#
Write Word CHANNEL, WORDTOWRITE
Write Long CHANNEL, INTEGERTOWRITE
Write String CHANNEL, STRINGTOWRITE$ (terminated by 0)

Regards;
Fred

Go to top
Re: Create a programing language
Quite a regular
Quite a regular


See User information
Hi freddix,

Quote:
Commands to read or write to files should become something like :

Open To Read CHANNEL, FILE$
Open To Write CHANNEL, FILE$
Close File CHANNEL

Hi freddix,

I can also do?
Open To Read CHANNEL, "dh2:book titles"

Right? Okay, this is something that is very straight forward. Terrific.
How about is this possible?
Open To Read CHANNEL, "dh0:"+USERENTRY$

"CHANNEL" can be a variable right?


So there could be:
If Exists "dh0:"+USERENTRY$ then 100
or maybe:
If "dh0:"+USERENTRY$=true then FILEDOESEXIST$="yes"

Quote:

INTEGER = Read Byte( CHANNEL )
FLOAT# = Read Float( CHANNEL )
INTEGER = Read Word( CHANNEL )
INTEGER = Read Long( CHANNEL )
STRING$ = Read String( CHANNEL )

Here, why don't you just make it,
NUMBER = Read 1, CHANNEL
NUMBER#= Read 2, CHANNEL
NUMBER% = Read 8,CHANNEL
NUMBER&= Read 4,CHANNEL
How about, "NUMBER" with nothing is integer, "NUMBER#" is real, "NUMBER%" is binary, and "NUMBER&" could be hexadecimal? How about 1, 2, 4 and 8 for amount of bytes? Although, wouldn't that be an unknown, so it just reads to the comma or semicolon delimeter in the file? Unless you go with the fixed length input stream.

Why put "String" when the variable IS a string? Just use:
STRING$ = Read CHANNEL

You could even opt for
STRING$ = Read variable,CHANNEL
Where "x" amount of characters are read.

And
STRING$ = Read ,CHANNEL
Would read to the delimeter, usually a comma or semicolon, or EOF.

Can you do?
FILEDATA$= Str$(2, CHANNEL)

That way change a number to a string right away? There won't be confusion, because a comma is used. A "Read" command is implied because the comma isn't an equation operand.

This is what's actually happening:
FILEDATA$= Str$(READ 2, CHANNEL)
The "2" is 2 bytes.


Hmmm, I think the channel number should always be first, even up above.

Quote:
Write Byte CHANNEL, BYTETOWRITE
Write Float CHANNEL, FLOATTOWRITE#
Write Word CHANNEL, WORDTOWRITE
Write Long CHANNEL, INTEGERTOWRITE
Write String CHANNEL, STRINGTOWRITE$ (terminated by 0)

Write CHANNEL, VARIABLE, 2
That could be a 2 byte integer variable.
Write CHANNEL, WORDTOWRITE#, 4
A 4 byte real number.

This is getting really hard actually, I mean, what if you choose a smaller byte size than the number actually is? I guess you can't choose the byte size to write unless you have absolute control?? But you'll wreck your output, possibly.

Maybe rather than using delimeters (when reading sequential files), a byte should be used to define the next amount of bytes to be read, upto 256? Are you losing bytes in the file? No, because you use a byte to separate entries in a sequential access file anyway. This way, strings don't have to be enclosed in quotes when saved. That would make max string lengths of 256 bytes, then they would need to be extended by the next byte afterwards.

Or, the LEAD byte that equals zero, is an empty string, 1 to 254 is upto 254 bytes, and 255 means, add the next block of upto 254 characters to this current string of characters.

If that's not clear, I could post an example.

Support Amiga Fantasy cases!!!
How to program: 1. Start with lots and lots of 0's. 10. Add 1's, liberally.
"Details for OS 5 will be made public in the fourth quarter of 2007, ..." - Bill McEwen
Whoah!!! He spoke, a bit late.
Go to top
Re: Create a programing language
Quite a regular
Quite a regular


See User information
@Atheist:
I will try to answer all your questions in the correct order.

Concerning all variant you mentionned for "Open To Read" command, yes, all should be possible .. it's the compiler that will parse correct data to input them in the command "Open To Read".

Concerning file existence, it will be coded in something this way :
If File Exist( FILENAME$ ) = 1 Then ....


Structure is really important.
You have 2 cases :
1. Commands : use arguments (or not) but return nothing. Generall coded this way :
COMMAND NAME argument1 [, argument2, argument3, etc ... ]
or :
COMMAND NAME
(simply if no argument is needed)

2. Functions : use arguments (or not) and return something, generally coded this way :
RETURNVALUE = FUNCTION NAME( argument1 [, argument2, argument3, etc ... ])
Or :
RETURNVALUE = FUNCTION NAME()
(simply if no argument is needed)

It's important to keep this structure to always know if a command/function return a value or not and to use if correctly.

The channel is really important because it allow you to open simultaneously more than 1 files. With this, you can read the next component on the correct file you had opened sooner, even if more than one file is opened.

FILEDATA$= Str$(2, CHANNEL)
no. it's not enough "easy to understand" and not intuitive.
READ STRING mean what it mean "you read a string"
if you want to read 2 bytes and make them become a string, you should combine this way :
FILEDATA$ = Str$( Read Word( CHANNEL ) )
Read Word( CHANNEL ) will return a 2 bytes value readen from the file and Str$() will transforme these 2 butes into a string.

Quote:
Hmmm, I think the channel number should always be first, even up above.

Isn't it exactly what I mentionned in my previous post ?

Quote:
Write CHANNEL, VARIABLE, 2
That could be a 2 byte integer variable.
Write CHANNEL, WORDTOWRITE#, 4
A 4 byte real number.

It's not possible and too hasardous to allow this. It should also result in a performance cost for checkings ...
when you code your program, you must work in a structured way, it's better ... and using the correct data type for the needed job result in higher performance (it avoir the compiler to have to cast data from a format to another).
using the correct command for the correct data type.
If you don't use the correct data type for the correct command, the compiler will try to cast your data to the correct format but the compiler can't cast STRING to other format nor other format to STRING.

I think I've answered all your questions.

Go to top
Re: Create a programing language
Just can't stay away
Just can't stay away


See User information
@AmigaBlitter

SDLBasic is my favorite basic, but i never had any luck working up the IDE. The official one is 'SciTE', but it it requires running in X11, which requires you to know a lot about Xwindows.

Hi @freddix

In fact, I don't want to get involved in an existing project (sorry). I have a precise idea of what I want to do and why I want to do this ... The only thing to precise is the way to achieve the project.

@Snuffy : Thank you for this link, will check it :)


Umm, I looked over your code objects and I can do all of that in Python 2.5. However, there's no graphics system in Python yet. I would like to learn how to compile a module for Python so we can move on this very powerful language already in OS4.0!


Edited by Snuffy on 2008/11/13 20:51:00
Go to top

  Register To Post
(1) 2 »

 




Currently Active Users Viewing This Thread: 2 ( 0 members and 2 Anonymous Users )




Powered by XOOPS 2.0 © 2001-2024 The XOOPS Project